[Clirr-devel] CVS: clirr/core/src/java/net/sf/clirr/core/internal/checks MethodSetCheck.java,1.10,1.
Status: Alpha
Brought to you by:
lkuehne
From: <lk...@us...> - 2006-03-16 22:30:30
|
Update of /cvsroot/clirr/clirr/core/src/java/net/sf/clirr/core/internal/checks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6735/src/java/net/sf/clirr/core/internal/checks Modified Files: MethodSetCheck.java Log Message: Replaced BCEL with ASM. This lays the groundwork for the Java5 RFEs and also fixes bug 1373831, which was caused by a bug in BCEL. As an added bonus, the uberjar file size drops by several hundred KB. Index: MethodSetCheck.java =================================================================== RCS file: /cvsroot/clirr/clirr/core/src/java/net/sf/clirr/core/internal/checks/MethodSetCheck.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- MethodSetCheck.java 10 Jan 2006 21:54:25 -0000 1.10 +++ MethodSetCheck.java 16 Mar 2006 22:30:19 -0000 1.11 @@ -602,16 +602,25 @@ JavaType bReturnType = baselineMethod.getReturnType(); JavaType cReturnType = currentMethod.getReturnType(); + if (bReturnType == null && cReturnType == null) + { + return; + } + // TODO: Check assignability. If the new return type is // assignable to the old type, then the code is source-code // compatible even when binary-incompatible. - if (!bReturnType.toString().equals(cReturnType.toString())) + + if (bReturnType != null && cReturnType != null && bReturnType.getName().equals(cReturnType.getName())) { - fireDiff(MSG_METHOD_RETURNTYPE_CHANGED, - getSeverity(compatBaseline, baselineMethod, Severity.ERROR), - compatBaseline, baselineMethod, - new String[] {cReturnType.toString()}); + return; } + + final String name = cReturnType == null ? "void" : cReturnType.getName(); + fireDiff(MSG_METHOD_RETURNTYPE_CHANGED, + getSeverity(compatBaseline, baselineMethod, Severity.ERROR), + compatBaseline, baselineMethod, + new String[] {name}); } private void checkDeclaredExceptions( |