You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2007/01/23 16:09:22 UTC
svn commit: r499046 -
/incubator/qpid/branches/qpid.0-9/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
Author: kpvdr
Date: Tue Jan 23 07:09:22 2007
New Revision: 499046
URL: http://svn.apache.org/viewvc?view=rev&rev=499046
Log:
Fixed bug in generated MethodBody toString() expressions for longstr types in which a null value resulted in an NPE.
Modified:
incubator/qpid/branches/qpid.0-9/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
Modified: incubator/qpid/branches/qpid.0-9/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/gentools/src/org/apache/qpid/gentools/JavaGenerator.java?view=diff&rev=499046&r1=499045&r2=499046
==============================================================================
--- incubator/qpid/branches/qpid.0-9/gentools/src/org/apache/qpid/gentools/JavaGenerator.java (original)
+++ incubator/qpid/branches/qpid.0-9/gentools/src/org/apache/qpid/gentools/JavaGenerator.java Tue Jan 23 07:09:22 2007
@@ -1057,7 +1057,8 @@
if (domain.compareTo("longstr") == 0)
{
sb.append(Utils.createSpaces(indentSize) +
- "buf.append(\" " + fieldName + ": \" + new String(" + fieldName + "));" + cr);
+ "buf.append(\" " + fieldName + ": \" + (" + fieldName +
+ " == null ? \"<null>\" : new String(" + fieldName + ")));" + cr);
}
else
{