commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator PrimarySourceGenerator.java
Date Mon, 14 Jan 2002 13:53:14 GMT
hammant     02/01/14 05:53:14

  Modified:    altrmi/src/java/org/apache/commons/altrmi/generator
                        PrimarySourceGenerator.java
  Log:
  more robust any logic
  
  Revision  Changes    Path
  1.5       +8 -12     jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/PrimarySourceGenerator.java
  
  Index: PrimarySourceGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/PrimarySourceGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PrimarySourceGenerator.java	13 Jan 2002 00:13:53 -0000	1.4
  +++ PrimarySourceGenerator.java	14 Jan 2002 13:53:14 -0000	1.5
  @@ -29,7 +29,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class PrimarySourceGenerator extends AbstractMethodHandler {
   
  @@ -124,12 +124,11 @@
           // methdos could be in more than one interface.
           Vector methodsDone = new Vector();
   
  +        String filename = mGenDir + File.separator + "AltrmiGenerated" + mGenName + "_"
+ name + ".java";
           try {
  -            mClassSource = new PrintWriter(new FileOutputStream(mGenDir + File.separator
  -                                                                + "AltrmiGenerated" + mGenName
  -                                                                + "_" + name + ".java"));
  +            mClassSource = new PrintWriter(new FileOutputStream(filename));
           } catch (FileNotFoundException e) {
  -            e.printStackTrace();
  +            throw new SourceGenerationException("Cannot make source output file '" + filename
+ "'");
           }
   
           mClassSource.print("public class AltrmiGenerated" + mGenName + "_" + name);
  @@ -148,7 +147,7 @@
               try {
                   clazz = cL.loadClass(classOrInterfacesToExpose[x]);
               } catch (ClassNotFoundException e) {
  -                e.printStackTrace();
  +                throw new SourceGenerationException("Cannot find '" + classOrInterfacesToExpose[x]
+ "' interface in classpath");
               }
   
               Method[] methods = clazz.getMethods();
  @@ -265,12 +264,9 @@
       public void makeSource2(ClassLoader cL, String name, String[] classOrInterfacesToExpose)
               throws SourceGenerationException {
   
  +        String filename = mGenDir + File.separator + "AltrmiGenerated2" + mGenName + "_"
+ name + ".java";
           try {
  -            PrintWriter class2Source = new PrintWriter(new FileOutputStream(mGenDir
  -                                                                            + File.separator
  -                                                                            + "AltrmiGenerated2"
  -                                                                            + mGenName
+ "_"
  -                                                                            + name + ".java"));
  +            PrintWriter class2Source = new PrintWriter(new FileOutputStream(filename));
   
               class2Source.print("public final class AltrmiGenerated2" + mGenName + "_" +
name);
               class2Source.print(" extends AltrmiGenerated" + mGenName + "_" + name);
  @@ -285,7 +281,7 @@
               class2Source.println("}");
               class2Source.close();
           } catch (FileNotFoundException e) {
  -            e.printStackTrace();
  +            throw new SourceGenerationException("Cannot make source output file '" + filename
+ "'");
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message