Commit f5e447fb authored by Kristof Szabados's avatar Kristof Szabados

could be final.

Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent abc61952
......@@ -165,25 +165,25 @@ public final class GlobalParser {
* Re-analyzes every already known projects, with all of their contents.
**/
public static void reAnalyzeSemantically() {
for (ProjectSourceParser parser : TTCN3_PARSERS.values()) {
WorkspaceJob job = parser.analyzeAll(false);
for (final ProjectSourceParser parser : TTCN3_PARSERS.values()) {
final WorkspaceJob job = parser.analyzeAll(false);
if (job != null) {
try {
job.join();
} catch (InterruptedException e) {
} catch (final InterruptedException e) {
ErrorReporter.logExceptionStackTrace(e);
}
}
}
for (ProjectConfigurationParser parser : CFG_PARSERS.values()) {
WorkspaceJob job = parser.doSyntaticalAnalyze();
for (final ProjectConfigurationParser parser : CFG_PARSERS.values()) {
final WorkspaceJob job = parser.doSyntaticalAnalyze();
if (job != null) {
try {
job.join();
} catch (InterruptedException e) {
} catch (final InterruptedException e) {
ErrorReporter.logExceptionStackTrace(e);
}
}
......@@ -194,7 +194,7 @@ public final class GlobalParser {
* Force the next semantic analyzation to reanalyze everything.
* */
public static void clearSemanticInformation() {
for (ProjectSourceParser parser : TTCN3_PARSERS.values()) {
for (final ProjectSourceParser parser : TTCN3_PARSERS.values()) {
parser.clearSemanticInformation();
}
}
......
......@@ -49,8 +49,8 @@ public final class GlobalProjectStructureTracker {
return;
}
ProjectStructureDataCollector dynamicCollector = dynamicInformations.get(project);
ProjectStructureDataCollector savedCollector = savedInformations.get(project);
final ProjectStructureDataCollector dynamicCollector = dynamicInformations.get(project);
final ProjectStructureDataCollector savedCollector = savedInformations.get(project);
savedInformations.put(project, dynamicCollector);
dynamicInformations.remove(project);
......@@ -66,7 +66,7 @@ public final class GlobalProjectStructureTracker {
List<String> savedImports;
List<String> dynamicimports;
for (String from : savedCollector.importations.keySet()) {
for (final String from : savedCollector.importations.keySet()) {
if (!dynamicCollector.importations.containsKey(from)) {
dependencyChanges.put(project, Boolean.TRUE);
return;
......@@ -105,7 +105,7 @@ public final class GlobalProjectStructureTracker {
return;
}
IProject project = file.getProject();
final IProject project = file.getProject();
projectChanged(project);
}
......@@ -123,7 +123,7 @@ public final class GlobalProjectStructureTracker {
return dynamicInformations.get(project);
}
ProjectStructureDataCollector collector = new ProjectStructureDataCollector();
final ProjectStructureDataCollector collector = new ProjectStructureDataCollector();
dynamicInformations.put(project, collector);
return collector;
}
......@@ -158,7 +158,7 @@ public final class GlobalProjectStructureTracker {
* */
public static boolean dependencyChanged(final IProject project) {
if (dependencyChanges.containsKey(project)) {
Boolean temp = dependencyChanges.get(project);
final Boolean temp = dependencyChanges.get(project);
return temp.booleanValue();
}
......
......@@ -62,8 +62,8 @@ public class OutdatedConfigFileCollector implements IResourceVisitor {
}
switch (resource.getType()) {
case IResource.FILE: {
IFile file = (IFile) resource;
String extension = file.getFileExtension();
final IFile file = (IFile) resource;
final String extension = file.getFileExtension();
if (!uptodateFiles.containsKey(file) && !highlySyntaxErroneousFiles.contains(file)) {
if (GlobalParser.SUPPORTED_CONFIG_FILE_EXTENSIONS[0].equals(extension)) {
cfgFilesToCheck.add(file);
......@@ -72,7 +72,7 @@ public class OutdatedConfigFileCollector implements IResourceVisitor {
}
break;
case IResource.FOLDER:
for (IContainer workingDirectory : workingDirectories) {
for (final IContainer workingDirectory : workingDirectories) {
if (workingDirectory.equals(resource)) {
return false;
}
......
......@@ -91,8 +91,8 @@ public final class OutdatedFileCollector implements IResourceVisitor {
}
switch (resource.getType()) {
case IResource.FILE:
IFile file = (IFile) resource;
String extension = file.getFileExtension();
final IFile file = (IFile) resource;
final String extension = file.getFileExtension();
if (!ResourceExclusionHelper.isDirectlyExcluded((IFile) resource) && !uptodateFiles.containsKey(file) && !highlySyntaxErroneousFiles.contains(file)
&& !helper.isExcludedByRegexp(resourcename)) {
if (GlobalParser.isSupportedTTCN3Extension(extension)) {
......@@ -107,7 +107,7 @@ public final class OutdatedFileCollector implements IResourceVisitor {
}
break;
case IResource.FOLDER:
for (IContainer workingDirectory : workingDirectories) {
for (final IContainer workingDirectory : workingDirectories) {
if (workingDirectory.equals(resource)) {
return false;
}
......
......@@ -168,7 +168,7 @@ public class ParserUtilities {
final CommonTokenStream commonTokenStream = (CommonTokenStream)tokenStream;
final List<Token> tokens = commonTokenStream.getTokens();
List<Token> comments = new ArrayList<Token>();
final List<Token> comments = new ArrayList<Token>();
final int start = aToken.getTokenIndex();
// a token is hidden if Token.getChannel() > 0
for ( int i = start - 1; i >= 0 && tokens.get( i ).getChannel() > 0; i-- ) {
......
......@@ -143,7 +143,7 @@ public final class ProjectConfigurationParser {
* @return the WorkspaceJob in which the operation is running
* */
public WorkspaceJob reportOutdating(final IFile outdatedFile) {
WorkspaceJob op = new WorkspaceJob("Reporting outdate for: " + outdatedFile.getName()) {
final WorkspaceJob op = new WorkspaceJob("Reporting outdate for: " + outdatedFile.getName()) {
@Override
public IStatus runInWorkspace(final IProgressMonitor monitor) {
if (uptodateFiles.containsKey(outdatedFile)) {
......@@ -177,7 +177,7 @@ public final class ProjectConfigurationParser {
* @return the WorkspaceJob in which the operation is running
* */
public WorkspaceJob reportOutdating(final List<IFile> outdatedFiles) {
WorkspaceJob op = new WorkspaceJob("Reporting outdate for " + outdatedFiles.size() + " files") {
final WorkspaceJob op = new WorkspaceJob("Reporting outdate for " + outdatedFiles.size() + " files") {
@Override
public IStatus runInWorkspace(final IProgressMonitor monitor) {
for (IFile file : outdatedFiles) {
......@@ -202,15 +202,15 @@ public final class ProjectConfigurationParser {
* Removes data related to modules, that were deleted or moved.
**/
private void removedReferencestoRemovedFiles() {
List<IFile> filesToRemove = new ArrayList<IFile>();
for (IFile file : fileMap.keySet()) {
final List<IFile> filesToRemove = new ArrayList<IFile>();
for (final IFile file : fileMap.keySet()) {
if (!file.isAccessible()) {
uptodateFiles.remove(file);
filesToRemove.add(file);
}
}
for (IFile file : filesToRemove) {
for (final IFile file : filesToRemove) {
fileMap.remove(file);
}
}
......@@ -220,15 +220,15 @@ public final class ProjectConfigurationParser {
final IContainer[] workingDirectories = ProjectBasedBuilder.getProjectBasedBuilder(project).getWorkingDirectoryResources(false);
OutdatedFileCollector visitor = new OutdatedFileCollector(workingDirectories, uptodateFiles, highlySyntaxErroneousFiles);
final OutdatedFileCollector visitor = new OutdatedFileCollector(workingDirectories, uptodateFiles, highlySyntaxErroneousFiles);
try {
project.accept(visitor);
} catch (CoreException e) {
ErrorReporter.logExceptionStackTrace(e);
}
List<IFile> filesToCheck = visitor.getCFGFilesToCheck();
final List<IFile> filesToCheck = visitor.getCFGFilesToCheck();
for (IFile file : uptodateFiles.keySet()) {
for (final IFile file : uptodateFiles.keySet()) {
MarkerHandler.markAllMarkersForRemoval(file, GeneralConstants.ONTHEFLY_SEMANTIC_MARKER);
MarkerHandler.markAllMarkersForRemoval(file, GeneralConstants.ONTHEFLY_MIXED_MARKER);
}
......@@ -278,11 +278,11 @@ public final class ProjectConfigurationParser {
monitor.done();
for (IFile file : uptodateFiles.keySet()) {
for (final IFile file : uptodateFiles.keySet()) {
MarkerHandler.removeAllOnTheFlyMarkedMarkers(file);
}
for (IFile file : filesToCheck) {
for (final IFile file : filesToCheck) {
if (!uptodateFiles.containsKey(file)) {
MarkerHandler.removeAllOnTheFlyMarkedMarkers(file);
}
......@@ -391,12 +391,12 @@ public final class ProjectConfigurationParser {
editor = (ConfigTextEditor) tempEditor;
}
String oldConfigFilePath = fileMap.get(file);
final String oldConfigFilePath = fileMap.get(file);
if (oldConfigFilePath != null) {
fileMap.remove(file);
}
CfgAnalyzer cfgAnalyzer = new CfgAnalyzer();
final CfgAnalyzer cfgAnalyzer = new CfgAnalyzer();
cfgAnalyzer.parse(file, document == null ? null : document.get());
errorsStored = cfgAnalyzer.getErrorStorage();
final CfgParseResult cfgParseResult = cfgAnalyzer.getCfgParseResult();
......@@ -427,7 +427,7 @@ public final class ProjectConfigurationParser {
}
if (editor != null && editor.getDocument() != null) {
ConfigEditor parentEditor = editor.getParentEditor();
final ConfigEditor parentEditor = editor.getParentEditor();
if ( errorsStored == null || errorsStored.isEmpty() ) {
parentEditor.setParseTreeRoot(cfgParseResult.getParseTreeRoot());
parentEditor.setTokens(cfgParseResult.getTokens());
......@@ -451,9 +451,9 @@ public final class ProjectConfigurationParser {
}
if (warningsAndErrors != null) {
for (TITANMarker marker : warningsAndErrors) {
for (final TITANMarker marker : warningsAndErrors) {
if (file.isAccessible()) {
Location location = new Location(file, marker.getLine(), marker.getOffset(), marker.getEndOffset());
final Location location = new Location(file, marker.getLine(), marker.getOffset(), marker.getEndOffset());
location.reportExternalProblem(marker.getMessage(), marker.getSeverity(),
GeneralConstants.ONTHEFLY_SYNTACTIC_MARKER);
}
......@@ -461,7 +461,7 @@ public final class ProjectConfigurationParser {
}
if (errorsStored != null && !errorsStored.isEmpty()) {
String reportLevel = Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER,
final String reportLevel = Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.REPORTERRORSINEXTENSIONSYNTAX, GeneralConstants.WARNING, null);
int errorLevel;
if (GeneralConstants.ERROR.equals(reportLevel)) {
......@@ -477,14 +477,14 @@ public final class ProjectConfigurationParser {
}
if (document != null && editors != null) {
ConfigFoldingSupport foldingSupport = new ConfigFoldingSupport();
final ConfigFoldingSupport foldingSupport = new ConfigFoldingSupport();
final IDocument tempDocument = document;
final List<ISemanticTITANEditor> editors2 = editors;
final List<Position> positions = foldingSupport.calculatePositions(tempDocument);
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
for (ISemanticTITANEditor editor : editors2) {
for (final ISemanticTITANEditor editor : editors2) {
editor.updateFoldingStructure(positions);
editor.invalidateTextPresentation();
}
......
......@@ -137,7 +137,7 @@ public class ProjectSourceSemanticAnalyzer {
* ones referenced.
* */
Set<String> internalGetKnownModuleNames() {
Set<String> temp = new HashSet<String>();
final Set<String> temp = new HashSet<String>();
temp.addAll(moduleMap.keySet());
return temp;
}
......@@ -171,17 +171,17 @@ public class ProjectSourceSemanticAnalyzer {
return;
}
Module module = fileModuleMap.get(outdatedFile);
final Module module = fileModuleMap.get(outdatedFile);
if (module == null) {
return;
}
IResource moduleFile = module.getIdentifier().getLocation().getFile();
final IResource moduleFile = module.getIdentifier().getLocation().getFile();
if (!outdatedFile.equals(moduleFile)) {
return;
}
String moduleName = module.getName();
final String moduleName = module.getName();
moduleMap.remove(moduleName);
fileModuleMap.remove(moduleFile);
......@@ -205,7 +205,7 @@ public class ProjectSourceSemanticAnalyzer {
* the file which seems to have changed
* */
public void reportSemanticOutdating(final IFile outdatedFile) {
Module module = fileModuleMap.get(outdatedFile);
final Module module = fileModuleMap.get(outdatedFile);
if(module != null) {
synchronized (semanticallyUptodateModules) {
semanticallyUptodateModules.remove(module.getName());
......@@ -300,14 +300,14 @@ public class ProjectSourceSemanticAnalyzer {
final long semanticCheckStart = System.nanoTime();
for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) {
ProjectSourceSemanticAnalyzer semanticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer();
final ProjectSourceSemanticAnalyzer semanticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer();
synchronized (semanticAnalyzer.outdatedModuleMap) {
semanticAnalyzer.outdatedModuleMap.clear();
}
semanticAnalyzer.moduleMap.clear();
}
// Semantic checking starts here
SubMonitor progress = SubMonitor.convert(monitor, 1);
final SubMonitor progress = SubMonitor.convert(monitor, 1);
progress.setTaskName("On-the-fly semantic checking of everything ");
progress.subTask("Checking the importations of the modules");
......@@ -318,8 +318,8 @@ public class ProjectSourceSemanticAnalyzer {
Ass_pard.resetAllInstanceCounters();
//check for duplicated module names
HashMap<String, Module> uniqueModules = new HashMap<String, Module>();
Set<String> duplicatedModules = new HashSet<String>();
final HashMap<String, Module> uniqueModules = new HashMap<String, Module>();
final Set<String> duplicatedModules = new HashSet<String>();
// collect all modules and semantically checked modules to work on.
final List<Module> allModules = new ArrayList<Module>();
......@@ -329,7 +329,7 @@ public class ProjectSourceSemanticAnalyzer {
for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) {
final ProjectSourceSemanticAnalyzer semanticAnalyzer =
GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer();
for (Module module: semanticAnalyzer.fileModuleMap.values()) {
for (final Module module: semanticAnalyzer.fileModuleMap.values()) {
if(module instanceof TTCN3Module){
MarkerHandler.markAllSemanticMarkersForRemoval(module.getIdentifier());
}
......@@ -339,7 +339,7 @@ public class ProjectSourceSemanticAnalyzer {
for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) {
final ProjectSourceSemanticAnalyzer semanticAnalyzer =
GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer();
for (Module module: semanticAnalyzer.fileModuleMap.values()) {
for (final Module module: semanticAnalyzer.fileModuleMap.values()) {
final String name = module.getIdentifier().getName();
allModules.add(module);
//ASN1 modules are not been analyzed incrementally, therefore their markers can be removed in one step:
......@@ -367,28 +367,28 @@ public class ProjectSourceSemanticAnalyzer {
if(allModules.size() > semanticallyChecked.size()) {
// check and build the import hierarchy of the modules
ModuleImportationChain referenceChain = new ModuleImportationChain(CIRCULARIMPORTCHAIN, false);
final ModuleImportationChain referenceChain = new ModuleImportationChain(CIRCULARIMPORTCHAIN, false);
//remove markers from import lines
for(Module module : allModules) {
for(final Module module : allModules) {
if(module instanceof TTCN3Module) {
List<ImportModule> imports = ((TTCN3Module) module).getImports();
for(ImportModule imp : imports) {
final List<ImportModule> imports = ((TTCN3Module) module).getImports();
for(final ImportModule imp : imports) {
MarkerHandler.markAllSemanticMarkersForRemoval(imp.getLocation());
}
}
// markers are removed in one step in ASN1 modules
}
for(Module module : allModules) {
for(final Module module : allModules) {
module.checkImports(compilationCounter, referenceChain, new ArrayList<Module>());
referenceChain.clear();
}
progress.subTask("Calculating the list of modules to be checked");
BrokenPartsViaReferences selectionMethod = new BrokenPartsViaReferences(compilationCounter);
SelectionMethodBase selectionMethodBase = (SelectionMethodBase)selectionMethod;
final BrokenPartsViaReferences selectionMethod = new BrokenPartsViaReferences(compilationCounter);
final SelectionMethodBase selectionMethodBase = (SelectionMethodBase)selectionMethod;
selectionMethodBase.setModules(allModules, semanticallyChecked);
selectionMethod.execute();
......@@ -397,18 +397,18 @@ public class ProjectSourceSemanticAnalyzer {
return Status.CANCEL_STATUS;
}
BrokenPartsChecker brokenPartsChecker = new BrokenPartsChecker(progress.newChild(1), compilationCounter, selectionMethodBase);
final BrokenPartsChecker brokenPartsChecker = new BrokenPartsChecker(progress.newChild(1), compilationCounter, selectionMethodBase);
brokenPartsChecker.doChecking();
// re-enable the markers on the skipped modules.
for (Module module2 : selectionMethodBase.getModulesToSkip()) {
for (final Module module2 : selectionMethodBase.getModulesToSkip()) {
MarkerHandler.reEnableAllMarkers((IFile) module2.getLocation().getFile());
}
nofModulesTobeChecked = selectionMethodBase.getModulesToCheck().size();
} else {
//re-enable all markers
for (Module module2 : allModules) {
for (final Module module2 : allModules) {
MarkerHandler.reEnableAllMarkers((IFile) module2.getLocation().getFile());
}
}
......@@ -418,12 +418,12 @@ public class ProjectSourceSemanticAnalyzer {
final String option = preferenceService.getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.REPORTUNSUPPORTEDCONSTRUCTS, GeneralConstants.WARNING, null);
for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) {
// report the unsupported constructs in the project
ProjectSourceSyntacticAnalyzer syntacticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSyntacticAnalyzer();
for (IFile file : syntacticAnalyzer.unsupportedConstructMap.keySet()) {
List<TITANMarker> markers = syntacticAnalyzer.unsupportedConstructMap.get(file);
final ProjectSourceSyntacticAnalyzer syntacticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSyntacticAnalyzer();
for (final IFile file : syntacticAnalyzer.unsupportedConstructMap.keySet()) {
final List<TITANMarker> markers = syntacticAnalyzer.unsupportedConstructMap.get(file);
if (markers != null && file.isAccessible()) {
for (TITANMarker marker : markers) {
Location location = new Location(file, marker.getLine(), marker.getOffset(), marker.getEndOffset());
for (final TITANMarker marker : markers) {
final Location location = new Location(file, marker.getLine(), marker.getOffset(), marker.getEndOffset());
location.reportConfigurableSemanticProblem(option, marker.getMessage());
}
}
......@@ -431,18 +431,18 @@ public class ProjectSourceSemanticAnalyzer {
}
if (preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, true, null)) {
MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream();
final MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream();
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);
}
progress.subTask("Cleanup operations");
for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) {
ProjectSourceSemanticAnalyzer semanticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer();
final ProjectSourceSemanticAnalyzer semanticAnalyzer = GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer();
synchronized (semanticAnalyzer.semanticallyUptodateModules) {
semanticAnalyzer.semanticallyUptodateModules.clear();
semanticAnalyzer.semanticallyUptodateModules.addAll(semanticAnalyzer.moduleMap.keySet());
for (String name: duplicatedModules) {
for (final String name: duplicatedModules) {
semanticAnalyzer.semanticallyUptodateModules.remove(name);
}
}
......@@ -458,8 +458,8 @@ public class ProjectSourceSemanticAnalyzer {
for (int i = 0; i < tobeSemanticallyAnalyzed.size(); i++) {
GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).setLastTimeChecked(compilationCounter);
ProjectStructureDataCollector collector = GlobalProjectStructureTracker.getDataCollector(tobeSemanticallyAnalyzed.get(i));
for (Module module : GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer().moduleMap.values()) {
final ProjectStructureDataCollector collector = GlobalProjectStructureTracker.getDataCollector(tobeSemanticallyAnalyzed.get(i));
for (final Module module : GlobalParser.getProjectSourceParser(tobeSemanticallyAnalyzed.get(i)).getSemanticAnalyzer().moduleMap.values()) {
collector.addKnownModule(module.getIdentifier());
module.extractStructuralInformation(collector);
}
......
......@@ -230,18 +230,18 @@ public final class ProjectSourceSyntacticAnalyzer {
synchronized (this) {
syntacticallyOutdated = true;
for (Iterator<IFile> iterator = uptodateFiles.keySet().iterator(); iterator.hasNext();) {
IFile tempFile = iterator.next();
IPath filepath = tempFile.getProjectRelativePath();
for (final Iterator<IFile> iterator = uptodateFiles.keySet().iterator(); iterator.hasNext();) {
final IFile tempFile = iterator.next();
final IPath filepath = tempFile.getProjectRelativePath();
if (folderPath.isPrefixOf(filepath)) {
sourceParser.getSemanticAnalyzer().reportOutdating(tempFile, useOnTheFlyParsing);
iterator.remove();
unsupportedConstructMap.remove(tempFile);
}
}
for (Iterator<IFile> iterator = highlySyntaxErroneousFiles.iterator(); iterator.hasNext();) {
IFile tempFile = iterator.next();
IPath filepath = tempFile.getProjectRelativePath();
for (final Iterator<IFile> iterator = highlySyntaxErroneousFiles.iterator(); iterator.hasNext();) {
final IFile tempFile = iterator.next();
final IPath filepath = tempFile.getProjectRelativePath();
if (folderPath.isPrefixOf(filepath)) {
iterator.remove();
}
......@@ -253,19 +253,19 @@ public final class ProjectSourceSyntacticAnalyzer {
* Removes data related to modules, that were deleted or moved.
**/
private void removedReferencestoRemovedFiles() {
List<IFile> filesToRemove = new ArrayList<IFile>();
for (IFile file : fileMap.keySet()) {
final List<IFile> filesToRemove = new ArrayList<IFile>();
for (final IFile file : fileMap.keySet()) {
if (!file.isAccessible()) {
uptodateFiles.remove(file);
highlySyntaxErroneousFiles.remove(file);
String moduleName = fileMap.get(file);
final String moduleName = fileMap.get(file);
filesToRemove.add(file);
sourceParser.getSemanticAnalyzer().removedReferencestoRemovedFiles(file, moduleName);
}
}
for (IFile file : filesToRemove) {
for (final IFile file : filesToRemove) {
fileMap.remove(file);
unsupportedConstructMap.remove(file);
......@@ -288,7 +288,7 @@ public final class ProjectSourceSyntacticAnalyzer {
* */
public void updateSyntax(final IFile file, final TTCN3ReparseUpdater reparser) {
if (uptodateFiles.containsKey(file)) {
Module module = sourceParser.getSemanticAnalyzer().getModulebyFile(file);
final Module module = sourceParser.getSemanticAnalyzer().getModulebyFile(file);
sourceParser.getSemanticAnalyzer().reportSemanticOutdating(file);
if (module != null && module_type.TTCN3_MODULE.equals(module.getModuletype())) {
......@@ -302,7 +302,7 @@ public final class ProjectSourceSyntacticAnalyzer {
uptodateFiles.remove(file);
sourceParser.getSemanticAnalyzer().reportSemanticOutdating(file);
String oldModuleName = fileMap.get(file);
final String oldModuleName = fileMap.get(file);
if (oldModuleName != null) {
sourceParser.getSemanticAnalyzer().removeModule(oldModuleName);
fileMap.remove(file);
......@@ -311,7 +311,7 @@ public final class ProjectSourceSyntacticAnalyzer {
reparser.maxDamage();
ITtcn3FileReparser r = new Ttcn3FileReparser( reparser, file, sourceParser, fileMap, uptodateFiles, highlySyntaxErroneousFiles );
final ITtcn3FileReparser r = new Ttcn3FileReparser( reparser, file, sourceParser, fileMap, uptodateFiles, highlySyntaxErroneousFiles );
syntacticallyOutdated = r.parse();
}
......@@ -333,7 +333,7 @@ public final class ProjectSourceSyntacticAnalyzer {
reportOutdating(file);
} else {
MarkerHandler.markAllMarkersForRemoval(file);
TemporalParseData temp = fileBasedTTCN3Analysis(file);
final TemporalParseData temp = fileBasedTTCN3Analysis(file);
postFileBasedGeneralAnalysis(temp);
}
......@@ -355,25 +355,26 @@ public final class ProjectSourceSyntacticAnalyzer {
if (!project.isAccessible() || !TITANNature.hasTITANNature(project)) {
return Status.CANCEL_STATUS;
}
MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream();
SubMonitor progress = SubMonitor.convert(monitor, 1);
final MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream();
final SubMonitor progress = SubMonitor.convert(monitor, 1);
progress.setTaskName("On-the-fly syntactic checking of project: " + project.getName());