Skip to content

Commit

Permalink
Fix embedded server to handle null outputDir and userDir
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylking committed Jun 28, 2019
1 parent 0bb53e1 commit 5141c38
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/java/net/wasdev/wlp/ant/types/EmbeddedServerInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,16 @@ public File getOutputDir() {

public boolean equals(EmbeddedServerInfo info) {
return
this.serverName.equals(info.serverName)
&& this.userDir.getAbsolutePath().equals(info.userDir.getAbsolutePath())
&& this.outputDir.getAbsolutePath().equals(info.outputDir.getAbsolutePath());
this.serverName.equals(info.serverName) &&
areFilesEqual(this.userDir, info.userDir) &&
areFilesEqual(this.outputDir, info.outputDir);
}

private boolean areFilesEqual(File file1, File file2) {
if (file1 != null && file2 != null) {
return file1.getAbsolutePath().equals(file2.getAbsolutePath());
}
return (file1 == null && file2 == null);
}

public static class EmbeddedServers {
Expand Down

0 comments on commit 5141c38

Please sign in to comment.