ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21498] New: - AntClassLoader. Problem with loading classes that can throw exception from static initializer.
Date Fri, 11 Jul 2003 11:59:29 GMT
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


Mime
View raw message