[Clirr-devel] CVS: clirr/src/java/net/sf/clirr/checks AbstractClassSetChangeCheck.java,1.6,1.7 Class
Status: Alpha
Brought to you by:
lkuehne
Update of /cvsroot/clirr/clirr/src/java/net/sf/clirr/checks In directory sc8-pr-cvs1:/tmp/cvs-serv6028/src/java/net/sf/clirr/checks Modified Files: AbstractClassSetChangeCheck.java ClassHierarchyCheck.java ClassModifierCheck.java GenderChangeCheck.java InterfaceSetCheck.java Log Message: added information about affected class/method/field to ApiDifference This is a first step towards filtering diffs to let the user specify changes that are OK Index: AbstractClassSetChangeCheck.java =================================================================== RCS file: /cvsroot/clirr/clirr/src/java/net/sf/clirr/checks/AbstractClassSetChangeCheck.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- AbstractClassSetChangeCheck.java 27 Sep 2003 05:28:43 -0000 1.6 +++ AbstractClassSetChangeCheck.java 27 Dec 2003 19:08:42 -0000 1.7 @@ -44,7 +44,7 @@ String oldClassName = setA[i]; if (Arrays.binarySearch(setB, oldClassName) < 0) { - log(diffPrefix + oldClassName, severity); + log(diffPrefix + oldClassName, severity, oldClassName, null, null); } } } Index: ClassHierarchyCheck.java =================================================================== RCS file: /cvsroot/clirr/clirr/src/java/net/sf/clirr/checks/ClassHierarchyCheck.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ClassHierarchyCheck.java 27 Sep 2003 05:28:43 -0000 1.6 +++ ClassHierarchyCheck.java 27 Dec 2003 19:08:42 -0000 1.7 @@ -77,18 +77,19 @@ List added = getSetDifference(currentSuper, compatSuper); List removed = getSetDifference(compatSuper, currentSuper); + final String className = compatBaseline.getClassName(); for (int i = 0; i < added.size(); i++) { String s = (String) added.get(i); - log("Added " + s + " to the list of superclasses of " - + compatBaseline.getClassName(), Severity.INFO); + log("Added " + s + " to the list of superclasses of " + className, + Severity.INFO, className, null, null); } for (int i = 0; i < removed.size(); i++) { String s = (String) removed.get(i); - log("Removed " + s + " from the list of superclasses of " - + compatBaseline.getClassName(), Severity.ERROR); + log("Removed " + s + " from the list of superclasses of " + className, + Severity.ERROR, className, null, null); } } } Index: ClassModifierCheck.java =================================================================== RCS file: /cvsroot/clirr/clirr/src/java/net/sf/clirr/checks/ClassModifierCheck.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ClassModifierCheck.java 27 Sep 2003 05:28:43 -0000 1.6 +++ ClassModifierCheck.java 27 Dec 2003 19:08:42 -0000 1.7 @@ -62,21 +62,25 @@ if (compatIsFinal && !currentIsFinal) { - log("Removed final modifier in class " + className, Severity.INFO); + log("Removed final modifier in class " + className, + Severity.INFO, className, null, null); } else if (!compatIsFinal && currentIsFinal) { - log("Added final modifier in class " + className, Severity.ERROR); + log("Added final modifier in class " + className, + Severity.ERROR, className, null, null); } // interfaces are always abstract, don't report gender change here if (compatIsAbstract && !currentIsAbstract && !compatIsInterface) { - log("Removed abstract modifier in class " + className, Severity.INFO); + log("Removed abstract modifier in class " + className, + Severity.INFO, className, null, null); } else if (!compatIsAbstract && currentIsAbstract && !currentIsInterface) { - log("Added abstract modifier in class " + className, Severity.ERROR); + log("Added abstract modifier in class " + className, + Severity.ERROR, className, null, null); } } Index: GenderChangeCheck.java =================================================================== RCS file: /cvsroot/clirr/clirr/src/java/net/sf/clirr/checks/GenderChangeCheck.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- GenderChangeCheck.java 27 Sep 2003 05:28:43 -0000 1.5 +++ GenderChangeCheck.java 27 Dec 2003 19:08:42 -0000 1.6 @@ -57,7 +57,8 @@ if (baseLine.isClass() != current.isClass()) { getApiDiffDispatcher().fireDiff(new ApiDifference( - "Changed Gender of " + baseLine.getClassName(), Severity.ERROR) + "Changed Gender of " + baseLine.getClassName(), Severity.ERROR, + baseLine.getClassName(), null, null) ); } } Index: InterfaceSetCheck.java =================================================================== RCS file: /cvsroot/clirr/clirr/src/java/net/sf/clirr/checks/InterfaceSetCheck.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- InterfaceSetCheck.java 27 Sep 2003 05:28:43 -0000 1.5 +++ InterfaceSetCheck.java 27 Dec 2003 19:08:42 -0000 1.6 @@ -73,7 +73,7 @@ log("Removed " + compatInterface + " from the set of interfaces implemented by " + className, - Severity.ERROR); + Severity.ERROR, className, null, null); } else { @@ -89,7 +89,7 @@ log("Added " + name + " to the set of implemented interfaces implemented by " + className, - Severity.INFO); + Severity.INFO, className, null, null); } } } |