From daf79f94cf010c77aadfc205575debc6e6a1f42e Mon Sep 17 00:00:00 2001 From: Siddharth Srinivasan Date: Wed, 30 Oct 2024 08:45:37 +0530 Subject: [PATCH] Fix MacOS tests failures in java.hints The javac outputs of the following tests in java/java.hints ErrorHintsProviderTest were updated for non-mac OSes due to changes in JDK 7 updates: - testShortErrors5: [jdk-6968793](https://github.com/openjdk/jdk/commit/b77effad6c6) - testTestShortErrorsSVUIDWarning: [jdk-6957438](https://github.com/openjdk/jdk/commit/1c75e97108) Since Apple JDK was present only up till JDK 6, we no longer require the special case for MacOS since JDK 8. Thus, making the test argument value `specialMacTreatment = false` for these two tests, and renaming the corresponding goldenfiles from "-nonmac.pass" suffix to ".pass" suffix. Signed-off-by: Siddharth Srinivasan --- .../ErrorHintsProviderTest/testShortErrors5-nonmac.pass | 3 --- .../ErrorHintsProviderTest/testShortErrors5.pass | 4 +++- .../testTestShortErrorsSVUIDWarning-nonmac.pass | 1 - .../testTestShortErrorsSVUIDWarning.pass | 2 +- .../java/hints/infrastructure/ErrorHintsProviderTest.java | 4 ++-- 5 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testShortErrors5-nonmac.pass delete mode 100644 java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testTestShortErrorsSVUIDWarning-nonmac.pass diff --git a/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testShortErrors5-nonmac.pass b/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testShortErrors5-nonmac.pass deleted file mode 100644 index 6564d61694f4..000000000000 --- a/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testShortErrors5-nonmac.pass +++ /dev/null @@ -1,3 +0,0 @@ -5:8-5:14:error:cannot find symbol - symbol:method create() - location:class TestShortErrors5 diff --git a/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testShortErrors5.pass b/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testShortErrors5.pass index a040a93300df..6564d61694f4 100644 --- a/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testShortErrors5.pass +++ b/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testShortErrors5.pass @@ -1 +1,3 @@ -5:8-5:14:error:compiler message file broken:key=compiler.err.cant.resolve.location.args arguments=method, create, , , class, javahints.TestShortErrors5, {6}, {7} +5:8-5:14:error:cannot find symbol + symbol:method create() + location:class TestShortErrors5 diff --git a/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testTestShortErrorsSVUIDWarning-nonmac.pass b/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testTestShortErrorsSVUIDWarning-nonmac.pass deleted file mode 100644 index a04bd4bb6bc3..000000000000 --- a/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testTestShortErrorsSVUIDWarning-nonmac.pass +++ /dev/null @@ -1 +0,0 @@ -2:13-2:40:warning:[serial] serializable class TestShortErrorsSVUIDWarning has no definition of serialVersionUID diff --git a/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testTestShortErrorsSVUIDWarning.pass b/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testTestShortErrorsSVUIDWarning.pass index 24348a1a6a23..a04bd4bb6bc3 100644 --- a/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testTestShortErrorsSVUIDWarning.pass +++ b/java/java.hints/test/unit/data/goldenfiles/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest/testTestShortErrorsSVUIDWarning.pass @@ -1 +1 @@ -2:13-2:40:warning:serializable class javahints.TestShortErrorsSVUIDWarning has no definition of serialVersionUID +2:13-2:40:warning:[serial] serializable class TestShortErrorsSVUIDWarning has no definition of serialVersionUID diff --git a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest.java b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest.java index f173387f11f7..de225bbab0d4 100644 --- a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest.java +++ b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProviderTest.java @@ -180,7 +180,7 @@ public void testShortErrors4() throws Exception { } public void testShortErrors5() throws Exception { - performTest("TestShortErrors5", true); + performTest("TestShortErrors5", false); } public void testShortErrors6() throws Exception { @@ -228,7 +228,7 @@ public void testTestShortErrorsSVUIDWarning() throws Exception { TestCompilerSettings.commandLine = "-Xlint:serial"; try { - performTest("TestShortErrorsSVUIDWarning", true); + performTest("TestShortErrorsSVUIDWarning", false); } finally { TestCompilerSettings.commandLine = null; }