axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From axis-...@ws.apache.org
Subject [jira] Created: (AXIS-1528) WSDL2Java emitter creating Date data types which throw java.text.ParseExceptions
Date Wed, 25 Aug 2004 02:59:26 GMT
Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1528

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1528
    Summary: WSDL2Java emitter creating Date data types which throw java.text.ParseExceptions
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis
 Components: 
             WSDL processing
   Versions:
             1.2 Beta

   Assignee: 
   Reporter: Christopher Bartling

    Created: Tue, 24 Aug 2004 7:58 PM
    Updated: Tue, 24 Aug 2004 7:58 PM
Environment: JDK 1.4.2_04, Windows XP

Description:
The wsdl2java emitter creates a constructor for Date data types which does not correctly parse
the default String representation of java.util.Date.  Below is a snippet of code from the
generated class, which the offending line commented out and a potential fix inserted.


package gov.ojp.it.www.jxdm._3_0.proxy.xsd._1_0;

import java.text.SimpleDateFormat;

public class Date implements java.io.Serializable, org.apache.axis.encoding.SimpleType {
    private java.util.Date value;

    public Date() {
    }

    // Simple Types must have a String constructor
    public Date(java.util.Date value) {
        this.value = value;
    }

    public Date(java.lang.String value) {
        try {
            // The following code does not work properly.  Throws a
            // ParseException.  SimpleDateFormat usage works.
            //
            //this.value = (java.text.DateFormat.getDateTimeInstance()).parse(value);
            this.value = new SimpleDateFormat("EEE MMM dd hh:mm:ss z yyyy").parse(value);
        } catch (java.text.ParseException e) {
            throw new java.lang.RuntimeException(e.toString());
        }
    }
...
}






---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message