From: markt Date: Wed, 15 Dec 2010 14:54:23 +0000 (+0000) Subject: Whilst I am thinking about excluding stuff from FindBugs - add some exceptions for... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ee2eea16d34de3e7b0e33e34ac698d9a3f1ff9aa;p=tomcat7.0 Whilst I am thinking about excluding stuff from FindBugs - add some exceptions for the generated code with issues and fix the remaining issues in the same package git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1049572 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/el/parser/AstNegative.java b/java/org/apache/el/parser/AstNegative.java index e16a0a79e..1e89c80b7 100644 --- a/java/org/apache/el/parser/AstNegative.java +++ b/java/org/apache/el/parser/AstNegative.java @@ -47,7 +47,7 @@ public final class AstNegative extends SimpleNode { Object obj = this.children[0].getValue(ctx); if (obj == null) { - return new Long(0); + return Long.valueOf(0); } if (obj instanceof BigDecimal) { return ((BigDecimal) obj).negate(); @@ -59,27 +59,27 @@ public final class AstNegative extends SimpleNode { if (isStringFloat((String) obj)) { return new Double(-Double.parseDouble((String) obj)); } - return new Long(-Long.parseLong((String) obj)); + return Long.valueOf(-Long.parseLong((String) obj)); } if (obj instanceof Long) { - return new Long(-((Long) obj).longValue()); + return Long.valueOf(-((Long) obj).longValue()); } if (obj instanceof Double) { return new Double(-((Double) obj).doubleValue()); } if (obj instanceof Integer) { - return new Integer(-((Integer) obj).intValue()); + return Integer.valueOf(-((Integer) obj).intValue()); } if (obj instanceof Float) { return new Float(-((Float) obj).floatValue()); } if (obj instanceof Short) { - return new Short((short) -((Short) obj).shortValue()); + return Short.valueOf((short) -((Short) obj).shortValue()); } if (obj instanceof Byte) { - return new Byte((byte) -((Byte) obj).byteValue()); + return Byte.valueOf((byte) -((Byte) obj).byteValue()); } Long num = (Long) coerceToNumber(obj, Long.class); - return new Long(-num.longValue()); + return Long.valueOf(-num.longValue()); } } diff --git a/java/org/apache/el/parser/SimpleNode.java b/java/org/apache/el/parser/SimpleNode.java index 9ff99d1dd..601038194 100644 --- a/java/org/apache/el/parser/SimpleNode.java +++ b/java/org/apache/el/parser/SimpleNode.java @@ -47,22 +47,27 @@ public abstract class SimpleNode extends ELSupport implements Node { id = i; } + @Override public void jjtOpen() { // NOOP by default } + @Override public void jjtClose() { // NOOP by default } + @Override public void jjtSetParent(Node n) { parent = n; } + @Override public Node jjtGetParent() { return parent; } + @Override public void jjtAddChild(Node n, int i) { if (children == null) { children = new Node[i + 1]; @@ -74,10 +79,12 @@ public abstract class SimpleNode extends ELSupport implements Node { children[i] = n; } + @Override public Node jjtGetChild(int i) { return children[i]; } + @Override public int jjtGetNumChildren() { return (children == null) ? 0 : children.length; } @@ -102,23 +109,7 @@ public abstract class SimpleNode extends ELSupport implements Node { return prefix + toString(); } - /* - * Override this method if you want to customize how the node dumps out its - * children. - */ - - public void dump(String prefix) { - System.out.println(toString(prefix)); - if (children != null) { - for (int i = 0; i < children.length; ++i) { - SimpleNode n = (SimpleNode) children[i]; - if (n != null) { - n.dump(prefix + " "); - } - } - } - } - + @Override public String getImage() { return image; } @@ -127,26 +118,31 @@ public abstract class SimpleNode extends ELSupport implements Node { this.image = image; } + @Override public Class getType(EvaluationContext ctx) throws ELException { throw new UnsupportedOperationException(); } + @Override public Object getValue(EvaluationContext ctx) throws ELException { throw new UnsupportedOperationException(); } + @Override public boolean isReadOnly(EvaluationContext ctx) throws ELException { return true; } + @Override public void setValue(EvaluationContext ctx, Object value) throws ELException { throw new PropertyNotWritableException(MessageFactory.get("error.syntax.set")); } + @Override public void accept(NodeVisitor visitor) throws Exception { visitor.visit(this); if (this.children != null && this.children.length > 0) { @@ -156,11 +152,13 @@ public abstract class SimpleNode extends ELSupport implements Node { } } + @Override public Object invoke(EvaluationContext ctx, Class[] paramTypes, Object[] paramValues) throws ELException { throw new UnsupportedOperationException(); } + @Override public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes) throws ELException { throw new UnsupportedOperationException(); @@ -208,6 +206,7 @@ public abstract class SimpleNode extends ELSupport implements Node { /** * @since EL 2.2 */ + @Override public ValueReference getValueReference(EvaluationContext ctx) { return null; } @@ -215,6 +214,7 @@ public abstract class SimpleNode extends ELSupport implements Node { /** * @since EL 2.2 */ + @Override public boolean isParametersProvided() { return false; } diff --git a/res/findbugs/filter-false-positives.xml b/res/findbugs/filter-false-positives.xml index 9786b7c37..940c9f60c 100644 --- a/res/findbugs/filter-false-positives.xml +++ b/res/findbugs/filter-false-positives.xml @@ -1,7 +1,18 @@ + + + + + + + + + + + \ No newline at end of file