summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-10-15 20:39:11 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-10-15 20:39:11 +0000
commit8bf67057459baf06e792bb5f7e5d70c83479f0aa (patch)
tree3aa96b54b21c6b75e0313081f338b3a2bf7206b7
parent06437a98ad81639862c09fe7013f4517033b1d59 (diff)
FIx JCA_90016 - @Reference on a constructor must not have required=false
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@825642 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java
index 57d014fd99..737bfc9ba8 100644
--- a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java
+++ b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java
@@ -137,6 +137,11 @@ public class ReferenceProcessor extends BaseJavaClassVisitor {
if (refAnnotation == null) {
return;
}
+
+ if (!refAnnotation.required()) {
+ throw new InvalidReferenceException("JCA90016 Constructor has @Reference with required=false: " + type.getName());
+ }
+
String paramName = parameter.getName();
String name = getReferenceName(paramName, parameter.getIndex(), refAnnotation.name());
JavaElementImpl ref = type.getReferenceMembers().get(name);