-
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
Jetty 12 - General cleanup of URIUtil #8861
Conversation
joakime
commented
Nov 3, 2022
- Removal of __CHARSET
- Removal of unused methods
- Using new switch/case concepts
+ Removal of __CHARSET + Removal of unused methods + Using new switch/case concepts
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
Outdated
Show resolved
Hide resolved
+ collapse separate methods + tag methods only used in URIUtilTest
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.
Also all the javadocs <code>
should be converted to {@code}
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
Outdated
Show resolved
Hide resolved
+ simplify encodePath()
// control characters | ||
ENCODE_PATH_NEEDS_ENCODING[0x7f] = true; | ||
for (int i = 0; i < 0x20; i++) | ||
ENCODE_PATH_NEEDS_ENCODING[i] = true; |
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.
I believe SPACE 0x20 should be encoded too.
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.
Already covered in the special chars above
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.
added testcase specific for this to show it's protected
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
} | ||
|
||
// Only URIUtil is using this method | ||
// Only used by URIUtil |
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.
Make it private then.
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.
Can't make it private, as it's tested in URIUtilTest.
And protected isn't valid.
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.
Then the comment is wrong, should be Only used by URIUtil*Test*.
@@ -1622,6 +1465,7 @@ static boolean equalsIgnoreEncodings(String uriA, String uriB) | |||
} | |||
} | |||
|
|||
// Only used by URIUtil |
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.
Make it private then.
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.
Can't make it private, as it's tested in URIUtilTest.
And protected isn't valid.
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.
Then the comment is wrong, should be Only used by URIUtil*Test*.
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.
It's used by URIUtil as a sub-method, and that sub-method is tested in URIUtilTest, it's not exposed to others.
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.
Went ahead and cleaned it out