From e62e7133938d09ab2b21b114a830637fb26eecf5 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Thu, 3 Dec 2020 14:18:15 +0200 Subject: [PATCH] fix string comparison --- .../com/baeldung/jvmbitversion/JVMBitVersionUnitTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/java-native/src/test/java/com/baeldung/jvmbitversion/JVMBitVersionUnitTest.java b/java-native/src/test/java/com/baeldung/jvmbitversion/JVMBitVersionUnitTest.java index 152008e5e2..35357dec77 100644 --- a/java-native/src/test/java/com/baeldung/jvmbitversion/JVMBitVersionUnitTest.java +++ b/java-native/src/test/java/com/baeldung/jvmbitversion/JVMBitVersionUnitTest.java @@ -5,7 +5,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.Before; import org.junit.Test; -import com.baeldung.jvmbitversion.JVMBitVersion; import com.sun.jna.Platform; public class JVMBitVersionUnitTest { @@ -19,9 +18,9 @@ public class JVMBitVersionUnitTest { @Test public void whenUsingSystemClass_thenOutputIsAsExpected() { - if (System.getProperty("sun.arch.data.model") == "64") { + if ("64".equals(System.getProperty("sun.arch.data.model"))) { assertEquals("64-bit", jvmVersion.getUsingSystemClass()); - } else if (System.getProperty("sun.arch.data.model") == "32") { + } else if ("32".equals(System.getProperty("sun.arch.data.model"))) { assertEquals("32-bit", jvmVersion.getUsingSystemClass()); } }