axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Buss (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-2446) Schema constraints generate incorrect code
Date Fri, 30 Mar 2007 16:57:25 GMT
Schema constraints generate incorrect code
------------------------------------------

                 Key: AXIS2-2446
                 URL: https://issues.apache.org/jira/browse/AXIS2-2446
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.1.1
         Environment: Java 1.5, Tomcat 5.5, Axis2 1.1.1 and more recent  Axis and Axiom SNAPSHOTs,
Axis2 Eclipse codegen plugin 1.1.1, Eclipse 3.2, WTP 1.5.1, Windows 2003 server

            Reporter: Tim Buss


This problem was originally found in Axis 1.1.1 but is stil present in AXIS SNAPSHOT 3/21
and Axiom SNAPSHOT 3/23

A schema constraint that attempts to limit a string to a particular "maxLength"  generates
code that instead eforces the given size as a "minLength".  eg:

The schema type

			<xsd:simpleType name="ConstrainedSimpleType">
				<xsd:restriction base="xsd:string">
					<xsd:maxLength value="36"/>
				</xsd:restriction>
			</xsd:simpleType>

generates

                             /**
                               * Auto generated setter method
                               * @param param ConstrainedSimpleType
                               */
                               public void setConstrainedSimpleType(java.lang.String param){
                            
                                            if (  (java.lang.String.valueOf(param).length()
>= 36)  ) {
                                                this.localConstrainedSimpleType=param;
                                            }
                                            else {
                                                throw new java.lang.RuntimeException();
                                            }
                                        

                               }

As you can see the ">" is reversed.  It should be "<".   I have only tested this case
so far so I don't know if the bug is isolated to this case.

I am having some other issues with minOccurs=0 (or its omission) where the generated code
does not behave as expected but I am still trying th characterize that.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message