From 73b1b753f4b344159e40aca00674bab8de832edf Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 10 Jan 2010 13:11:52 +0000 Subject: [PATCH] Fix the remaining Eclipse warnings in the non-generated classes git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@897635 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/el/parser/AstIdentifier.java | 2 ++ java/org/apache/el/parser/AstValue.java | 8 ++++++-- java/org/apache/el/parser/SimpleNode.java | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/java/org/apache/el/parser/AstIdentifier.java b/java/org/apache/el/parser/AstIdentifier.java index 5cefbb3a7..540bee8be 100644 --- a/java/org/apache/el/parser/AstIdentifier.java +++ b/java/org/apache/el/parser/AstIdentifier.java @@ -91,6 +91,7 @@ public final class AstIdentifier extends SimpleNode { ctx.getELResolver().setValue(ctx, null, this.image, value); } + @SuppressWarnings("unchecked") @Override public Object invoke(EvaluationContext ctx, Class[] paramTypes, Object[] paramValues) throws ELException { @@ -98,6 +99,7 @@ public final class AstIdentifier extends SimpleNode { } + @SuppressWarnings("unchecked") @Override public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes) throws ELException { diff --git a/java/org/apache/el/parser/AstValue.java b/java/org/apache/el/parser/AstValue.java index 03715229a..9a5cb5d3d 100644 --- a/java/org/apache/el/parser/AstValue.java +++ b/java/org/apache/el/parser/AstValue.java @@ -142,9 +142,11 @@ public final class AstValue extends SimpleNode { Class targetClass = resolver.getType(ctx, t.base, t.property); if (COERCE_TO_ZERO == true || !isAssignable(value, targetClass)) { - value = ELSupport.coerceToType(value, targetClass); + resolver.setValue(ctx, t.base, t.property, + ELSupport.coerceToType(value, targetClass)); + } else { + resolver.setValue(ctx, t.base, t.property, value); } - resolver.setValue(ctx, t.base, t.property, value); } private boolean isAssignable(Object value, Class targetClass) { @@ -159,6 +161,7 @@ public final class AstValue extends SimpleNode { } + @SuppressWarnings("unchecked") @Override public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes) throws ELException { @@ -168,6 +171,7 @@ public final class AstValue extends SimpleNode { .getParameterTypes()); } + @SuppressWarnings("unchecked") @Override public Object invoke(EvaluationContext ctx, Class[] paramTypes, Object[] paramValues) throws ELException { diff --git a/java/org/apache/el/parser/SimpleNode.java b/java/org/apache/el/parser/SimpleNode.java index 79bef0b00..84e76b848 100644 --- a/java/org/apache/el/parser/SimpleNode.java +++ b/java/org/apache/el/parser/SimpleNode.java @@ -45,9 +45,11 @@ public abstract class SimpleNode extends ELSupport implements Node { } public void jjtOpen() { + // NOOP by default } public void jjtClose() { + // NOOP by default } public void jjtSetParent(Node n) { @@ -151,11 +153,13 @@ public abstract class SimpleNode extends ELSupport implements Node { } } + @SuppressWarnings("unchecked") public Object invoke(EvaluationContext ctx, Class[] paramTypes, Object[] paramValues) throws ELException { throw new UnsupportedOperationException(); } + @SuppressWarnings("unchecked") public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes) throws ELException { throw new UnsupportedOperationException(); -- 2.11.0