-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix contains in HttpFields name set and prove random access to HttpFields via EnumMap not worth it. #11846
Fix contains in HttpFields name set and prove random access to HttpFields via EnumMap not worth it. #11846
Conversation
Fix #11811 with javadoc and an optional random access implementation.
@sbordet @lachlan-roberts @lorban review please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost LGTM. I would just like to see some checks for the iterator.
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
Show resolved
Hide resolved
jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldsTest.java
Show resolved
Hide resolved
jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldsTest.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
Outdated
Show resolved
Hide resolved
Fix #11811 with javadoc and an optional random access implementation.
I have removed the random access class, but there are some other minor fixes in this PR (for contains checks in name sets). Also some javadoc improvements and the JMH test to show that even enumMap doesn't help. |
This is an experiment towards fix #11811 with regards to the extra comments received on #11823
It provides an optional random access implementation and fixes the issue that the name set returned is not case sensitive.
Another approach could be to always create the EnumMap when an immutable HttpFields is created and only do the iteration lookup on fields that are not known HttpHeaders