|
28 | 28 | import org.eclipse.core.resources.IResource;
|
29 | 29 | import org.eclipse.core.runtime.CoreException;
|
30 | 30 | import org.eclipse.core.runtime.IPath;
|
31 |
| -import org.eclipse.jdt.core.IJavaModelMarker; |
32 | 31 | import org.eclipse.jdt.core.IJavaProject;
|
33 | 32 | import org.eclipse.jdt.core.IPackageFragmentRoot;
|
34 |
| -import org.eclipse.jdt.core.compiler.IProblem; |
35 | 33 | import org.eclipse.jdt.launching.IVMInstall;
|
36 | 34 | import org.eclipse.jdt.launching.JavaRuntime;
|
37 | 35 | import org.eclipse.jdt.ls.core.internal.JavaClientConnection.JavaLanguageClient;
|
38 | 36 | import org.eclipse.jdt.ls.core.internal.ProjectUtils;
|
| 37 | +import org.eclipse.jdt.ls.core.internal.ResourceUtils; |
39 | 38 | import org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager;
|
40 | 39 |
|
41 | 40 | import com.google.gson.JsonArray;
|
@@ -119,7 +118,7 @@ public void onBuildFinished(long buildFinishedTime) {
|
119 | 118 | IMarker[] projectMarkers = project.findMarkers(null /* all markers */, true /* subtypes */, IResource.DEPTH_ZERO);
|
120 | 119 | projectErrors += Stream.of(projectMarkers).filter(m -> m.getAttribute(IMarker.SEVERITY, 0) == IMarker.SEVERITY_ERROR).count();
|
121 | 120 | IMarker[] allmarkers = project.findMarkers(null /* all markers */, true /* subtypes */, IResource.DEPTH_INFINITE);
|
122 |
| - unresolvedImportErrors += Stream.of(allmarkers).filter(m -> isUnresolvedImportError(m)).count(); |
| 121 | + unresolvedImportErrors += Stream.of(allmarkers).filter(m -> ResourceUtils.isUnresolvedImportError(m)).count(); |
123 | 122 | } catch (CoreException e) {
|
124 | 123 | // ignore
|
125 | 124 | }
|
@@ -171,11 +170,6 @@ public void onBuildFinished(long buildFinishedTime) {
|
171 | 170 | telemetryEvent(JAVA_PROJECT_BUILD, properties);
|
172 | 171 | }
|
173 | 172 |
|
174 |
| - private boolean isUnresolvedImportError(IMarker marker) { |
175 |
| - return marker.getAttribute(IMarker.SEVERITY, 0) == IMarker.SEVERITY_ERROR |
176 |
| - && marker.getAttribute(IJavaModelMarker.ID, 0) == IProblem.ImportNotFound; |
177 |
| - } |
178 |
| - |
179 | 173 | /**
|
180 | 174 | * The total size (in bytes) of all dependencies in the workspace
|
181 | 175 | * This should correspond to the total size of dependencies used by a
|
|
0 commit comments