Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DispatchingTest.test_headers_forward fails on Java 18 #11

Closed
iloveeclipse opened this issue Apr 5, 2022 · 2 comments
Closed

DispatchingTest.test_headers_forward fails on Java 18 #11

iloveeclipse opened this issue Apr 5, 2022 · 2 comments

Comments

@iloveeclipse
Copy link
Member

iloveeclipse commented Apr 5, 2022

https://download.eclipse.org/eclipse/downloads/drops4/I20220404-1800/testresults/html/org.eclipse.equinox.http.servlet.tests_ep424I-unit-cen64-gtk3-java18_linux.gtk.x86_64_18.html

expected:<foo=ba[z]> but was:<foo=ba[r]>

org.junit.ComparisonFailure: expected:<foo=ba[z]> but was:<foo=ba[r]>
at org.junit.Assert.assertEquals(Assert.java:117)
at org.junit.Assert.assertEquals(Assert.java:146)
at org.eclipse.equinox.http.servlet.tests.DispatchingTest.test_headers_forward(DispatchingTest.java:1411)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)

I can reproduce it locally, it fails only with Java 18.
The response object contains both cookies from first and second servlet, and the expected one is now on the second place: Set-Cookie=[foo=bar, foo=baz].

@tjwatson : I have no clue who generates the response, but the order is wrong on Java 18.

@tjwatson tjwatson transferred this issue from eclipse-equinox/equinox.framework Apr 5, 2022
@tjwatson
Copy link
Contributor

The issue is what appears to be a change in how java.net.URLConnection.getHeaderFields() behaves. In < Java 18 the header list gets reversed. The source leads to the method

sun.net.www.MessageHeader.filterAndAddHeaders

In < Java 18 this did a reverse list processing of the keys, now it does a forward list processing. The result is the value list is in the reverse order that it has been for all < Java 18 versions.

I'm not sure why they changed this order here (intentional or not).

@laeubi laeubi transferred this issue from eclipse-equinox/equinox.bundles Jun 16, 2022
@akurtakov
Copy link
Member

This is fixed in the referenced commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants