You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-cvs@xml.apache.org by pc...@apache.org on 2004/03/16 22:55:32 UTC

cvs commit: xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam ClassesJamTest.java JamTestBase.java ParserJamTest.java SourcesJamTest.java

pcal        2004/03/16 13:55:31

  Modified:    v2/jam/src/org/apache/xmlbeans/impl/jam
                        JamServiceFactory.java JamServiceParams.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal
                        DirectoryScanner.java JamClassLoaderImpl.java
                        JamServiceContextImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/classrefs
                        UnqualifiedJClassRef.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements
                        PropertyImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/javadoc
                        JavadocClassBuilder.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/reflect
                        ReflectClassBuilder.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/provider
                        JamLogger.java JamServiceFactoryImpl.java
               v2/jam/test/tests/org/apache/xmlbeans/test/jam
                        ClassesJamTest.java JamTestBase.java
                        ParserJamTest.java SourcesJamTest.java
  Log:
  updates to JamServiceParams
  
  Revision  Changes    Path
  1.3       +1 -1      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JamServiceFactory.java
  
  Index: JamServiceFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JamServiceFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JamServiceFactory.java	16 Mar 2004 05:34:49 -0000	1.2
  +++ JamServiceFactory.java	16 Mar 2004 21:55:31 -0000	1.3
  @@ -92,7 +92,7 @@
       try {
         JamServiceParams sp = getInstance().createServiceParams();
         for(int i=0; i<args.length; i++) {
  -        sp.includeSourceFiles(new File("."),args[i]);
  +        sp.includeSourceFiles(new File[] {new File(".")},args[i]);
         }
         JamService service = getInstance().createService(sp);
         JamPrinter jp = JamPrinter.newInstance();
  
  
  
  1.4       +29 -29    xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JamServiceParams.java
  
  Index: JamServiceParams.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JamServiceParams.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JamServiceParams.java	11 Mar 2004 23:01:41 -0000	1.3
  +++ JamServiceParams.java	16 Mar 2004 21:55:31 -0000	1.4
  @@ -37,53 +37,53 @@
      * <p>Note that calling this method implicitly includes the 'root' in
      * the sourcepath (exactly as if addSourcepath(root) had been called).</p>
      *
  -   * @param root Root directory of the source files.
  +   * @param sourcepath Root directory/ies containing source files.
      * @param pattern A relative file pattern (as described above under
      * 'Include and Exclude Patterns').
      * @throws IllegalArgumentException if either argument is null.
      */
  -  public void includeSourceFiles(File root, String pattern);
  +  public void includeSourceFiles(File[] sourcepath, String pattern);
   
     /**
      * Specifies a set of java source files to be excluded in the JamService.
  -   * Note that calling this method implicitly includes the 'root' in
  -   * the sourcepath (as in a call to addSourcepath(root)).
  +   * Note that calling this method implicitly includes the 'sourcepath' in
  +   * the sourcepath (as in a call to addSourcepath(sourcepath)).
      *
  -   * @param root Root directory of the source files.
  +   * @param sourcepath Root directory of the source files.
      * @param pattern A relative file pattern (as described above under
      * 'Include and Exclude Patterns').
      * @throws IllegalArgumentException if either argument is null.
      */
  -  public void excludeSourceFiles(File root, String pattern);
  +  public void excludeSourceFiles(File[] sourcepath, String pattern);
   
     /**
      * Specifies a set of java class files to be excluded in the JamService.
  -   * Note that calling this method implicitly includes the 'root' in
  -   * the classpath (as in a call to addClasspath(root)).
  +   * Note that calling this method implicitly includes the 'classpath' in
  +   * the classpath (as in a call to addClasspath(classpath)).
      *
  -   * @param root Root directory of the source files.
  +   * @param classpath Root directory of the source files.
      * @param pattern A relative file pattern (as described above under
      * 'Include and Exclude Patterns').
      * @throws IllegalArgumentException if either argument is null.
      */
  -  public void includeClassFiles(File root, String pattern);
  +  public void includeClassFiles(File[] classpath, String pattern);
   
     /**
      * Specifies a set of java class files to be excluded from the JamService.
  -   * Note that calling this method implicitly includes the 'root' in
  -   * the classpath (as in a call to addClasspath(root)).
  +   * Note that calling this method implicitly includes the 'classpath' in
  +   * the classpath (as in a call to addClasspath(classpath)).
      *
  -   * @param root Root directory of the source files.
  +   * @param classpath Root directory of the source files.
      * @param pattern A relative file pattern (as described above under
      * 'Include and Exclude Patterns').
      * @throws IllegalArgumentException if either argument is null.
      */
  -  public void excludeClassFiles(File root, String pattern);
  +  public void excludeClassFiles(File[] classpath, String pattern);
   
     /**
  -   * <p>Includes a single source File in the JamService.  The root parameter
  -   * should identify the source root of the java source file; the sourceFile
  -   * parameter must be under the root subtree.</p>
  +   * <p>Includes a single source File in the JamService.  The sourcepath parameter
  +   * should identify the source sourcepath of the java source file; the sourceFile
  +   * parameter must be under the sourcepath subtree.</p>
      *
      * <p>For example, if a class "foo.bar.MyClass" is stored in a file
      * "c:/myproject/src/foo/bar/MyClass.java", that class could be included in
  @@ -100,38 +100,38 @@
      *  includeSourceFiles(new File("c:/myproject/src"),"foo/bar/MyClass.java");
      * </pre>
      *
  -   * <p>If you are calling this method and have more than one root directory,
  -   * and do not readily know which is the correct root for a given source
  +   * <p>If you are calling this method and have more than one sourcepath directory,
  +   * and do not readily know which is the correct sourcepath for a given source
      * File, you can use the getRootForFile() utility method to determine the
  -   * correct root to use.</p>
  +   * correct sourcepath to use.</p>
      *
  -   * <p>Note that calling this method implicitly includes the 'root' in
  -   * the sourcepath (exactly as if addSourcepath(root) had been called).</p>
  +   * <p>Note that calling this method implicitly includes the 'sourcepath' in
  +   * the sourcepath (exactly as if addSourcepath(sourcepath) had been called).</p>
      *
  -   * @param root source root for the java source file
  +   * @param sourcepath source sourcepath for the java source file
      * @param sourceFile the java source file
      * @throws IllegalArgumentException if either argument is null or if
  -   * root is not an ancestor of sourceFile in the file system.
  +   * sourcepath is not an ancestor of sourceFile in the file system.
      */
  -  public void includeSourceFile(File root, File sourceFile);
  +  public void includeSourceFile(File[] sourcepath, File sourceFile);
   
     /**
      * <p>Excludes a single source File in the JamService in exactly the same
      * way theat includeSourceFile() includes a source file.
      */
  -  public void excludeSourceFile(File root, File sourceFile);
  +  public void excludeSourceFile(File[] sourcepath, File sourceFile);
   
     /**
      * <p>Includes a single class File in the JamService in exactly the same
      * way theat includeSourceFile() includes a source file.
      */
  -  public void includeClassFile(File root, File sourceFile);
  +  public void includeClassFile(File[] sourcepath, File sourceFile);
   
     /**
      * <p>Excludes a single class File in the JamService in exactly the same
      * way theat includeSourceFile() includes a source file.
      */
  -  public void excludeClassFile(File root, File sourceFile);
  +  public void excludeClassFile(File[] sourcepath, File sourceFile);
   
     /**
      * Names a specific class to be included in the JamService.  Note that
  @@ -223,7 +223,7 @@
      * does.
      * @throws IllegalArgumentException if either argument is null.
      */
  -  public File getRootForFile(File[] sourceRoots, File sourceFile);
  +  //public File getRootForFile(File[] sourceRoots, File sourceFile);
   
   
     /**
  
  
  
  1.4       +17 -1     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/DirectoryScanner.java
  
  Index: DirectoryScanner.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/DirectoryScanner.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DirectoryScanner.java	9 Mar 2004 10:38:52 -0000	1.3
  +++ DirectoryScanner.java	16 Mar 2004 21:55:31 -0000	1.4
  @@ -15,6 +15,8 @@
   
   package org.apache.xmlbeans.impl.jam.internal;
   
  +import org.apache.xmlbeans.impl.jam.provider.JamLogger;
  +
   import java.io.File;
   import java.io.IOException;
   import java.util.ArrayList;
  @@ -33,6 +35,7 @@
   
     private boolean mCaseSensitive = true;
     private File mRoot;
  +  private JamLogger mLogger;
     private List mIncludeList = null;
     private List mExcludeList = null;
     private String[] mIncludes;
  @@ -42,10 +45,13 @@
     private boolean mIsDirty = false;
     private String[] mIncludedFilesCache = null;
   
  +
     // ========================================================================
     // Constructors
   
  -  public DirectoryScanner(File dirToScan) {
  +  public DirectoryScanner(File dirToScan, JamLogger logger) {
  +    if (logger == null) throw new IllegalArgumentException("null logger");
  +    mLogger = logger;
       mRoot = dirToScan;
     }
   
  @@ -210,6 +216,9 @@
      */
     private void scandir(File dir, String vpath, boolean fast)
             throws IOException {
  +    if (mLogger.isVerbose()) {
  +      mLogger.verbose("[DirectoryScanner] scanning dir "+dir+" for '"+vpath+"'");
  +    }
       String[] newfiles = dir.list();
       if (newfiles == null) {
         /*
  @@ -265,6 +274,13 @@
           if (isIncluded(name)) {
             if (!isExcluded(name)) {
               mFilesIncluded.addElement(name);
  +            if (mLogger.isVerbose()) {
  +              mLogger.verbose("[DirectoryScanner] including "+name+" under '"+dir);
  +            }
  +          } else {
  +            if (mLogger.isVerbose()) {
  +              mLogger.verbose("[DirectoryScanner] EXCLUDING "+name+" under '"+dir);
  +            }
             }
           }
         }
  
  
  
  1.6       +6 -1      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamClassLoaderImpl.java
  
  Index: JamClassLoaderImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamClassLoaderImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JamClassLoaderImpl.java	11 Mar 2004 23:01:41 -0000	1.5
  +++ JamClassLoaderImpl.java	16 Mar 2004 21:55:31 -0000	1.6
  @@ -81,8 +81,13 @@
       }
       out = mBuilder.build(pkg,name);
       if (out == null) {
  +      //FIXME currently, the unqualified ref stuff will keep calling this,
  +      //newing up new UnresolvedClassImpls for each import until it finds
  +      //something.  We need to break out a separate checkClass() method
  +      //or something for them which returns null rather than UnresolvedClass.
         out = new UnresolvedClassImpl(pkg,name,mContext);
  -      mContext.debug("unresolved class '"+pkg+" "+name);
  +      mContext.warning(new ClassNotFoundException("Failed to resolve class "+
  +                                                  pkg+"' '"+name+"'"));
         mFd2ClassCache.put(fd,out);
         return out;
       }
  
  
  
  1.6       +85 -39    xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamServiceContextImpl.java
  
  Index: JamServiceContextImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamServiceContextImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JamServiceContextImpl.java	11 Mar 2004 23:01:41 -0000	1.5
  +++ JamServiceContextImpl.java	16 Mar 2004 21:55:31 -0000	1.6
  @@ -160,18 +160,6 @@
       return null;
     }
   
  -  public File getRootForFile(File[] sourceRoots, File sourceFile) {
  -    if (sourceRoots == null) throw new IllegalArgumentException("null roots");
  -    if (sourceFile == null) throw new IllegalArgumentException("null file");
  -    String f = sourceFile.getAbsolutePath();
  -    for(int i=0; i<sourceRoots.length; i++) {
  -      if (f.startsWith(sourceRoots[i].getAbsolutePath())) {//cheesy?
  -        return sourceRoots[i];
  -      }
  -    }
  -    return null;
  -  }
  -
     public void register175AnnotationProxy(Class proxy, String jsr175type) {
       validateProxyClass(proxy);
       ClassImpl.validateClassName(jsr175type);
  @@ -243,40 +231,64 @@
     }
   
   
  -  public void includeSourceFiles(File srcRoot, String pattern) {
  -    addSourcepath(srcRoot);
  -    getSourceScanner(srcRoot).include(pattern);
  +  public void includeSourceFiles(File[] sourcepath, String pattern) {
  +    if (sourcepath == null) throw new IllegalArgumentException("null sourcepath");
  +    if (sourcepath.length == 0) throw new IllegalArgumentException("empty sourcepath");
  +    if (pattern == null) throw new IllegalArgumentException("null pattern");
  +    for(int i=0; i<sourcepath.length; i++) {
  +      addSourcepath(sourcepath[i]);
  +      getSourceScanner(sourcepath[i]).include(pattern);
  +    }
     }
   
  -  public void includeClassFiles(File srcRoot, String pattern) {
  -    addClasspath(srcRoot);
  -    getClassScanner(srcRoot).include(pattern);
  +  public void includeClassFiles(File classpath[], String pattern) {
  +    if (classpath == null) throw new IllegalArgumentException("null classpath");
  +    if (classpath.length == 0) throw new IllegalArgumentException("empty classpath");
  +    if (pattern == null) throw new IllegalArgumentException("null pattern");
  +    for(int i=0; i<classpath.length; i++) {
  +      addClasspath(classpath[i]);
  +      getClassScanner(classpath[i]).include(pattern);
  +    }
     }
   
  -  public void excludeSourceFiles(File srcRoot, String pattern) {
  -    addSourcepath(srcRoot);
  -    getSourceScanner(srcRoot).exclude(pattern);
  +  public void excludeSourceFiles(File[] sourcepath, String pattern) {
  +    if (sourcepath == null) throw new IllegalArgumentException("null sourcepath");
  +    if (sourcepath.length == 0) throw new IllegalArgumentException("empty sourcepath");
  +    if (pattern == null) throw new IllegalArgumentException("null pattern");
  +    for(int i=0; i<sourcepath.length; i++) {
  +      addSourcepath(sourcepath[i]);
  +      getSourceScanner(sourcepath[i]).exclude(pattern);
  +    }
     }
   
  -  public void excludeClassFiles(File srcRoot, String pattern) {
  -    addClasspath(srcRoot);
  -    getClassScanner(srcRoot).exclude(pattern);
  +  public void excludeClassFiles(File[] classpath, String pattern) {
  +    if (classpath == null) throw new IllegalArgumentException("null classpath");
  +    if (classpath.length == 0) throw new IllegalArgumentException("empty classpath");
  +    if (pattern == null) throw new IllegalArgumentException("null pattern");
  +    for(int i=0; i<classpath.length; i++) {
  +      addClasspath(classpath[i]);
  +      getClassScanner(classpath[i]).exclude(pattern);
  +    }
     }
   
  -  public void includeSourceFile(File root, File sourceFile) {
  -    includeSourceFiles(root,source2pattern(root,sourceFile));
  +  public void includeSourceFile(File[] sourcepath, File sourceFile) {
  +    File root = getPathRootForFile(sourcepath,sourceFile);
  +    includeSourceFiles(new File[] {root}, source2pattern(root,sourceFile));
     }
   
  -  public void excludeSourceFile(File root, File sourceFile) {
  -    excludeSourceFiles(root,source2pattern(root,sourceFile));
  +  public void excludeSourceFile(File[] sourcepath, File sourceFile) {
  +    File root = getPathRootForFile(sourcepath,sourceFile);
  +    excludeSourceFiles(new File[] {root}, source2pattern(root,sourceFile));
     }
   
  -  public void includeClassFile(File root, File classFile) {
  -    includeClassFiles(root,source2pattern(root,classFile));
  +  public void includeClassFile(File[] classpath, File classFile) {
  +    File root = getPathRootForFile(classpath,classFile);
  +    includeClassFiles(new File[] {root}, source2pattern(root,classFile));
     }
   
  -  public void excludeClassFile(File root, File classFile) {
  -    excludeClassFiles(root,source2pattern(root,classFile));
  +  public void excludeClassFile(File[] classpath, File classFile) {
  +    File root = getPathRootForFile(classpath,classFile);
  +    excludeClassFiles(new File[] {root}, source2pattern(root,classFile));
     }
   
     public void includeClass(String qualifiedClassname) {
  @@ -290,17 +302,29 @@
     }
   
     public void addClasspath(File classpathElement) {
  -    if (mClasspath == null) mClasspath = new ArrayList();
  +    if (mClasspath == null) {
  +      mClasspath = new ArrayList();
  +    } else {
  +      if (mClasspath.contains(classpathElement)) return;
  +    }
       mClasspath.add(classpathElement);
     }
   
     public void addSourcepath(File sourcepathElement) {
  -    if (mSourcepath == null) mSourcepath = new ArrayList();
  +    if (mSourcepath == null) {
  +      mSourcepath = new ArrayList();
  +    } else {
  +      if (mSourcepath.contains(sourcepathElement)) return;
  +    }
       mSourcepath.add(sourcepathElement);
     }
   
     public void addToolClasspath(File classpathElement) {
  -    if (mToolClasspath == null) mToolClasspath = new ArrayList();
  +    if (mToolClasspath == null) {
  +      mToolClasspath = new ArrayList();
  +    } else {
  +      if (mToolClasspath.contains(classpathElement)) return;
  +    }
       mToolClasspath.add(classpathElement);
     }
   
  @@ -338,11 +362,11 @@
     // ========================================================================
     // JamLogger implementation
   
  -  public void debug(String msg) {
  +  public void verbose(String msg) {
       if (mVerbose) mOut.println(msg);
     }
   
  -  public void debug(Throwable t) {
  +  public void verbose(Throwable t) {
       if (mVerbose) t.printStackTrace(mOut);
     }
   
  @@ -350,10 +374,18 @@
       error(t);//FIXME
     }
   
  +  public void warning(String w) {
  +    error(w);//FIXME
  +  }
  +
     public void error(Throwable t) {
       t.printStackTrace(mOut);
     }
   
  +  public void error(String msg) {
  +    mOut.println(msg);
  +  }
  +
     // ========================================================================
     // ElementContext implementation
   
  @@ -416,6 +448,20 @@
     // ========================================================================
     // Private methods
   
  +  private File getPathRootForFile(File[] sourcepath, File sourceFile) {
  +    if (sourcepath == null) throw new IllegalArgumentException("null sourcepath");
  +    if (sourcepath.length == 0) throw new IllegalArgumentException("empty sourcepath");
  +    if (sourceFile == null) throw new IllegalArgumentException("null sourceFile");
  +    String f = sourceFile.getAbsolutePath();
  +    for(int i=0; i<sourcepath.length; i++) {
  +      if (f.startsWith(sourcepath[i].getAbsolutePath())) {//cheesy?
  +        return sourcepath[i];
  +      }
  +    }
  +    throw new IllegalArgumentException(sourceFile+" is not in the given path.");
  +  }
  +
  +
     private AnnotationProxy createProxy(Class clazz) {
       if (clazz == null) clazz = mDefaultAnnotationProxyClass;
       AnnotationProxy p;
  @@ -497,7 +543,7 @@
       if (mSourceRoot2Scanner == null) mSourceRoot2Scanner = new HashMap();
       DirectoryScanner out = (DirectoryScanner)mSourceRoot2Scanner.get(srcRoot);
       if (out == null) {
  -      mSourceRoot2Scanner.put(srcRoot,out = new DirectoryScanner(srcRoot));
  +      mSourceRoot2Scanner.put(srcRoot,out = new DirectoryScanner(srcRoot,this));
       }
       return out;
     }
  @@ -510,7 +556,7 @@
       if (mClassRoot2Scanner == null) mClassRoot2Scanner = new HashMap();
       DirectoryScanner out = (DirectoryScanner)mClassRoot2Scanner.get(clsRoot);
       if (out == null) {
  -      mClassRoot2Scanner.put(clsRoot,out = new DirectoryScanner(clsRoot));
  +      mClassRoot2Scanner.put(clsRoot,out = new DirectoryScanner(clsRoot,this));
       }
       return out;
     }
  
  
  
  1.2       +2 -1      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/classrefs/UnqualifiedJClassRef.java
  
  Index: UnqualifiedJClassRef.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/classrefs/UnqualifiedJClassRef.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UnqualifiedJClassRef.java	9 Mar 2004 10:38:52 -0000	1.1
  +++ UnqualifiedJClassRef.java	16 Mar 2004 21:55:31 -0000	1.2
  @@ -45,7 +45,8 @@
      */
     public static JClassRef create(String qualifiedClassname,
                                    JClassRefContext ctx) {
  -    return new UnqualifiedJClassRef(qualifiedClassname,ctx);
  +    throw new IllegalStateException("Unqualified names currently disabled.");
  +    //return new UnqualifiedJClassRef(qualifiedClassname,ctx);
     }
   
     // ========================================================================
  
  
  
  1.2       +2 -2      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/PropertyImpl.java
  
  Index: PropertyImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/PropertyImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PropertyImpl.java	9 Mar 2004 10:38:53 -0000	1.1
  +++ PropertyImpl.java	16 Mar 2004 21:55:31 -0000	1.2
  @@ -18,7 +18,7 @@
   
   import org.apache.xmlbeans.impl.jam.*;
   import org.apache.xmlbeans.impl.jam.internal.classrefs.JClassRef;
  -import org.apache.xmlbeans.impl.jam.internal.classrefs.UnqualifiedJClassRef;
  +import org.apache.xmlbeans.impl.jam.internal.classrefs.QualifiedJClassRef;
   
   import java.util.HashMap;
   import java.util.Map;
  @@ -57,7 +57,7 @@
       mName = name;
       mGetter = getter;
       mSetter = setter;
  -    mTypeRef = UnqualifiedJClassRef.create
  +    mTypeRef = QualifiedJClassRef.create
         (qualifiedTypeName,((ClassImpl)getter.getContainingClass()));
     }
   
  
  
  
  1.9       +4 -6      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/javadoc/JavadocClassBuilder.java
  
  Index: JavadocClassBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/javadoc/JavadocClassBuilder.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JavadocClassBuilder.java	16 Mar 2004 06:40:44 -0000	1.8
  +++ JavadocClassBuilder.java	16 Mar 2004 21:55:31 -0000	1.9
  @@ -57,13 +57,11 @@
         mExtractor = (JavadocAnnotationExtractor)
           Class.forName(JAVA15_EXTRACTOR).newInstance();
       } catch (ClassNotFoundException e) {
  -      ctx.error(e);
  +      mServiceContext.error(e);
       } catch (IllegalAccessException e) {
  -      //if this fails, we'll assume it's because we're not under 1.5
  -      ctx.debug(e);
  +      mServiceContext.verbose(e);
       } catch (InstantiationException e) {
  -      //if this fails, we'll assume it's because we're not under 1.5
  -      ctx.debug(e);
  +      mServiceContext.verbose(e);
       }
     }
   
  @@ -99,7 +97,7 @@
                            classPath,
                            getJavadocArgs(mServiceContext));
         if (mRootDoc == null) {
  -        ctx.debug("Javadoc returned a null root");//FIXME error
  +        ctx.verbose("Javadoc returned a null root");//FIXME error
         }
       } catch (FileNotFoundException e) {
         ctx.error(e);
  
  
  
  1.2       +12 -8     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/reflect/ReflectClassBuilder.java
  
  Index: ReflectClassBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/reflect/ReflectClassBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReflectClassBuilder.java	16 Mar 2004 05:34:50 -0000	1.1
  +++ ReflectClassBuilder.java	16 Mar 2004 21:55:31 -0000	1.2
  @@ -16,6 +16,9 @@
   
   import org.apache.xmlbeans.impl.jam.mutable.*;
   import org.apache.xmlbeans.impl.jam.provider.JamClassBuilder;
  +import org.apache.xmlbeans.impl.jam.provider.JamServiceContext;
  +import org.apache.xmlbeans.impl.jam.provider.JamLogger;
  +import org.apache.xmlbeans.impl.jam.internal.JamServiceContextImpl;
   
   import java.lang.reflect.Constructor;
   import java.lang.reflect.Field;
  @@ -36,8 +39,8 @@
     // ========================================================================
     // Public static utilities
   
  -  public static JamClassBuilder getSystemClassBuilder() {
  -    return new ReflectClassBuilder(ClassLoader.getSystemClassLoader());
  +  public static JamClassBuilder getSystemClassBuilder(JamServiceContext ctx) {
  +    return new ReflectClassBuilder(ClassLoader.getSystemClassLoader(),ctx);
     }
   
     // ========================================================================
  @@ -45,24 +48,25 @@
   
     private ClassLoader mLoader;
     private ReflectAnnotationExtractor mExtractor = null;
  +  private JamLogger mLogger = null;
   
     // ========================================================================
     // Constructors
   
  -  public ReflectClassBuilder(ClassLoader rcl) {
  +  public ReflectClassBuilder(ClassLoader rcl, JamServiceContext ctx) {
       if (rcl == null) throw new IllegalArgumentException("null rcl");
  +    if (ctx == null) throw new IllegalArgumentException("null ctx");
  +    mLogger = ctx;
       mLoader = rcl;
       try {
         mExtractor = (ReflectAnnotationExtractor)
           Class.forName(JAVA15_EXTRACTOR).newInstance();
       } catch (ClassNotFoundException e) {
  -      //      ctx.error(e);
  +      mLogger.error(e);
       } catch (IllegalAccessException e) {
  -      //if this fails, we'll assume it's because we're not under 1.5
  -      //    ctx.debug(e);
  +      mLogger.verbose(e);
       } catch (InstantiationException e) {
  -      //if this fails, we'll assume it's because we're not under 1.5
  -      //  ctx.debug(e);
  +      mLogger.verbose(e);
       }
     }
   
  
  
  
  1.2       +9 -2      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/provider/JamLogger.java
  
  Index: JamLogger.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/provider/JamLogger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JamLogger.java	9 Mar 2004 10:38:53 -0000	1.1
  +++ JamLogger.java	16 Mar 2004 21:55:31 -0000	1.2
  @@ -19,20 +19,27 @@
    */
   public interface JamLogger {
   
  +  public boolean isVerbose();
  +
     /**
      * <p>Outputs a debug message as appropriate.</p>
      */
  -  public void debug(String msg);
  +  public void verbose(String msg);
   
     /**
      * <p>Outputs a debug message as appropriate.</p>
      */
  -  public void debug(Throwable t);
  +  public void verbose(Throwable t);
   
     /**
      * <p>Outputs a debug message as appropriate.</p>
      */
     public void warning(Throwable t);
  +
  +  /**
  +   * <p>Outputs a debug message as appropriate.</p>
  +   */
  +  public void warning(String w);
   
     /**
      * <p>Outputs an error as appropriate.</p>
  
  
  
  1.4       +2 -3      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/provider/JamServiceFactoryImpl.java
  
  Index: JamServiceFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/provider/JamServiceFactoryImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JamServiceFactoryImpl.java	16 Mar 2004 05:34:50 -0000	1.3
  +++ JamServiceFactoryImpl.java	16 Mar 2004 21:55:31 -0000	1.4
  @@ -22,7 +22,6 @@
   import org.apache.xmlbeans.impl.jam.internal.JamServiceContextImpl;
   import org.apache.xmlbeans.impl.jam.internal.JamServiceImpl;
   import org.apache.xmlbeans.impl.jam.internal.reflect.ReflectClassBuilder;
  -import org.apache.xmlbeans.impl.jam.internal.reflect.ReflectClassBuilder;
   import org.apache.xmlbeans.impl.jam.internal.elements.ElementContext;
   import org.apache.xmlbeans.impl.jam.internal.javadoc.JavadocClassBuilder;
   import org.apache.xmlbeans.impl.jam.internal.parser.ParserClassBuilder;
  @@ -126,7 +125,7 @@
       b = createClassfileBuilder(ctx);  // then custom classpath
       if (b != null) builders.add(b);
       if (ctx.isUseSystemClasspath()) { // then system classpath
  -      builders.add(ReflectClassBuilder.getSystemClassBuilder());
  +      builders.add(ReflectClassBuilder.getSystemClassBuilder(ctx));
       }
       JamClassBuilder[] barray = new JamClassBuilder[builders.size()];
       builders.toArray(barray);
  @@ -171,7 +170,7 @@
       } else {
         URL[] urls = cp.toUrlPath();
         ClassLoader cl = new URLClassLoader(urls);
  -      return new ReflectClassBuilder(cl);
  +      return new ReflectClassBuilder(cl,jp);
       }
     }
   
  
  
  
  1.7       +1 -1      xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/ClassesJamTest.java
  
  Index: ClassesJamTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/ClassesJamTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ClassesJamTest.java	16 Mar 2004 05:34:50 -0000	1.6
  +++ ClassesJamTest.java	16 Mar 2004 21:55:31 -0000	1.7
  @@ -82,7 +82,7 @@
       JamServiceFactory jsf = JamServiceFactory.getInstance();
       JamServiceParams params = jsf.createServiceParams();
   //include
  -    params.includeClassFiles(getDummyclassesClassDir(),"**/*.class");
  +    params.includeClassFiles(getDummyclassesClassPath(),"**/*.class");
       params.setVerbose(true);
       return jsf.createService(params);
     }
  
  
  
  1.7       +4 -4      xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/JamTestBase.java
  
  Index: JamTestBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/JamTestBase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JamTestBase.java	16 Mar 2004 05:34:50 -0000	1.6
  +++ JamTestBase.java	16 Mar 2004 21:55:31 -0000	1.7
  @@ -193,15 +193,15 @@
     /**
      * Returns the directory in which the sources for the dummyclasses live.
      */
  -  protected File getDummyclassesSourceRoot() {
  -    return new File("dummyclasses");
  +  protected File[] getDummyclassesSourcepath() {
  +    return new File[] {new File("dummyclasses")};
     }
   
     /**
      * Returns the directory into which the dummyclasses have been compiled.
      */
  -  protected File getDummyclassesClassDir() {
  -    return new File("../../build/jam/test/dummyclasses");
  +  protected File[] getDummyclassesClassPath() {
  +    return new File[] {new File("../../build/jam/test/dummyclasses")};
     }
   
     // ========================================================================
  
  
  
  1.4       +1 -1      xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/ParserJamTest.java
  
  Index: ParserJamTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/ParserJamTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ParserJamTest.java	9 Mar 2004 10:38:54 -0000	1.3
  +++ ParserJamTest.java	16 Mar 2004 21:55:31 -0000	1.4
  @@ -41,7 +41,7 @@
       JamServiceFactory jsf = JamServiceFactory.getInstance();
       JamServiceParams params = jsf.createServiceParams();
       params.setProperty(JamServiceFactoryImpl.USE_NEW_PARSER,"true");
  -    params.includeSourceFiles(getDummyclassesSourceRoot(),"**/*.java");
  +    params.includeSourceFiles(getDummyclassesSourcepath(),"**/*.java");
       return jsf.createService(params);
     }
   
  
  
  
  1.5       +2 -1      xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/SourcesJamTest.java
  
  Index: SourcesJamTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/SourcesJamTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SourcesJamTest.java	16 Mar 2004 05:34:50 -0000	1.4
  +++ SourcesJamTest.java	16 Mar 2004 21:55:31 -0000	1.5
  @@ -82,7 +82,8 @@
     protected JamService getResultToTest() throws IOException {
       JamServiceFactory jsf = JamServiceFactory.getInstance();
       JamServiceParams params = jsf.createServiceParams();
  -    params.includeSourceFiles(getDummyclassesSourceRoot(),"**/*.java");
  +    params.setVerbose(true);
  +    params.includeSourceFiles(getDummyclassesSourcepath(),"**/*.java");
       params.setProperty(JavadocClassBuilder.ARGS_PROPERTY,"-source 1.5");
       return jsf.createService(params);
     }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org