From fa232f74a2529ef095fdd83d3faf40b4d01ad4ae Mon Sep 17 00:00:00 2001 From: Eric Milles Date: Mon, 5 Dec 2016 12:20:49 -0600 Subject: [PATCH] Fixed some warnings --- .../groovy/eclipse/dsl/RefreshDSLDJob.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ide/org.codehaus.groovy.eclipse.dsl/src/org/codehaus/groovy/eclipse/dsl/RefreshDSLDJob.java b/ide/org.codehaus.groovy.eclipse.dsl/src/org/codehaus/groovy/eclipse/dsl/RefreshDSLDJob.java index ca8b15d15f..c026ed3d31 100644 --- a/ide/org.codehaus.groovy.eclipse.dsl/src/org/codehaus/groovy/eclipse/dsl/RefreshDSLDJob.java +++ b/ide/org.codehaus.groovy.eclipse.dsl/src/org/codehaus/groovy/eclipse/dsl/RefreshDSLDJob.java @@ -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; @@ -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 errorStatuses = new ArrayList(); - 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); } @@ -315,7 +314,8 @@ public IStatus run(IProgressMonitor monitor) { return res; } } - monitor.done(); + + submon.done(); if (errorStatuses.isEmpty()) { return Status.OK_STATUS; @@ -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); } @@ -405,4 +404,4 @@ private IStatus refreshProject(IProject project, IProgressMonitor monitor) { public boolean belongsTo(Object family) { return family == RefreshDSLDJob.class; } -} \ No newline at end of file +}