axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Gawor" <>
Subject Anonymous type collisoins
Date Thu, 01 Apr 2004 19:32:22 GMT

I'm trying to understand the following code in

                // If there is already an existing type,
                // there will be a collision.
                // If there is an existing anon type,
                // there will be a  collision.
                // In both cases, mangle the name.

                if (anonQNames.get(typeQName) != null) {
                    localName += "Type" + uniqueNum++;
                    typeQName =
                    new QName(typeQName.getNamespaceURI(),
                anonQNames.put(typeQName, typeQName);

Aren't the type qnames already unique? Because the type qname is composed of
all parents element names? 
We ran into a problem were the same wsdl/xsd files are imported directly and
indirectly. That is, a.wsdl imports b.wsdl and c.wsdl, and b.wsdl also
import c.wsdl. The WSDL2Java started generating these *Type<num> classes
because of the code above. However, there were really no collisions here as
the same definitions were loaded twice from the same doc. 
Removing the piece of code helps but I'm wondering if this will break
anything. From what I can tell it does not. Please also note that the
comment in the code talks about doing the same for regular types but no such
thing is done, it only affects anonymous types.

Can someone clarify this for me?


View raw message