diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-16 07:50:01 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-16 07:50:01 +0000 |
commit | 45b6972589242db0fefb0bbb4bbf73bc5606db01 (patch) | |
tree | 531ca400415ca90f5213b15aff7f58a7b4725685 /java/sca/modules/interface-java | |
parent | d03314c4873c666649d8e13ab35bd77b41ed54f4 (diff) |
Fix otest JCA 3001
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@825790 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/interface-java')
-rw-r--r-- | java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java | 137 |
1 files changed, 71 insertions, 66 deletions
diff --git a/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java b/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java index c01947fa76..e1f1c3ec2b 100644 --- a/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java +++ b/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java @@ -244,87 +244,92 @@ public class JavaInterfaceProcessor implements StAXArtifactProcessor<JavaInterfa private static List<Class<?>> JCA30008_ANNOTATIONS = Arrays.asList(new Class<?>[] {Intent.class, Qualifier.class}); private void checkForbiddenAnnotations(JavaInterfaceContract javaInterfaceContract) { - if (javaInterfaceContract.getInterface() != null) { - Class<?> ifc = ((JavaInterface) javaInterfaceContract.getInterface()).getJavaClass(); - if (ifc != null) { - for (Annotation a : ifc.getAnnotations()) { - if (ifc.isInterface()) { - if (JCA30006_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30006", javaInterfaceContract, a.annotationType(), ifc.getName()); - } - } else { - if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); - } - } + if (javaInterfaceContract.getInterface() == null) { + return; + } + Class<?> ifc = ((JavaInterface) javaInterfaceContract.getInterface()).getJavaClass(); + if (ifc == null) { + return; + } + for (Annotation a : ifc.getAnnotations()) { + if (ifc.isInterface()) { + if (JCA30006_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30006", javaInterfaceContract, a.annotationType(), ifc.getName()); + } + } else { + if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); } } - for (Method m : ifc.getMethods()) { - for (Annotation a : m.getAnnotations()) { - if (ifc.isInterface()) { - if (JCA30006_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30006", javaInterfaceContract, a.annotationType(), ifc.getName()); - } - } else { - if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); - } + } + for (Method m : ifc.getMethods()) { + for (Annotation a : m.getAnnotations()) { + if (ifc.isInterface()) { + if (JCA30006_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30006", javaInterfaceContract, a.annotationType(), ifc.getName()); + } + } else { + if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); } } } - for (Field f : ifc.getFields()) { - for (Annotation a : f.getAnnotations()) { - if (ifc.isInterface()) { - if (JCA30006_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30006", javaInterfaceContract, a.annotationType(), ifc.getName()); - } - } else { - if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); - } + } + for (Field f : ifc.getFields()) { + for (Annotation a : f.getAnnotations()) { + if (ifc.isInterface()) { + if (JCA30006_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30006", javaInterfaceContract, a.annotationType(), ifc.getName()); + } + } else { + if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); } } } } - if (javaInterfaceContract.getCallbackInterface() != null) { - Class<?> ifc = ((JavaInterface) javaInterfaceContract.getCallbackInterface()).getJavaClass(); - if (ifc != null) { - for (Annotation a : ifc.getAnnotations()) { - if (ifc.isInterface()) { - if (JCA30007_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30007", javaInterfaceContract, a.annotationType(), ifc.getName()); - } - } else { - if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); - } - } + if (javaInterfaceContract.getCallbackInterface() == null) { + return; + } + ifc = ((JavaInterface) javaInterfaceContract.getCallbackInterface()).getJavaClass(); + if (ifc == null) { + return; + } + + for (Annotation a : ifc.getAnnotations()) { + if (ifc.isInterface()) { + if (JCA30007_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30007", javaInterfaceContract, a.annotationType(), ifc.getName()); + } + } else { + if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); } } - for (Method m : ifc.getMethods()) { - for (Annotation a : m.getAnnotations()) { - if (ifc.isInterface()) { - if (JCA30007_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30007", javaInterfaceContract, a.annotationType(), ifc.getName()); - } - } else { - if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); - } + } + for (Method m : ifc.getMethods()) { + for (Annotation a : m.getAnnotations()) { + if (ifc.isInterface()) { + if (JCA30007_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30007", javaInterfaceContract, a.annotationType(), ifc.getName()); + } + } else { + if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); } } } - for (Field f : ifc.getFields()) { - for (Annotation a : f.getAnnotations()) { - if (ifc.isInterface()) { - if (JCA30007_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30007", javaInterfaceContract, a.annotationType(), ifc.getName()); - } - } else { - if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { - error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); - } + } + for (Field f : ifc.getFields()) { + for (Annotation a : f.getAnnotations()) { + if (ifc.isInterface()) { + if (JCA30007_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30007", javaInterfaceContract, a.annotationType(), ifc.getName()); + } + } else { + if (JCA30008_ANNOTATIONS.contains(a.annotationType())) { + error("ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName()); } } } |