axis-java-dev mailing list archives

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

I'm trying to understand the following code in
org.apache.axis.wsdl.toJava.JavaGeneratorFactory#javifyTypeEntryName():

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

                symbolTable.getType(typeQName);
                if (anonQNames.get(typeQName) != null) {
                    localName += "Type" + uniqueNum++;
                    typeQName =
                    new QName(typeQName.getNamespaceURI(),
                            localName);
                }
                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?

Thanks,
Jarek



Mime
View raw message