> 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.
Eirik Bjørsnøs has updated the pull request incrementally with one additional commit since the last revision: Rename 'separator' to 'separatorIndex', 'nameIdx' to 'nameIndex' ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24218/files - new: https://git.openjdk.org/jdk/pull/24218/files/1f9fc452..ddcb18d9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24218&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24218&range=00-01 Stats: 12 lines in 1 file changed: 0 ins; 0 del; 12 mod Patch: https://git.openjdk.org/jdk/pull/24218.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24218/head:pull/24218 PR: https://git.openjdk.org/jdk/pull/24218