Skip to content

Commit

Permalink
Fixed some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Dec 5, 2016
1 parent 68a7da5 commit fa232f7
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.core.IJavaModelStatusConstants;
Expand Down Expand Up @@ -297,15 +297,14 @@ public IStatus run(IProgressMonitor monitor) {
return Status.OK_STATUS;
}

SubMonitor submon = SubMonitor.convert(monitor != null ? monitor : new NullProgressMonitor());
submon.beginTask("Refresh DSLD scripts", projects.size() * 9);

List<IStatus> errorStatuses = new ArrayList<IStatus>();
if (monitor == null) {
monitor = new NullProgressMonitor();
}
monitor.beginTask("Refresh DSLD scripts", projects.size() * 9);
for (IProject project : projects) {
IStatus res = Status.OK_STATUS;
try {
res = refreshProject(project, new SubProgressMonitor(monitor, 9));
res = refreshProject(project, submon.split(9));
} finally {
contextStoreManager.removeInProgress(project);
}
Expand All @@ -315,7 +314,8 @@ public IStatus run(IProgressMonitor monitor) {
return res;
}
}
monitor.done();

submon.done();

if (errorStatuses.isEmpty()) {
return Status.OK_STATUS;
Expand All @@ -327,8 +327,7 @@ public IStatus run(IProgressMonitor monitor) {
return multi;
}
} finally {
// in case the job was exited early, ensure all projects
// have their initialization stage removed
// in case the job was exited early, ensure all projects have their initialization stage removed
for (IProject project : projects) {
contextStoreManager.removeInProgress(project);
}
Expand Down Expand Up @@ -405,4 +404,4 @@ private IStatus refreshProject(IProject project, IProgressMonitor monitor) {
public boolean belongsTo(Object family) {
return family == RefreshDSLDJob.class;
}
}
}

0 comments on commit fa232f7

Please sign in to comment.