You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by ja...@ws.apache.org on 2004/08/30 11:27:19 UTC

[jira] Commented: (JAXME-30) Schema attribute names not checked for Java.lang.Object safety

The following comment has been added to this issue:

     Author: Ias
    Created: Mon, 30 Aug 2004 2:27 AM
       Body:
According to JAXB 1.0 spec C.2.1 "Collisions and conflicts",

A class name must not conflict with the generated JAXB class,
ObjectFactory, section 4.2 on page 36, that occurs in each schema-derived
Java package. Method names are forbidden to conflict with Java keywords or
literals, with methods declared in java.lang.Object, or with methods
declared in the binding-framework classes. Such conflicts are reported as errors
and may be repaired by revising the appropriate schema or by specifying an
appropriate customized binding that resolves the name collision.

Therefore, in my opinion, a JAXB comliant schema binding compiler should fail to compile a schema containing a fragment like above and reports an appropriate error guiding revision or costomization.
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/JAXME-30?page=comments#action_37909

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JAXME-30

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAXME-30
    Summary: Schema attribute names not checked for Java.lang.Object safety
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: JaxMe
 Components: 
             JaxMe Core
   Versions:
             current (nightly)

   Assignee: 
   Reporter: Michael Forrest

    Created: Mon, 30 Aug 2004 12:31 AM
    Updated: Mon, 30 Aug 2004 2:27 AM
Environment: Java 1.4.2_05, on Linux 2.4.20

Description:
The following element definition in an xsd file:

 <xs:element name='mocid'>
  <xs:complexType>
   <xs:attribute name='tag' type='xs:ID' use='required'/>
   <xs:attribute name='class' type='xs:string' use='required'/>
   <xs:attribute name='interface' type='xs:string' use='optional'/>
   <xs:attribute name='id' type='xs:string' use='required'/>
  </xs:complexType>
 </xs:element>

succesfully generates code which fails to compile. The problem centers
around the second attribute. It causes the generation of a
"getClass()" method in MocidType (as well as the associated MocidTypeImpl and MocidTypeSerializer) that does not compile, owing
to the fact that getClass is final on java.lang.Object).


---------------------------------------------------------------------
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


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org