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

removing line ending whitespaces.


Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent 48cf5c46
......@@ -89,7 +89,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
public ComponentFinderFromEditor() {
}
@Override
public void setActivePart(final IAction action, final IWorkbenchPart targetPart) {
// Do nothing
......@@ -112,7 +112,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
return null;
}
private void doOpenComponentFinderGraphForSelected() {
final Definition def = findSelection();
if (! (def instanceof Def_Testcase)) {
......@@ -127,9 +127,9 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
final Map<String, NodeDescriptor> labels = new HashMap<String, NodeDescriptor>();
final Def_Testcase tc = (Def_Testcase) def;
System.out.println("dOCFGFS: "+tc.getFullName());
final HashMap<Component_Type, List<Component_Type>> components = new HashMap<Component_Type, List<Component_Type>>();
final Component_Type ct = tc.getRunsOnType(CompilationTimeStamp.getBaseTimestamp());
components.put(ct, new ArrayList<Component_Type>());
......@@ -141,7 +141,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
//TITANDebugConsole.println(entry.getKey().getFullName()+": "+comp.getFullName());
}
}
for (final Entry<Component_Type, List<Component_Type>> entry : vis.getComponents().entrySet()) {
final NodeDescriptor node = new NodeDescriptor(entry.getKey().getFullName(), entry.getKey().getFullName(),
......@@ -158,16 +158,16 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
graph.addVertex(node2);
labels.put(node2.getName(), node2);
}
final EdgeDescriptor edge = new EdgeDescriptor(entry.getKey().getFullName() + "->" + ct2.getFullName(), Color.black);
if (!graph.containsEdge(edge)) {
graph.addEdge(edge, labels.get(entry.getKey().getFullName()), labels.get(ct2.getFullName()), EdgeType.DIRECTED);
}
}
}
String path = "";
try {
path = project.getPersistentProperty(
......@@ -201,9 +201,9 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
}
}
});
try {
final IEditorPart editor = page.findEditor(new FileEditorInput(selectedFile));
if (editor instanceof ComponentFinderGraphEditor) {
......@@ -217,7 +217,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
errorHandler.reportException("Error while parsing the project", exc);
}
}
private Definition findSelection() {
//getting the active editor
......@@ -256,7 +256,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
}
return selectedDef;
}
private static class SelectionFinderVisitor extends ASTVisitor {
private Definition def;
......@@ -276,7 +276,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
return V_CONTINUE;
}
final Location loc = ((ILocateableNode) node).getLocation();
if (loc == null) {
return V_ABORT;
}
......@@ -305,9 +305,9 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
return null;
}
return (TextSelection)sel;
}
}
private static class TestcaseVisitor extends ASTVisitor {
private HashMap<Component_Type, List<Component_Type>> components = new HashMap<Component_Type, List<Component_Type>>();
......@@ -315,7 +315,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
private int counter;
private boolean cce;
private Component_Type comp;
TestcaseVisitor(final List<Def_Function> checkedFunctions, HashMap<Component_Type, List<Component_Type>> components, final Component_Type comp) {
this.components.putAll(components);
this.checkedFunctions = checkedFunctions;
......@@ -324,7 +324,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
this.comp = comp;
}
private HashMap<Component_Type, List<Component_Type>> getComponents() {
return components;
}
......@@ -337,7 +337,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
else if (node instanceof PortReference && (counter == 0 || counter == 1)) {
counter++;
final PortReference pr = ((PortReference)node);
final Assignment as = pr.getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false);
if (as != null && as instanceof Def_Port) {
final Def_Port dp = (Def_Port)as;
......@@ -348,18 +348,18 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
if (!components.containsKey(comp)) {
components.put(comp, new ArrayList<Component_Type>());
}
if (!components.get(comp).contains(ct) && !comp.equals(ct)) {
components.get(comp).add(ct);
}
}
}
}
else if (node instanceof Function_Instance_Statement) {
final Function_Instance_Statement fis = (Function_Instance_Statement)node;
final Assignment as = fis.getReference().getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), true);
analyzeFunction(as, comp);
analyzeFunction(as, comp);
}
else if (node instanceof ComponentCreateExpression) {
cce = true;
......@@ -386,7 +386,7 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
return V_CONTINUE;
}
public void analyzeFunction(final Assignment assignment, final Component_Type component) {
if (assignment != null && assignment instanceof Def_Function) {
final Def_Function df = (Def_Function)assignment;
......@@ -413,12 +413,12 @@ public class ComponentFinderFromEditor extends AbstractHandler implements IObjec
}
}
}
private static class ModuleVisitor extends ASTVisitor {
private List<Component_Type> comps = new ArrayList<Component_Type>();
private Def_Port port;
ModuleVisitor(final Def_Port port) {
comps = new ArrayList<Component_Type>();
this.port = port;
......
......@@ -88,7 +88,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
public ExportComponentTopologyFromEditor() {
}
@Override
public void setActivePart(final IAction action, final IWorkbenchPart targetPart) {
// Do nothing
......@@ -111,7 +111,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
return null;
}
private void doOpenComponentTopologyGraphForSelected() {
final Definition def = findSelection();
if (! (def instanceof Def_Testcase)) {
......@@ -126,7 +126,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
final Map<String, NodeDescriptor> labels = new HashMap<String, NodeDescriptor>();
final Def_Testcase tc = (Def_Testcase) def;
final HashMap<Component_Type, List<Component_Type>> components = new HashMap<Component_Type, List<Component_Type>>();
final Component_Type ct = tc.getRunsOnType(CompilationTimeStamp.getBaseTimestamp());
components.put(ct, new ArrayList<Component_Type>());
......@@ -148,16 +148,14 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
graph.addVertex(node2);
labels.put(node2.getName(), node2);
}
final EdgeDescriptor edge = new EdgeDescriptor(entry.getKey().getFullName() + "->" + ct2.getFullName(), Color.black);
if (!graph.containsEdge(edge)) {
graph.addEdge(edge, labels.get(entry.getKey().getFullName()), labels.get(ct2.getFullName()), EdgeType.DIRECTED);
}
}
}
String path = "";
try {
path = project.getPersistentProperty(
......@@ -191,9 +189,9 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
}
}
});
try {
final IEditorPart editor = page.findEditor(new FileEditorInput(selectedFile));
if (editor instanceof ComponentTopologyGraphEditor) {
......@@ -207,7 +205,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
errorHandler.reportException("Error while parsing the project", exc);
}
}
private Definition findSelection() {
//getting the active editor
......@@ -246,7 +244,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
}
return selectedDef;
}
private static class SelectionFinderVisitor extends ASTVisitor {
private Definition def;
......@@ -266,7 +264,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
return V_CONTINUE;
}
final Location loc = ((ILocateableNode) node).getLocation();
if (loc == null) {
return V_ABORT;
}
......@@ -295,9 +293,9 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
return null;
}
return (TextSelection)sel;
}
}
private static class TestcaseVisitor extends ASTVisitor {
private HashMap<Component_Type, List<Component_Type>> components = new HashMap<Component_Type, List<Component_Type>>();
......@@ -305,7 +303,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
private int counter;
private boolean cce;
private Component_Type comp;
TestcaseVisitor(final List<Def_Function> checkedFunctions, HashMap<Component_Type, List<Component_Type>> components, final Component_Type comp) {
this.components.putAll(components);
this.checkedFunctions = checkedFunctions;
......@@ -314,7 +312,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
this.comp = comp;
}
private HashMap<Component_Type, List<Component_Type>> getComponents() {
return components;
}
......@@ -327,7 +325,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
else if (node instanceof PortReference && (counter == 0 || counter == 1)) {
counter++;
final PortReference pr = ((PortReference)node);
final Assignment as = pr.getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false);
if (as != null && as instanceof Def_Port) {
final Def_Port dp = (Def_Port)as;
......@@ -338,18 +336,18 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
if (!components.containsKey(comp)) {
components.put(comp, new ArrayList<Component_Type>());
}
if (!components.get(comp).contains(ct) && !comp.equals(ct)) {
components.get(comp).add(ct);
}
}
}
}
else if (node instanceof Function_Instance_Statement) {
final Function_Instance_Statement fis = (Function_Instance_Statement)node;
final Assignment as = fis.getReference().getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), true);
analyzeFunction(as, comp);
analyzeFunction(as, comp);
}
else if (node instanceof ComponentCreateExpression) {
cce = true;
......@@ -376,7 +374,7 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
return V_CONTINUE;
}
public void analyzeFunction(final Assignment assignment, final Component_Type component) {
if (assignment != null && assignment instanceof Def_Function) {
final Def_Function df = (Def_Function)assignment;
......@@ -403,12 +401,12 @@ public class ExportComponentTopologyFromEditor extends AbstractHandler implement
}
}
}
private static class ModuleVisitor extends ASTVisitor {
private List<Component_Type> comps = new ArrayList<Component_Type>();
private Def_Port port;
ModuleVisitor(final Def_Port port) {
comps = new ArrayList<Component_Type>();
this.port = port;
......
......@@ -49,8 +49,8 @@ import edu.uci.ics.jung.graph.util.EdgeType;
*/
public class ComponentFinderGraphGenerator extends GraphGenerator {
private final IFile selectedFile;
public ComponentFinderGraphGenerator(final IFile selectedFile, final IProject project, final ErrorHandler eHandler) {
super(project, eHandler);
this.selectedFile = selectedFile;
......@@ -60,13 +60,13 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
@Override
protected void createGraph() {
final TestcaseCollector tcc = new TestcaseCollector();
final IProject sourceProj = selectedFile.getProject();
final ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(sourceProj);
final Module selectedModule = projectSourceParser.containedModule(selectedFile);
selectedModule.accept(tcc);
for (final Def_Testcase tc : tcc.getTestcases()) {
final HashMap<Component_Type, List<Component_Type>> components = new HashMap<Component_Type, List<Component_Type>>();
final Component_Type ct = tc.getRunsOnType(CompilationTimeStamp.getBaseTimestamp());
......@@ -79,8 +79,8 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
//TITANDebugConsole.println(entry.getKey().getFullName()+": "+comp.getFullName());
}
}
NodeDescriptor node = new NodeDescriptor(tc.getFullName()+"\n"+ct.getFullName(), tc.getFullName()+"\n"+ct.getFullName(),
NodeColours.DARK_RED, project, false, ct.getLocation());
graph.addVertex(node);
......@@ -102,18 +102,18 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
graph.addVertex(node2);
labels.put(node2.getName(), node2);
}
final EdgeDescriptor edge = new EdgeDescriptor(tc.getFullName()+"\n"+entry.getKey().getFullName() + "->" +
final EdgeDescriptor edge = new EdgeDescriptor(tc.getFullName()+"\n"+entry.getKey().getFullName() + "->" +
ct2.getFullName(), Color.black);
if (!graph.containsEdge(edge)) {
graph.addEdge(edge, labels.get(tc.getFullName()+"\n"+entry.getKey().getFullName()),
graph.addEdge(edge, labels.get(tc.getFullName()+"\n"+entry.getKey().getFullName()),
labels.get(tc.getFullName()+"\n"+ct2.getFullName()), EdgeType.DIRECTED);
}
}
}
}
}
}
private static class TestcaseVisitor extends ASTVisitor {
private final HashMap<Component_Type, List<Component_Type>> components = new HashMap<Component_Type, List<Component_Type>>();
......@@ -121,7 +121,7 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
private int counter;
private boolean cce;
private final Component_Type comp;
TestcaseVisitor(final List<Def_Function> checkedFunctions, final HashMap<Component_Type, List<Component_Type>> components, final Component_Type comp) {
this.components.putAll(components);
this.checkedFunctions = checkedFunctions;
......@@ -129,7 +129,7 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
cce = false;
this.comp = comp;
}
private HashMap<Component_Type, List<Component_Type>> getComponents() {
return components;
}
......@@ -142,7 +142,7 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
else if (node instanceof PortReference && (counter == 0 || counter == 1)) {
counter++;
final PortReference pr = ((PortReference)node);
final Assignment as = pr.getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false);
if (as != null && as instanceof Def_Port) {
final Def_Port dp = (Def_Port)as;
......@@ -153,7 +153,7 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
if (!components.containsKey(comp)) {
components.put(comp, new ArrayList<Component_Type>());
}
if (!components.get(comp).contains(ct) && !comp.equals(ct)) {
components.get(comp).add(ct);
}
......@@ -163,7 +163,7 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
else if (node instanceof Function_Instance_Statement) {
final Function_Instance_Statement fis = (Function_Instance_Statement)node;
final Assignment as = fis.getReference().getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), true);
analyzeFunction(as, comp);
analyzeFunction(as, comp);
}
else if (node instanceof ComponentCreateExpression) {
cce = true;
......@@ -189,7 +189,7 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
return V_CONTINUE;
}
public void analyzeFunction(final Assignment assignment, final Component_Type component) {
if (assignment != null && assignment instanceof Def_Function) {
final Def_Function df = (Def_Function)assignment;
......@@ -216,12 +216,12 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
}
}
private static class ModuleVisitor extends ASTVisitor {
private final List<Component_Type> comps = new ArrayList<Component_Type>();
private final Def_Port port;
ModuleVisitor(final Def_Port port) {
this.port = port;
}
......@@ -246,11 +246,11 @@ public class ComponentFinderGraphGenerator extends GraphGenerator {
}
}
private static class TestcaseCollector extends ASTVisitor {
private final List<Def_Testcase> tcs = new ArrayList<Def_Testcase>();
TestcaseCollector() {
}
......
......@@ -49,8 +49,8 @@ import edu.uci.ics.jung.graph.util.EdgeType;
*/
public class ComponentTopologyGraphGenerator extends GraphGenerator {
private final IFile selectedFile;
public ComponentTopologyGraphGenerator(final IFile selectedFile, final IProject project, final ErrorHandler eHandler) {
super(project, eHandler);
this.selectedFile = selectedFile;
......@@ -60,20 +60,20 @@ public class ComponentTopologyGraphGenerator extends GraphGenerator {
@Override
protected void createGraph() {
final TestcaseCollector tcc = new TestcaseCollector();
final IProject sourceProj = selectedFile.getProject();
final ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(sourceProj);
final Module selectedModule = projectSourceParser.containedModule(selectedFile);
selectedModule.accept(tcc);
for (final Def_Testcase tc : tcc.getTestcases()) {
final HashMap<Component_Type, List<Component_Type>> components = new HashMap<Component_Type, List<Component_Type>>();
final Component_Type ct = tc.getRunsOnType(CompilationTimeStamp.getBaseTimestamp());
components.put(ct, new ArrayList<Component_Type>());
final TestcaseVisitor vis = new TestcaseVisitor(new ArrayList<Def_Function>(), components, ct);
tc.accept(vis);
NodeDescriptor node = new NodeDescriptor(tc.getFullName()+"\n"+ct.getFullName(), tc.getFullName()+"\n"+ct.getFullName(),
NodeColours.DARK_RED, project, false, ct.getLocation());
graph.addVertex(node);
......@@ -95,18 +95,18 @@ public class ComponentTopologyGraphGenerator extends GraphGenerator {
graph.addVertex(node2);
labels.put(node2.getName(), node2);
}
final EdgeDescriptor edge = new EdgeDescriptor(tc.getFullName()+"\n"+entry.getKey().getFullName() + "->" +
final EdgeDescriptor edge = new EdgeDescriptor(tc.getFullName()+"\n"+entry.getKey().getFullName() + "->" +
ct2.getFullName(), Color.black);
if (!graph.containsEdge(edge)) {
graph.addEdge(edge, labels.get(tc.getFullName()+"\n"+entry.getKey().getFullName()),
graph.addEdge(edge, labels.get(tc.getFullName()+"\n"+entry.getKey().getFullName()),
labels.get(tc.getFullName()+"\n"+ct2.getFullName()), EdgeType.DIRECTED);
}
}
}
}
}
}
private static class TestcaseVisitor extends ASTVisitor {
private final HashMap<Component_Type, List<Component_Type>> components = new HashMap<Component_Type, List<Component_Type>>();
......@@ -114,7 +114,7 @@ public class ComponentTopologyGraphGenerator extends GraphGenerator {
private int counter;
private boolean cce;
private final Component_Type comp;
TestcaseVisitor(final List<Def_Function> checkedFunctions, final HashMap<Component_Type, List<Component_Type>> components, final Component_Type comp) {
this.components.putAll(components);
this.checkedFunctions = checkedFunctions;
......@@ -122,7 +122,7 @@ public class ComponentTopologyGraphGenerator extends GraphGenerator {
cce = false;
this.comp = comp;
}
private HashMap<Component_Type, List<Component_Type>> getComponents() {
return components;
}
......@@ -135,7 +135,7 @@ public class ComponentTopologyGraphGenerator extends GraphGenerator {
else if (node instanceof PortReference && (counter == 0 || counter == 1)) {
counter++;
final PortReference pr = ((PortReference)node);
final Assignment as = pr.getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false);
if (as != null && as instanceof Def_Port) {
final Def_Port dp = (Def_Port)as;
......@@ -146,7 +146,7 @@ public class ComponentTopologyGraphGenerator extends GraphGenerator {
if (!components.containsKey(comp)) {
components.put(comp, new ArrayList<Component_Type>());
}