Axis2
  1. Axis2
  2. AXIS2-4688

getUniqueSuffix uses unqualified (java built-in) System class, conflicts with generated System type defined in WSDL

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.3, 1.6.0
    • Component/s: codegen
    • Labels:
      None
    • Environment:
      jdk 1.6

      Description

      Steps to Reproduce:
      Run wsdl2java on a WSDL with the following XSD element, then compile:
      <xsd:simpleType name="system"><xsd:restriction base="xsd:string"><xsd:enumeration value="A"/><xsd:enumeration value="B"/><xsd:enumeration value="C"/><xsd:enumeration value="D"/><xsd:enumeration value="E"/></xsd:restriction></xsd:simpleType>

      Error Result:
      Compilation warning of "no symbol found" for currentTimeMillis()

      Suspected Reason:
      The .wsdl file defines a Type named "System", which the generator creates a class for in the Stub. The unqualified reference (in getUniqueSuffix) to java's built System class conflicts.

      Proposed Fix:
      Change the reference to "System" in the method getUniqueSuffix in generated Stub to fully qualified "java.lang.System"

      private static synchronized java.lang.String getUniqueSuffix(){
      // reset the counter if it is greater than 99999
      if (counter > 99999)

      { counter = 0; }

      counter = counter + 1;
      return java.lang.Long.toString(System.currentTimeMillis()) + "_" + counter;
      }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Andreas Veithen
            Reporter:
            Dean Holdren
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development