Please review this PR which applies various cleanups to `sun.net.www.protocol.file.FileURLConnection`.
This class is known to be an _old, intricate, and hard to maintain piece of code._ However, there are some relatively straightforward refactorings / cleanups possible which improve readability and makes it easier to reason about what's going on in this class. In this PR, I have chosen to make each individual small change a separate commit. This to assist review of each individual change, which can otherwise disappear a bit when reviewing the PR as a whole. A detailed listing of each commit follows in a separate comment. This is a pure cleanup PR, no tests are added or updated in this PR. ------------- Commit messages: - Use enhanced for loop when constructing directory list - Avoid explicit type parameter when calling Arrays::asList - Update copyright year - Remove unused local variables in getInputStream - Make instance fields private - Reorder instance fields - Remove unneccessary catch/rethrow of IOException - Remove contentType field - Rename files field to directoryListing - Make file field final - ... and 1 more: https://git.openjdk.org/jdk/compare/4bc826ac...f9efa3b8 Changes: https://git.openjdk.org/jdk/pull/22459/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22459&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345249 Stats: 38 lines in 1 file changed: 2 ins; 13 del; 23 mod Patch: https://git.openjdk.org/jdk/pull/22459.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22459/head:pull/22459 PR: https://git.openjdk.org/jdk/pull/22459