xmlbeans-commits 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
Date Thu, 08 Apr 2004 19:44:44 GMT
pcal        2004/04/08 12:44:44

  Modified:    v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15
                        Javadoc15DelegateImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/javadoc
                        JavadocClassBuilder.java
               v2/jam/test/tests/org/apache/xmlbeans/test/jam
                        JamTestBase.java
  Log:
  JAM: update tests, fix bug with annotation source positions
  
  Revision  Changes    Path
  1.4       +4 -0      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Javadoc15DelegateImpl.java
  
  Index: Javadoc15DelegateImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Javadoc15DelegateImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Javadoc15DelegateImpl.java	7 Apr 2004 23:20:01 -0000	1.3
  +++ Javadoc15DelegateImpl.java	8 Apr 2004 19:44:44 -0000	1.4
  @@ -16,6 +16,8 @@
   
   import org.apache.xmlbeans.impl.jam.mutable.MAnnotatedElement;
   import org.apache.xmlbeans.impl.jam.mutable.MAnnotation;
  +import org.apache.xmlbeans.impl.jam.mutable.MSourcePosition;
  +import org.apache.xmlbeans.impl.jam.mutable.MElement;
   import org.apache.xmlbeans.impl.jam.internal.javadoc.Javadoc15Delegate;
   import org.apache.xmlbeans.impl.jam.internal.javadoc.JavadocClassBuilder;
   import org.apache.xmlbeans.impl.jam.internal.elements.ElementContext;
  @@ -87,6 +89,7 @@
     private void populateAnnotation(MAnnotation dest, 
                                     AnnotationDesc src, 
                                     SourcePosition sp) {
  +    if (sp != null) JavadocClassBuilder.addSourcePosition(dest,sp);
       AnnotationDesc.MemberValuePair[] mvps = src.memberValues();
       for(int i=0; i<mvps.length; i++) {
         Type jmt = mvps[i].member().returnType();
  @@ -180,6 +183,7 @@
                                      AnnotationValue[] annValueArray,
                                      SourcePosition sp)
     {
  +    if (sp != null) JavadocClassBuilder.addSourcePosition(dest,sp);
       String memberName = memberDoc.name();
       Type returnType = memberDoc.returnType();
       if (annValueArray.length == 0) {
  
  
  
  1.20      +9 -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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JavadocClassBuilder.java	7 Apr 2004 04:18:09 -0000	1.19
  +++ JavadocClassBuilder.java	8 Apr 2004 19:44:44 -0000	1.20
  @@ -289,13 +289,16 @@
       }
     }
   
  -  private void addSourcePosition(MElement dest, Doc src) {
  -    SourcePosition jds = src.position();
  -    if (jds == null) return;
  +  public static void addSourcePosition(MElement dest, Doc src) {
  +    SourcePosition pos = src.position();
  +    if (pos != null) addSourcePosition(dest,pos);
  +  }
  +
  +  public static void addSourcePosition(MElement dest, SourcePosition pos) {
       MSourcePosition sp = dest.createSourcePosition();
  -    sp.setColumn(jds.column());
  -    sp.setLine(jds.line());
  -    File f = jds.file();
  +    sp.setColumn(pos.column());
  +    sp.setLine(pos.line());
  +    File f = pos.file();
       if (f != null) sp.setSourceURI(f.toURI());
     }
   
  
  
  
  1.22      +5 -0      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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JamTestBase.java	7 Apr 2004 23:20:01 -0000	1.21
  +++ JamTestBase.java	8 Apr 2004 19:44:44 -0000	1.22
  @@ -415,6 +415,8 @@
                  employeeList.length == 2);
       JAnnotation boog = employeeList[0];
       assertTrue("boog annotation is null",boog != null);
  +    //FIXME shouldnt be isCommentsAvailable
  +    if (isCommentsAvailable()) assertTrue(boog.getSourcePosition() != null);
       {
         JAnnotationValue firstName = boog.getValue("firstName");
         assertTrue("firstName is null",firstName != null);
  @@ -485,6 +487,9 @@
         assertTrue("address is null",addressValue != null);
         JAnnotation address = addressValue.asAnnotation();
         assertTrue("address is null",address != null);
  +      //FIXME shouldnt be isCommentsAvailable
  +      if (isCommentsAvailable()) assertTrue(boog.getSourcePosition() != null);
  +
         {
           JAnnotationValue street = address.getValue("street");
           assertTrue("street is null",street != null);
  
  
  

---------------------------------------------------------------------
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