commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r832503 - in /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl: JexlArithmetic.java scripting/JexlScriptEngine.java
Date Tue, 03 Nov 2009 18:45:55 GMT
Author: sebb
Date: Tue Nov  3 18:45:54 2009
New Revision: 832503

URL: http://svn.apache.org/viewvc?rev=832503&view=rev
Log:
Reduce scope of @SuppressWarnings as much as possible

Modified:
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/JexlArithmetic.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/JexlArithmetic.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/JexlArithmetic.java?rev=832503&r1=832502&r2=832503&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/JexlArithmetic.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/JexlArithmetic.java Tue
Nov  3 18:45:54 2009
@@ -439,7 +439,6 @@
      * @param right second value
      * @return test result.
      */
-    @SuppressWarnings("unchecked")
     public boolean lessThan(Object left, Object right) {
         if ((left == right) || (left == null) || (right == null)) {
             return false;
@@ -460,9 +459,11 @@
             String rightString = right.toString();
             return leftString.compareTo(rightString) < 0;
         } else if (left instanceof Comparable<?>) {
+            @SuppressWarnings("unchecked")
             final Comparable<Object> comparable = (Comparable<Object>) left;
             return comparable.compareTo(right) < 0;
         } else if (right instanceof Comparable<?>) {
+            @SuppressWarnings("unchecked")
             final Comparable<Object> comparable = (Comparable<Object>) right;
             return comparable.compareTo(left) > 0;
         }

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java?rev=832503&r1=832502&r2=832503&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java
Tue Nov  3 18:45:54 2009
@@ -130,7 +130,6 @@
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
     public Object eval(String scriptText, final ScriptContext context) throws ScriptException
{
         // This is mandated by JSR-223 (see SCR.5.5.2   Methods)
         if (scriptText == null || context == null) {
@@ -142,6 +141,7 @@
         try {
             Script script = jexlEngine.createScript(scriptText);
             JexlContext ctxt = new JexlContext(){
+                @SuppressWarnings("unchecked")
                 public void setVars(Map vars) {
                     context.setBindings(new SimpleBindings(vars), ScriptContext.ENGINE_SCOPE);
                 }



Mime
View raw message