Skip to content

Commit

Permalink
Move NPE check to factory method
Browse files Browse the repository at this point in the history
  • Loading branch information
fabri1983 committed Sep 22, 2019
1 parent b4257a9 commit def3b7f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
16 changes: 0 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,29 +89,13 @@
<artifactId>powermock-api-easymock</artifactId>
<version>2.0.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
</exclusion>
<exclusion>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>4.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public static IEnhancedJobLogger newFileJobLogger(File file) {
}

public static IEnhancedJobLogger newDatabaseJobLogger(Connection connection) {
if (connection == null) {
throw new JobLoggerException(JobLoggerExceptionMessage.CONNECTION_IS_MISSING);
}
return new DatabaseJobLogger(connection);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ public DatabaseJobLogger(Connection connection) {
}

protected void validateConnection(Connection connection) {
if (connection == null) {
throw new JobLoggerException(JobLoggerExceptionMessage.CONNECTION_IS_MISSING);
}
try {
if (connection.isClosed()) {
throw new JobLoggerException(JobLoggerExceptionMessage.CONNECTION_IS_CLOSED);
Expand Down

0 comments on commit def3b7f

Please sign in to comment.