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 bu...@apache.org on 2002/03/26 17:09:45 UTC

cvs commit: xml-axis/java/src/org/apache/axis/wsdl/fromJava Emitter.java Namespaces.java

butek       02/03/26 08:09:45

  Modified:    java/src/org/apache/axis/wsdl/fromJava Emitter.java
                        Namespaces.java
  Log:
  A few days ago Java2WSDL -p option didn't work.  I fixed Emitter so it did.
  But that fix broke Java2WSDL for classes in the default (no-name) package.
  It would throw a NullPointerException.  For classes in the default package
  it USED to generate the namespace "http://DefaultNamespace".  It now does
  that again.  But I wonder whether that'll be a problem.  It certainly doesn't
  roundtrip properly.
  
  Revision  Changes    Path
  1.25      +5 -2      xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Emitter.java	22 Mar 2002 17:21:25 -0000	1.24
  +++ Emitter.java	26 Mar 2002 16:09:45 -0000	1.25
  @@ -415,8 +415,11 @@
                   defaultTM = DefaultSOAP12TypeMappingImpl.create();
               }
   
  -            if (intfNS == null) 
  -                intfNS = namespaces.getCreate(cls.getPackage().getName());
  +            if (intfNS == null) {
  +                Package pkg = cls.getPackage();
  +                intfNS = namespaces.getCreate(
  +                        pkg == null ? null : pkg.getName());
  +            }
               if (implNS == null)
                   implNS = intfNS + "-impl";
   
  
  
  
  1.2       +1 -1      xml-axis/java/src/org/apache/axis/wsdl/fromJava/Namespaces.java
  
  Index: Namespaces.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Namespaces.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Namespaces.java	11 Dec 2001 15:13:55 -0000	1.1
  +++ Namespaces.java	26 Mar 2002 16:09:45 -0000	1.2
  @@ -204,7 +204,7 @@
       
       
       private static String makeNamespaceFromPackageName(String packageName, String protocol) {
  -        if (packageName.equals("") ||packageName == null)
  +        if (packageName == null || packageName.equals(""))
               return protocol + "://" + "DefaultNamespace";
           StringTokenizer st = new StringTokenizer( packageName, "." );
           String[] words = new String[ st.countTokens() ];