Skip to content

Commit

Permalink
use getResolvedClasspathEntry directly
Browse files Browse the repository at this point in the history
  • Loading branch information
cdietrich committed Aug 6, 2024
1 parent 87b6681 commit 03ea150
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.core.ClasspathAccessRule;
import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.xtext.common.types.JvmConstructor;
import org.eclipse.xtext.common.types.JvmDeclaredType;
import org.eclipse.xtext.common.types.JvmIdentifiableElement;
Expand Down Expand Up @@ -219,17 +218,6 @@ protected RestrictionKind computeRestriction(IJavaProject project, IType type) {

/* @Nullable */
protected IClasspathEntry getResolvedClasspathEntry(IJavaProject javaProject, /* @NonNull */ IPackageFragmentRoot root) throws JavaModelException {
IClasspathEntry result = null;
JavaProject castedProject = (JavaProject) javaProject;
castedProject.getResolvedClasspath(); // force the resolved entry cache to be populated
@SuppressWarnings("rawtypes")
Map rootPathToResolvedEntries = castedProject.getPerProjectInfo().rootPathToResolvedEntries;
if (rootPathToResolvedEntries != null) {
result = (IClasspathEntry) rootPathToResolvedEntries.get(root.getPath());
if (result == null)
result = (IClasspathEntry) rootPathToResolvedEntries.get(root.getJavaProject().getPath());
}

return result;
return root.getResolvedClasspathEntry();
}
}

0 comments on commit 03ea150

Please sign in to comment.