diff options
-rw-r--r-- | java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java index 797ffcf5d7..51f2678f55 100644 --- a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java +++ b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java @@ -150,6 +150,11 @@ public class ServiceProcessor extends BaseJavaClassVisitor { if (annotation == null) { return; } + + if (!(annotation.value() == null || annotation.value() == Void.class)) { + throw new IllegalCallbackReferenceException("JCA90046 @Callback on field of method must not have any parameters: " + type.getName() + "." + method.getName()); + } + if(Modifier.isPrivate(method.getModifiers())) { throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+method, method); } @@ -167,6 +172,9 @@ public class ServiceProcessor extends BaseJavaClassVisitor { if (annotation == null) { return; } + if (!(annotation.value() == null || annotation.value() == Void.class)) { + throw new IllegalCallbackReferenceException("JCA90046 @Callback on field of method must not have any parameters: " + type.getName() + "." + field.getName()); + } if(Modifier.isPrivate(field.getModifiers())) { throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+field, field); } |