Much nicer. Thanks for the tip.
http://cr.openjdk.java.net/~jjg/8222669/webrev.02/
-- Jon
On 04/19/2019 07:17 AM, Jonathan Gibbons wrote:
Just "ignorance". I didn't know that one existed. I will update. Thanks!
-- Jon
On 4/19/19 5:58 AM, Hannes Wallnöfer wrote:
Looks good.
In escapeHtmlChars(CharSequence) is there a reason for casting to
String to use String::substring vs. using CharSequence::subSequence?
Hannes
Am 19.04.2019 um 02:13 schrieb Jonathan Gibbons
<[email protected]>:
On 04/18/2019 07:33 AM, Jonathan Gibbons wrote:
The only suggestion I have is that there are three almost
identical pieces of code that escape a String to a StringBuilder.
It would be nice to factor that out into a shared method somewhere.
Yes, I was aware of that when I was modifying the code. The code
is not quite identical, but now that you make me look at it again,
I can see how to make it happen. That will be a nice addition to
this cleanup. Thanks for pointing this out.
There's no one great place to put the shared code, which is mostly
why it hadn't been shared before.
But the new Entity class is not a bad place, and so I introduced new
shared code as static methods there, and updated StringContent.java,
FixedStringContent and HtmlTree.java accordingly. No other changes
to any other files.
New webrev: http://cr.openjdk.java.net/~jjg/8222669/webrev.00/
-- Jon