You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ga...@apache.org on 2004/11/09 18:49:31 UTC

cvs commit: ws-axis/java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java

gawor       2004/11/09 09:49:30

  Modified:    java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java
  Log:
  a fix to symboltable to reuse existing type for reference type if there is one. solves problems with invalid type mapping and propably duplicated type mappings in the stub
  
  Revision  Changes    Path
  1.109     +14 -8     ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
  retrieving revision 1.108
  retrieving revision 1.109
  diff -u -r1.108 -r1.109
  --- SymbolTable.java	25 Oct 2004 14:32:21 -0000	1.108
  +++ SymbolTable.java	9 Nov 2004 17:49:30 -0000	1.109
  @@ -1220,6 +1220,7 @@
                           // be mapped as a simple type, and put it in the
                           // symbol table.
                           TypeEntry te = null;
  +                        TypeEntry parentType = null;
   
                           if (!isElement) {
                               te = new DefinedType(qName, node);
  @@ -1231,11 +1232,7 @@
                                   Node parent = node.getParentNode();
                                   QName parentQName =
                                           Utils.getNodeNameQName(parent);
  -                                TypeEntry parentType = getElement(parentQName);
  -
  -                                if (parentType != null) {
  -                                    parentType.setRefType(te);
  -                                }
  +                                parentType = getElement(parentQName);
                               }
                           } else {
                               if (!belowSchemaLevel) {
  @@ -1247,7 +1244,11 @@
                               if (SchemaUtils.isSimpleTypeOrSimpleContent(node)) {
                                   te.setSimpleType(true);
                               }
  -                            symbolTablePut(te);
  +                            te = (TypeEntry)symbolTablePut(te);
  +
  +                            if (parentType != null) {
  +                                parentType.setRefType(te);
  +                            }
                           }
                       }
                   }
  @@ -3505,11 +3506,14 @@
        * @param entry 
        * @throws IOException 
        */
  -    private void symbolTablePut(SymTabEntry entry) throws IOException {
  +    private SymTabEntry symbolTablePut(SymTabEntry entry) throws IOException {
   
           QName name = entry.getQName();
   
  -        if (get(name, entry.getClass()) == null) {
  +        SymTabEntry e = get(name, entry.getClass());
  +
  +        if (e == null) {
  +            e = entry;
   
               // An entry of the given qname of the given type doesn't exist yet.
               if ((entry instanceof Type)
  @@ -3597,6 +3601,8 @@
                                                          "" + name));
               }
           }
  +
  +        return e;
       }    // symbolTablePut
   
       /**