Commit 6f7e8a1f authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* minor refinements and notes to checkNoUnusedImports

parent 55330087
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1413,8 +1413,9 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
			return
		}

		//TODO: why is this here?!
		val TTCN3GlobalScopeProvider scopeProvider = globalScopeProvider as TTCN3GlobalScopeProvider
		if (scopeProvider == null) {
		if (scopeProvider === null) {
			return
		}

@@ -1423,7 +1424,7 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
				val list = IMPORTS.get(module.eResource)
				for (i : 0 .. list.size - 1) {
					val d = list.get(i)
					if (d.module == null) {
					if (d.module === null) {
						statistics.incrementCountStyle
						val message = "Imported module \"" + d.importDef.name + "\" cannot be resolved!"
						val INode node = NodeModelUtils.getNode(d.importDef)
@@ -1438,11 +1439,11 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
							LogLevel.INFORMATION.toString
						);
					}

					val Set<EObject> target = newHashSet(d.exportedObjects.map[getEObjectOrProxy]);
					var boolean found = module.isReferenced2(target, false)
					
					if (!found && d.module != null) {
					//TODO: the second condition is superfluous?
					if (!found && d.module !== null) {
						statistics.incrementCountStyle
						val message = "No definitions from imported module \"" + d.importDef.name + "\" are ever used!"
						val INode node = NodeModelUtils.getNode(d.importDef)