Author: markt Date: Tue May 22 16:48:04 2018 New Revision: 1832047 URL: http://svn.apache.org/viewvc?rev=1832047&view=rev Log: SpotBugs: Value is only read once so treat it as a constant.
Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java?rev=1832047&r1=1832046&r2=1832047&view=diff ============================================================================== --- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java (original) +++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidationQueryTimeout.java Tue May 22 16:48:04 2018 @@ -35,7 +35,7 @@ import org.apache.tomcat.jdbc.pool.inter public class TestValidationQueryTimeout extends DefaultTestCase { - private static int TIMEOUT = 10; + private static final int TIMEOUT = 10; private static boolean isTimeoutSet; private static final String longQuery = "select * from test as A, test as B, test as C, test as D, test as E"; @@ -54,7 +54,6 @@ public class TestValidationQueryTimeout this.datasource.setValidationQuery("SELECT 1"); this.datasource.setValidationQueryTimeout(TIMEOUT); - TIMEOUT = 10; isTimeoutSet = false; } @@ -93,9 +92,6 @@ public class TestValidationQueryTimeout Connection con = this.datasource.getConnection(); Assert.assertTrue(isTimeoutSet); - // increase the expected timeout to 30, which is what we set for the interceptor - TIMEOUT = 30; - // now create a statement, make sure the query timeout is set by the interceptor Statement st = con.createStatement(); Assert.assertEquals(interceptorTimeout, st.getQueryTimeout()); @@ -109,7 +105,6 @@ public class TestValidationQueryTimeout con.close(); // pull another connection and check it - TIMEOUT = 10; isTimeoutSet = false; Connection con2 = this.datasource.getConnection(); Assert.assertTrue(isTimeoutSet); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org