summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/implementation-java/src
diff options
context:
space:
mode:
authorkelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68>2010-05-10 12:02:56 +0000
committerkelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68>2010-05-10 12:02:56 +0000
commitea2451fbdf303d7c706deb1114d3781403802209 (patch)
treee3d0ba766b09d1c4ce03f0920d01c91f34e5d628 /sca-java-2.x/trunk/modules/implementation-java/src
parentb005770623eaf2a9015aa97a737c6e278abeba2d (diff)
error message updates for caa otests
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@942716 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-java/src')
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java8
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java2
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java2
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java4
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java10
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/main/resources/impl-javaxml-validation-messages.properties2
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java2
7 files changed, 15 insertions, 15 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java
index cf01ede748..180ea3e64d 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java
@@ -113,7 +113,7 @@ public abstract class AbstractPropertyProcessor<A extends Annotation> extends Ba
Annotation argAnnotations[] = paramsAnnotations[i];
for (int j = 0; j < argAnnotations.length; j++) {
if(argAnnotations[j].annotationType() == org.oasisopen.sca.annotation.Property.class) {
- throw new IllegalPropertyException("Argument " + (i+1) + " of method " + method.getName() + " in class " + method.getDeclaringClass() + " can not be a Property");
+ throw new IllegalPropertyException("[JCA90001] Argument " + (i+1) + " of method " + method.getName() + " in class " + method.getDeclaringClass() + " can not be a Property");
}
}
}
@@ -133,7 +133,7 @@ public abstract class AbstractPropertyProcessor<A extends Annotation> extends Ba
}
if(Modifier.isFinal(field.getModifiers())) {
- throw new IllegalPropertyException("Final field " + field.getName() +" in class " + field.getDeclaringClass().getName() + " can not be annotated as a Property");
+ throw new IllegalPropertyException("[JCA90011] Final field " + field.getName() +" in class " + field.getDeclaringClass().getName() + " can not be annotated as a Property");
}
String name = getName(annotation);
@@ -175,14 +175,14 @@ public abstract class AbstractPropertyProcessor<A extends Annotation> extends Ba
throw new InvalidConstructorException("Mismatched property name: " + parameter);
}
if ("".equals(name) && "".equals(parameter.getName())) {
- throw new InvalidPropertyException("Missing property name: " + parameter);
+ throw new InvalidPropertyException("[JCA90013] Missing property name: " + parameter);
}
if ("".equals(name)) {
name = parameter.getName();
}
if (!getRequired(annotation)) {
- throw new InvalidPropertyException("JCA_90014 Constructor property must not have required=false: " + type.getName());
+ throw new InvalidPropertyException("[JCA90014] Constructor property must not have required=false: " + type.getName());
}
JavaElementImpl prop = properties.get(name);
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java
index 0c4c0a4731..a4b760760c 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java
@@ -50,7 +50,7 @@ public class DestroyProcessor extends BaseJavaClassVisitor {
return;
}
if (method.getParameterTypes().length != 0) {
- throw new IllegalDestructorException("Destructor must not have argments", method);
+ throw new IllegalDestructorException("[JCA90004] Destructor must not have arguments", method);
}
if(!method.getReturnType().equals(void.class)) {
throw new IllegalDestructorException("Destructor must return void.", method);
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java
index 8d67236fe2..a5227fc4f5 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java
@@ -51,7 +51,7 @@ public class InitProcessor extends BaseJavaClassVisitor {
return;
}
if (method.getParameterTypes().length != 0) {
- throw new IllegalInitException("Initializer must not have argments", method);
+ throw new IllegalInitException("[JCA90008] Initializer must not have argments", method);
}
if(!method.getReturnType().equals(void.class)) {
throw new IllegalInitException("Initializer must return void.", method);
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java
index d30ac074af..b5c3806166 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java
@@ -143,11 +143,11 @@ public class ReferenceProcessor extends BaseJavaClassVisitor {
}
if (!refAnnotation.required()) {
- throw new InvalidReferenceException("JCA90016 Constructor has @Reference with required=false: " + type.getName());
+ throw new InvalidReferenceException("[JCA90016] Constructor has @Reference with required=false: " + type.getName());
}
if (refAnnotation.name() == null || refAnnotation.name().length() < 1) {
- throw new InvalidReferenceException("JCA90018 @Reference in a Constructor must have a name attribute" + type.getName());
+ throw new InvalidReferenceException("[JCA90018] @Reference in a Constructor must have a name attribute" + type.getName());
}
String paramName = parameter.getName();
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
index 30ed5dda44..99a29ece1c 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
@@ -94,7 +94,7 @@ public class ServiceProcessor extends BaseJavaClassVisitor {
Class<?>[] interfaces = annotation.value();
if (annotation.names().length > 0) {
if (annotation.names().length != interfaces.length) {
- throw new IntrospectionException("JCA90050 The number of Strings in the names attribute array of the @Service annotation MUST match the number of elements in the value attribute array");
+ throw new IntrospectionException("[JCA90050] The number of Strings in the names attribute array of the @Service annotation MUST match the number of elements in the value attribute array");
}
Set<String> names = new HashSet<String>();
names.addAll(Arrays.asList(annotation.names()));
@@ -106,7 +106,7 @@ public class ServiceProcessor extends BaseJavaClassVisitor {
//validate no scope on servce interface
for (Class<?> iface : interfaces) {
if (iface.getAnnotation(org.oasisopen.sca.annotation.Scope.class) != null) {
- throw new IntrospectionException("JCA90041 @Scope annotation not allowed on service interface " + iface
+ throw new IntrospectionException("[JCA90041] @Scope annotation not allowed on service interface " + iface
.getName());
}
}
@@ -116,7 +116,7 @@ public class ServiceProcessor extends BaseJavaClassVisitor {
for (Class<?> iface : interfaces) {
for (Method m : iface.getMethods()) {
if (!hasMethod(m, ms)) {
- throw new IntrospectionException("JCA???? Implementation missing service method " + m.getName() + " service interface " + iface.getName());
+ throw new IntrospectionException("[JCA90042] Implementation missing service method " + m.getName() + " service interface " + iface.getName());
}
}
}
@@ -150,7 +150,7 @@ public class ServiceProcessor extends BaseJavaClassVisitor {
}
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());
+ throw new IllegalCallbackReferenceException("[JCA90046] @Callback on field of method must not have any parameters: " + type.getName() + "." + method.getName());
}
if(Modifier.isPrivate(method.getModifiers())) {
@@ -171,7 +171,7 @@ public class ServiceProcessor extends BaseJavaClassVisitor {
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());
+ 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);
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/resources/impl-javaxml-validation-messages.properties b/sca-java-2.x/trunk/modules/implementation-java/src/main/resources/impl-javaxml-validation-messages.properties
index 337a0b8458..4976bc0e9f 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/main/resources/impl-javaxml-validation-messages.properties
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/resources/impl-javaxml-validation-messages.properties
@@ -20,4 +20,4 @@
#
ClassNotFoundException = Class Not Found Exception: {0}
ContributionResolveException = Contribution Resolve Exception occured due to:
-IllegalSCAAnnotation = JCA9002 SCA annotations are not permitted on static members: {0}.{1}
+IllegalSCAAnnotation = [JCA9002] SCA annotations are not permitted on static members: {0}.{1}
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java b/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
index d591123aef..1d6b412a27 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
@@ -127,7 +127,7 @@ public class ServiceProcessorTestCase {
processor.visitClass(BadServiceNames.class, type);
fail();
} catch (IntrospectionException e) {
- assertTrue(e.getMessage().startsWith("JCA90050"));
+ assertTrue(e.getMessage().startsWith("[JCA90050]"));
}
}