commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1194867 - in /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl: OgnlContext.java OgnlException.java OgnlOps.java
Date Sat, 29 Oct 2011 11:01:56 GMT
Author: mcucchiara
Date: Sat Oct 29 11:01:56 2011
New Revision: 1194867

URL: http://svn.apache.org/viewvc?rev=1194867&view=rev
Log:
OGNL-11: fixed checkstyle errors

Modified:
    commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java
    commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlException.java
    commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java

Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java?rev=1194867&r1=1194866&r2=1194867&view=diff
==============================================================================
--- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java (original)
+++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java Sat Oct
29 11:01:56 2011
@@ -111,11 +111,13 @@ public class OgnlContext
 
         try
         {
-            if ( ( s = System.getProperty( PROPERTY_KEY_PREFIX + ".traceEvaluations" ) )
!= null )
+            s = System.getProperty( PROPERTY_KEY_PREFIX + ".traceEvaluations" );
+            if ( s != null )
             {
                 defaultTraceEvaluations = Boolean.valueOf( s.trim() );
             }
-            if ( ( s = System.getProperty( PROPERTY_KEY_PREFIX + ".keepLastEvaluation" )
) != null )
+            s = System.getProperty( PROPERTY_KEY_PREFIX + ".keepLastEvaluation" );
+            if ( s != null )
             {
                 defaultKeepLastEvaluation = Boolean.valueOf( s.trim() );
             }

Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlException.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlException.java?rev=1194867&r1=1194866&r2=1194867&view=diff
==============================================================================
--- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlException.java (original)
+++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlException.java Sat
Oct 29 11:01:56 2011
@@ -35,12 +35,12 @@ public class OgnlException
 
     private static final long serialVersionUID = -842845048743721078L;
 
-    static Method _initCause;
+    static Method initCause;
     static
     {
         try
         {
-            _initCause = OgnlException.class.getMethod( "initCause", new Class[] { Throwable.class
} );
+            initCause = OgnlException.class.getMethod( "initCause", new Class[] { Throwable.class
} );
         }
         catch ( NoSuchMethodException e )
         {
@@ -51,14 +51,14 @@ public class OgnlException
     /**
      * The root evaluation of the expression when the exception was thrown
      */
-    private Evaluation _evaluation;
+    private Evaluation evaluation;
 
     /**
      * Why this exception was thrown.
      * 
      * @serial
      */
-    private Throwable _reason;
+    private Throwable reason;
 
     /** Constructs an OgnlException with no message or encapsulated exception. */
     public OgnlException()
@@ -85,15 +85,15 @@ public class OgnlException
     public OgnlException( String msg, Throwable reason )
     {
         super( msg );
-        this._reason = reason;
+        this.reason = reason;
 
-        if ( _initCause != null )
+        if ( initCause != null )
         {
             try
             {
-                _initCause.invoke( this, new Object[] { reason } );
+                initCause.invoke( this, reason );
             }
-            catch ( Exception t )
+            catch ( Exception ignored )
             {
                 /** ignore */
             }
@@ -107,7 +107,7 @@ public class OgnlException
      */
     public Throwable getReason()
     {
-        return _reason;
+        return reason;
     }
 
     /**
@@ -117,7 +117,7 @@ public class OgnlException
      */
     public Evaluation getEvaluation()
     {
-        return _evaluation;
+        return evaluation;
     }
 
     /**
@@ -127,7 +127,7 @@ public class OgnlException
      */
     public void setEvaluation( Evaluation value )
     {
-        _evaluation = value;
+        evaluation = value;
     }
 
     /**
@@ -138,10 +138,12 @@ public class OgnlException
     @Override
     public String toString()
     {
-        if ( _reason == null )
+        if ( reason == null )
+        {
             return super.toString();
+        }
 
-        return super.toString() + " [" + _reason + "]";
+        return super.toString() + " [" + reason + "]";
     }
 
     /**
@@ -162,10 +164,10 @@ public class OgnlException
         synchronized ( s )
         {
             super.printStackTrace( s );
-            if ( _reason != null )
+            if ( reason != null )
             {
                 s.println( "/-- Encapsulated exception ------------\\" );
-                _reason.printStackTrace( s );
+                reason.printStackTrace( s );
                 s.println( "\\--------------------------------------/" );
             }
         }
@@ -180,10 +182,10 @@ public class OgnlException
         synchronized ( s )
         {
             super.printStackTrace( s );
-            if ( _reason != null )
+            if ( reason != null )
             {
                 s.println( "/-- Encapsulated exception ------------\\" );
-                _reason.printStackTrace( s );
+                reason.printStackTrace( s );
                 s.println( "\\--------------------------------------/" );
             }
         }

Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java?rev=1194867&r1=1194866&r2=1194867&view=diff
==============================================================================
--- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java (original)
+++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java Sat Oct 29
11:01:56 2011
@@ -122,7 +122,8 @@ public abstract class OgnlOps
         {
             if ( ( object1 != null ) && object1.getClass().isArray() )
             {
-                if ( ( object2 != null ) && object2.getClass().isArray() &&
( object2.getClass() == object1.getClass() ) )
+                if ( ( object2 != null ) && object2.getClass().isArray() &&
( object2.getClass()
+                    == object1.getClass() ) )
                 {
                     result = ( Array.getLength( object1 ) == Array.getLength( object2 ) );
                     if ( result )
@@ -186,8 +187,9 @@ public abstract class OgnlOps
         Class<?> c = value.getClass();
 
         if ( c == Boolean.class )
+        {
             return (Boolean) value;
-
+        }
         // if ( c == String.class )
         // return ((String)value).length() > 0;
 
@@ -195,12 +197,8 @@ public abstract class OgnlOps
         {
             return (Character) value != 0;
         }
-        if ( value instanceof Number )
-        {
-            return ( (Number) value ).doubleValue() != 0;
-        }
+        return !( value instanceof Number ) || ( (Number) value ).doubleValue() != 0;
 
-        return true; // non-null
     }
 
     /**
@@ -211,7 +209,6 @@ public abstract class OgnlOps
      * @throws NumberFormatException if the given object can't be understood as a long integer
      */
     public static long longValue( Object value )
-        throws NumberFormatException
     {
         if ( value == null )
         {
@@ -241,7 +238,6 @@ public abstract class OgnlOps
      * @throws NumberFormatException if the given object can't be understood as a double
      */
     public static double doubleValue( Object value )
-        throws NumberFormatException
     {
         if ( value == null )
         {
@@ -273,7 +269,6 @@ public abstract class OgnlOps
      * @throws NumberFormatException if the given object can't be understood as a BigInteger
      */
     public static BigInteger bigIntValue( Object value )
-        throws NumberFormatException
     {
         if ( value == null )
         {
@@ -311,7 +306,6 @@ public abstract class OgnlOps
      * @throws NumberFormatException if the given object can't be understood as a BigDecimal
      */
     public static BigDecimal bigDecValue( Object value )
-        throws NumberFormatException
     {
         if ( value == null )
         {
@@ -626,7 +620,9 @@ public abstract class OgnlOps
         throws OgnlException
     {
         if ( value == null )
+        {
             return null;
+        }
 
         Object result;
 



Mime
View raw message