You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/07/11 13:59:29 UTC

DO NOT REPLY [Bug 21498] New: - AntClassLoader. Problem with loading classes that can throw exception from static initializer.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21498>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21498

AntClassLoader. Problem with loading classes that can throw exception from static initializer.

           Summary: AntClassLoader. Problem with loading classes that can
                    throw exception from static initializer.
           Product: Ant
           Version: 1.5.3
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: sergg@kazbek.ispras.ru


AntClassLoader has the problem during loading classes, that can throw an 
exception from static initializer code. E.g. we have a class that loads native 
library and that library does not exist. Normally when such class is loading 
with default ClassLoader UnsatisfiedLinkError will be thrown. But method 
AntClassLoader.initializeClass(Class theClass) catches Throwable and 
BuildException occured during executing has the cause: NullPointerException not 
UnsatisfiedLinkError.

Temporary solution can be: catch only exceptions that can occure in method 
Constructor.newInstance all other exceptions should be rethrown with 
BuildException. But this is not fully correct because exceptions thrown by 
Constructor.newInstance can occure in static initializer of loaded class also.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org