On Wed, Jan 14, 2009 at 1:36 PM, <s...@apache.org> wrote: > Author: sebb > Date: Wed Jan 14 10:36:07 2009 > New Revision: 734473 > > URL: http://svn.apache.org/viewvc?rev=734473&view=rev > Log: > Make non-private static fields final <snip/>
Note that the above breaks binary and source compatibility. Therefore, at the least, such changes deserve notable mentions in the release notes and often additional thought about the version number of the next release. -Rahul > Replace deprecated SQLNestedException with equivalent code > > Modified: > > commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDriver.java > > commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterDriver.java > > Modified: > commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDriver.java > URL: > http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDriver.java?rev=734473&r1=734472&r2=734473&view=diff > ============================================================================== > --- > commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDriver.java > (original) > +++ > commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDriver.java > Wed Jan 14 10:36:07 2009 > @@ -59,7 +59,7 @@ > } > > /** The map of registered pools. */ > - protected static HashMap _pools = new HashMap(); > + protected static final HashMap _pools = new HashMap(); > > /** Controls access to the underlying connection */ > private static boolean accessToUnderlyingConnectionAllowed = false; > @@ -112,10 +112,10 @@ > jocl = JOCLContentHandler.parse(in); > } > catch (SAXException e) { > - throw new SQLNestedException("Could not parse > configuration file", e); > + throw (SQLException) new SQLException("Could not parse > configuration file").initCause(e); > } > catch (IOException e) { > - throw new SQLNestedException("Could not load > configuration file", e); > + throw (SQLException) new SQLException("Could not load > configuration file").initCause(e); > } > if(jocl.getType(0).equals(String.class)) { > pool = getPool((String)(jocl.getValue(0))); > @@ -148,7 +148,7 @@ > pool.close(); > } > catch (Exception e) { > - throw new SQLNestedException("Error closing pool " + name, > e); > + throw (SQLException) new SQLException("Error closing pool " > + name).initCause(e); > } > } > } > @@ -181,11 +181,11 @@ > } catch(SQLException e) { > throw e; > } catch(NoSuchElementException e) { > - throw new SQLNestedException("Cannot get a connection, > pool error: " + e.getMessage(), e); > + throw (SQLException) new SQLException("Cannot get a > connection, pool error: " + e.getMessage()).initCause(e); > } catch(RuntimeException e) { > throw e; > } catch(Exception e) { > - throw new SQLNestedException("Cannot get a connection, > general error: " + e.getMessage(), e); > + throw (SQLException) new SQLException("Cannot get a > connection, general error: " + e.getMessage()).initCause(e); > } > } > } else { > @@ -236,12 +236,12 @@ > } > > /** My URL prefix */ > - protected static String URL_PREFIX = "jdbc:apache:commons:dbcp:"; > - protected static int URL_PREFIX_LEN = URL_PREFIX.length(); > + protected static final String URL_PREFIX = "jdbc:apache:commons:dbcp:"; > + protected static final int URL_PREFIX_LEN = URL_PREFIX.length(); > > // version numbers > - protected static int MAJOR_VERSION = 1; > - protected static int MINOR_VERSION = 0; > + protected static final int MAJOR_VERSION = 1; > + protected static final int MINOR_VERSION = 0; > > /** > * PoolGuardConnectionWrapper is a Connection wrapper that makes sure a > > Modified: > commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterDriver.java > URL: > http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterDriver.java?rev=734473&r1=734472&r2=734473&view=diff > ============================================================================== > --- > commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterDriver.java > (original) > +++ > commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterDriver.java > Wed Jan 14 10:36:07 2009 > @@ -116,10 +116,10 @@ > return new DriverPropertyInfo[0]; > } > > - protected static String CONNECT_STRING = > "jdbc:apache:commons:testdriver"; > + protected static final String CONNECT_STRING = > "jdbc:apache:commons:testdriver"; > > // version numbers > - protected static int MAJOR_VERSION = 1; > - protected static int MINOR_VERSION = 0; > + protected static final int MAJOR_VERSION = 1; > + protected static final int MINOR_VERSION = 0; > > } > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org