Community
Participate
Working Groups
I have a plugin that depends on org.eclipse.jdt.launching and calls the method JavaRuntime.newArchiveRuntimeClasspathEntry(IPath) I get a compilation error: "The type org.eclipse.core.resources.IResource cannot be resolved. It is indirectly referenced from required .class files" This is due to the overloaded method JavaRuntime.newArchiveRuntimeClasspathEntry(IResource) As my own plugins doesn't depend on core.resources at all, this dependency seems unwarranted to me.
Please provide a code sample showing how you perform the invocation.
The following class is in the first plugin: package foo; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; public class Foo { public static void doit(IResource resource) {} public static void doit(IPath path) {} } And class Bar will be in the second plugin, depending on the first, but not on core.resources: package bar import org.eclipse.core.runtime.Path; import foo.Foo; public class Bar { public Bar() { Foo.doit(new Path("/")); } } The call to doit(IPath) will be flagged with an error.
When looking for an exact match, we could avoid resolving other methods potentially. This could improve performance, as compiler would be more lazy at loading new types.
But we do not have an exact method parameter match in this case. We must resolve both methods to find out which one is a better match.
The only solution to this problem is to change the name of one of the methods, since they really shouldn't have the same name as IResource and IPath are not related.
Good point Kent. My exact match trick wouldn't work.