Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1631210FE8 for ; Tue, 3 Sep 2013 20:44:07 +0000 (UTC) Received: (qmail 85567 invoked by uid 500); 3 Sep 2013 20:44:06 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 85504 invoked by uid 500); 3 Sep 2013 20:44:06 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 85497 invoked by uid 99); 3 Sep 2013 20:44:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Sep 2013 20:44:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Sep 2013 20:44:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 62FF92388980; Tue, 3 Sep 2013 20:43:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1519844 - in /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl: ASTCtor.java ASTStaticMethod.java OgnlRuntime.java Date: Tue, 03 Sep 2013 20:43:45 -0000 To: commits@commons.apache.org From: grobmeier@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130903204345.62FF92388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: grobmeier Date: Tue Sep 3 20:43:44 2013 New Revision: 1519844 URL: http://svn.apache.org/r1519844 Log: removed unnecessary null checks Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTCtor.java commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTStaticMethod.java commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTCtor.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTCtor.java?rev=1519844&r1=1519843&r2=1519844&view=diff ============================================================================== --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTCtor.java (original) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTCtor.java Tue Sep 3 20:43:44 2013 @@ -158,7 +158,7 @@ public class ASTCtor ctorValue = this.getValueBody( context, target ); context.setCurrentObject( ctorValue ); - if ( clazz != null && ctorValue != null ) + if ( ctorValue != null ) { context.setCurrentType( ctorValue.getClass() ); Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTStaticMethod.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTStaticMethod.java?rev=1519844&r1=1519843&r2=1519844&view=diff ============================================================================== --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTStaticMethod.java (original) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTStaticMethod.java Tue Sep 3 20:43:44 2013 @@ -91,7 +91,7 @@ public class ASTStaticMethod Class clazz = OgnlRuntime.classForName( context, className ); Method m = OgnlRuntime.getMethod( context, clazz, methodName, children, true ); - if ( clazz == null || m == null ) + if ( m == null ) { throw new UnsupportedCompilationException( "Unable to find class/method combo " + className + " / " + methodName ); Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java?rev=1519844&r1=1519843&r2=1519844&view=diff ============================================================================== --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java (original) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java Tue Sep 3 20:43:44 2013 @@ -949,10 +949,6 @@ public class OgnlRuntime try { Class targetClass = classForName( context, className ); - if ( targetClass == null ) - { - throw new ClassNotFoundException( "Unable to resolve class with name " + className ); - } MethodAccessor methodAccessor = getMethodAccessor( targetClass ); @@ -1297,12 +1293,6 @@ public class OgnlRuntime { Class clazz = classForName( context, className ); - if ( clazz == null ) - { - throw new OgnlException( - "Unable to find class " + className + " when resolving field name of " + fieldName ); - } - /* * Check for virtual static field "class"; this cannot interfere with normal static fields because it is a * reserved word.