Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263560: Remove needless wrapping with BufferedInputStream #2992

Closed
wants to merge 7 commits into from

Conversation

@stsypanov
Copy link
Contributor

@stsypanov stsypanov commented Mar 13, 2021

In some cases wrapping of InputStream with BufferedInputStream is redundant, e.g. in case the wrapped one is ByteArrayOutputStream which does not require any buffer having one within.

Other cases are related to reading either a byte or short byte[]: in both cases BufferedInputStream.fill() will be called resulting in load of much bigger amount of data (8192 by default) than required.


Progress

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

Issue

  • JDK-8263560: Remove needless wrapping with BufferedInputStream

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2992/head:pull/2992
$ git checkout pull/2992

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Mar 13, 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
Copy link

@openjdk openjdk bot commented Mar 13, 2021

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

  • 2d
  • core-libs
  • net

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

@AlanBateman
Copy link
Contributor

@AlanBateman AlanBateman commented Mar 14, 2021

/issue JDK-8263560

@openjdk
Copy link

@openjdk openjdk bot commented Mar 14, 2021

@AlanBateman Only the author (@stsypanov) is allowed to issue the /issue command.

@stsypanov
Copy link
Contributor Author

@stsypanov stsypanov commented Mar 14, 2021

/issue JDK-8263560

@openjdk openjdk bot changed the title Drop redundant BufferedInputStream-wrapping 8263560: Remove needless wrapping with BufferedInputStream Mar 14, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 14, 2021

@stsypanov The primary solved issue for a PR is set through the PR title. Since the current title does not contain an issue reference, it will now be updated.

@openjdk openjdk bot added the rfr label Mar 14, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Mar 14, 2021

prrace
prrace approved these changes Mar 14, 2021
Copy link
Contributor

@prrace prrace left a comment

2d change is fine.

@openjdk
Copy link

@openjdk openjdk bot commented Mar 14, 2021

⚠️ @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 review-usage-of-buffer
$ git commit -c user.name='Preferred Full Name' --allow-empty -m 'Update full name'
$ git push

@openjdk
Copy link

@openjdk openjdk bot commented Mar 14, 2021

@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:

8263560: Remove needless wrapping with BufferedInputStream

Reviewed-by: prr, alanb, dfuchs, serb

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 29 new commits pushed to the master branch:

  • c484d89: 8263557: Possible NULL dereference in Arena::destruct_contents()
  • ba35193: 8263559: Add missing initializers to VM_PopulateDumpSharedSpace
  • e03a594: 8262504: Some CLHSDB command cannot know they run on remote debugger
  • d896246: 8263420: Incorrect function name in NSAccessibilityStaticText native peer implementation
  • 8c1112a: 8261916: gtest/GTestWrapper.java vmErrorTest.unimplemented1_vm_assert failed
  • 1e57087: 8263392: Allow current thread to be specified in ExceptionMark
  • 4d1c08c: 8263616: 'Deprecatd' typo in src/hotspot/share/classfile/classFileParser.cpp
  • 0c718ab: 8262277: URLClassLoader.getResource throws undocumented IllegalArgumentException
  • 4f1cda4: 8263387: G1GarbageCollection JFR event gets gc phase, not gc type
  • 5ab5244: 8263514: Minor issue in JavacFileManager.SortFiles.REVERSE
  • ... and 19 more: https://git.openjdk.java.net/jdk/compare/a7aba2b61cbe937a1aa59636f6e28afdec1e10d0...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 (@prrace, @AlanBateman, @dfuch, @mrserb) 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 label Mar 14, 2021
@stsypanov
Copy link
Contributor Author

@stsypanov stsypanov commented Mar 14, 2021

/integrate

@openjdk openjdk bot added the sponsor label Mar 14, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 14, 2021

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

@openjdk openjdk bot removed the sponsor label Mar 15, 2021
@stsypanov
Copy link
Contributor Author

@stsypanov stsypanov commented Mar 15, 2021

/integrate

@openjdk openjdk bot added the sponsor label Mar 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 15, 2021

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

@openjdk openjdk bot removed the sponsor label Mar 15, 2021
dfuch
dfuch approved these changes Mar 15, 2021
Copy link
Member

@dfuch dfuch left a comment

LGTM. Thanks!

mrserb
mrserb approved these changes Mar 16, 2021
@stsypanov
Copy link
Contributor Author

@stsypanov stsypanov commented Mar 16, 2021

/integrate

@openjdk openjdk bot added the sponsor label Mar 16, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 16, 2021

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

@shipilev
Copy link
Contributor

@shipilev shipilev commented Mar 30, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Mar 30, 2021

@shipilev @stsypanov Since your change was applied there have been 260 commits pushed to the master branch:

  • 182b11c: 8264016: [JVMCI] add some thread local fields for use by JVMCI
  • 8cf1c62: 8263754: HexFormat 'fromHex' methods should be static
  • a5d7de2: 8263404: RsaPrivateKeySpec is always recognized as RSAPrivateCrtKeySpec in RSAKeyFactory.engineGetKeySpec
  • 128c0c9: 8248418: jpackage fails to extract main class and version from app module linked in external runtime
  • fd45694: 8264344: Outdated links in JavaComponentAccessibility.m
  • f17ea9e: 8262899: TestRedirectLinks fails
  • 963f1fc: 8264309: JFR: Improve .jfc parser
  • 364cce1: 8264332: Use the blessed modifier order in jdk.charsets
  • fbbd98b: 8264029: Replace uses of StringBuffer with StringBuilder in java.base
  • 019080e: 8264268: Don't use oop types for derived pointers
  • ... and 250 more: https://git.openjdk.java.net/jdk/compare/a7aba2b61cbe937a1aa59636f6e28afdec1e10d0...master

Your commit was automatically rebased without conflicts.

Pushed as commit 1a681fa.

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

@stsypanov stsypanov deleted the review-usage-of-buffer branch Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants