xml-xmlbeans-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam JamTestBase.java ParserJamTest.java ReflectJamTest.java SourcesJamTest.java
Date Fri, 26 Mar 2004 00:15:40 GMT
pcal        2004/03/25 16:15:40

  Modified:    v2/jam/src/org/apache/xmlbeans/impl/jam JConstructor.java
                        JElement.java JField.java JMethod.java
                        JamServiceParams.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/annotation
                        AnnotationProxy.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal
                        JamClassLoaderImpl.java JamLoggerImpl.java
                        JamServiceContextImpl.java JamServiceImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/classrefs
                        QualifiedJClassRef.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements
                        AnnotatedElementImpl.java ConstructorImpl.java
                        ElementImpl.java FieldImpl.java MethodImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15
                        Reflect15AnnotationExtractor.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/mutable
                        MAnnotatedElement.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/provider
                        JamClassBuilder.java JamLogger.java
                        JamServiceContext.java JamServiceFactoryImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/xml JamXmlUtils.java
               v2/jam/test build.xml
               v2/jam/test/masters/reflect testXmlWriter.xml
               v2/jam/test/tests/org/apache/xmlbeans/test/jam
                        JamTestBase.java ParserJamTest.java
                        ReflectJamTest.java SourcesJamTest.java
  Log:
  java2schema & jam updates & tests
  
  Revision  Changes    Path
  1.4       +19 -0     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JConstructor.java
  
  Index: JConstructor.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JConstructor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JConstructor.java	9 Mar 2004 10:38:51 -0000	1.3
  +++ JConstructor.java	26 Mar 2004 00:15:38 -0000	1.4
  @@ -22,4 +22,23 @@
    */
   public interface JConstructor extends JInvokable {
   
  +  /**
  +   * <p>Returns a qualied name for this method as specified by
  +   * <code>java.lang.reflect.Constructor.toString()</code>:</p>
  +   *
  +   * <p><i>Returns a string describing this Constructor. The string is formatted
  +   * as the constructor access modifiers, if any, followed by the
  +   * fully-qualified name of the declaring class, followed by a parenthesized,
  +   * comma-separated list of the constructor's formal parameter types.
  +   * For example:<i></p>
  +   *
  +   * <p><i>public java.util.Hashtable(int,float)</i></p>
  +   *
  +   * <p><i>The only possible modifiers for constructors are the access modifiers
  +   * public, protected or private. Only one of these may appear, or none if
  +   * the constructor has default (package) access.</i></p>
  +   */
  +  public String getQualifiedName();
  +
  +
   }
  
  
  
  1.8       +10 -4     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JElement.java
  
  Index: JElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JElement.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JElement.java	12 Mar 2004 21:24:31 -0000	1.7
  +++ JElement.java	26 Mar 2004 00:15:38 -0000	1.8
  @@ -56,10 +56,10 @@
     public String getSimpleName();
   
     /**
  -   * <p>Returns a fully-qualified name for this abstraction.  The
  -   * exact format of the name depends on the particular abstraction.
  -   * Please refer to the JAM package documentation for more details on
  -   * naming conventions.</p>
  +   * <p>Returns a qualified name for this abstraction.  The exact format of
  +   * this name depends on the particular abstraction.  Please refer to the
  +   * documentation for each JElement subclass for a detailed description
  +   * of the qualified name formats.</p>
      */
     public String getQualifiedName();
   
  @@ -84,4 +84,10 @@
      * @return
      */
     public Object getArtifact();
  +
  +  /**
  +   * <p>Returns the same String as getQualifiedName().</p>
  +   */
  +  public String toString();
  +  
   }
  
  
  
  1.4       +20 -0     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JField.java
  
  Index: JField.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JField.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JField.java	9 Mar 2004 10:38:51 -0000	1.3
  +++ JField.java	26 Mar 2004 00:15:38 -0000	1.4
  @@ -47,4 +47,24 @@
      */
     public boolean isTransient();
   
  +
  +  /**
  +   * <p>Returns a qualied name for this method as specified by
  +   * <code>java.lang.reflect.Field.toString()</code>:</p>
  +   *
  +   * <p><i>Returns a string describing this Field. The format is the access
  +   * modifiers for the field, if any, followed by the field type, followed
  +   * by a space, followed by the fully-qualified name of the class declaring
  +   * the field, followed by a period, followed by the name of the field.
  +   * For example:</i></p>
  +   *
  +   * <p><i>public static final int java.lang.Thread.MIN_PRIORITY</i></p>
  +   * <p><i>private int java.io.FileDescriptor.fd</i></p>
  +   *
  +   * <p><i>The modifiers are placed in canonical order as specified by "The
  +   * Java Language Specification". This is public, protected or private
  +   * first, and then other modifiers in the following order: static, final,
  +   * transient, volatile.</i></p>
  +   */
  +  public String getQualifiedName();
   }
  
  
  
  1.4       +23 -0     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JMethod.java
  
  Index: JMethod.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JMethod.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JMethod.java	9 Mar 2004 10:38:51 -0000	1.3
  +++ JMethod.java	26 Mar 2004 00:15:38 -0000	1.4
  @@ -55,6 +55,29 @@
      */
     public boolean isSynchronized();
   
  +  /**
  +   * <p>Returns a qualied name for this method as specified by
  +   * <code>java.lang.reflect.Method.toString()</code>:</p>
  +   *
  +   * <p><i>
  +   * Returns a string describing this Method. The string is formatted as
  +   * the method access modifiers, if any, followed by the method return
  +   * type, followed by a space, followed by the class declaring the method,
  +   * followed by a period, followed by the method name, followed by a
  +   * parenthesized, comma-separated list of the method's formal parameter
  +   * types. If the method throws checked exceptions, the parameter list is
  +   * followed by a space, followed by the word throws followed by a
  +   * comma-separated list of the thrown exception types. For example:</i></p>
  +   *
  +   * <p><i>public boolean java.lang.Object.equals(java.lang.Object)</i></p>
  +   *
  +   * <p><i>The access modifiers are placed in canonical order as specified by
  +   * "The Java Language Specification". This is public, protected or private
  +   * first, and then other modifiers in the following order: abstract,
  +   * static, final, synchronized native.</i></p>
  +   */
  +  public String getQualifiedName();
  +
   
     /**
      * Returns the name of this class in the format described in section
  
  
  
  1.9       +7 -0      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JamServiceParams.java	20 Mar 2004 21:51:34 -0000	1.8
  +++ JamServiceParams.java	26 Mar 2004 00:15:38 -0000	1.9
  @@ -198,6 +198,13 @@
      */
     public void setVerbose(Class c);
   
  +
  +  /**
  +   * <p>Enables or suppresses the logging of warning messages.  By default
  +   * this is true.</p>
  +   */
  +  public void setShowWarnings(boolean b);
  +
     /**
      * Sets the parent JamClassLoader of the service JamClassLoader.
      *
  
  
  
  1.10      +3 -2      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/annotation/AnnotationProxy.java
  
  Index: AnnotationProxy.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/annotation/AnnotationProxy.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AnnotationProxy.java	23 Mar 2004 00:01:14 -0000	1.9
  +++ AnnotationProxy.java	26 Mar 2004 00:15:39 -0000	1.10
  @@ -25,6 +25,7 @@
   import java.lang.reflect.Method;
   import java.lang.reflect.Modifier;
   import java.lang.reflect.InvocationTargetException;
  +import java.lang.annotation.Annotation;
   import java.io.StringWriter;
   
   /**
  @@ -128,9 +129,9 @@
      * <p>Extending classes are free to override this method if different
      * behavior is required.</p>
      */
  -  public void initFromAnnotationInstance(Object jsr175annotationObject) {
  +  public void initFromAnnotationInstance(Class annType,
  +                                         Object jsr175annotationObject) {
       if (jsr175annotationObject == null) throw new IllegalArgumentException();
  -    Class annType = jsr175annotationObject.getClass();
       //FIXME this is a bit clumsy right now - I think we need to be a little
       // more surgical in identifying the annotation member methods
       Method[] methods = annType.getMethods();
  
  
  
  1.9       +1 -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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JamClassLoaderImpl.java	18 Mar 2004 04:31:35 -0000	1.8
  +++ JamClassLoaderImpl.java	26 Mar 2004 00:15:39 -0000	1.9
  @@ -86,7 +86,7 @@
         //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.warning("Warning: failed to resolve class '"+pkg+"' '"+name+"'");
  +      mContext.warning("failed to resolve class "+fd);
         mFd2ClassCache.put(fd,out);
         return out;
       }
  
  
  
  1.2       +21 -4     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamLoggerImpl.java
  
  Index: JamLoggerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamLoggerImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JamLoggerImpl.java	17 Mar 2004 23:29:45 -0000	1.1
  +++ JamLoggerImpl.java	26 Mar 2004 00:15:39 -0000	1.2
  @@ -29,6 +29,7 @@
     // ========================================================================
     // Variables
   
  +  private boolean mShowWarnings = true;
     private Set mVerboseClasses = null;
     private PrintWriter mOut = new PrintWriter(System.out,true);
   
  @@ -51,6 +52,10 @@
       mVerboseClasses.add(c);
     }
   
  +  public void setShowWarnings(boolean b) {
  +    mShowWarnings = b;
  +  }
  +  
     public void verbose(String msg, Object o) {
       if (isVerbose(o)) verbose(msg);
     }
  @@ -66,22 +71,33 @@
   
   
     public void verbose(Throwable t) {
  +    printVerbosePrefix();
  +    mOut.println();
       t.printStackTrace(mOut);
     }
   
     public void warning(Throwable t) {
  -    error(t);//FIXME
  +    if (mShowWarnings) {
  +      mOut.println("[JAM] Warning: unexpected exception thrown: ");
  +      t.printStackTrace();
  +    }
     }
   
     public void warning(String w) {
  -    error(w);//FIXME
  +    if (mShowWarnings) {
  +
  +      mOut.print("[JAM] Warning: ");
  +      mOut.println(w);
  +    }
     }
   
     public void error(Throwable t) {
  +    mOut.println("[JAM] Error: unexpected exception thrown: ");
       t.printStackTrace(mOut);
     }
   
     public void error(String msg) {
  +    mOut.print("[JAM] Error: ");
       mOut.println(msg);
     }
   
  @@ -97,13 +113,14 @@
   
     private void printVerbosePrefix() {
       StackTraceElement[] st = new Exception().getStackTrace();
  -    mOut.print('[');
  +    mOut.println("[JAM] Verbose: ");
  +    mOut.print('(');
       mOut.print(shortName(st[2].getClassName()));
       mOut.print('.');
       mOut.print(st[2].getMethodName());
       mOut.print(':');
       mOut.print(st[2].getLineNumber());
  -    mOut.print("]  ");
  +    mOut.print(")  ");
     }
   
     private static String shortName(String className) {
  
  
  
  1.12      +38 -8     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JamServiceContextImpl.java	20 Mar 2004 20:10:45 -0000	1.11
  +++ JamServiceContextImpl.java	26 Mar 2004 00:15:39 -0000	1.12
  @@ -25,10 +25,11 @@
   import org.apache.xmlbeans.impl.jam.provider.JamServiceContext;
   import org.apache.xmlbeans.impl.jam.provider.ResourcePath;
   import org.apache.xmlbeans.impl.jam.provider.JamLogger;
  +import org.apache.xmlbeans.impl.jam.provider.JamClassBuilder;
  +import org.apache.xmlbeans.impl.jam.provider.CompositeJamClassBuilder;
   
   import java.io.File;
   import java.io.IOException;
  -import java.io.PrintWriter;
   import java.lang.reflect.Constructor;
   import java.lang.reflect.Modifier;
   import java.util.*;
  @@ -69,6 +70,7 @@
     private List mOtherInitializers = null;
     private List mUnstructuredSourceFiles = null;
     private List mClassLoaders = null;
  +  private List mBaseBuilders = null;
   
     private JamClassLoader mLoader = null;
   
  @@ -79,6 +81,24 @@
       mLoader = loader;
     }
   
  +  //may want to expose this in JamServiceParams
  +  public void addBaseBuilder(JamClassBuilder builder) {
  +    if (mBaseBuilders == null) mBaseBuilders = new ArrayList();
  +    mBaseBuilders.add(builder);
  +  }
  +
  +  public JamClassBuilder getBaseBuilder() {
  +    if (mBaseBuilders == null || mBaseBuilders.size() == 0) {
  +      return null;
  +    }
  +    if (mBaseBuilders.size() == 1) {
  +      return (JamClassBuilder)mBaseBuilders.get(0);
  +    }
  +    JamClassBuilder[] comp = new JamClassBuilder[mBaseBuilders.size()];
  +    mBaseBuilders.toArray(comp);
  +    return new CompositeJamClassBuilder(comp);
  +  }
  +
     // ========================================================================
     // Constructors
   
  @@ -126,15 +146,18 @@
     }*/
   
     public File[] getSourceFiles() throws IOException {
  -
       Set set = new HashSet();
       if (mSourceRoot2Scanner != null) {
         for(Iterator i = mSourceRoot2Scanner.values().iterator(); i.hasNext(); ) {
           DirectoryScanner ds = (DirectoryScanner)i.next();
  -        if (isVerbose(this)) verbose(PREFIX+ " checking scanner for dir"+ds.getRoot());
  +        if (isVerbose(this)) {
  +          verbose(PREFIX+ " checking scanner for dir"+ds.getRoot());
  +        }
           String[] files = ds.getIncludedFiles();
           for(int j=0; j<files.length; j++) {
  -          if (isVerbose(this)) verbose(PREFIX+ " ...including a source file "+files[j]);
  +          if (isVerbose(this)) {
  +            verbose(PREFIX+ " ...including a source file "+files[j]);
  +          }
             set.add(new File(ds.getRoot(),files[j]));
           }
         }
  @@ -391,13 +414,20 @@
   
     public ClassLoader[] getReflectionClassLoaders() {
       if (mClassLoaders == null) {
  -      return new ClassLoader[] { ClassLoader.getSystemClassLoader() };
  +      if (mUseSystemClasspath) {
  +        return new ClassLoader[] { ClassLoader.getSystemClassLoader() };
  +      } else {
  +        return new ClassLoader[0];
  +      }
       } else {
  -      ClassLoader[] out = new ClassLoader[mClassLoaders.size()];
  -      for(int i=0; i<out.length; i++) {
  +      ClassLoader[] out = new ClassLoader[mClassLoaders.size()+
  +        (mUseSystemClasspath ? 1 : 0)];
  +      for(int i=0; i<mClassLoaders.size(); i++) {
           out[i] = (ClassLoader)mClassLoaders.get(i);
         }
  -      out[out.length-1] = ClassLoader.getSystemClassLoader();
  +      if (mUseSystemClasspath) {
  +        out[out.length-1] = ClassLoader.getSystemClassLoader();
  +      }
         return out;
       }
     }
  
  
  
  1.4       +3 -4      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamServiceImpl.java
  
  Index: JamServiceImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamServiceImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JamServiceImpl.java	22 Mar 2004 07:32:37 -0000	1.3
  +++ JamServiceImpl.java	26 Mar 2004 00:15:39 -0000	1.4
  @@ -83,10 +83,9 @@
       return out;
     }
   
  -  public MClass addNewClass(JClass copyme) {
  -    throw new IllegalStateException("NYI");
  -  }
  -
  +  // this is a back door for jamxmlutils, which can't know the class names
  +  // until after it's parsed the xml file (which can't be done without
  +  // a jamservice - catch 22).
     public void setClassNames(String[] names) {
       mClassNames = names;
     }
  
  
  
  1.3       +1 -1      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/classrefs/QualifiedJClassRef.java
  
  Index: QualifiedJClassRef.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/classrefs/QualifiedJClassRef.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- QualifiedJClassRef.java	17 Mar 2004 23:29:45 -0000	1.2
  +++ QualifiedJClassRef.java	26 Mar 2004 00:15:39 -0000	1.3
  @@ -52,7 +52,7 @@
      */
     public static JClassRef create(String qcname, JamClassLoader cl) {
       if (qcname == null) throw new IllegalArgumentException("null qcname");
  -    if (cl == null) throw new IllegalArgumentException("null ctx");
  +    if (cl == null) throw new IllegalArgumentException("null classloader");
       return new QualifiedJClassRef(qcname,cl);
     }
   
  
  
  
  1.14      +14 -20    xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/AnnotatedElementImpl.java
  
  Index: AnnotatedElementImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/AnnotatedElementImpl.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AnnotatedElementImpl.java	23 Mar 2004 00:01:14 -0000	1.13
  +++ AnnotatedElementImpl.java	26 Mar 2004 00:15:39 -0000	1.14
  @@ -25,19 +25,14 @@
   
     private Map mName2Annotation = null;
     private MComment mComment = null;
  -
     private List mAllJavadocTags = null;
   
     // ========================================================================
     // Constructors
   
  -  protected AnnotatedElementImpl(ElementContext ctx) {
  -    super(ctx);
  -  }
  +  protected AnnotatedElementImpl(ElementContext ctx) { super(ctx); }
   
  -  protected AnnotatedElementImpl(ElementImpl parent) {
  -    super(parent);
  -  }
  +  protected AnnotatedElementImpl(ElementImpl parent) { super(parent); }
   
     // ========================================================================
     // JAnnotatedElement implementation
  @@ -180,25 +175,24 @@
       return out;
     }
   
  -  public MAnnotation addAnnotationForInstance(/*Annotation*/ Object jsr175annotationInstance) {
  -    if (jsr175annotationInstance == null) {
  -      throw new IllegalArgumentException("null instance");
  -    }
  -    String typename = getAnnotationTypeFor(jsr175annotationInstance); //FIXME this isn't working right
  -    MAnnotation ann = getMutableAnnotation(typename);
  +  public MAnnotation addAnnotationForInstance(Class annType,
  +                                              Object instance) {
  +    if (annType == null) throw new IllegalArgumentException("null anntype");
  +    if (instance == null) throw new IllegalArgumentException("null instance");
  +    MAnnotation ann = getMutableAnnotation(annType);
       if (ann != null) {
  -      ann.setAnnotationInstance(jsr175annotationInstance);
  -      ann.getMutableProxy().initFromAnnotationInstance(jsr175annotationInstance);
  +      ann.setAnnotationInstance(instance);
  +      ann.getMutableProxy().initFromAnnotationInstance(annType,instance);
         //REVIEW this is a weird case where they add another instance
         // of the same annotation type.  We'll just go with it for now,
         // but we might want to throw an exception here, not sure.
       } else {
         AnnotationProxy proxy = getContext().createProxyForAnnotationType
  -        (getAnnotationTypeFor(jsr175annotationInstance));
  -      proxy.initFromAnnotationInstance(jsr175annotationInstance);
  -      ann = new AnnotationImpl(getContext(),proxy,typename);
  -      ann.setAnnotationInstance(jsr175annotationInstance);
  -      setArtifact(jsr175annotationInstance);
  +        (getAnnotationTypeFor(instance));
  +      proxy.initFromAnnotationInstance(annType,instance);
  +      ann = new AnnotationImpl(getContext(),proxy,annType.getName());
  +      ann.setAnnotationInstance(instance);
  +      setArtifact(instance);
         addAnnotation(ann);
       }
       return ann;
  
  
  
  1.6       +37 -1     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/ConstructorImpl.java
  
  Index: ConstructorImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/ConstructorImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ConstructorImpl.java	11 Mar 2004 23:01:41 -0000	1.5
  +++ ConstructorImpl.java	26 Mar 2004 00:15:39 -0000	1.6
  @@ -18,6 +18,10 @@
   import org.apache.xmlbeans.impl.jam.visitor.MVisitor;
   import org.apache.xmlbeans.impl.jam.visitor.JVisitor;
   import org.apache.xmlbeans.impl.jam.mutable.MConstructor;
  +import org.apache.xmlbeans.impl.jam.JParameter;
  +
  +import java.lang.reflect.Modifier;
  +import java.io.StringWriter;
   
   /**
    *
  @@ -38,6 +42,38 @@
   
     public void accept(MVisitor visitor) { visitor.visit(this); }
   
  -  public void accept(JVisitor visitor) { visitor.visit(this); }  
  +  public void accept(JVisitor visitor) { visitor.visit(this); }
  +
  +  public String getQualifiedName() {
  +    StringWriter sbuf = new StringWriter();
  +    sbuf.write(Modifier.toString(getModifiers()));
  +    sbuf.write(' ');
  +    sbuf.write(getSimpleName());
  +    sbuf.write('(');
  +    {
  +    JParameter[] params = getParameters();
  +    if (params != null && params.length > 0) {
  +      for(int i=0; i<params.length; i++) {
  +        sbuf.write(params[i].getType().getQualifiedName());
  +        if (i<params.length-1) sbuf.write(',');
  +      }
  +    }
  +    }
  +    sbuf.write(')');
  +    /* REVIEW the docs on java.lang.reflect.Constructor don't say include
  +       the exceptions.  That seems wrong, but we'll go with it for now.
  +    {
  +      JClass[] thrown = getExceptionTypes();
  +      if (thrown != null && thrown.length > 0) {
  +        sbuf.write(" throws ");
  +        for(int i=0; i<thrown.length; i++) {
  +          sbuf.write(thrown[i].getQualifiedName());
  +          if (i<thrown.length-1) sbuf.write(',');
  +        }
  +      }
  +    }
  +    */
  +    return sbuf.toString();
  +  }
   
   }
  
  
  
  1.7       +7 -0      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/ElementImpl.java
  
  Index: ElementImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/ElementImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ElementImpl.java	17 Mar 2004 23:29:45 -0000	1.6
  +++ ElementImpl.java	26 Mar 2004 00:15:39 -0000	1.7
  @@ -144,6 +144,13 @@
     public ElementContext getContext() { return mContext; }
   
     // ========================================================================
  +  // Object implementation
  +
  +  public String toString() {
  +    return getQualifiedName();
  +  }
  +  
  +  // ========================================================================
     // Protected methods
   
     protected JamLogger getLogger() {
  
  
  
  1.5       +17 -10    xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/FieldImpl.java
  
  Index: FieldImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/FieldImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FieldImpl.java	11 Mar 2004 23:01:41 -0000	1.4
  +++ FieldImpl.java	26 Mar 2004 00:15:39 -0000	1.5
  @@ -25,6 +25,7 @@
   import org.apache.xmlbeans.impl.jam.internal.classrefs.UnqualifiedJClassRef;
   
   import java.lang.reflect.Modifier;
  +import java.io.StringWriter;
   
   /**
    * <p>Implementation of JField and MField.</p>
  @@ -51,15 +52,6 @@
     }
   
     // ========================================================================
  -  // JElement implementation
  -
  -  public String getQualifiedName() {
  -    //REVIEW
  -    return getContainingClass().getQualifiedName()+"."+getSimpleName();
  -  }
  -
  -
  -  // ========================================================================
     // MField implementation
   
     public void setType(JClass type) {
  @@ -104,9 +96,24 @@
     }
   
     // ========================================================================
  -  // JElement implementation
  +  // M/JElement implementation
   
     public void accept(MVisitor visitor) { visitor.visit(this); }
   
     public void accept(JVisitor visitor) { visitor.visit(this); }
  +
  +  public String getQualifiedName() {
  +    StringWriter sbuf = new StringWriter();
  +    sbuf.write(Modifier.toString(getModifiers()));
  +    sbuf.write(' ');
  +    sbuf.write(getType().getQualifiedName());
  +    sbuf.write(' ');
  +    sbuf.write(getContainingClass().getQualifiedName());
  +    sbuf.write('.');
  +    sbuf.write(getSimpleName());
  +    return sbuf.toString();
  +  }
  +
  +
  +
   }
  
  
  
  1.5       +39 -0     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/MethodImpl.java
  
  Index: MethodImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/MethodImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MethodImpl.java	11 Mar 2004 23:01:41 -0000	1.4
  +++ MethodImpl.java	26 Mar 2004 00:15:39 -0000	1.5
  @@ -16,6 +16,7 @@
   package org.apache.xmlbeans.impl.jam.internal.elements;
   
   import org.apache.xmlbeans.impl.jam.JClass;
  +import org.apache.xmlbeans.impl.jam.JParameter;
   import org.apache.xmlbeans.impl.jam.visitor.MVisitor;
   import org.apache.xmlbeans.impl.jam.visitor.JVisitor;
   import org.apache.xmlbeans.impl.jam.mutable.MMethod;
  @@ -25,6 +26,9 @@
   import org.apache.xmlbeans.impl.jam.internal.classrefs.UnqualifiedJClassRef;
   
   import java.lang.reflect.Modifier;
  +import java.io.StringWriter;
  +
  +
   
   /**
    * <p>Standard implementation of MMethod.  It's probably bad inheritance to
  @@ -104,4 +108,39 @@
   
     public void accept(JVisitor visitor) { visitor.visit(this); }
   
  +  public String getQualifiedName() {
  +    StringWriter sbuf = new StringWriter();
  +    sbuf.write(Modifier.toString(getModifiers()));
  +    sbuf.write(' ');
  +    JClass returnJClass = getReturnType();
  +    if (returnJClass == null){
  +      sbuf.write("void ");  // should not happen
  +    } else {
  +      sbuf.write(returnJClass.getQualifiedName());
  +      sbuf.write(' ');
  +    }
  +    sbuf.write(getSimpleName());
  +    sbuf.write('(');
  +    {
  +    JParameter[] params = getParameters();
  +    if (params != null && params.length > 0) {
  +      for(int i=0; i<params.length; i++) {
  +        sbuf.write(params[i].getType().getQualifiedName());
  +        if (i<params.length-1) sbuf.write(',');
  +      }
  +    }
  +    }
  +    sbuf.write(')');
  +    {
  +      JClass[] thrown = getExceptionTypes();
  +      if (thrown != null && thrown.length > 0) {
  +        sbuf.write(" throws ");
  +        for(int i=0; i<thrown.length; i++) {
  +          sbuf.write(thrown[i].getQualifiedName());
  +          if (i<thrown.length-1) sbuf.write(',');
  +        }
  +      }
  +    }
  +    return sbuf.toString();
  +  }
   }
  
  
  
  1.2       +17 -7     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Reflect15AnnotationExtractor.java
  
  Index: Reflect15AnnotationExtractor.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Reflect15AnnotationExtractor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Reflect15AnnotationExtractor.java	16 Mar 2004 05:34:49 -0000	1.1
  +++ Reflect15AnnotationExtractor.java	26 Mar 2004 00:15:39 -0000	1.2
  @@ -34,32 +34,41 @@
     public void extractAnnotations(MMember dest, Method src) {
       Annotation[] anns = src.getDeclaredAnnotations();
       if (anns == null) return;
  -    for(int i=0; i<anns.length; i++) dest.addAnnotationForInstance(anns[i]);
  +    for(int i=0; i<anns.length; i++) {
  +      dest.addAnnotationForInstance(anns[i].annotationType(),anns[i]);
  +    }
     }
   
     public void extractAnnotations(MConstructor dest, Constructor src) {
       Annotation[] anns = src.getDeclaredAnnotations();
       if (anns == null) return;
  -    for(int i=0; i<anns.length; i++) dest.addAnnotationForInstance(anns[i]);
  +    for(int i=0; i<anns.length; i++) {
  +      dest.addAnnotationForInstance(anns[i].annotationType(),anns[i]);
  +    }
     }
   
     public void extractAnnotations(MField dest, Field src) {
       Annotation[] anns = src.getDeclaredAnnotations();
       if (anns == null) return;
  -    for(int i=0; i<anns.length; i++) dest.addAnnotationForInstance(anns[i]);
  +    for(int i=0; i<anns.length; i++) {
  +      dest.addAnnotationForInstance(anns[i].annotationType(),anns[i]);
  +    }
     }
   
     public void extractAnnotations(MClass dest, Class src) {
       Annotation[] anns = src.getDeclaredAnnotations();
       if (anns == null) return;
  -    for(int i=0; i<anns.length; i++) dest.addAnnotationForInstance(anns[i]);
  +    for(int i=0; i<anns.length; i++) {
  +      dest.addAnnotationForInstance(anns[i].annotationType(),anns[i]);
  +    }
     }
   
     public void extractAnnotations(MParameter dest, Method src, int paramNum) {
       Annotation[][] anns = src.getParameterAnnotations();
       if (anns == null) return;
       for(int i=0; i<anns[paramNum].length; i++) {
  -      dest.addAnnotationForInstance(anns[paramNum][i]);
  +      dest.addAnnotationForInstance(anns[paramNum][i].annotationType(),
  +                                    anns[paramNum][i]);
       }
     }
   
  @@ -69,14 +78,15 @@
       try {
         anns = src.getParameterAnnotations();
       } catch(NullPointerException wtf) {
  -      //FIXME sun code throws an NPE here
  +      //FIXME workaround, sun code throws an NPE here
   //      System.err.println("[Reflect15AnnotationExtractor] Ignoring apprent bug in reflection");
         //wtf.printStackTrace();
         return;
       }
       if (anns == null) return;
       for(int i=0; i<anns[paramNum].length; i++) {
  -      dest.addAnnotationForInstance(anns[paramNum][i]);
  +      dest.addAnnotationForInstance(anns[paramNum][i].annotationType(),
  +                                    anns[paramNum][i]);
       }
     }
   }
  
  
  
  1.17      +26 -12    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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JavadocClassBuilder.java	23 Mar 2004 00:01:14 -0000	1.16
  +++ JavadocClassBuilder.java	26 Mar 2004 00:15:39 -0000	1.17
  @@ -57,26 +57,40 @@
       if (ctx == null) throw new IllegalArgumentException("null context");
       mServiceContext = ctx;
       mLogger = ctx.getLogger();
  +    String pct = ctx.getProperty(PARSETAGS_PROPERTY);
  +    if (pct != null) {
  +      mParseTags = Boolean.valueOf(pct).booleanValue();
  +      mLogger.verbose("mParseTags="+mParseTags,this);
  +    }
       try {
         // class for name this because it's 1.5 specific.  if it fails, we
         // don't want to use the extractor
         Class.forName("com.sun.javadoc.AnnotationDesc");
  +    } catch (ClassNotFoundException e) {
  +      mLogger.warning("You are running under a pre-1.5 JDK.  JSR175-style "+
  +                      "source annotations will not be understood");
  +      if (mLogger.isVerbose(this)) {
  +        mLogger.verbose(e);
  +      }
  +      return;
  +    }
  +    // ok, if we could load that, let's new up the extractor delegate
  +    try {
         mExtractor = (JavadocAnnotationExtractor)
           Class.forName(JAVA15_EXTRACTOR).newInstance();
  -
  +      // if this fails for any reason, things are in a bad state
       } catch (ClassNotFoundException e) {
  -      mLogger.warning(e);
  +      mLogger.error("Internal error, failed to instantiate "+
  +                    JAVA15_EXTRACTOR);
  +      mLogger.error(e);
       } catch (IllegalAccessException e) {
  -      mLogger.verbose(e);
  +      mLogger.error("Internal error, failed to instantiate "+
  +                    JAVA15_EXTRACTOR);
  +      mLogger.error(e);
       } catch (InstantiationException e) {
  -      mLogger.verbose(e);
  -      //if this fails, we'll assume it's because we're not under 1.5
  -      ctx.verbose(e);
  -    }
  -    String pct = ctx.getProperty(PARSETAGS_PROPERTY);
  -    if (pct != null) {
  -      mParseTags = Boolean.valueOf(pct).booleanValue();
  -      mLogger.verbose("mParseTags="+mParseTags,this);
  +      mLogger.error("Internal error, failed to instantiate "+
  +                    JAVA15_EXTRACTOR);
  +      mLogger.error(e);
       }
     }
   
  @@ -154,7 +168,7 @@
         className;
       ClassDoc cd = mRootDoc.classNamed(loadme);
       if (cd == null) {
  -      if (true || getLogger().isVerbose(this)) {
  +      if (getLogger().isVerbose(this)) {
           getLogger().verbose("no ClassDoc for "+loadme);
         }
         return null;
  
  
  
  1.6       +23 -6     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ReflectClassBuilder.java	23 Mar 2004 00:01:14 -0000	1.5
  +++ ReflectClassBuilder.java	26 Mar 2004 00:15:39 -0000	1.6
  @@ -18,11 +18,12 @@
   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 org.apache.xmlbeans.impl.jam.internal.javadoc.JavadocAnnotationExtractor;
   
   import java.lang.reflect.Constructor;
   import java.lang.reflect.Field;
   import java.lang.reflect.Method;
  +import java.lang.annotation.Annotation;
   
   /**
    *
  @@ -62,17 +63,33 @@
         // class for name this because it's 1.5 specific.  if it fails, we
         // don't want to use the extractor
         Class.forName("java.lang.annotation.Annotation");
  +    } catch (ClassNotFoundException e) {
  +      mLogger.warning("You are running under a pre-1.5 JDK.  JSR175-style "+
  +                      "class annotations will not be understood");
  +      if (mLogger.isVerbose(this)) {
  +        mLogger.verbose(e);
  +      }
  +      return;
  +    }
  +    // ok, if we could load that, let's new up the extractor delegate
  +    try {
         mExtractor = (ReflectAnnotationExtractor)
           Class.forName(JAVA15_EXTRACTOR).newInstance();
  +      // if this fails for any reason, things are in a bad state
       } catch (ClassNotFoundException e) {
  -      mLogger.warning(e);
  +      mLogger.error("Internal error, failed to instantiate "+
  +                    JAVA15_EXTRACTOR);
  +      mLogger.error(e);
       } catch (IllegalAccessException e) {
  -      mLogger.verbose(e);
  +      mLogger.error("Internal error, failed to instantiate "+
  +                    JAVA15_EXTRACTOR);
  +      mLogger.error(e);
       } catch (InstantiationException e) {
  -      mLogger.verbose(e);
  +      mLogger.error("Internal error, failed to instantiate "+
  +                    JAVA15_EXTRACTOR);
  +      mLogger.error(e);
       }
     }
  -
     // ========================================================================
     // JamClassBuilder implementation
   
  @@ -85,7 +102,7 @@
           className;
         rclass = mLoader.loadClass(loadme);
       } catch(ClassNotFoundException cnfe) {
  -     getLogger().verbose(cnfe,this);
  +      getLogger().verbose(cnfe,this);
         return null;
       }
       MClass out = createClassToBuild(packageName, className, null);
  
  
  
  1.3       +2 -1      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/mutable/MAnnotatedElement.java
  
  Index: MAnnotatedElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/mutable/MAnnotatedElement.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MAnnotatedElement.java	11 Mar 2004 23:01:42 -0000	1.2
  +++ MAnnotatedElement.java	26 Mar 2004 00:15:39 -0000	1.3
  @@ -31,7 +31,8 @@
     public MAnnotation addAnnotationForTag(String tagName, String tagContents);
   
     //DOCME
  -  public MAnnotation addAnnotationForInstance(/*Annotation*/ Object jsr175annotationInstance);
  +  public MAnnotation addAnnotationForInstance(Class annotationType,
  +                                              /*Annotation*/ Object jsr175annotationInstance);
   
     //DOCME
     public MAnnotation addAnnotationForType(String jsr175annotationClassname);
  
  
  
  1.6       +1 -0      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/provider/JamClassBuilder.java
  
  Index: JamClassBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/provider/JamClassBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JamClassBuilder.java	22 Mar 2004 07:32:37 -0000	1.5
  +++ JamClassBuilder.java	26 Mar 2004 00:15:39 -0000	1.6
  @@ -40,6 +40,7 @@
       if (mContext != null) {
         throw new IllegalStateException("init called more than once");
       }
  +    if (ctx == null) throw new IllegalArgumentException("null ctx");
       mContext = ctx;
     }
   
  
  
  
  1.5       +2 -0      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JamLogger.java	17 Mar 2004 23:29:46 -0000	1.4
  +++ JamLogger.java	26 Mar 2004 00:15:39 -0000	1.5
  @@ -23,6 +23,8 @@
   
     public boolean isVerbose(Object o);
   
  +  public void setShowWarnings(boolean b);
  +
     /**
      * <p>Outputs a debug message if appropriate for the given object.</p>
      */
  
  
  
  1.8       +2 -0      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/provider/JamServiceContext.java
  
  Index: JamServiceContext.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/provider/JamServiceContext.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JamServiceContext.java	20 Mar 2004 20:10:45 -0000	1.7
  +++ JamServiceContext.java	26 Mar 2004 00:15:39 -0000	1.8
  @@ -115,6 +115,8 @@
   
     public JamLogger getLogger();
   
  +  public JamClassBuilder getBaseBuilder();
  +
     //public PrintWriter getOut();
   
   
  
  
  
  1.8       +24 -20    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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JamServiceFactoryImpl.java	22 Mar 2004 07:32:37 -0000	1.7
  +++ JamServiceFactoryImpl.java	26 Mar 2004 00:15:39 -0000	1.8
  @@ -18,10 +18,10 @@
   import org.apache.xmlbeans.impl.jam.JamService;
   import org.apache.xmlbeans.impl.jam.JamServiceFactory;
   import org.apache.xmlbeans.impl.jam.JamServiceParams;
  +import org.apache.xmlbeans.impl.jam.JClass;
   import org.apache.xmlbeans.impl.jam.internal.JamClassLoaderImpl;
   import org.apache.xmlbeans.impl.jam.internal.JamServiceContextImpl;
   import org.apache.xmlbeans.impl.jam.internal.JamServiceImpl;
  -import org.apache.xmlbeans.impl.jam.internal.CachedClassBuilder;
   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;
  @@ -81,7 +81,7 @@
       ((JamServiceContextImpl)jsps).setClassLoader(clToUse);
   
       return new JamServiceImpl((ElementContext)jsps,
  -      getSpecifiedClasses((JamServiceContextImpl)jsps));
  +                              getSpecifiedClasses((JamServiceContextImpl)jsps));
     }
   
     public JamClassLoader createSystemJamClassLoader() {
  @@ -147,24 +147,43 @@
       throws IOException
   
     {
  +    JamLogger log = ctx.getLogger();
       List builders = new ArrayList();  // make a list of the builders we want
  -    JamClassBuilder b = createSourceBuilder(ctx);
  +    // add the base builder if there is one
  +    JamClassBuilder b = ctx.getBaseBuilder();
  +    if (b != null) builders.add(b);
  +    // look for source file builder
  +    b = createSourceBuilder(ctx);
  +    if (log.isVerbose(this)) {
  +      log.verbose("added classbuilder for sources");
  +    }
       if (b != null) builders.add(b);   // prefer first source
       b = createClassfileBuilder(ctx);  // then custom classpath
  +    if (log.isVerbose(this)) {
  +      log.verbose("added classbuilder for custom classpath");
  +    }
       if (b != null) builders.add(b);
       ClassLoader[] cls = ctx.getReflectionClassLoaders();
       for(int i=0; i<cls.length; i++) {
  +      if (log.isVerbose(this)) {
  +        log.verbose("added classbuilder for classloader "+cls[i].getClass());
  +      }
         builders.add(new ReflectClassBuilder(cls[i],ctx));
       }
       JamClassBuilder[] barray = new JamClassBuilder[builders.size()];
       builders.toArray(barray);
       JamClassBuilder out = new CompositeJamClassBuilder(barray);
       out.init((ElementContext)ctx);
  +    if (log.isVerbose(this)) {
  +      log.verbose("returning a composite of "+barray.length+" class builders.");
  +
  +      JClass c = out.build("java.lang","Object");
  +      c = out.build("javax.ejb","SessionBean");
  +    }
       return out;
   
     }
   
  -
     /**
      * <p>Creates the source-based classbuilder for the given context.
      * If no source files or paths are specified in the context,
  @@ -175,7 +194,7 @@
     {
       File[] sources = ctx.getSourceFiles();
       if (sources == null || sources.length == 0) {
  -      if (ctx.isVerbose()) {
  +      if (ctx.isVerbose(this)) {
           ctx.verbose(PREFIX+ "no source files present, "+
                       "skipping source ClassBuilder");
         }
  @@ -234,21 +253,6 @@
     }
      */
   
  -  // ========================================================================
  -  // For internal use only - used by JamXmlUtils
  -
  -  public JamService createService(CachedClassBuilder builder)
  -  {
  -    JamServiceParams jsps = createServiceParams();
  -    JamClassLoader cl = new JamClassLoaderImpl((ElementContext)jsps,//eww
  -                                               builder,null);
  -    //this is a nasty way to shoehorn it in there, should do better
  -    ((JamServiceContextImpl)jsps).setClassLoader(cl);
  -    builder.init((ElementContext)jsps);
  -
  -    return new JamServiceImpl((ElementContext)jsps,
  -                              builder.getClassNames());
  -  }
   
   
   }
  
  
  
  1.2       +20 -4     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/xml/JamXmlUtils.java
  
  Index: JamXmlUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/xml/JamXmlUtils.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JamXmlUtils.java	22 Mar 2004 07:32:38 -0000	1.1
  +++ JamXmlUtils.java	26 Mar 2004 00:15:39 -0000	1.2
  @@ -17,14 +17,17 @@
   import org.apache.xmlbeans.impl.jam.JamService;
   import org.apache.xmlbeans.impl.jam.JamServiceFactory;
   import org.apache.xmlbeans.impl.jam.JClass;
  -import org.apache.xmlbeans.impl.jam.provider.JamServiceFactoryImpl;
  +import org.apache.xmlbeans.impl.jam.JamServiceParams;
   import org.apache.xmlbeans.impl.jam.internal.CachedClassBuilder;
  +import org.apache.xmlbeans.impl.jam.internal.JamServiceContextImpl;
   import org.apache.xmlbeans.impl.jam.internal.JamServiceImpl;
   
   import javax.xml.stream.XMLStreamException;
   import java.io.InputStream;
   import java.io.IOException;
   import java.io.Writer;
  +import java.util.List;
  +import java.util.Arrays;
   
   /**
    * @author Patrick Calahan &lt;email: pcal-at-bea-dot-com&gt;
  @@ -46,12 +49,25 @@
     public JamService createService(InputStream in)
       throws IOException, XMLStreamException
     {
  -    JamServiceFactoryImpl jsf = (JamServiceFactoryImpl)JamServiceFactory.getInstance();
  +    if (in == null) throw new IllegalArgumentException("null stream");
  +    JamServiceFactory jsf = JamServiceFactory.getInstance();
  +    JamServiceParams params = jsf.createServiceParams();
       CachedClassBuilder cache = new CachedClassBuilder();
  -    JamService out = jsf.createService(cache);
  +    // finish initalizing the params and create the service
  +    ((JamServiceContextImpl)params).addBaseBuilder(cache);
  +    JamService out = jsf.createService(params);
  +    // now go read the xml.  we have to do this afterwards so that the
  +    // classloader has been created and is available for linking.
       JamXmlReader reader = new JamXmlReader(cache,in);
       reader.read();
  -    ((JamServiceImpl)out).setClassNames(cache.getClassNames());//FIXME!! gross
  +    {
  +      // slightly gross hack to get the class names into the service
  +      List classNames = Arrays.asList(cache.getClassNames());
  +      classNames.addAll(Arrays.asList(out.getClassNames()));
  +      String[] nameArray = new String[classNames.size()];
  +      classNames.toArray(nameArray);
  +      ((JamServiceImpl)out).setClassNames(nameArray);
  +    }
       return out;
     }
   
  
  
  
  1.8       +10 -9     xml-xmlbeans/v2/jam/test/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/test/build.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- build.xml	18 Mar 2004 04:31:35 -0000	1.7
  +++ build.xml	26 Mar 2004 00:15:39 -0000	1.8
  @@ -18,6 +18,7 @@
   
    <!-- use build/classes instead of xbean.jar for develpment convenience -->
       <pathelement path='${build_dir}/classes' />
  +    <pathelement path='${dummy_dir}' />
       <pathelement location='${test_build_dir}' />
       <pathelement location='${junit_jar}'/>
       <pathelement path='${java.class.path}' />
  @@ -30,21 +31,21 @@
   
     <property name='classpath-value' refid='classpath'/>
   
  -  <target name='all' depends='build,run' />
  +  <target name='all' depends='compile,run' />
   
  -  <target name='build' >
  -    <mkdir dir='${test_build_dir}'/>
  -    <javac
  -       srcdir='tests'
  -       destdir='${test_build_dir}'
  -       classpathref='classpath'
  -       includes='**/*.java'
  -     />
  +  <target name='compile' >
       <mkdir dir='${dummy_dir}'/>
       <javac
          source='1.5' target='1.5'
          srcdir='dummyclasses'
          destdir='${dummy_dir}'
  +       classpathref='classpath'
  +       includes='**/*.java'
  +     />
  +    <mkdir dir='${test_build_dir}'/>
  +    <javac
  +       srcdir='tests'
  +       destdir='${test_build_dir}'
          classpathref='classpath'
          includes='**/*.java'
        />
  
  
  
  1.4       +1 -1      xml-xmlbeans/v2/jam/test/masters/reflect/testXmlWriter.xml
  
  Index: testXmlWriter.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/test/masters/reflect/testXmlWriter.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- testXmlWriter.xml	23 Mar 2004 00:01:14 -0000	1.3
  +++ testXmlWriter.xml	26 Mar 2004 00:15:39 -0000	1.4
  @@ -1 +1 @@
  -<jam-service><class><name>org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotationImpl</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><interface>org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotation</interface><constructor><modifiers>1</modifiers></constructor><method><name>annotationType</name><return-type>java.lang.Class</return-type><modifiers>1</modifiers></method><method><name>id</name><return-type>int</return-type><modifiers>1</modifiers></method><method><name>date</name><return-type>java.lang.String</return-type><modifiers>1</modifiers></method><method><name>synopsis</name><return-type>java.lang.String</return-type><modifiers>1</modifiers></method><method><name>engineer</name><return-type>java.lang.String</return-type><modifiers>1</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ejb.TraderEJB</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><interface>org.apache.xmlbeans.test.jam.dummyclasses.ejb.IEnv</interface><constructor><modifiers>1</modifiers></constructor><method><name>buy</name><return-type>org.apache.xmlbeans.test.jam.dummyclasses.ejb.TradeResult</return-type><modifiers>1</modifiers><parameter><name>param0</name><parameter>java.lang.String</parameter></parameter><parameter><name>param1</name><parameter>java.lang.String</parameter></parameter><parameter><name>param2</name><parameter>int</parameter></parameter></method></class><class><name>org.TopLevelPackageClass</name><is-interface>true</is-interface><modifiers>1537</modifiers><method><name>getId</name><return-type>int</return-type><modifiers>1025</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.Foo</name><is-interface>true</is-interface><modifiers>1537</modifiers><method><name>getId</name><return-type>int</return-type><modifiers>1025</modifiers></method><method><name>setId</name><return-type>void</return-type><modifiers>1025</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ejb.TradeResult</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ejb.MyEjbException</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Exception</superclass><constructor><modifiers>1</modifiers></constructor></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.Baz</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><interface>java.lang.Runnable</interface><constructor><modifiers>1</modifiers></constructor><method><name>run</name><return-type>void</return-type><modifiers>1</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.FooImpl</name><is-interface>false</is-interface><modifiers>1025</modifiers><superclass>org.apache.xmlbeans.test.jam.dummyclasses.Base</superclass><interface>org.apache.xmlbeans.test.jam.dummyclasses.Foo</interface><constructor><modifiers>1</modifiers></constructor><method><name>getId</name><return-type>int</return-type><modifiers>1</modifiers></method><method><name>setId</name><return-type>void</return-type><modifiers>1</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter></method><method><name>setId2</name><return-type>void</return-type><modifiers>26</modifiers><parameter><name>param0</name><parameter>double</parameter></parameter></method><method><name>setId3</name><return-type>void</return-type><modifiers>36</modifiers><parameter><name>param0</name><parameter>double</parameter></parameter><parameter><name>param1</name><parameter>double</parameter></parameter></method><method><name>setId4</name><return-type>void</return-type><modifiers>1028</modifiers><parameter><name>param0</name><parameter>double</parameter></parameter><parameter><name>param1</name><parameter>double</parameter></parameter><parameter><name>param2</name><parameter>double</parameter></parameter></method><method><name>methodDealingWithArrays</name><return-type>java.lang.String[][]</return-type><modifiers>0</modifiers><parameter><name>param0</name><parameter>int[]</parameter></parameter><parameter><name>param1</name><parameter>java.lang.Object[]</parameter></parameter></method><method><name>iThrowExceptions</name><return-type>void</return-type><modifiers>1028</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter><parameter><name>param1</name><parameter>java.lang.String</parameter></parameter></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.MultilineTags</name><is-interface>true</is-interface><modifiers>1537</modifiers></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.jsr175.AnnotatedClass</name><is-interface>false</is-interface><modifiers>1025</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor><method><name>getFoo</name><return-type>int</return-type><modifiers>1025</modifiers></method><method><name>setFoo</name><return-type>void</return-type><modifiers>1025</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter></method><annotation><name>$Proxy3</name><annotation-value><name>hashCode</name><value>-1161457048</value></annotation-value><annotation-value><name>toString</name><value>@org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotation(date=[unimplemented], engineer=[unassigned], id=4561414, synopsis=Balance the federal budget)</value></annotation-value><annotation-value><name>annotationType</name><value>interface org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotation</value></annotation-value><annotation-value><name>id</name><value>4561414</value></annotation-value><annotation-value><name>date</name><value>[unimplemented]</value></annotation-value><annotation-value><name>synopsis</name><value>Balance the federal budget</value></annotation-value><annotation-value><name>engineer</name><value>[unassigned]</value></annotation-value></annotation></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.Base</name><is-interface>false</is-interface><modifiers>1025</modifiers><superclass>java.lang.Object</superclass><interface>org.apache.xmlbeans.test.jam.dummyclasses.Foo</interface><constructor><modifiers>1</modifiers></constructor><method><name>getId</name><return-type>int</return-type><modifiers>1</modifiers></method><method><name>setId</name><return-type>void</return-type><modifiers>1</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter></method><method><name>getFoo</name><return-type>java.lang.String</return-type><modifiers>1</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ejb.IEnv</name><is-interface>true</is-interface><modifiers>1537</modifiers><method><name>buy</name><return-type>org.apache.xmlbeans.test.jam.dummyclasses.ejb.TradeResult</return-type><modifiers>1025</modifiers><parameter><name>param0</name><parameter>java.lang.String</parameter></parameter><parameter><name>param1</name><parameter>java.lang.String</parameter></parameter><parameter><name>param2</name><parameter>int</parameter></parameter></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ManyTags</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor><method><name>getId</name><return-type>int</return-type><modifiers>1</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ValuesById</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.MyException</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Exception</superclass><constructor><modifiers>1</modifiers></constructor></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.HeavilyCommented</name><is-interface>false</is-interface><modifiers>1025</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor><method><name>simpleComment</name><return-type>void</return-type><modifiers>1028</modifiers></method><method><name>multilineComment</name><return-type>void</return-type><modifiers>1028</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotation</name><is-interface>true</is-interface><modifiers>9729</modifiers><interface>java.lang.annotation.Annotation</interface><method><name>id</name><return-type>int</return-type><modifiers>1025</modifiers></method><method><name>date</name><return-type>java.lang.String</return-type><modifiers>1025</modifiers></method><method><name>synopsis</name><return-type>java.lang.String</return-type><modifiers>1025</modifiers></method><method><name>engineer</name><return-type>java.lang.String</return-type><modifiers>1025</modifiers></method><annotation><name>$Proxy0</name><annotation-value><name>hashCode</name><value>-566392314</value></annotation-value><annotation-value><name>value</name><value>RUNTIME</value></annotation-value><annotation-value><name>toString</name><value>@java.lang.annotation.Retention(value=RUNTIME)</value></annotation-value><annotation-value><name>annotationType</name><value>interface java.lang.annotation.Retention</value></annotation-value></annotation><annotation><name>$Proxy1</name><annotation-value><name>hashCode</name><value>-592721908</value></annotation-value><annotation-value><name>value</name><value>[Ljava.lang.annotation.ElementType;@166aa18</value></annotation-value><annotation-value><name>toString</name><value>@java.lang.annotation.Target(value=[TYPE])</value></annotation-value><annotation-value><name>annotationType</name><value>interface java.lang.annotation.Target</value></annotation-value></annotation></class><class><name>DefaultPackageClass</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor><method><name>getId</name><return-type>int</return-type><modifiers>1</modifiers></method></class></jam-service>
  \ No newline at end of file
  +<jam-service><class><name>org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotationImpl</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><interface>org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotation</interface><constructor><modifiers>1</modifiers></constructor><method><name>annotationType</name><return-type>java.lang.Class</return-type><modifiers>1</modifiers></method><method><name>id</name><return-type>int</return-type><modifiers>1</modifiers></method><method><name>date</name><return-type>java.lang.String</return-type><modifiers>1</modifiers></method><method><name>synopsis</name><return-type>java.lang.String</return-type><modifiers>1</modifiers></method><method><name>engineer</name><return-type>java.lang.String</return-type><modifiers>1</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ejb.TraderEJB</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><interface>org.apache.xmlbeans.test.jam.dummyclasses.ejb.IEnv</interface><constructor><modifiers>1</modifiers></constructor><method><name>buy</name><return-type>org.apache.xmlbeans.test.jam.dummyclasses.ejb.TradeResult</return-type><modifiers>1</modifiers><parameter><name>param0</name><parameter>java.lang.String</parameter></parameter><parameter><name>param1</name><parameter>java.lang.String</parameter></parameter><parameter><name>param2</name><parameter>int</parameter></parameter></method></class><class><name>org.TopLevelPackageClass</name><is-interface>true</is-interface><modifiers>1537</modifiers><method><name>getId</name><return-type>int</return-type><modifiers>1025</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.Foo</name><is-interface>true</is-interface><modifiers>1537</modifiers><method><name>getId</name><return-type>int</return-type><modifiers>1025</modifiers></method><method><name>setId</name><return-type>void</return-type><modifiers>1025</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ejb.TradeResult</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ejb.MyEjbException</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Exception</superclass><constructor><modifiers>1</modifiers></constructor></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.Baz</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><interface>java.lang.Runnable</interface><constructor><modifiers>1</modifiers></constructor><method><name>run</name><return-type>void</return-type><modifiers>1</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.FooImpl</name><is-interface>false</is-interface><modifiers>1025</modifiers><superclass>org.apache.xmlbeans.test.jam.dummyclasses.Base</superclass><interface>org.apache.xmlbeans.test.jam.dummyclasses.Foo</interface><constructor><modifiers>1</modifiers></constructor><method><name>getId</name><return-type>int</return-type><modifiers>1</modifiers></method><method><name>setId</name><return-type>void</return-type><modifiers>1</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter></method><method><name>setId2</name><return-type>void</return-type><modifiers>26</modifiers><parameter><name>param0</name><parameter>double</parameter></parameter></method><method><name>setId3</name><return-type>void</return-type><modifiers>36</modifiers><parameter><name>param0</name><parameter>double</parameter></parameter><parameter><name>param1</name><parameter>double</parameter></parameter></method><method><name>setId4</name><return-type>void</return-type><modifiers>1028</modifiers><parameter><name>param0</name><parameter>double</parameter></parameter><parameter><name>param1</name><parameter>double</parameter></parameter><parameter><name>param2</name><parameter>double</parameter></parameter></method><method><name>methodDealingWithArrays</name><return-type>java.lang.String[][]</return-type><modifiers>0</modifiers><parameter><name>param0</name><parameter>int[]</parameter></parameter><parameter><name>param1</name><parameter>java.lang.Object[]</parameter></parameter></method><method><name>iThrowExceptions</name><return-type>void</return-type><modifiers>1028</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter><parameter><name>param1</name><parameter>java.lang.String</parameter></parameter></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.MultilineTags</name><is-interface>true</is-interface><modifiers>1537</modifiers></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.jsr175.AnnotatedClass</name><is-interface>false</is-interface><modifiers>1025</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor><method><name>getFoo</name><return-type>int</return-type><modifiers>1025</modifiers></method><method><name>setFoo</name><return-type>void</return-type><modifiers>1025</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter></method><annotation><name>org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotation</name><annotation-value><name>id</name><value>4561414</value></annotation-value><annotation-value><name>date</name><value>[unimplemented]</value></annotation-value><annotation-value><name>synopsis</name><value>Balance the federal budget</value></annotation-value><annotation-value><name>engineer</name><value>[unassigned]</value></annotation-value></annotation></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.Base</name><is-interface>false</is-interface><modifiers>1025</modifiers><superclass>java.lang.Object</superclass><interface>org.apache.xmlbeans.test.jam.dummyclasses.Foo</interface><constructor><modifiers>1</modifiers></constructor><method><name>getId</name><return-type>int</return-type><modifiers>1</modifiers></method><method><name>setId</name><return-type>void</return-type><modifiers>1</modifiers><parameter><name>param0</name><parameter>int</parameter></parameter></method><method><name>getFoo</name><return-type>java.lang.String</return-type><modifiers>1</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ejb.IEnv</name><is-interface>true</is-interface><modifiers>1537</modifiers><method><name>buy</name><return-type>org.apache.xmlbeans.test.jam.dummyclasses.ejb.TradeResult</return-type><modifiers>1025</modifiers><parameter><name>param0</name><parameter>java.lang.String</parameter></parameter><parameter><name>param1</name><parameter>java.lang.String</parameter></parameter><parameter><name>param2</name><parameter>int</parameter></parameter></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ManyTags</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor><method><name>getId</name><return-type>int</return-type><modifiers>1</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.ValuesById</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.MyException</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Exception</superclass><constructor><modifiers>1</modifiers></constructor></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.HeavilyCommented</name><is-interface>false</is-interface><modifiers>1025</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor><method><name>simpleComment</name><return-type>void</return-type><modifiers>1028</modifiers></method><method><name>multilineComment</name><return-type>void</return-type><modifiers>1028</modifiers></method></class><class><name>org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotation</name><is-interface>true</is-interface><modifiers>9729</modifiers><interface>java.lang.annotation.Annotation</interface><method><name>id</name><return-type>int</return-type><modifiers>1025</modifiers></method><method><name>date</name><return-type>java.lang.String</return-type><modifiers>1025</modifiers></method><method><name>synopsis</name><return-type>java.lang.String</return-type><modifiers>1025</modifiers></method><method><name>engineer</name><return-type>java.lang.String</return-type><modifiers>1025</modifiers></method><annotation><name>java.lang.annotation.Retention</name><annotation-value><name>value</name><value>RUNTIME</value></annotation-value></annotation><annotation><name>java.lang.annotation.Target</name><annotation-value><name>value</name><value>[Ljava.lang.annotation.ElementType;@406199</value></annotation-value></annotation></class><class><name>DefaultPackageClass</name><is-interface>false</is-interface><modifiers>1</modifiers><superclass>java.lang.Object</superclass><constructor><modifiers>1</modifiers></constructor><method><name>getId</name><return-type>int</return-type><modifiers>1</modifiers></method></class></jam-service>
  \ No newline at end of file
  
  
  
  1.16      +17 -1     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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- JamTestBase.java	23 Mar 2004 00:01:14 -0000	1.15
  +++ JamTestBase.java	26 Mar 2004 00:15:39 -0000	1.16
  @@ -77,6 +77,7 @@
   
   import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
   import com.sun.org.apache.xml.internal.serialize.OutputFormat;
  +import org.apache.xmlbeans.test.jam.dummyclasses.jsr175.RFEAnnotation;
   
   /**
    * <p>Abstract base class for basic jam test cases.  These test cases work
  @@ -201,6 +202,13 @@
     //JStore
     protected abstract boolean isAnnotationsAvailable();
   
  +
  +  //kind of a quick hack for now, should remove this and make sure that
  +  //even the classes case make the annotations available using a special
  +  //JStore
  +  protected abstract boolean is175AnnotationInstanceAvailable();
  +
  +
     //kind of a quick hack for now, should remove this and make sure that
     //even the classes case make the annotations available using a special
     //JStore
  @@ -364,7 +372,14 @@
   
     public void test175Annotations() throws IOException, XMLStreamException {
       JClass clazz = resolved(mLoader.loadClass(DUMMY+".jsr175.AnnotatedClass"));
  -    //dump(clazz);
  +    JAnnotation ann = clazz.getAnnotation(RFEAnnotation.class);
  +    assertTrue("no "+RFEAnnotation.class+ " on "+clazz.getQualifiedName(),
  +               ann != null);
  +    if (!is175AnnotationInstanceAvailable()) return; //FIXME test untyped access
  +    RFEAnnotation rfe = (RFEAnnotation)ann.getAnnotationInstance();
  +    assertTrue("id = "+rfe.id(), rfe.id() == 4561414);
  +    assertTrue("synopsis = '"+rfe.synopsis()+"'",
  +               rfe.synopsis().equals("Balance the federal budget"));
     }
   
     public void testRecursiveResolve() {
  @@ -398,6 +413,7 @@
       GoldenInvokable.doComparison(fooImpl.getDeclaredMethods(),
                                 methods,isParameterNamesKnown(),this);
     }
  +
   
   
     public void testInterfaceIsAssignableFrom()
  
  
  
  1.7       +7 -0      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ParserJamTest.java	18 Mar 2004 04:31:35 -0000	1.6
  +++ ParserJamTest.java	26 Mar 2004 00:15:40 -0000	1.7
  @@ -50,6 +50,13 @@
       return false;//FIXME!!
     }
   
  +  //kind of a quick hack for now, should remove this and make sure that
  +  //even the classes case make the annotations available using a special
  +  //JStore
  +  protected boolean is175AnnotationInstanceAvailable() {
  +    return false;
  +  }
  +
     protected boolean isParameterNamesKnown() {
       return true;
     }
  
  
  
  1.2       +7 -0      xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/ReflectJamTest.java
  
  Index: ReflectJamTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/test/tests/org/apache/xmlbeans/test/jam/ReflectJamTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReflectJamTest.java	18 Mar 2004 04:31:35 -0000	1.1
  +++ ReflectJamTest.java	26 Mar 2004 00:15:40 -0000	1.2
  @@ -90,6 +90,13 @@
       return false;
     }
   
  +  //kind of a quick hack for now, should remove this and make sure that
  +  //even the classes case make the annotations available using a special
  +  //JStore
  +  protected boolean is175AnnotationInstanceAvailable() {
  +    return true;
  +  }
  +
     protected boolean isParameterNamesKnown() { return false; }
   
     protected boolean isCommentsAvailable() {
  
  
  
  1.9       +7 -0      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SourcesJamTest.java	18 Mar 2004 04:31:35 -0000	1.8
  +++ SourcesJamTest.java	26 Mar 2004 00:15:40 -0000	1.9
  @@ -97,6 +97,13 @@
       return true;
     }
   
  +  //kind of a quick hack for now, should remove this and make sure that
  +  //even the classes case make the annotations available using a special
  +  //JStore
  +  protected boolean is175AnnotationInstanceAvailable() {
  +    return false;
  +  }
  +
     protected boolean isParameterNamesKnown() {
       return true;
     }
  
  
  

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


Mime
View raw message