axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/wsdl/toJava JavaClassWriter.java
Date Fri, 03 Sep 2004 17:31:47 GMT
tomj        2004/09/03 10:31:47

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaClassWriter.java
  Log:
  Defend against empty package names.
  
  Revision  Changes    Path
  1.12      +10 -3     ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaClassWriter.java
  
  Index: JavaClassWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaClassWriter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JavaClassWriter.java	25 Feb 2004 14:02:52 -0000	1.11
  +++ JavaClassWriter.java	3 Sep 2004 17:31:47 -0000	1.12
  @@ -155,7 +155,13 @@
        */
       protected void registerFile(String file) {
   
  -        String fqClass = getPackage() + '.' + getClassName();
  +        final String pkg = getPackage();
  +        String fqClass;
  +        if (pkg != null && pkg.length() > 0) {
  +            fqClass = pkg + '.' + getClassName();
  +        } else {
  +            fqClass = getClassName();
  +        }
   
           emitter.getGeneratedFileInfo().add(file, fqClass, type);
       }    // registerFile
  @@ -211,8 +217,9 @@
        */
       protected void writePackage(PrintWriter pw) throws IOException {
   
  -        if (getPackage() != null) {
  -            pw.println("package " + getPackage() + ";");
  +        final String pkg = getPackage();
  +        if (pkg != null && pkg.length() > 0) {
  +            pw.println("package " + pkg + ";");
               pw.println();
           }
       }    // writePackage
  
  
  

Mime
View raw message