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 2005/03/11 10:53:02 UTC
DO NOT REPLY [Bug 33958] New: -
Bad classloader used to load particular java compiler
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33958>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=33958
Summary: Bad classloader used to load particular java compiler
Product: Ant
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Core tasks
AssignedTo: dev@ant.apache.org
ReportedBy: sebastien.chassandebarrioz@rd.francetelecom.com
When ant compilers are used under eclipse, the loading of the eclipse compiler
(org.eclipse.jdt.core.JDTCompilerAdapter) fails. The problem comes from the
classloader used to load the class. The loading is done by the method
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.resolveClassName(String).
The used classloader is the System classloader. Below you will found the patch
of the class. My patch try to use the classloader of the current class instead
of the system classloader.
--- CompilerAdapterFactory.java.orig 2005-03-11 10:35:44.000000000 +0100
+++ CompilerAdapterFactory.java 2005-03-11 10:38:50.000000000 +0100
@@ -162,7 +162,13 @@
private static CompilerAdapter resolveClassName(String className)
throws BuildException {
try {
- Class c = Class.forName(className);
+ ClassLoader cl = CompilerAdapterFactory.class.getClassLoader();
+ Class c;
+ if (cl != null) {
+ c = cl.loadClass(className);
+ } else {
+ c = Class.forName(className);
+ }
Object o = c.newInstance();
return (CompilerAdapter) o;
} catch (ClassNotFoundException cnfe) {
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org