summaryrefslogtreecommitdiff
path: root/java/common/templates/method
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2010-09-12 22:40:40 +0000
committerRobert Godfrey <rgodfrey@apache.org>2010-09-12 22:40:40 +0000
commit28f852661ecf2210538abea84576dfb3a570bc87 (patch)
tree2ddab287f32837766db005bc077f15cb6b608af7 /java/common/templates/method
parentc49ead1bd1681e34254d81940f8c24227cec3fb3 (diff)
downloadqpid-python-28f852661ecf2210538abea84576dfb3a570bc87.tar.gz
QPID-2857 : Address issues found by running FindBugs against the Java codebase
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@996393 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/templates/method')
-rw-r--r--java/common/templates/method/version/MethodBodyClass.vm10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/common/templates/method/version/MethodBodyClass.vm b/java/common/templates/method/version/MethodBodyClass.vm
index 9b2ba0fa39..a739110d70 100644
--- a/java/common/templates/method/version/MethodBodyClass.vm
+++ b/java/common/templates/method/version/MethodBodyClass.vm
@@ -70,9 +70,9 @@ public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version
return FACTORY_INSTANCE;
}
- public static int CLASS_ID = $clazz.ClassId;
+ public static final int CLASS_ID = $clazz.ClassId;
- public static int METHOD_ID = $method.MethodId;
+ public static final int METHOD_ID = $method.MethodId;
@@ -196,7 +196,11 @@ public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version
StringBuilder buf = new StringBuilder("[$javaClassName: ");
#foreach( $field in $method.FieldList )
buf.append( "$field.Name=" );
- buf.append( get#toUpperCamel( $field.Name )() );
+#if( $field.NativeType == "byte[]" )
+ buf.append( get#toUpperCamel( $field.Name )() == null ? "null" : java.util.Arrays.toString( get#toUpperCamel( $field.Name )() ) );
+#else
+ buf.append( get#toUpperCamel( $field.Name )() );
+#end
#if( $velocityCount != $method.FieldList.size() )
buf.append( ", " );
#end