You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/05/22 17:38:16 UTC
svn commit: r1125993 -
/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/NumericExpression.java
Author: simonetripodi
Date: Sun May 22 15:38:16 2011
New Revision: 1125993
URL: http://svn.apache.org/viewvc?rev=1125993&view=rev
Log:
suppressed warning in the numeric class cast
Modified:
incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/NumericExpression.java
Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/NumericExpression.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/NumericExpression.java?rev=1125993&r1=1125992&r2=1125993&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/NumericExpression.java (original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/NumericExpression.java Sun May 22 15:38:16 2011
@@ -118,7 +118,9 @@ public abstract class NumericExpression
else if ( context.getCurrentType() != null && context.getCurrentType().isPrimitive()
&& ( ASTConst.class.isInstance( child ) || NumericExpression.class.isInstance( child ) ) )
{
- ret.append( OgnlRuntime.getNumericLiteral( (Class<? extends Number>) context.getCurrentType() ) );
+ @SuppressWarnings( "unchecked" ) // checked by the condition in the if clause
+ Class<? extends Number> numberClass = (Class<? extends Number>) context.getCurrentType();
+ ret.append( OgnlRuntime.getNumericLiteral( numberClass ) );
}
else if ( context.getCurrentType() != null && String.class.isAssignableFrom( context.getCurrentType() ) )
{