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 11196] New: - ClassLoader does not produce an appropriate package name
Date Fri, 26 Jul 2002 07:24:07 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=11196>.
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=11196

ClassLoader  does not produce an appropriate package name

           Summary: ClassLoader  does not produce an appropriate package
                    name
           Product: Ant
           Version: 1.5
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: abackenr@interwoven.com


it seems the AntClassLoader does not correctly resolve the package name for a
class not loaded via the bootclasspath.

the particular case i am running involes a JUnit test case which attempts to
strip off the package name by doing:

Class oink = moo.cow.Piggy.class;
String oinkClassName = oink.getName();
String oinkPackageName = oink.getPackage().getName(); 
String classNameNoPackage = oinkClassName.substring(oinkPackageName + 1);

oink.getPackage() will return null.

the workaround is to have junit fork the jvm.  the forked jvm will return an
appropriate package name.

the JVM i'm running is JDK 1.3.1 (build 1.3.1-b24) on solaris 2.8

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


Mime
View raw message