]> source.dussan.org Git - jgit.git/commitdiff
WinPipeConnector: Resolve warnings by using "equals" instead of "==" 10/191410/5
authorFabio Ponciroli <ponch78@gmail.com>
Thu, 3 Mar 2022 16:27:25 +0000 (17:27 +0100)
committerFabio Ponciroli <ponch78@gmail.com>
Thu, 17 Mar 2022 21:03:16 +0000 (16:03 -0500)
Errorprone raises the following warning: "[ReferenceEquality] Comparison
using reference equality instead of value equality".

Change-Id: Ic73305b2af628f66e7659ea1b839b3a640e3cd8d

org.eclipse.jgit.ssh.apache.agent/src/org/eclipse/jgit/internal/transport/sshd/agent/connector/WinPipeConnector.java

index 7bad90f24f3a7910999928e17ecc83f0d973d803..81c653722f57950624031c0a425545e0aa3d2d44 100644 (file)
@@ -90,7 +90,7 @@ public class WinPipeConnector extends AbstractConnector {
                        file = libs.kernel.CreateFile(pipeName,
                                        WinNT.GENERIC_READ | WinNT.GENERIC_WRITE, FILE_SHARE_NONE,
                                        null, WinNT.OPEN_EXISTING, FILE_ATTRIBUTE_NONE, null);
-                       if (file == null || file == WinBase.INVALID_HANDLE_VALUE) {
+                       if (file == null || WinBase.INVALID_HANDLE_VALUE.equals(file)) {
                                int errorCode = libs.kernel.GetLastError();
                                if (errorCode == WinError.ERROR_FILE_NOT_FOUND
                                                && CANONICAL_PIPE_NAME.equalsIgnoreCase(pipeName)) {