Commit f6e51c6a authored by Kristof Szabados's avatar Kristof Szabados
Browse files

SubProgressMonitors have to be replaced by SubMonitors, as the former are...


SubProgressMonitors have to be replaced by SubMonitors, as the former are being deprecated in eclipse 4.5
Signed-off-by: Kristof Szabados's avatarkristof <Kristof.Szabados@ericsson.com>
parent d8fa1ac0
......@@ -23,7 +23,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.filesystem,
org.eclipse.debug.core,
org.eclipse.titan.common;bundle-version="5.5.0",
org.antlr.runtime;bundle-version="4.3.0"
org.antlr.runtime;bundle-version="4.3.0",
org.eclipse.equinox.common.source;bundle-version="3.3"
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Bundle-ClassPath: .
......
......@@ -11,7 +11,7 @@ import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.titan.designer.AST.Assignment;
import org.eclipse.titan.designer.AST.Module;
import org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module;
......@@ -24,7 +24,7 @@ import org.eclipse.titan.designer.parsers.CompilationTimeStamp;
*/
public final class BrokenPartsChecker {
private final SubProgressMonitor semanticMonitor;
private final SubMonitor progress;
private final IProgressMonitor monitor;
......@@ -32,11 +32,12 @@ public final class BrokenPartsChecker {
private final SelectionMethodBase selectionMethod;
public BrokenPartsChecker(final IProgressMonitor monitor, final CompilationTimeStamp compilationCounter, final SelectionMethodBase selectionMethod) {
public BrokenPartsChecker(final SubMonitor monitor, final CompilationTimeStamp compilationCounter, final SelectionMethodBase selectionMethod) {
this.compilationCounter = compilationCounter;
this.selectionMethod = selectionMethod;
this.monitor = monitor;
semanticMonitor = new SubProgressMonitor(this.monitor, 1);
progress = SubMonitor.convert(monitor, 100);
}
public void doChecking() {
......@@ -68,11 +69,12 @@ public final class BrokenPartsChecker {
module.postCheck();
}
semanticMonitor.done();
progress.done();
}
//TODO check if this can be merged with the following one
private void generalChecker() {
semanticMonitor.beginTask("Semantic check", selectionMethod.getModulesToCheck().size());
progress.setTaskName("Semantic check");
progress.setWorkRemaining(selectionMethod.getModulesToCheck().size());
for (Module module : selectionMethod.getModulesToSkip()) {
module.setSkippedFromSemanticChecking(true);
......@@ -83,9 +85,11 @@ public final class BrokenPartsChecker {
// process the modules one-by-one
for (final Module module : selectionMethod.getModulesToCheck()) {
semanticMonitor.subTask("Semantically checking module: " + module.getName());
progress.subTask("Semantically checking module: " + module.getName());
module.check(compilationCounter);
semanticMonitor.worked(1);
progress.worked(1);
}
for (final Module module : selectionMethod.getModulesToSkip()) {
......@@ -94,19 +98,21 @@ public final class BrokenPartsChecker {
}
private void definitionsChecker(final Map<Module, List<Assignment>> moduleAndBrokenDefs) {
semanticMonitor.beginTask("Semantic check", moduleAndBrokenDefs.size());
progress.setTaskName("Semantic check");
progress.setWorkRemaining(moduleAndBrokenDefs.size());
for (Map.Entry<Module, List<Assignment>> entry : moduleAndBrokenDefs.entrySet()) {
Module module = entry.getKey();
semanticMonitor.subTask("Semantically checking broken parts in module: " + module.getName());
progress.subTask("Semantically checking broken parts in module: " + module.getName());
if (module instanceof TTCN3Module) {
((TTCN3Module) module).checkWithDefinitions(compilationCounter, entry.getValue());
} else {
module.check(compilationCounter);
}
semanticMonitor.worked(1);
progress.worked(1);
}
}
}
......@@ -39,7 +39,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
......@@ -748,7 +748,7 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
return project.getReferencedProjects();
}
IProgressMonitor internalMonitor = monitor == null ? new NullProgressMonitor() : monitor;
final SubMonitor progress = SubMonitor.convert(monitor);
String consoleActionBeforeBuild = store.getString(PreferenceConstants.CONSOLE_ACTION_BEFORE_BUILD);
......@@ -768,12 +768,12 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
TITANDebugConsole.println("starting to build " + project.getName());
}
internalMonitor.beginTask("Build", 6);
IProgressMonitor initialisationMonitor = new SubProgressMonitor(internalMonitor, 1);
progress.beginTask("Build", 6);
IProgressMonitor initialisationMonitor = progress.newChild(1);
initialisationMonitor.beginTask("Checking prerequisites", 3);
if (!isBuilderEnabled(project)) {
initialisationMonitor.done();
internalMonitor.done();
progress.done();
if (reportDebugInformation) {
TITANDebugConsole.println("Finished building " + project.getName());
}
......@@ -784,7 +784,7 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
if (workingDir == null) {
initialisationMonitor.done();
internalMonitor.done();
progress.done();
if (reportDebugInformation) {
TITANDebugConsole.println("Finished building " + project.getName());
}
......@@ -858,7 +858,7 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
// to check the source code and place back markers.
if (nofChangedResources == 0 && kind != FULL_BUILD) {
initialisationMonitor.done();
internalMonitor.done();
progress.done();
if (reportDebugInformation) {
TITANDebugConsole.println("Finished building " + project.getName());
}
......@@ -893,10 +893,10 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
buildJob.removeOnTheFlyMarkers();
}
IProgressMonitor symboliclinkMonitor = new SubProgressMonitor(internalMonitor, 1);
final SubMonitor symboliclinkMonitor = progress.newChild(1);
symboliclinkMonitor.beginTask("Refreshing symbolic links", 3);
SymbolicLinkHandler
.copyExternalFileToWorkingDirectory(files, workingDir.toOSString(), new SubProgressMonitor(symboliclinkMonitor, 1));
.copyExternalFileToWorkingDirectory(files, workingDir.toOSString(), symboliclinkMonitor.newChild(1));
boolean automaticMakefileGeneration = ProjectBuildPropertyData.useAutomaticMakefilegeneration(project);
boolean useInternalMakefileGeneration = ProjectBuildPropertyData.useInternalMakefilegeneration(project);
......@@ -905,10 +905,10 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
if (useSymbolicLinks){
SymbolicLinkHandler.addSymlinkRemovingCommandForRemovedFiles(workingDir.toOSString(), buildJob,
deltavisitor.getLastTimeRemovedFiles(), new SubProgressMonitor(symboliclinkMonitor, 1));
deltavisitor.getLastTimeRemovedFiles(), symboliclinkMonitor.newChild(1));
SymbolicLinkHandler.addSymlinkCreationCommand(files, workingDir.toOSString(), buildJob, deltavisitor
.getLastTimeRemovedFiles(), new SubProgressMonitor(symboliclinkMonitor, 1), automaticMakefileGeneration);
.getLastTimeRemovedFiles(), symboliclinkMonitor.newChild(1), automaticMakefileGeneration);
}
symboliclinkMonitor.done();
......@@ -923,8 +923,8 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
return project.getReferencedProjects();
}
IProgressMonitor filepreparerMonitor = new SubProgressMonitor(internalMonitor, 1);
filepreparerMonitor.beginTask("removing markers from files", files.size());
final SubMonitor filepreparserMonitor = progress.newChild(1);
filepreparserMonitor.beginTask("removing markers from files", files.size());
if (PreferenceConstantValues.ONTHEFLYOPTIONREMOVE.equals(store.getString(PreferenceConstants.ONTHEFLYMARKERSAFTERCOMPILER))) {
List<IFile> outdatedFiles = new ArrayList<IFile>();
......@@ -949,7 +949,7 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
} catch (CoreException e) {
ErrorReporter.logExceptionStackTrace("While deleting markers from `" + tempFile.getName() + "'", e);
}
filepreparerMonitor.worked(1);
filepreparserMonitor.worked(1);
}
if (!outdatedFiles.isEmpty()) {
......@@ -960,7 +960,7 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
}
}
filepreparerMonitor.done();
filepreparserMonitor.done();
IPath makefile = new Path(workingDir.toOSString() + File.separatorChar + MAKEFILE);
boolean makefileExists = makefile.toFile().exists();
......@@ -1092,7 +1092,7 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
ErrorReporter.logError(BUILD_WITHOUT_MAKEFILE_ERROR + project.getName());
}
IStatus status = buildJob.runInWorkspace(new SubProgressMonitor(internalMonitor, 3));
IStatus status = buildJob.runInWorkspace(progress.newChild(3));
try {
project.setSessionProperty(GeneralConstants.PROJECT_UP_TO_DATE, status.isOK());
TITANDecorator.refreshSelectively(project);
......@@ -1103,8 +1103,8 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
TITANDebugConsole.println("Finished building " + project.getName());
}
internalMonitor.done();
if (buildJob.foundErrors() || internalMonitor.isCanceled()) {
progress.done();
if (buildJob.foundErrors() || progress.isCanceled()) {
if (project != null && (kind == FULL_BUILD || kind == INCREMENTAL_BUILD)) {
final IProject project2 = project;
WorkspaceJob op = new WorkspaceJob("Touching the project") {
......@@ -1146,14 +1146,15 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
return;
}
monitor.beginTask("Cleaning", 2);
final SubMonitor progress = SubMonitor.convert(monitor,2);
progress.setTaskName("Cleaning");
getProject().touch(new SubProgressMonitor(monitor, 1));
getProject().touch(progress.newChild(1));
IPath workingDir = ProjectBasedBuilder.getProjectBasedBuilder(getProject()).getWorkingDirectoryPath(true);
if (workingDir == null) {
monitor.done();
progress.done();
return;
}
......@@ -1172,13 +1173,13 @@ public final class TITANBuilder extends IncrementalProjectBuilder {
command.add(MAKE_CLEAN);
titanJob.addCommand(command, MAKE_CLEAN);
titanJob.runInWorkspace(new SubProgressMonitor(monitor, 1));
titanJob.runInWorkspace(progress.newChild(1));
} else {
TITANConsole.println(MessageFormat.format(CLEAN_WITHOUT_MAKEFILE_ERROR, getProject().getName()));
ErrorReporter.logError(MessageFormat.format(CLEAN_WITHOUT_MAKEFILE_ERROR, getProject().getName()));
}
monitor.done();
progress.done();
}
/**
......
......@@ -15,11 +15,10 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.titan.common.logging.ErrorReporter;
/**
......@@ -47,7 +46,8 @@ public enum ExtensionHandler {
}
public void executeContributors(final IProgressMonitor monitor, final IProject project) {
final IProgressMonitor pm = (monitor == null) ? new NullProgressMonitor() : monitor;
final SubMonitor progress = SubMonitor.convert(monitor);
ISafeRunnable runnable = new ISafeRunnable() {
@Override
public void handleException(final Throwable e) {
......@@ -57,15 +57,15 @@ public enum ExtensionHandler {
@Override
public void run() throws Exception {
try {
pm.beginTask("Executing extensions", plugins.size());
progress.beginTask("Executing extensions", plugins.size());
for (IProjectProcesser proc : plugins) {
proc.workOnProject(new SubProgressMonitor(pm, 1), project);
if (pm.isCanceled()) {
proc.workOnProject(progress.newChild(1), project);
if (progress.isCanceled()) {
throw new OperationCanceledException();
}
}
} finally {
pm.done();
progress.done();
}
}
};
......
......@@ -32,7 +32,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
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.core.runtime.jobs.MultiRule;
......@@ -665,7 +665,7 @@ public final class ProjectSourceParser {
*
* @return status information on exit.
* */
private IStatus internalDoAnalyzeWithReferences(final IProgressMonitor monitor) {
private IStatus internalDoAnalyzeWithReferences(final SubMonitor monitor) {
if (!checkConfigurationRequirements(project, GeneralConstants.ONTHEFLY_SEMANTIC_MARKER)) {
return Status.OK_STATUS;
}
......@@ -731,8 +731,8 @@ public final class ProjectSourceParser {
// Do the analyzes in the determined order.
CompilationTimeStamp compilationCounter = CompilationTimeStamp.getNewCompilationCounter();
IProgressMonitor internalMonitor = monitor == null ? new NullProgressMonitor() : monitor;
internalMonitor.beginTask("Analysis of projects", tobeAnalyzed.size() * 2);
SubMonitor progress = SubMonitor.convert(monitor, tobeAnalyzed.size() * 2);
progress.setTaskName("Analysis of projects");
IPreferencesService preferenceService = Platform.getPreferencesService();
boolean reportDebugInformation = preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
......@@ -750,20 +750,20 @@ public final class ProjectSourceParser {
try {
for (int i = 0; i < tobeAnalyzed.size(); i++) {
internalMonitor.setTaskName("Analyzing project " + tobeAnalyzed.get(i).getName());
progress.subTask("Analyzing project " + tobeAnalyzed.get(i).getName());
GlobalParser.getProjectSourceParser(tobeAnalyzed.get(i)).analyzesRunning = true;
if (tobeAnalyzed.get(i).isAccessible()) {
if (TITANNature.hasTITANNature(tobeAnalyzed.get(i))) {
GlobalParser.getProjectSourceParser(tobeAnalyzed.get(i)).syntacticAnalyzer
.internalDoAnalyzeSyntactically(new SubProgressMonitor(internalMonitor, 1));
.internalDoAnalyzeSyntactically(progress.newChild(1));
tobeSemanticallyAnalyzed.add(tobeAnalyzed.get(i));
} else {
Location location = new Location(project, 0, 0, 0);
location.reportExternalProblem(MessageFormat.format(REQUIREDPROJECTNOTTITANPROJECT,
tobeAnalyzed.get(i).getName(), project.getName()), IMarker.SEVERITY_ERROR,
GeneralConstants.ONTHEFLY_SEMANTIC_MARKER);
internalMonitor.worked(1);
progress.worked(1);
}
} else {
Location location = new Location(project);
......@@ -771,18 +771,18 @@ public final class ProjectSourceParser {
MessageFormat.format(REQUIREDPROJECTNOTACCESSIBLE, tobeAnalyzed.get(i).getName(),
project.getName()), IMarker.SEVERITY_ERROR,
GeneralConstants.ONTHEFLY_SEMANTIC_MARKER);
internalMonitor.worked(1);
progress.worked(1);
}
}
ProjectSourceSemanticAnalyzer.analyzeMultipleProjectsSemantically(tobeSemanticallyAnalyzed, internalMonitor, compilationCounter);
ProjectSourceSemanticAnalyzer.analyzeMultipleProjectsSemantically(tobeSemanticallyAnalyzed, progress.newChild(tobeAnalyzed.size()), compilationCounter);
} finally {
for (int i = 0; i < tobeAnalyzed.size(); i++) {
GlobalParser.getProjectSourceParser(tobeAnalyzed.get(i)).analyzesRunning = false;
}
}
internalMonitor.done();
progress.done();
lastTimeChecked = compilationCounter;
return Status.OK_STATUS;
......@@ -970,7 +970,7 @@ public final class ProjectSourceParser {
}
}
result = internalDoAnalyzeWithReferences(monitor);
result = internalDoAnalyzeWithReferences(SubMonitor.convert(monitor));
boolean reportDebugInformation = preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.DISPLAYDEBUGINFORMATION, true, null);
......@@ -1019,13 +1019,14 @@ public final class ProjectSourceParser {
WorkspaceJob extensions = new WorkspaceJob("Executing Titan extensions") {
@Override
public IStatus runInWorkspace(final IProgressMonitor monitor) {
final IProgressMonitor pm = (monitor == null) ? new NullProgressMonitor() : monitor;
final SubMonitor progress = SubMonitor.convert(monitor, 100);
final int priortity = getThread().getPriority();
try {
getThread().setPriority(Thread.MIN_PRIORITY);
pm.beginTask("Executing Titan extensions", 100);
pm.subTask("Waiting for semantic analysis");
progress.setTaskName("Executing Titan extensions");
progress.subTask("Waiting for semantic analysis");
try {
temp.join();
......@@ -1033,12 +1034,12 @@ public final class ProjectSourceParser {
ErrorReporter.logExceptionStackTrace(e);
}
pm.subTask("Executing extensions");
progress.subTask("Executing extensions");
if (Status.OK_STATUS.equals(temp.getResult())) {
ExtensionHandler.INSTANCE.executeContributors(new SubProgressMonitor(pm, 100), project);
ExtensionHandler.INSTANCE.executeContributors(progress.newChild(100), project);
}
} finally {
pm.done();
progress.done();
fullAnalyzersRunning.decrementAndGet();
getThread().setPriority(priortity);
}
......@@ -1187,7 +1188,7 @@ public final class ProjectSourceParser {
Job.getJobManager().beginRule(rule, new NullProgressMonitor());
try {
internalDoAnalyzeWithReferences(new NullProgressMonitor());
internalDoAnalyzeWithReferences(null);
} catch (Exception e) {
ErrorReporter.logExceptionStackTrace(e);
} finally {
......
......@@ -24,6 +24,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.titan.common.logging.ErrorReporter;
import org.eclipse.titan.common.parsers.TITANMarker;
......@@ -304,8 +305,9 @@ public class ProjectSourceSemanticAnalyzer {
semanticAnalyzer.moduleMap.clear();
}
// Semantic checking starts here
monitor.beginTask("On-the-fly semantic checking of everything ", 1);
monitor.subTask("Checking the importations of the modules");
SubMonitor progress = SubMonitor.convert(monitor, 1);
progress.setTaskName("On-the-fly semantic checking of everything ");
progress.subTask("Checking the importations of the modules");
try{
final String option = preferenceService.getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.REPORTUNSUPPORTEDCONSTRUCTS, GeneralConstants.WARNING, null);
......@@ -365,7 +367,7 @@ public class ProjectSourceSemanticAnalyzer {
referenceChain.clear();
}
monitor.subTask("Calculating the list of modules to be checked");
progress.subTask("Calculating the list of modules to be checked");
IBaseAnalyzer selectionMethod = new BrokenPartsViaReferences(SelectionAlgorithm.BROKENREFERENCESINVERTED, compilationCounter);
SelectionMethodBase selectionMethodBase = (SelectionMethodBase)selectionMethod;
......@@ -377,7 +379,7 @@ public class ProjectSourceSemanticAnalyzer {
return Status.CANCEL_STATUS;
}
BrokenPartsChecker brokenPartsChecker = new BrokenPartsChecker(monitor, compilationCounter, selectionMethodBase);
BrokenPartsChecker brokenPartsChecker = new BrokenPartsChecker(progress.newChild(1), compilationCounter, selectionMethodBase);
brokenPartsChecker.doChecking();
// re-enable the markers on the skipped modules.
......@@ -398,7 +400,7 @@ public class ProjectSourceSemanticAnalyzer {
TITANDebugConsole.println(" ** Had to start checking at " + nofModulesTobeChecked + " modules. ", stream);
TITANDebugConsole.println(" **On-the-fly semantic checking of projects (" + allModules.size() + " modules) took " + (System.nanoTime() - semanticCheckStart) * (1e-9) + " seconds", stream);
}
monitor.subTask("Cleanup operations");
progress.subTask("Cleanup operations");
for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) {
ProjectSourceSemanticAnalyzer semanticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer();
......@@ -416,7 +418,7 @@ public class ProjectSourceSemanticAnalyzer {
// wrong inside the analysis.
ErrorReporter.logExceptionStackTrace(e);
}
monitor.done();
progress.done();
for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) {
GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).setLastTimeChecked(compilationCounter);
......
......@@ -34,7 +34,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
......@@ -361,7 +361,8 @@ public final class ProjectSourceSyntacticAnalyzer {
return Status.CANCEL_STATUS;
}
MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream();
monitor.beginTask("On-the-fly syntactic checking of project: " + project.getName(), 1);
SubMonitor progress = SubMonitor.convert(monitor, 1);
progress.setTaskName("On-the-fly syntactic checking of project: " + project.getName());
if (syntacticallyOutdated) {
syntacticallyOutdated = false;
......@@ -404,8 +405,8 @@ public final class ProjectSourceSyntacticAnalyzer {
allCheckedFiles.addAll(asn1FilesToCheck);
// parsing the files
final SubProgressMonitor parseMonitor = new SubProgressMonitor(monitor, 1);
parseMonitor.beginTask("Parse", ttcn3FilesToCheck.size() + asn1FilesToCheck.size());
final SubMonitor parseProgress = SubMonitor.convert(progress, ttcn3FilesToCheck.size() + asn1FilesToCheck.size());
parseProgress.setTaskName("Parse");
final ThreadPoolExecutor executor = new ThreadPoolExecutor(NUMBER_OF_PROCESSORS, NUMBER_OF_PROCESSORS, 10, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>());
......@@ -424,9 +425,8 @@ public final class ProjectSourceSyntacticAnalyzer {
for (IFile file : ttcn3FilesToCheck) {
// parse a file only if the operation was not
// canceled and the file is not yet up-to-date
if (monitor.isCanceled()) {
parseMonitor.done();
monitor.done();
if (parseProgress.isCanceled()) {
parseProgress.done();
return Status.CANCEL_STATUS;
} else if (!file.isAccessible()) {
if (reportDebugInformation) {
......@@ -434,7 +434,7 @@ public final class ProjectSourceSyntacticAnalyzer {
}
latch.countDown();
} else if (!uptodateFiles.containsKey(file) && !highlySyntaxErroneousFiles.contains(file)) {
parseMonitor.subTask("Syntactically analyzing file: " + file.getProjectRelativePath().toOSString());
parseProgress.subTask("Syntactically analyzing file: " + file.getProjectRelativePath().toOSString());
// parse the contents of the file
final IFile tempFile = file;
final int index = nofFilesProcessed;
......@@ -442,14 +442,14 @@ public final class ProjectSourceSyntacticAnalyzer {
executor.execute(new Runnable() {
@Override
public void run() {
if (monitor.isCanceled()) {
if (parseProgress.isCanceled()) {
return;
}
TemporalParseData temp = fileBasedTTCN3Analysis(tempFile);
tempResults[index] = temp;
latch.countDown();
parseMonitor.worked(1);
parseProgress.worked(1);
LoadBalancingUtilities.syntaxAnalyzerProcessedAFile();
}
......@@ -462,9 +462,8 @@ public final class ProjectSourceSyntacticAnalyzer {
for (IFile file : asn1FilesToCheck) {
// parse a file only if the operation was not
// canceled and the file is not yet up-to-date
if (monitor.isCanceled()) {
parseMonitor.done();
monitor.done();
if (parseProgress.isCanceled()) {
parseProgress.done();
return Status.CANCEL_STATUS;
} else if (!file.isAccessible()) {
if (reportDebugInformation) {
......@@ -472,7 +471,7 @@ public final class ProjectSourceSyntacticAnalyzer {
}
latch.countDown();
} else if (!uptodateFiles.containsKey(file) && !highlySyntaxErroneousFiles.contains(file)) {
parseMonitor.subTask("Syntactically analyzing file: " + file.getProjectRelativePath().toOSString());
parseProgress.subTask("Syntactically analyzing file: " + file.getProjectRelativePath().toOSString());
// parse the contents of the file
final IFile tempFile = file;