From: Eric P. <de...@us...> - 2005-11-01 16:32:45
|
dep4b 05/11/01 08:32:38 Modified: findbugs/src/plugin-resources findbugs.jsl Added: findbugs/src/plugin-test/src/java/net/sf/mavenplugins/findbugs ClassWithInnerClassWithErrorsForFindbugs.java Log: Properly create links to inner classes xref. Revision Changes Path 1.1 maven-plugins/findbugs/src/plugin-test/src/java/net/sf/mavenplugins/findbugs/ClassWithInnerClassWithErrorsForFindbugs.java Index: ClassWithInnerClassWithErrorsForFindbugs.java =================================================================== package net.sf.mavenplugins.findbugs; import java.util.Vector; /** * This is a simple example of a class with an innerclass that findbugs will analyze. It * should return one bug looking like: * "M UuF: Unused field: net.sf.mavenplugins.findbugs.MathUtil.mode:. * * and another bug like * Line * NS: Questionable use of non-short-circuit logic in net.sf.mavenplugins.findbugs.ClassWithErrorsForFindbugs.setValue(double) * * @author Eric Pugh */ public class ClassWithInnerClassWithErrorsForFindbugs{ public class InnerClass { public double unusedVariable; /**This method adds a new number to the data set and re-compute the mean, mean square, minimum and maximum values, and order statistics*/ public void setValue(double x){ double a, b; int size =0; boolean notInserted = true; //Add the value to the data set for (int i = 0; i < size - 1; i++){ a = 0; b = 0; if ((a <= x) & (x >= b)){ } } } } } 1.2 +10 -2 maven-plugins/findbugs/src/plugin-resources/findbugs.jsl Index: findbugs.jsl =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/src/plugin-resources/findbugs.jsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- findbugs.jsl 29 Jul 2004 18:09:51 -0000 1.1 +++ findbugs.jsl 1 Nov 2005 16:32:38 -0000 1.2 @@ -90,8 +90,16 @@ </td> <td> <j:set var="line" value="${error.attribute('line').getValue()}"/> - <util:replace var="jxrName" value="${name}" oldChar="." newChar="/"/> - <a href="xref/${jxrName}.html#${line}">${line}</a> + <util:replace var="jxrName1" value="${name}" oldChar="." newChar="/"/> + <util:tokenize var="jxrName2" delim="\$">${jxrName1}</util:tokenize> + + <j:set var="loopOnceVar" value="TRUE"/> + <j:forEach var="jxrName3" items="${jxrName2}"> + <j:if test="${loopOnceVar=='TRUE'}"> + <a href="xref/${jxrName3}.html#${line}">${line}</a> + <j:set var="loopOnceVar" value="FALSE"/> + </j:if> + </j:forEach> </td> </tr> </j:forEach> |