jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • castor
  • CASTOR-67

Generated classes don't compile when using "default" on an element that extends xsd:string

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.9.3.9
  • Fix Version/s: 1.2
  • Component/s: XML code generator
  • Labels:
    None
  • Environment:
    Operating System: All
    Platform: PC
  • Bugzilla Id:
    887
  • Testcase included:
    yes

Description

Reported by Ozgur Balsoy:

I have an element X which is extended from xsd:string and defaulted to a
value "Y"

I have another element Z which contains X as a reference (or not, it does not
matter). When I generate the source code for this schema, X is initialized in Z
in a very weird way:

X _x = new X("Y");

There is no X(string) constructor generated. Is this a valid schema?

I have attached the schema and the generated code. I have tried it with 0.9.3.9
and today's CVS copy.

Ozgur

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Arnaud Blandin added a comment - 19/Feb/02 9:08 AM

Created an attachment (id=96)
Schema + generated files

Show
Arnaud Blandin added a comment - 19/Feb/02 9:08 AM Created an attachment (id=96) Schema + generated files
Hide
Permalink
Arnaud Blandin added a comment - 08/Apr/02 8:55 AM

MemberFactory contains code that only works if the class has a constructor that
takes a string as parameter. This needs to be changed

Show
Arnaud Blandin added a comment - 08/Apr/02 8:55 AM MemberFactory contains code that only works if the class has a constructor that takes a string as parameter. This needs to be changed
Hide
Permalink
Werner Guttmann added a comment - 02/Nov/06 9:18 AM

It would be nice to see a sample XML schema that actually demonstrates the issue at hand.

Show
Werner Guttmann added a comment - 02/Nov/06 9:18 AM It would be nice to see a sample XML schema that actually demonstrates the issue at hand.
Hide
Permalink
Edward Kuns added a comment - 11/Dec/06 11:40 PM

I just added a regression test case to reproduce this problem. It's a genuine bug and easily reproducable.

Show
Edward Kuns added a comment - 11/Dec/06 11:40 PM I just added a regression test case to reproduce this problem. It's a genuine bug and easily reproducable.
Hide
Permalink
Edward Kuns added a comment - 11/Dec/06 11:42 PM

Test case is in the RegressionTestSuite under sourcegenerator/Default-C67

Show
Edward Kuns added a comment - 11/Dec/06 11:42 PM Test case is in the RegressionTestSuite under sourcegenerator/Default-C67
Hide
Permalink
Edward Kuns added a comment - 14/Dec/07 10:49 PM

Bug fixed. There was a missing case that fell through the cracks causing extended or certain other types to generate uncompilable code when used with default values.

Show
Edward Kuns added a comment - 14/Dec/07 10:49 PM Bug fixed. There was a missing case that fell through the cracks causing extended or certain other types to generate uncompilable code when used with default values.

People

  • Assignee:
    Edward Kuns
    Reporter:
    Arnaud Blandin
Vote (0)
Watch (0)

Dates

  • Created:
    19/Feb/02 9:08 AM
    Updated:
    14/Mar/08 6:40 AM
    Resolved:
    14/Dec/07 10:49 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.