Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/CodeStyleValidator.xtend +16 −13 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ import static extension de.ugoe.cs.swe.common.TTCN3ReferenceHelper.* import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import static extension org.eclipse.xtext.EcoreUtil2.* import de.ugoe.cs.swe.tTCN3.PortInstance import java.util.HashSet import com.google.common.collect.Sets class CheckDefinitionComeFirstParameter { public boolean hasOtherDefinitions Loading Loading @@ -745,6 +747,8 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { } } // TODO: figure out another way to find referenced objects private def boolean isUnreferenced(EObject type, TTCN3Module parent) { stopwatch.start Loading Loading @@ -954,40 +958,39 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { } private def boolean isReferencedComponentSpec(ComponentDef component, EObject parent) { val module = parent.findDesiredParent(TTCN3Module) val HashSet<EObject> variables = Sets.newHashSet for (d : component.defs) { val element = d.element if (element.port != null) { for (p : element.port.instances) { if (!p.isUnreferenced(module)) return true variables.add(p) } } else if (element.const != null) { for (c : element.const.defs.list) { if (!c.isUnreferenced(module)) return true variables.add(c) } } else if (element.timer != null) { for (t : element.timer.list.variables) { if (!t.isUnreferenced(module)) return true variables.add(t) } } else if (element.variable != null) { if (element.variable.list != null) { for (v : element.variable.list.variables) { if (!v.isUnreferenced(module)) return true variables.add(v) } } if (element.variable.tempList != null) { for (tv : element.variable.tempList.variables) { if (!tv.isUnreferenced(module)) return true variables.add(tv) } } } } if (parent.isReferenced2(variables)) { return true } else { return false } false } private def ArrayList<TTCN3Reference> findAllParameters(EObject parent) { Loading Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/CodeStyleValidator.xtend +16 −13 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ import static extension de.ugoe.cs.swe.common.TTCN3ReferenceHelper.* import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import static extension org.eclipse.xtext.EcoreUtil2.* import de.ugoe.cs.swe.tTCN3.PortInstance import java.util.HashSet import com.google.common.collect.Sets class CheckDefinitionComeFirstParameter { public boolean hasOtherDefinitions Loading Loading @@ -745,6 +747,8 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { } } // TODO: figure out another way to find referenced objects private def boolean isUnreferenced(EObject type, TTCN3Module parent) { stopwatch.start Loading Loading @@ -954,40 +958,39 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { } private def boolean isReferencedComponentSpec(ComponentDef component, EObject parent) { val module = parent.findDesiredParent(TTCN3Module) val HashSet<EObject> variables = Sets.newHashSet for (d : component.defs) { val element = d.element if (element.port != null) { for (p : element.port.instances) { if (!p.isUnreferenced(module)) return true variables.add(p) } } else if (element.const != null) { for (c : element.const.defs.list) { if (!c.isUnreferenced(module)) return true variables.add(c) } } else if (element.timer != null) { for (t : element.timer.list.variables) { if (!t.isUnreferenced(module)) return true variables.add(t) } } else if (element.variable != null) { if (element.variable.list != null) { for (v : element.variable.list.variables) { if (!v.isUnreferenced(module)) return true variables.add(v) } } if (element.variable.tempList != null) { for (tv : element.variable.tempList.variables) { if (!tv.isUnreferenced(module)) return true variables.add(tv) } } } } if (parent.isReferenced2(variables)) { return true } else { return false } false } private def ArrayList<TTCN3Reference> findAllParameters(EObject parent) { Loading