Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=47577
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 30 Jul 2009 18:29:30 +0000 (18:29 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 30 Jul 2009 18:29:30 +0000 (18:29 +0000)
Imports / casts

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@799400 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPoolMBean.java

index baf6a4e..42046ec 100644 (file)
@@ -161,7 +161,7 @@ public class ConnectionPool {
      */
     public Connection getConnection() throws SQLException {
         //check out a connection
-        PooledConnection con = (PooledConnection)borrowConnection(-1);
+        PooledConnection con = borrowConnection(-1);
         return setupConnection(con);
     }
 
@@ -770,9 +770,9 @@ public class ConnectionPool {
      */
     protected boolean shouldAbandon() {
         if (poolProperties.getAbandonWhenPercentageFull()==0) return true;
-        float used = (float)busy.size();
-        float max  = (float)poolProperties.getMaxActive();
-        float perc = (float)poolProperties.getAbandonWhenPercentageFull();
+        float used = busy.size();
+        float max  = poolProperties.getMaxActive();
+        float perc = poolProperties.getAbandonWhenPercentageFull();
         return (used/max*100f)>=perc;
     }
     
index 8d5092e..7632d37 100644 (file)
@@ -15,8 +15,6 @@
  */
 package org.apache.tomcat.jdbc.pool.jmx;
 
-import java.util.Properties;
-
 import org.apache.tomcat.jdbc.pool.PoolConfiguration;
 
 public interface ConnectionPoolMBean extends PoolConfiguration  {