On Tue, 25 Mar 2025 08:33:57 GMT, Eirik Bjørsnøs <eir...@openjdk.org> wrote:

> Please help review this cleanup PR which makes the 
> `java.net.JarURLConnection` fields `jarFileURL` and `entryName` final.
> 
> The current `parseSpec` method is somewhat crufty, with some code quality  
> issues which this PR aims to improve:
> 
> * The method-level comment seems stale and misplaced
> * The local variable  `separator` is confusingly incremented during parsing 
> (using pre AND post increment operators) 
> * Unused local variables introduced for the sole purpose of attaching 
> `@SuppressWarnings` annotations
> * The `jarFileURL` and `entryName` fields are both assigned more than once
> * Block comments are used where line comments would suffice
> 
> The PR addresses the above issues by inlining `parseSpec` into the 
> constructor, then extracting static helper methods for parsing the file URL 
> and the entry name. This allows the fields to be made final.
> 
> Since this is purely a refactoring PR, no tests are updated and the 
> `noreg-cleanup` label is added in JBS.
> 
> Reviewing individual commits in this PR may aid verification of separate 
> refactorings.

This pull request has now been integrated.

Changeset: 1a8c8e07
Author:    Eirik Bjørsnøs <eir...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/1a8c8e07fee33861d348f7b41fea0e3fd5bbc0af
Stats:     58 lines in 1 file changed: 32 ins; 10 del; 16 mod

8352858: Make java.net.JarURLConnection fields final

Reviewed-by: jpai, dfuchs

-------------

PR: https://git.openjdk.org/jdk/pull/24218

Reply via email to