Skip to content

Commit

Permalink
test: Clean up throws clauses in TestUtil
Browse files Browse the repository at this point in the history
Restricts throws clauses in TestUtil to SQLException rather than a
more broad Exception and removes throws clause from initDriver().
  • Loading branch information
sehrope committed Dec 4, 2018
1 parent af5895e commit 590823d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pgjdbc/src/test/java/org/postgresql/test/TestUtil.java
Expand Up @@ -242,7 +242,7 @@ public static Properties loadPropertyFiles(String... names) {
return p;
}

public static void initDriver() throws Exception {
public static void initDriver() {
synchronized (TestUtil.class) {
if (initialized) {
return;
Expand Down Expand Up @@ -281,7 +281,7 @@ public static File getFile(String name) {
* @return connection using a privileged user mostly for tests that the ability to load C
* functions now as of 4/14
*/
public static Connection openPrivilegedDB() throws Exception {
public static Connection openPrivilegedDB() throws SQLException {
initDriver();
Properties properties = new Properties();
properties.setProperty("user", getPrivilegedUser());
Expand All @@ -295,15 +295,15 @@ public static Connection openPrivilegedDB() throws Exception {
*
* @return connection
*/
public static Connection openDB() throws Exception {
public static Connection openDB() throws SQLException {
return openDB(new Properties());
}

/*
* Helper - opens a connection with the allowance for passing additional parameters, like
* "compatible".
*/
public static Connection openDB(Properties props) throws Exception {
public static Connection openDB(Properties props) throws SQLException {
initDriver();

// Allow properties to override the user name.
Expand Down

0 comments on commit 590823d

Please sign in to comment.