You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2014/04/24 15:36:22 UTC

[jira] [Updated] (BCEL-7) NullPointerException in ClassLoader

     [ https://issues.apache.org/jira/browse/BCEL-7?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg updated BCEL-7:
------------------------------

      Description: 
When trying to load an unknown class, a NullPointerException is thrown, but a ClassNotFoundException should be thrown.

A patch for this is:

{code}
Index: src/java/org/apache/bcel/util/ClassLoaderRepository.java
===================================================================
RCS file:
/home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/util/ClassLoaderRepository.java,v
retrieving revision 1.2
diff -r1.2 ClassLoaderRepository.java
124a125,128
>             if (is == null) {
>                 throw new ClassNotFoundException( "Class not found." );
>             }
>
{code}

  was:
When trying to load an unknown class, a NullPointerException is thrown, but a
ClassNotFoundException should be thrown.

A patch for this is:

Index: src/java/org/apache/bcel/util/ClassLoaderRepository.java
===================================================================
RCS file:
/home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/util/ClassLoaderRepository.java,v
retrieving revision 1.2
diff -r1.2 ClassLoaderRepository.java
124a125,128
>             if (is == null) {
>                 throw new ClassNotFoundException( "Class not found." );
>             }
>

         Priority: Major
      Environment:     (was: Operating System: Linux
Platform: PC)
    Fix Version/s: 5.1
         Priority:   (was: P3)
         Severity:   (was: normal)

This was fixed in r152817 on 2002-07-31 by mdahm


> NullPointerException in ClassLoader
> -----------------------------------
>
>                 Key: BCEL-7
>                 URL: https://issues.apache.org/jira/browse/BCEL-7
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 5.0
>            Reporter: wombat
>            Assignee: Apache Commons Developers
>             Fix For: 5.1
>
>
> When trying to load an unknown class, a NullPointerException is thrown, but a ClassNotFoundException should be thrown.
> A patch for this is:
> {code}
> Index: src/java/org/apache/bcel/util/ClassLoaderRepository.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/util/ClassLoaderRepository.java,v
> retrieving revision 1.2
> diff -r1.2 ClassLoaderRepository.java
> 124a125,128
> >             if (is == null) {
> >                 throw new ClassNotFoundException( "Class not found." );
> >             }
> >
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)