From 1c88cdcecc11d1d2bf0c14c6ebc34c16db28ac70 Mon Sep 17 00:00:00 2001 From: yeom Date: Sat, 23 Apr 2011 00:51:14 +0000 Subject: [PATCH] interim changes: ssjava will have its own class library, not relying on Java Class Library --- .../SSJava/DefinitelyWrittenCheck.java | 34 +++++++++++++++++-- Robust/src/Analysis/SSJava/FlowDownCheck.java | 16 +++++---- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/Robust/src/Analysis/SSJava/DefinitelyWrittenCheck.java b/Robust/src/Analysis/SSJava/DefinitelyWrittenCheck.java index bd7ed906..4283d278 100644 --- a/Robust/src/Analysis/SSJava/DefinitelyWrittenCheck.java +++ b/Robust/src/Analysis/SSJava/DefinitelyWrittenCheck.java @@ -40,6 +40,31 @@ public class DefinitelyWrittenCheck { public void definitelyWrittenCheck() { + SymbolTable classtable = state.getClassSymbolTable(); + toanalyze.addAll(classtable.getValueSet()); + toanalyze.addAll(state.getTaskSymbolTable().getValueSet()); + while (!toanalyze.isEmpty()) { + Object obj = toanalyze.iterator().next(); + ClassDescriptor cd = (ClassDescriptor) obj; + toanalyze.remove(cd); + +// if (cd.isClassLibrary()) { + // doesn't care about class libraries now +// continue; +// } + for (Iterator method_it = cd.getMethods(); method_it.hasNext();) { + MethodDescriptor md = (MethodDescriptor) method_it.next(); + FlatMethod fm = state.getMethodFlat(md); + if (fm != null) { + + } + + } + } + + + + /* // creating map SymbolTable classtable = state.getClassSymbolTable(); toanalyze.addAll(classtable.getValueSet()); @@ -51,12 +76,12 @@ public class DefinitelyWrittenCheck { if (cd.isClassLibrary()) { // doesn't care about class libraries now -// continue; + continue; } for (Iterator method_it = cd.getMethods(); method_it.hasNext();) { MethodDescriptor md = (MethodDescriptor) method_it.next(); FlatMethod fm = state.getMethodFlat(md); - if(fm!=null){ + if (fm != null) { LoopFinder loopFinder = new LoopFinder(fm); Loops loops = loopFinder.getRootloop(fm); Set loopSet = loops.nestedLoops(); @@ -66,7 +91,6 @@ public class DefinitelyWrittenCheck { Set loopEntranceSet = rootLoops.loopEntrances(); for (Iterator iterator2 = loopEntranceSet.iterator(); iterator2.hasNext();) { FlatNode loopEnter = (FlatNode) iterator2.next(); - String flatNodeLabel = (String) state.fn2labelMap.get(loopEnter); if (flatNodeLabel != null && flatNodeLabel.equals("ssjava")) { System.out.println("encounting ss loop:" + loopEnter); @@ -101,8 +125,12 @@ public class DefinitelyWrittenCheck { } } } + */ } + + + private void checkMethodBody(FlatMethod fm) { diff --git a/Robust/src/Analysis/SSJava/FlowDownCheck.java b/Robust/src/Analysis/SSJava/FlowDownCheck.java index ffee22f2..f509cdb7 100644 --- a/Robust/src/Analysis/SSJava/FlowDownCheck.java +++ b/Robust/src/Analysis/SSJava/FlowDownCheck.java @@ -85,10 +85,10 @@ public class FlowDownCheck { Object obj = toanalyze.iterator().next(); ClassDescriptor cd = (ClassDescriptor) obj; toanalyze.remove(cd); - if (cd.isClassLibrary()) { +// if (cd.isClassLibrary()) { // doesn't care about class libraries now - continue; - } +// continue; +// } checkDeclarationInClass(cd); for (Iterator method_it = cd.getMethods(); method_it.hasNext();) { MethodDescriptor md = (MethodDescriptor) method_it.next(); @@ -141,10 +141,10 @@ public class FlowDownCheck { Object obj = toanalyze.iterator().next(); ClassDescriptor cd = (ClassDescriptor) obj; toanalyze.remove(cd); - if (cd.isClassLibrary()) { +// if (cd.isClassLibrary()) { // doesn't care about class libraries now - continue; - } +// continue; +// } checkClass(cd); for (Iterator method_it = cd.getMethods(); method_it.hasNext();) { MethodDescriptor md = (MethodDescriptor) method_it.next(); @@ -810,7 +810,9 @@ public class FlowDownCheck { } } - addTypeLocation(an.getSrc().getType(), srcLocation); + if(an.getSrc()!=null){ + addTypeLocation(an.getSrc().getType(), srcLocation); + } addTypeLocation(an.getDest().getType(), destLocation); return destLocation; -- 2.34.1