Author: fhanik Date: Tue Mar 27 17:32:49 2012 New Revision: 1305921 URL: http://svn.apache.org/viewvc?rev=1305921&view=rev Log: simplify logic, less comparisons on each call
Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java?rev=1305921&r1=1305920&r2=1305921&view=diff ============================================================================== --- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java (original) +++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java Tue Mar 27 17:32:49 2012 @@ -42,14 +42,16 @@ public class DisposableConnectionFacade @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - if (compare(ISCLOSED_VAL, method) && getNext() == null) { - return Boolean.TRUE; - } - if (compare(CLOSE_VAL, method) && getNext() == null) { - return null; - } - if (compare(ISVALID_VAL, method) && getNext() == null) { - return Boolean.FALSE; + if (getNext()==null) { + if (compare(ISCLOSED_VAL, method)) { + return Boolean.TRUE; + } + else if (compare(CLOSE_VAL, method)) { + return null; + } + else if (compare(ISVALID_VAL, method)) { + return Boolean.FALSE; + } } try { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org