RFR: 8300176: URLEncoder/URLDecoder static fields should be private static final [v2]
Darragh Clarke
duke at openjdk.org
Wed Jan 25 14:57:38 UTC 2023
On Wed, 25 Jan 2023 14:53:19 GMT, Darragh Clarke <duke at openjdk.org> wrote:
>> Made the `static` fields `private static final`, updated the naming as well to reflect this.
>>
>> This meant I updated `URLDecoder` to set the `DEFAULT_ENCODING_NAME` itself since it had been previously getting it from `URLEncoder`.
>>
>> Since these fields are only referenced from inside the classes nothing else needed updated
>
> Darragh Clarke has updated the pull request incrementally with three additional commits since the last revision:
>
> - reduced bitset to 128 bits
> - formatting
> - implemented feedback from PR
I pushed changes there based on the comments, and to touch on some points brought up
Personally I'd prefer to keep `DEFAULT_ENCODING_NAME` just for readability, though I'm not incredibly pushed on that if folk think it'd be better to just replace its usages with a direct call.
And as for testing, I ran some benchmarks on my local machine that did show a speed up after the changes, but this was my first time using JMH so I was wondering if you have any pointers @cl4es as to what settings/how many iterations should I run before I can be confident in any results it gives?
-------------
PR: https://git.openjdk.org/jdk/pull/12122
More information about the net-dev
mailing list