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

Jetty 12 - General cleanup of URIUtil #8861

Merged
merged 9 commits into from
Nov 4, 2022

Conversation

joakime
Copy link
Contributor

@joakime 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
+ collapse separate methods
+ tag methods only used in URIUtilTest
@joakime joakime requested a review from sbordet November 3, 2022 19:22
Copy link
Contributor

@sbordet sbordet left a 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}

+ simplify encodePath()
@joakime joakime requested a review from sbordet November 4, 2022 14:17
// control characters
ENCODE_PATH_NEEDS_ENCODING[0x7f] = true;
for (int i = 0; i < 0x20; i++)
ENCODE_PATH_NEEDS_ENCODING[i] = true;
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

}
}
}

// Only URIUtil is using this method
// Only used by URIUtil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it private then.

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it private then.

Copy link
Contributor Author

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.

Copy link
Contributor

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*.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

@joakime joakime requested a review from sbordet November 4, 2022 17:24
@joakime joakime merged commit b3505ae into jetty-12.0.x Nov 4, 2022
@joakime joakime deleted the fix/jetty-12-remove-uriutil.charset branch November 4, 2022 19:28
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

Successfully merging this pull request may close these issues.

3 participants