commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgra...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/test/org/apache/commons/dbcp TesterDriver.java
Date Tue, 15 Apr 2003 23:34:34 GMT
dgraham     2003/04/15 16:34:34

  Modified:    dbcp/src/test/org/apache/commons/dbcp TesterDriver.java
  Log:
  Simplified some method implementations.
  
  Revision  Changes    Path
  1.2       +10 -14    jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterDriver.java
  
  Index: TesterDriver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterDriver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TesterDriver.java	14 Apr 2001 17:16:29 -0000	1.1
  +++ TesterDriver.java	15 Apr 2003 23:34:34 -0000	1.2
  @@ -7,7 +7,7 @@
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -61,7 +61,11 @@
   
   package org.apache.commons.dbcp;
   
  -import java.sql.*;
  +import java.sql.Connection;
  +import java.sql.Driver;
  +import java.sql.DriverManager;
  +import java.sql.DriverPropertyInfo;
  +import java.sql.SQLException;
   import java.util.Properties;
   
   public class TesterDriver implements Driver {
  @@ -73,19 +77,11 @@
       }
   
       public boolean acceptsURL(String url) throws SQLException {
  -        try {
  -            return url.equals(CONNECT_STRING);
  -        } catch(NullPointerException e) {
  -            return false;
  -        }
  +        return CONNECT_STRING.equals(url);
       }
   
       public Connection connect(String url, Properties info) throws SQLException {
  -        if(acceptsURL(url)) {
  -            return new TesterConnection();
  -        } else {
  -            return null;
  -        }
  +        return (acceptsURL(url) ? new TesterConnection() : null);
       }
   
       public int getMajorVersion() {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message