You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/01/11 16:07:16 UTC
[commons-io] 01/02: Fix NPE compiler warning by short circuit.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
commit ffb46b826ae5aa82fcc337133e758dca4d5b2dd1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jan 11 10:59:28 2021 -0500
Fix NPE compiler warning by short circuit.
---
src/main/java/org/apache/commons/io/file/PathUtils.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/file/PathUtils.java b/src/main/java/org/apache/commons/io/file/PathUtils.java
index 3a2fb69..fc53109 100644
--- a/src/main/java/org/apache/commons/io/file/PathUtils.java
+++ b/src/main/java/org/apache/commons/io/file/PathUtils.java
@@ -525,7 +525,7 @@ public final class PathUtils {
if (path1 == null && path2 == null) {
return true;
}
- if (path1 == null ^ path2 == null) {
+ if (path1 == null || path2 == null) {
return false;
}
if (!Files.exists(path1) && !Files.exists(path2)) {
@@ -621,7 +621,7 @@ public final class PathUtils {
if (path1 == null && path2 == null) {
return true;
}
- if (path1 == null ^ path2 == null) {
+ if (path1 == null || path2 == null) {
return false;
}
final Path nPath1 = path1.normalize();