You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by to...@apache.org on 2002/11/07 23:50:59 UTC

cvs commit: xml-axis/java/src/org/apache/axis/utils/bytecode ClassReader.java

tomj        2002/11/07 14:50:59

  Modified:    java/src/org/apache/axis/i18n resource.properties
               java/src/org/apache/axis/utils/bytecode ClassReader.java
  Log:
  Fix a problem reported by Ed Snible [snible@us.ibm.com]
  
  I discovered the problem trying to deploy in AXIS a "dynamic proxy class"
  (a class created by java.lang.reflect.Proxy.getProxyClass()).
  
  ClassReader.getBytes() throws a null pointer exception if
  Class.getResourceAsStream() returns null -- not an IOException.
  ParamNameExtractor.getParameterNamesFromDebugInfo() only expects to catch
  IOException.  Thus, the comment is wrong: the parameter names can't be
  read, but the method throws an exception rather than returning null.
  
  Revision  Changes    Path
  1.27      +1 -0      xml-axis/java/src/org/apache/axis/i18n/resource.properties
  
  Index: resource.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/i18n/resource.properties,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- resource.properties	4 Nov 2002 17:01:28 -0000	1.26
  +++ resource.properties	7 Nov 2002 22:50:58 -0000	1.27
  @@ -1068,3 +1068,4 @@
   badLanguage00=Invalid language
   
   noContainerForAnonymousType=makeTypeElement() was told to create a type "{0}", with no containing element
  +cantLoadByecode=Unable to load bytecode for class "{0}"
  
  
  
  1.6       +4 -1      xml-axis/java/src/org/apache/axis/utils/bytecode/ClassReader.java
  
  Index: ClassReader.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/bytecode/ClassReader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ClassReader.java	18 Sep 2002 16:10:43 -0000	1.5
  +++ ClassReader.java	7 Nov 2002 22:50:59 -0000	1.6
  @@ -55,7 +55,6 @@
   
   package org.apache.axis.utils.bytecode;
   
  -import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.Messages;
   
   import java.io.ByteArrayInputStream;
  @@ -119,6 +118,10 @@
        */
       protected static byte[] getBytes(Class c) throws IOException {
           InputStream fin = c.getResourceAsStream('/' + c.getName().replace('.', '/') + ".class");
  +        if (fin == null) {
  +            throw new IOException(
  +                    Messages.getMessage("cantLoadByecode", c.getName()));
  +        }
           try {
               ByteArrayOutputStream out = new ByteArrayOutputStream();
               byte[] buf = new byte[1024];