// keep the field ownership from the linear type checking
Hashtable<MethodDescriptor, Set<FieldDescriptor>> mapMethodToOwnedFieldSet;
-
+
Set<FlatNode> sameHeightWriteFlatNodeSet;
CallGraph callgraph;
private LinkedList<MethodDescriptor> sortedDescriptors;
+ private Map<Location, Set<Descriptor>> mapSharedLocToDescSet;
+
public SSJavaAnalysis(State state, TypeUtil tu, BuildFlat bf, CallGraph callgraph) {
this.state = state;
this.tu = tu;
this.mapDescriptorToSetDependents = new Hashtable<Descriptor, Set<MethodDescriptor>>();
this.sortedDescriptors = new LinkedList<MethodDescriptor>();
this.md2pcLoc = new HashMap<MethodDescriptor, CompositeLocation>();
+ this.mapSharedLocToDescSet = new HashMap<Location, Set<Descriptor>>();
}
public void doCheck() {
doDefinitelyWrittenCheck();
doLoopCheck();
}
+
+ for (Iterator iterator = annotationRequireSet.iterator(); iterator.hasNext();) {
+ MethodDescriptor md = (MethodDescriptor) iterator.next();
+ MethodLattice<String> locOrder = getMethodLattice(md);
+ writeLatticeDotFile(md.getClassDesc(), md, getMethodLattice(md));
+ // System.out.println("~~~\t" + md.getClassDesc() + "_" + md + "\t"
+ // + locOrder.getKeySet().size());
+ }
}
public void init() {
return (LinkedList<MethodDescriptor>) sortedDescriptors.clone();
}
+ public void addSharedDesc(Location loc, Descriptor fd) {
+ if (!mapSharedLocToDescSet.containsKey(loc)) {
+ mapSharedLocToDescSet.put(loc, new HashSet<Descriptor>());
+ }
+ mapSharedLocToDescSet.get(loc).add(fd);
+ }
+
+ public Set<Descriptor> getSharedDescSet(Location loc) {
+ return mapSharedLocToDescSet.get(loc);
+ }
+
private void inference() {
- LocationInference inferEngine = new LocationInference(this, state);
+ LocationInference inferEngine = new LocationInference(this, state, tu);
inferEngine.inference();
}
if (state.SSJAVADEBUG) {
// generate lattice dot file
writeLatticeDotFile(cd, null, locOrder);
+ System.out.println("~~~\t" + cd + "\t" + locOrder.getKeySet().size());
}
} else if (marker.equals(METHODDEFAULT)) {
new MethodLattice<String>(SSJavaAnalysis.TOP, SSJavaAnalysis.BOTTOM);
cd2methodDefault.put(cd, locOrder);
parseMethodDefaultLatticeDefinition(cd, an.getValue(), locOrder);
+ // writeLatticeDotFile(cd, null, locOrder, "METHOD_DEFAULT");
}
}
new MethodLattice<String>(SSJavaAnalysis.TOP, SSJavaAnalysis.BOTTOM);
md2lattice.put(md, locOrder);
parseMethodDefaultLatticeDefinition(cd, an.getValue(), locOrder);
+ writeLatticeDotFile(cd, md, locOrder, "");
} else if (an.getMarker().equals(TERMINATE)) {
// developer explicitly wants to skip loop termination analysis
String value = an.getValue();