Skip to content

8277983: Remove unused fields from sun.net.www.protocol.jar.JarURLConnection#6649

Closed
stsypanov wants to merge 2 commits intoopenjdk:masterfrom
stsypanov:jar-url-connection
Closed

8277983: Remove unused fields from sun.net.www.protocol.jar.JarURLConnection#6649
stsypanov wants to merge 2 commits intoopenjdk:masterfrom
stsypanov:jar-url-connection

Conversation

@stsypanov
Copy link
Contributor

@stsypanov stsypanov commented Dec 1, 2021

There are some fields that are unused in current implementation of JarURLConnection:

  • debug
  • jarFileURL
  • permission
  • jarFileURLConnection (inherited one can be used)
  • entryName (can be taken from super-class)

They can be safely removed reducing object footprint. Before:

sun.net.www.protocol.jar.JarURLConnection object internals:
 OFFSET  SIZE                        TYPE DESCRIPTION                               VALUE
      0    12                             (object header)                           N/A
     12     4                         int URLConnection.connectTimeout              N/A
     16     8                        long URLConnection.ifModifiedSince             N/A
     24     4                         int URLConnection.readTimeout                 N/A
     28     1                     boolean URLConnection.doInput                     N/A
     29     1                     boolean URLConnection.doOutput                    N/A
     30     1                     boolean URLConnection.allowUserInteraction        N/A
     31     1                     boolean URLConnection.useCaches                   N/A
     32     1                     boolean URLConnection.connected                   N/A
     33     3                             (alignment/padding gap)                  
     36     4                java.net.URL URLConnection.url                         N/A
     40     4   sun.net.www.MessageHeader URLConnection.requests                    N/A
     44     4                java.net.URL JarURLConnection.jarFileURL               N/A
     48     4            java.lang.String JarURLConnection.entryName                N/A
     52     4      java.net.URLConnection JarURLConnection.jarFileURLConnection     N/A
     56     4                java.net.URL JarURLConnection.jarFileURL               N/A
     60     4    java.security.Permission JarURLConnection.permission               N/A
     64     4      java.net.URLConnection JarURLConnection.jarFileURLConnection     N/A
     68     4            java.lang.String JarURLConnection.entryName                N/A
     72     4      java.util.jar.JarEntry JarURLConnection.jarEntry                 N/A
     76     4       java.util.jar.JarFile JarURLConnection.jarFile                  N/A
     80     4            java.lang.String JarURLConnection.contentType              N/A
     84     4                             (loss due to the next object alignment)
Instance size: 88 bytes
Space losses: 3 bytes internal + 4 bytes external = 7 bytes total

After:

sun.net.www.protocol.jar.JarURLConnection object internals:
 OFFSET  SIZE                        TYPE DESCRIPTION                               VALUE
      0    12                             (object header)                           N/A
     12     4                         int URLConnection.connectTimeout              N/A
     16     8                        long URLConnection.ifModifiedSince             N/A
     24     4                         int URLConnection.readTimeout                 N/A
     28     1                     boolean URLConnection.doInput                     N/A
     29     1                     boolean URLConnection.doOutput                    N/A
     30     1                     boolean URLConnection.allowUserInteraction        N/A
     31     1                     boolean URLConnection.useCaches                   N/A
     32     1                     boolean URLConnection.connected                   N/A
     33     3                             (alignment/padding gap)                  
     36     4                java.net.URL URLConnection.url                         N/A
     40     4   sun.net.www.MessageHeader URLConnection.requests                    N/A
     44     4                java.net.URL JarURLConnection.jarFileURL               N/A
     48     4            java.lang.String JarURLConnection.entryName                N/A
     52     4      java.net.URLConnection JarURLConnection.jarFileURLConnection     N/A
     56     4      java.util.jar.JarEntry JarURLConnection.jarEntry                 N/A
     60     4       java.util.jar.JarFile JarURLConnection.jarFile                  N/A
     64     4            java.lang.String JarURLConnection.contentType              N/A
     68     4                             (loss due to the next object alignment)
Instance size: 72 bytes
Space losses: 3 bytes internal + 4 bytes external = 7 bytes total

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8277983: Remove unused fields from sun.net.www.protocol.jar.JarURLConnection

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6649/head:pull/6649
$ git checkout pull/6649

Update a local copy of the PR:
$ git checkout pull/6649
$ git pull https://git.openjdk.java.net/jdk pull/6649/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6649

View PR using the GUI difftool:
$ git pr show -t 6649

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6649.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 1, 2021

👋 Welcome back stsypanov! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 1, 2021
@openjdk
Copy link

openjdk bot commented Dec 1, 2021

@stsypanov The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the net net-dev@openjdk.org label Dec 1, 2021
@mlbridge
Copy link

mlbridge bot commented Dec 1, 2021

Webrevs

@AlanBateman
Copy link
Contributor

I suspect these may be left over from when the protocol handler was extended by other code.

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 29, 2021

@stsypanov This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@stsypanov
Copy link
Contributor Author

Let's wait a bit

Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dfuch
Copy link
Member

dfuch commented Jan 25, 2022

Drop me a note after integrating and I will sponsor.

@stsypanov
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 25, 2022

@stsypanov This pull request has not yet been marked as ready for integration.

@stsypanov stsypanov changed the title 8277983: Remove unused fields from s.n.w.p.j.JarURLConnection 8277983: Remove unused fields from sun.net.www.protocol.jar.JarURLConnection Jan 26, 2022
@openjdk
Copy link

openjdk bot commented Jan 26, 2022

⚠️ @stsypanov the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout jar-url-connection
$ git commit -c user.name='Preferred Full Name' --allow-empty -m 'Update full name'
$ git push

@openjdk
Copy link

openjdk bot commented Jan 26, 2022

@stsypanov This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8277983: Remove unused fields from sun.net.www.protocol.jar.JarURLConnection

Reviewed-by: dfuchs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 698 new commits pushed to the master branch:

  • c180070: 8280373: Update Xalan serializer / SystemIDResolver to align with JDK-8270492
  • a24f44d: 8280526: x86_32 Math.sqrt performance regression with -XX:UseSSE={0,1}
  • e72eefd: 8280531: Remove unused DeferredCloseInputStream
  • 2c64a7f: 8280374: G1: Remove unnecessary prev bitmap mark
  • a183bfb: 8280377: MethodHandleProxies does not correctly invoke default methods with varags
  • 2eab86b: 8213905: reflection not working for type annotations applied to exception types in the inner class constructor
  • 295c047: 8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement
  • 841eae6: 8269542: JDWP: EnableCollection support is no longer spec compliant after JDK-8255987
  • 76fe03f: 8280166: Extend java/lang/instrument/GetObjectSizeIntrinsicsTest.java test cases
  • cebaad1: 8280041: Retry loop issues in java.io.ClassCache
  • ... and 688 more: https://git.openjdk.java.net/jdk/compare/05ab1767684bee0a3b8c8214c610beafaad058f9...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dfuch) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 26, 2022
@stsypanov
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 26, 2022
@openjdk
Copy link

openjdk bot commented Jan 26, 2022

@stsypanov
Your change (at version db32350) is now ready to be sponsored by a Committer.

@dfuch
Copy link
Member

dfuch commented Jan 26, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Jan 26, 2022

Going to push as commit f34f8d4.
Since your change was applied there have been 700 commits pushed to the master branch:

  • a07e19d: 8278410: Improve argument processing around UseHeavyMonitors
  • ed0df2f: 8268033: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails with "fatal error: Not compilable at tier 3: CodeBuffer overflow"
  • c180070: 8280373: Update Xalan serializer / SystemIDResolver to align with JDK-8270492
  • a24f44d: 8280526: x86_32 Math.sqrt performance regression with -XX:UseSSE={0,1}
  • e72eefd: 8280531: Remove unused DeferredCloseInputStream
  • 2c64a7f: 8280374: G1: Remove unnecessary prev bitmap mark
  • a183bfb: 8280377: MethodHandleProxies does not correctly invoke default methods with varags
  • 2eab86b: 8213905: reflection not working for type annotations applied to exception types in the inner class constructor
  • 295c047: 8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement
  • 841eae6: 8269542: JDWP: EnableCollection support is no longer spec compliant after JDK-8255987
  • ... and 690 more: https://git.openjdk.java.net/jdk/compare/05ab1767684bee0a3b8c8214c610beafaad058f9...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 26, 2022
@openjdk openjdk bot closed this Jan 26, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Jan 26, 2022
@openjdk
Copy link

openjdk bot commented Jan 26, 2022

@dfuch @stsypanov Pushed as commit f34f8d4.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@stsypanov stsypanov deleted the jar-url-connection branch January 26, 2022 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated net net-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

3 participants