eclipse-jdt / eclipse.jdt.core

Eclipse Public License 2.0
141 stars 107 forks source link

[Win32] JavaSearchIssue190Test & JavaSearchTests.testExternalFolder2 fail since I20240507-0220 #2439

Closed iloveeclipse closed 2 weeks ago

iloveeclipse commented 2 weeks ago

This seem to be regression from https://github.com/eclipse-jdt/eclipse.jdt.core/pull/227.

On Windows only, JavaSearchIssue190Test & JavaSearchTests.testExternalFolder2 fail since I20240507-0220 (I believe they are failing since I20240503-1800 but I don't have the results anymore).

See latest build: https://download.eclipse.org/eclipse/downloads/drops4/I20240512-1800/testresults/html/org.eclipse.jdt.core.tests.model_ep432I-unit-win32-java17_win32.win32.x86_64_17.html

Searched class not found in external classpath container

junit.framework.AssertionFailedError: Searched class not found in external classpath container
at junit.framework.Assert.fail(Assert.java:57)
at junit.framework.Assert.assertTrue(Assert.java:22)
at junit.framework.TestCase.assertTrue(TestCase.java:192)
at org.eclipse.jdt.core.tests.model.JavaSearchIssue190Test.testIssue190(JavaSearchIssue190Test.java:95)
Unexpected search results. ----------- Expected ------------ ExternalType (not open) [in ExternalType.class [in p [in C:\Users\genie.releng\workspace\AutomatedTests\ep432I-unit-win32-java17\workarea\I20240512-1800\eclipse-testing\test-eclipse\eclipse\jdt_model_folder\externalLib]]] ------------ but was ------------ ---------------------- ---------- expected:<[ExternalType (not open) [in ExternalType.class [in p [in C:\Users\genie.releng\workspace\AutomatedTests\ep432I-unit-win32-java17\workarea\I20240512-1800\eclipse-testing\test-eclipse\eclipse\jdt_model_folder\externalLib]]]]> but was:<[]>

junit.framework.ComparisonFailure: Unexpected search results.
----------- Expected ------------
ExternalType (not open) [in ExternalType.class [in p [in C:\Users\genie.releng\workspace\AutomatedTests\ep432I-unit-win32-java17\workarea\I20240512-1800\eclipse-testing\test-eclipse\eclipse\jdt_model_folder\externalLib]]]
------------ but was ------------

---------------------- ----------
expected:<[ExternalType (not open) [in ExternalType.class [in p [in C:\Users\genie.releng\workspace\AutomatedTests\ep432I-unit-win32-java17\workarea\I20240512-1800\eclipse-testing\test-eclipse\eclipse\jdt_model_folder\externalLib]]]]> but was:<[]>
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:267)
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:242)
at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertSearchResults(AbstractJavaModelTests.java:677)
at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertSearchResults(AbstractJavaModelTests.java:663)
at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertSearchResults(AbstractJavaModelTests.java:660)
at org.eclipse.jdt.core.tests.model.JavaSearchTests.testExternalFolder2(JavaSearchTests.java:646)
jukzi commented 2 weeks ago

it is locally reproducible and reverting dbdb5c499cb36b9b72d04db14e7afa91d8357693 solves JavaSearchTests.testExternalFolder2

iloveeclipse commented 2 weeks ago

OK, it's Windows specific issue because in org.eclipse.jdt.internal.core.search.JavaSearchScope.getPath(IJavaElement, boolean) the container search paths are always concatenated with forward slash, even if the rest of the code happily uses both toString() and toOSString()...

I will push a fix for this concrete case.