scheu 02/04/22 10:33:32
Modified: java/src/org/apache/axis/wsdl/toJava JavaBeanWriter.java
java/test/wsdl/types ComprehensiveTypes.wsdl
VerifyTestCase.java
Log:
This change fixes:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8367
and
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8334
The 8334 bug fix involved fixing the hashCode generation for a boolean field.
The 8367 bug fix involved correctling the comprehensive test wsdl to specify
the DST attribute correctly. This revealed a small bug in the toString generation
which I also fixed.
Revision Changes Path
1.10 +4 -2
xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java
Index: JavaBeanWriter.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- JavaBeanWriter.java 19 Apr 2002 21:22:23 -0000 1.9
+++ JavaBeanWriter.java 22 Apr 2002 17:33:31 -0000 1.10
@@ -262,7 +262,7 @@
if (wrapper != null) {
pw.println(" return new " + wrapper + "(value).toString();");
} else {
- pw.println(" return value.toString();");
+ pw.println(" return value == null ? null :
value.toString();");
}
pw.println(" }");
pw.println();
@@ -386,10 +386,12 @@
if (variableType.equals("int") ||
variableType.equals("short") ||
- variableType.equals("boolean") ||
variableType.equals("byte")) {
pw.println(" _hashCode += " + get +
Utils.capitalizeFirstChar(variable) + "();");
+ } else if (variableType.equals("boolean")) {
+ pw.println(" _hashCode += new Boolean(" + get +
+ Utils.capitalizeFirstChar(variable) + "()).hashCode();");
} else if (variableType.equals("long")) {
pw.println(" _hashCode += new Long(" + get +
Utils.capitalizeFirstChar(variable) + "()).hashCode();");
1.26 +5 -3 xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl
Index: ComprehensiveTypes.wsdl
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ComprehensiveTypes.wsdl 8 Apr 2002 23:18:45 -0000 1.25
+++ ComprehensiveTypes.wsdl 22 Apr 2002 17:33:32 -0000 1.26
@@ -95,9 +95,11 @@
</xsd:element>
<xsd:complexType name="time">
- <xsd:restriction base="xsd:string">
- <xsd:attribute name="DST" type="xsd:boolean" />
- </xsd:restriction>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="DST" type="xsd:boolean" />
+ </xsd:extension>
+ </xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="complexWComplex">
1.20 +3 -1 xml-axis/java/test/wsdl/types/VerifyTestCase.java
Index: VerifyTestCase.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/types/VerifyTestCase.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- VerifyTestCase.java 8 Apr 2002 23:18:45 -0000 1.19
+++ VerifyTestCase.java 22 Apr 2002 17:33:32 -0000 1.20
@@ -333,7 +333,9 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
StockQuote stockQuote = new StockQuote();
- stockQuote.setTime(new Time());
+ Time time = new Time();
+ time.setDST(false);
+ stockQuote.setTime(time);
stockQuote.setChange(new SimpleFwd("5"));
stockQuote.setPctchange("100%");
stockQuote.setBid("9");