Skip to content

Commit

Permalink
Fix for #1087: use classpath entry's own java project ref for resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Apr 15, 2020
1 parent 8627b6c commit ca12f1e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private static void calculateClasspath(IJavaProject javaProject, Set<String> cla
Arrays.sort(entries, Comparator.comparing(IRuntimeClasspathEntry::getType));
for (IRuntimeClasspathEntry unresolved : entries) {
Set<String> paths = (unresolved.getType() == IRuntimeClasspathEntry.CONTAINER ? classPaths : xformPaths);
for (IRuntimeClasspathEntry resolved : resolveRuntimeClasspathEntry(unresolved, javaProject)) {
for (IRuntimeClasspathEntry resolved : resolveRuntimeClasspathEntry(unresolved)) {
paths.add(getAbsoluteLocation(resolved));
}
}
Expand All @@ -199,9 +199,9 @@ private static void calculateClasspath(IJavaProject javaProject, Set<String> cla
}
}

private static IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry classpathEntry, IJavaProject javaProject) throws Exception {
private static IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry classpathEntry) throws ReflectiveOperationException {
//return JavaRuntime.resolveRuntimeClasspathEntry(classpathEntry, javaProject); // indirect dependency on org.eclipse.debug.core.ILaunchConfiguration
return ReflectionUtils.throwableExecutePrivateMethod(JavaRuntime.class, "resolveRuntimeClasspathEntry", new Class[] {IRuntimeClasspathEntry.class, IJavaProject.class}, JavaRuntime.class, new Object[] {classpathEntry, javaProject});
return (IRuntimeClasspathEntry[]) JavaRuntime.class.getDeclaredMethod("resolveRuntimeClasspathEntry", IRuntimeClasspathEntry.class, IJavaProject.class).invoke(JavaRuntime.class, classpathEntry, classpathEntry.getJavaProject());
}

private static String getAbsoluteLocation(IRuntimeClasspathEntry classpathEntry) {
Expand Down

0 comments on commit ca12f1e

Please sign in to comment.