From 8c8130d0288446f88deef393823cccffcaed474d Mon Sep 17 00:00:00 2001 From: Robert Godfrey Date: Sun, 12 Sep 2010 22:40:40 +0000 Subject: QPID-2857 : Address issues found by running FindBugs against the Java codebase git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@996393 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/java/common/templates/method/version/MethodBodyClass.vm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'qpid/java/common/templates/method/version/MethodBodyClass.vm') diff --git a/qpid/java/common/templates/method/version/MethodBodyClass.vm b/qpid/java/common/templates/method/version/MethodBodyClass.vm index 9b2ba0fa39..a739110d70 100644 --- a/qpid/java/common/templates/method/version/MethodBodyClass.vm +++ b/qpid/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 -- cgit v1.2.1