[Clirr-devel] CVS: clirr/src/java/net/sf/clirr/checks ClassScopeCheck.java,1.1,1.2
Status: Alpha
Brought to you by:
lkuehne
From: Simon K. <s_k...@us...> - 2004-07-02 02:36:12
|
Update of /cvsroot/clirr/clirr/src/java/net/sf/clirr/checks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15959 Modified Files: ClassScopeCheck.java Log Message: Use Message class Index: ClassScopeCheck.java =================================================================== RCS file: /cvsroot/clirr/clirr/src/java/net/sf/clirr/checks/ClassScopeCheck.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ClassScopeCheck.java 18 Jun 2004 07:59:22 -0000 1.1 +++ ClassScopeCheck.java 2 Jul 2004 02:36:01 -0000 1.2 @@ -21,6 +21,7 @@ import net.sf.clirr.event.Severity; import net.sf.clirr.event.ScopeSelector; +import net.sf.clirr.event.Message; import net.sf.clirr.framework.AbstractDiffReporter; import net.sf.clirr.framework.ApiDiffDispatcher; import net.sf.clirr.framework.ClassChangeCheck; @@ -49,6 +50,11 @@ extends AbstractDiffReporter implements ClassChangeCheck { + private static final Message MSG_SCOPE_INCREASED = new Message(1000); + private static final Message MSG_SCOPE_DECREASED = new Message(1001); + private static final Message MSG_ERROR_DETERMINING_SCOPE_OLD = new Message(1002); + private static final Message MSG_ERROR_DETERMINING_SCOPE_NEW = new Message(1003); + private ScopeSelector scopeSelector; /** @@ -71,8 +77,9 @@ } catch (CheckerException ex) { - log(ex.getMessage() + " in old class version", - Severity.ERROR, compatBaseline.getClassName(), null, null); + log(MSG_ERROR_DETERMINING_SCOPE_OLD, + Severity.ERROR, compatBaseline.getClassName(), null, null, + new String[] {ex.getMessage()}); return false; } @@ -83,8 +90,9 @@ } catch (CheckerException ex) { - log(ex.getMessage() + " in new class version", - Severity.ERROR, compatBaseline.getClassName(), null, null); + log(MSG_ERROR_DETERMINING_SCOPE_NEW, + Severity.ERROR, compatBaseline.getClassName(), null, null, + new String[] {ex.getMessage()}); return false; } @@ -98,21 +106,25 @@ if (cScope.isMoreVisibleThan(bScope)) { - log( - "Increased visibility of class from " - + bScope.getDesc() - + " to " - + cScope.getDesc(), - Severity.INFO, compatBaseline.getClassName(), null, null); + String[] args = + { + bScope.getDesc(), + cScope.getDesc() + }; + + log(MSG_SCOPE_INCREASED, + Severity.INFO, compatBaseline.getClassName(), null, null, args); } else if (cScope.isLessVisibleThan(bScope)) { - log( - "Decreased visibility of class from " - + bScope.getDesc() - + " to " - + cScope.getDesc(), - Severity.ERROR, compatBaseline.getClassName(), null, null); + String[] args = + { + bScope.getDesc(), + cScope.getDesc() + }; + + log(MSG_SCOPE_DECREASED, + Severity.ERROR, compatBaseline.getClassName(), null, null, args); } // Apply further checks only if both versions of the class have scopes |