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/src/org/apache/xmlbeans/impl/jam/internal/java15 Reflect15DelegateImpl.java
Date Tue, 06 Apr 2004 00:17:22 GMT
pcal        2004/04/05 17:17:22

  Modified:    v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15
                        Reflect15DelegateImpl.java
  Log:
  add some defensive code against bugs in reflection/175
  
  Revision  Changes    Path
  1.3       +12 -1     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Reflect15DelegateImpl.java
  
  Index: Reflect15DelegateImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Reflect15DelegateImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Reflect15DelegateImpl.java	3 Apr 2004 01:21:29 -0000	1.2
  +++ Reflect15DelegateImpl.java	6 Apr 2004 00:17:22 -0000	1.3
  @@ -80,6 +80,14 @@
     public void extractAnnotations(MParameter dest, Method src, int paramNum) {
       Annotation[][] anns = src.getParameterAnnotations();
       if (anns == null) return;
  +    if (anns.length <= paramNum) {
  +      //FIXME something is not right here, just a quick fix.  bug in reflection?
  +      if (mLogger.isVerbose(this)) {
  +        mLogger.warning("method "+src.getName()+
  +                        " has fewer than expected parameter annotations ");
  +      }
  +      return;
  +    }
       extractAnnotations(dest,anns[paramNum]);
     }
   
  @@ -90,7 +98,10 @@
         anns = src.getParameterAnnotations();
       } catch(NullPointerException wtf) {
         //FIXME workaround, sun code throws an NPE here
  -//      System.err.println("[Reflect15DelegateImpl] Ignoring apprent bug in reflection");
  +      if (mLogger.isVerbose(this)) {
  +        mLogger.verbose("ignoring unexpected error while calling Constructor.getParameterAnnotations():");
  +        mLogger.verbose(wtf);
  +      }
         //wtf.printStackTrace();
         return;
       }
  
  
  

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