+/*******************************************************************************
+ * Copyright (c) 2019 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ * Semantum Oy - gitlab #313
+ *******************************************************************************/
package org.simantics.databoard.binding.reflection;
import java.lang.annotation.Annotation;
if(request.hasAnnotation(Optional.class))
{
Optional optional = request.getAnnotation(Optional.class);
- Annotation[] newAnnotations = ArrayUtils.dropElements(request.annotations, optional);
- BindingRequest componentRequest = new BindingRequest(request.getClazz(), newAnnotations);
+ BindingRequest componentRequest = request.withAnnotations(ArrayUtils.dropElements(request.annotations, optional));
OptionalType type = new OptionalType();
OptionalBinding binding = new OptionalBindingDefault(type, null);
inprogress.put(request, binding);
type.componentType = binding.componentBinding.type();
inprogress.remove(request);
+ repository.put(request, binding);
return binding;
}
Identifier idAnnotation = componentRequest.getAnnotation( Identifier.class );
if ( idAnnotation!=null ) {
- componentRequest.dropAnnotations(1, idAnnotation);
+ componentRequest = componentRequest.withAnnotations(componentRequest.dropAnnotations(1, idAnnotation));
identifierIndices.add( i );
}
Binding componentBinding = componentBindings[i] = construct( componentRequest );
binding = defaultBinding;
}
- repository.put(request, binding);
-
return binding;
} catch (RangeException e) {
inprogress.remove( request );