summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-08-02 10:12:38 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-08-02 10:12:38 +0000
commitf8b4a656a104ee3dd6f235ad375461f5c7d2bf05 (patch)
treec824b7202c8498fb17fbb3b007e2095cfe41ee6e /sca-java-2.x/trunk
parenta79580f2396b2f1ff99f219a852bf301b6d77155 (diff)
Changes for JCI_8023. The policy annotations can appear on otherwise unannotated references. Hence we need to take this into account when deciding if an unannotated field is a reference.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@981443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
index adb6b284ff..16d8f4e67e 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
@@ -144,7 +144,13 @@ public class HeuristicPojoProcessor extends BaseJavaClassVisitor {
private static boolean isAnnotatedWithSCA(AnnotatedElement element) {
for (Annotation a : element.getAnnotations()) {
- if (isSCAAnnotation(a)) {
+ // JCI_8023
+ // policy annotations can be added to reference fields that
+ // don't have @Reference annotations so we need to allow
+ // for the fields to be detected as references
+ if (isSCAPolicyAnnotation(a)){
+ continue;
+ } else if (isSCAAnnotation(a)) {
return true;
}
}
@@ -154,6 +160,16 @@ public class HeuristicPojoProcessor extends BaseJavaClassVisitor {
private static boolean isSCAAnnotation(Annotation a) {
return a.annotationType().getName().startsWith("org.oasisopen.sca.annotation.");
}
+
+ private static boolean isSCAPolicyAnnotation(Annotation a) {
+ if (a.annotationType().getName().startsWith("org.oasisopen.sca.annotation.PolicySets") ){
+ return true;
+ } else if (a.annotationType().getName().startsWith("org.oasisopen.sca.annotation.Intent") ){
+ return true;
+ } else {
+ return false;
+ }
+ }
private <T> void calcPropRefs(Set<Method> methods,
List<org.apache.tuscany.sca.assembly.Service> services,