You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2010/08/02 12:12:39 UTC
svn commit: r981443 -
/tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
Author: slaws
Date: Mon Aug 2 10:12:38 2010
New Revision: 981443
URL: http://svn.apache.org/viewvc?rev=981443&view=rev
Log:
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.
Modified:
tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
Modified: tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java?rev=981443&r1=981442&r2=981443&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java Mon Aug 2 10:12:38 2010
@@ -144,7 +144,13 @@ public class HeuristicPojoProcessor exte
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 exte
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,