commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1563924 - in /commons/proper/dbcp/trunk/src: changes/changes.xml main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
Date Mon, 03 Feb 2014 14:41:07 GMT
Author: markt
Date: Mon Feb  3 14:41:06 2014
New Revision: 1563924

URL: http://svn.apache.org/r1563924
Log:
Return BasicDataSource rather than DataSource from BasicDataSourceFactory so a cast is not
required to use BasicDataSource specific methods.

Modified:
    commons/proper/dbcp/trunk/src/changes/changes.xml
    commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
    commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java

Modified: commons/proper/dbcp/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/changes/changes.xml?rev=1563924&r1=1563923&r2=1563924&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/changes/changes.xml (original)
+++ commons/proper/dbcp/trunk/src/changes/changes.xml Mon Feb  3 14:41:06 2014
@@ -107,6 +107,11 @@ The <action> type attribute can be add,u
       <action dev="markt" issue="DBCP-404" type="fix">
         Make all mutable fields private.
       </action>
+      <action dev="markt" issue="DBCP-364" type="fix">
+        Return BasicDataSource rather than DataSource from
+        BasicDataSourceFactory so a cast is not required to use BasicDataSource
+        specific methods.
+      </action>
     </release>
     <release version="1.5.1" date="TBD" description="TBD">
       <action dev="markt" issue="DBCP-400" type="fix">

Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java?rev=1563924&r1=1563923&r2=1563924&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
Mon Feb  3 14:41:06 2014
@@ -32,7 +32,6 @@ import javax.naming.Name;
 import javax.naming.RefAddr;
 import javax.naming.Reference;
 import javax.naming.spi.ObjectFactory;
-import javax.sql.DataSource;
 
 /**
  * <p>JNDI object factory that creates an instance of
@@ -182,7 +181,7 @@ public class BasicDataSourceFactory impl
      * @param properties the datasource configuration properties
      * @throws Exception if an error occurs creating the data source
      */
-    public static DataSource createDataSource(Properties properties) throws Exception {
+    public static BasicDataSource createDataSource(Properties properties) throws Exception
{
         BasicDataSource dataSource = new BasicDataSource();
         String value = null;
 

Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java?rev=1563924&r1=1563923&r2=1563924&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
Mon Feb  3 14:41:06 2014
@@ -82,7 +82,7 @@ public class TestBasicDataSourceFactory 
         properties.setProperty("maxOpenPreparedStatements", "10");
         properties.setProperty("lifo", "true");
 
-        BasicDataSource ds = (BasicDataSource) BasicDataSourceFactory.createDataSource(properties);
+        BasicDataSource ds = BasicDataSourceFactory.createDataSource(properties);
 
         assertEquals("org.apache.commons.dbcp2.TesterDriver", ds.getDriverClassName());
         assertEquals("jdbc:apache:commons:testdriver", ds.getUrl());



Mime
View raw message