Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.eclipse.jdt.core.search.SearchParticipant;
import org.eclipse.jdt.core.search.SearchPattern;
import org.eclipse.jdt.core.search.SearchRequestor;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;

import com.microsoft.java.debug.core.Configuration;
Expand Down Expand Up @@ -162,12 +163,34 @@ private static String[][] computeClassPath(IJavaProject javaProject) throws Core
}
String[][] result = new String[2][];
if (JavaRuntime.isModularProject(javaProject)) {
result[0] = JavaRuntime.computeDefaultRuntimeClassPath(javaProject);
result[0] = computeDefaultRuntimeClassPath(javaProject);
result[1] = new String[0];
} else {
result[0] = new String[0];
result[1] = JavaRuntime.computeDefaultRuntimeClassPath(javaProject);
result[1] = computeDefaultRuntimeClassPath(javaProject);
}
return result;
}

private static String[] computeDefaultRuntimeClassPath(IJavaProject jproject) throws CoreException {
IRuntimeClasspathEntry[] unresolved = JavaRuntime.computeUnresolvedRuntimeClasspath(jproject);
List<String> resolved = new ArrayList<>(unresolved.length);
for (int i = 0; i < unresolved.length; i++) {
IRuntimeClasspathEntry entry = unresolved[i];
if (entry.getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
IRuntimeClasspathEntry[] entries = JavaRuntime.resolveRuntimeClasspathEntry(entry, jproject);
for (int j = 0; j < entries.length; j++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the existing API:

IClasspathEntry.isTest() 

@andxu Andy Xu(devdiv) (andxu) Aug 13, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicer to use isTest since photon is added to pom.xml, fixed.

if (entries[j].getClasspathEntry().isTest()) {
continue;
}
String location = entries[j].getLocation();
if (location != null) {
resolved.add(location);
}
}
}
}
return resolved.toArray(new String[resolved.size()]);
}
}