Skip to content

Commit

Permalink
Address code review feedback.
Browse files Browse the repository at this point in the history
Signed-off-by: Yaohai Zheng <[email protected]>
  • Loading branch information
yaohaizh committed Aug 31, 2018
1 parent fe5c75e commit 08d2292
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public BuildWorkspaceStatus buildWorkspace(boolean forceReBuild, IProgressMonito
}
}
ResourcesPlugin.getWorkspace().build(forceReBuild ? IncrementalProjectBuilder.FULL_BUILD : IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
List<IMarker> problemMarkers = workspaceDiagnosticsHandler.publichDiagnostic(monitor);
List<IMarker> problemMarkers = workspaceDiagnosticsHandler.publichDiagnostics(monitor);
List<String> errors = problemMarkers.stream().filter(m -> m.getAttribute(IMarker.SEVERITY, 0) == IMarker.SEVERITY_ERROR).map(e -> convertMarker(e)).collect(Collectors.toList());
if (errors.isEmpty()) {
return BuildWorkspaceStatus.SUCCEED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void initialized(InitializedParams params) {

computeAsync((monitor) -> {
try {
workspaceDiagnosticsHandler.publichDiagnostic(monitor);
workspaceDiagnosticsHandler.publichDiagnostics(monitor);
} catch (CoreException e) {
logException(e.getMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ else if (projectsManager.isBuildFile(file)) {
return false;
}

public List<IMarker> publichDiagnostic(IProgressMonitor monitor) throws CoreException {
public List<IMarker> publichDiagnostics(IProgressMonitor monitor) throws CoreException {
List<IMarker> problemMarkers = getProblemMarkers(monitor);
publishDiagnostics(problemMarkers);
return problemMarkers;
Expand All @@ -153,6 +153,9 @@ private List<IMarker> getProblemMarkers(IProgressMonitor monitor) throws CoreExc
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
List<IMarker> markers = new ArrayList<>();
for (IProject project : projects) {
if (project.equals(projectsManager.getDefaultProject())) {
continue;
}
if (monitor != null && monitor.isCanceled()) {
throw new OperationCanceledException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ public void testProjectLevelMarkers() throws Exception {

@Test
public void testProjectConfigurationIsNotUpToDate() throws Exception {
InitHandler initHandler = new InitHandler(projectsManager, preferenceManager, connection);
initHandler.addWorkspaceDiagnosticsHandler();
//import project
importProjects("maven/salut");
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("salut");
Expand Down

0 comments on commit 08d2292

Please sign in to comment.