|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectDiff
public final class Diff
Diff is the main class for the invariant diff program. The invariant diff program outputs the differences between two sets of invariants. The following is a high-level description of the program. Each input file contains a serialized PptMap or InvMap. PptMap and InvMap are similar structures, in that they both map program points to invariants. However, PptMaps are much more complicated than InvMaps. PptMaps are output by Daikon, and InvMaps are output by this program. First, if either input is a PptMap, it is converted to an InvMap. Next, the two InvMaps are combined to form a tree. The tree is exactly three levels deep. The first level contains the root, which holds no data. Each node in the second level is a pair of Ppts, and each node in the third level is a pair of Invariants. The tree is constructed by pairing the corresponding Ppts and Invariants in the two PptMaps. Finally, the tree is traversed via the Visitor pattern to produce output. The Visitor pattern makes it easy to extend the program, simply by writing a new Visitor.
| Field Summary | |
|---|---|
static Logger |
debug
|
| Constructor Summary | |
|---|---|
Diff()
|
|
Diff(boolean examineAllPpts)
|
|
Diff(boolean examineAllPpts,
boolean ignoreNumberedExits)
|
|
| Method Summary | |
|---|---|
InvMap |
convertToInvMap(PptMap pptMap)
Extracts the PptTopLevel and Invariants out of a pptMap, and places them into an InvMap. |
RootNode |
diffInvMap(InvMap map1,
InvMap map2)
Returns a pair tree of corresponding program points, and corresponding invariants at each program point. |
RootNode |
diffInvMap(InvMap map1,
InvMap map2,
boolean includeUnjustified)
Returns a pair tree of corresponding program points, and corresponding invariants at each program point. |
RootNode |
diffPptMap(PptMap pptMap1,
PptMap pptMap2)
Diffs two PptMaps by converting them to InvMaps. |
RootNode |
diffPptMap(PptMap pptMap1,
PptMap pptMap2,
boolean includeUnjustified)
Diffs two PptMaps by converting them to InvMaps. |
static void |
main(String[] args)
Read two PptMap or InvMap objects from their respective files. |
static void |
mainHelper(String[] args)
This does the work of main, but it never calls System.exit, so it is appropriate to be called progrmmatically. |
void |
setAllInvComparators(Comparator<Invariant> c)
Use the comparator for sorting both sets and creating the pair tree. |
void |
setInvPairComparator(Comparator<Invariant> c)
Use the comparator for creating the pair tree. |
void |
setInvSortComparator1(Comparator<Invariant> c)
Use the comparator for sorting the first set. |
void |
setInvSortComparator2(Comparator<Invariant> c)
Use the comparator for sorting the second set. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Logger debug
| Constructor Detail |
|---|
public Diff()
public Diff(boolean examineAllPpts)
public Diff(boolean examineAllPpts,
boolean ignoreNumberedExits)
| Method Detail |
|---|
public static void main(String[] args)
throws FileNotFoundException,
StreamCorruptedException,
OptionalDataException,
IOException,
ClassNotFoundException,
InstantiationException,
IllegalAccessException
FileNotFoundException
StreamCorruptedException
OptionalDataException
IOException
ClassNotFoundException
InstantiationException
IllegalAccessException
public static void mainHelper(String[] args)
throws FileNotFoundException,
StreamCorruptedException,
OptionalDataException,
IOException,
ClassNotFoundException,
InstantiationException,
IllegalAccessException
FileNotFoundException
StreamCorruptedException
OptionalDataException
IOException
ClassNotFoundException
InstantiationException
IllegalAccessExceptionmain(String[]),
Daikon.TerminationMessagepublic InvMap convertToInvMap(PptMap pptMap)
public RootNode diffInvMap(InvMap map1,
InvMap map2)
public RootNode diffInvMap(InvMap map1,
InvMap map2,
boolean includeUnjustified)
public RootNode diffPptMap(PptMap pptMap1,
PptMap pptMap2)
public RootNode diffPptMap(PptMap pptMap1,
PptMap pptMap2,
boolean includeUnjustified)
public void setAllInvComparators(Comparator<Invariant> c)
public void setInvSortComparator1(Comparator<Invariant> c)
public void setInvSortComparator2(Comparator<Invariant> c)
public void setInvPairComparator(Comparator<Invariant> c)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||