Commit f35cf2e1 authored by Daniel Honsel's avatar Daniel Honsel
Browse files

fixed implemented part of checkNoUnusedImports

parent 028f6a2d
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -52,6 +52,18 @@ public class PreAnalyzer implements Callable<Boolean> {
					}
				}
				
			} else {
				
				synchronized (TTCN3GlobalScopeProvider.IMPORTS) {
					if (TTCN3GlobalScopeProvider.IMPORTS.containsKey(this.resource)) {
						TTCN3GlobalScopeProvider.IMPORTS.get(this.resource)
								.add(initializeImportedObjects(i, importedModule));
					} else {
						TTCN3GlobalScopeProvider.IMPORTS.put(this.resource,
								initializeImportedObjects(i, importedModule));
					}
				}				
				
			}
		}
		return true;
@@ -60,7 +72,9 @@ public class PreAnalyzer implements Callable<Boolean> {
	private ImportData initializeImportedObjects(final ImportDef def, final TTCN3Module module) {
		ImportData data = new ImportData(def.getName(), def, module);
		
		if (module != null) {
			data.getExportedObjects().addAll(TTCN3GlobalScopeProvider.EXPORTED_OBJECTS.get(module.eResource()));
		}
		
		return data;
	}
+5 −4
Original line number Diff line number Diff line
@@ -1231,13 +1231,14 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
						statistics.incrementCountStyle
						val message = "Imported module \"" + d.importDef.name + "\" cannot be resolved!"
						val INode node = NodeModelUtils.getNode(d.importDef)
						warning(
						info(
							message,
							null,
							MessageClass.STYLE.toString,
							node.startLine.toString,
							node.endLine.toString,
							"6.18, " + MiscTools.getMethodName()
							"6.18, " + MiscTools.getMethodName(),
							LogLevel.INFORMATION.toString
						);						
					}