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

8291027: Some of TimeZone methods marked 'synchronized' unnecessarily #17441

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

turbanoff
Copy link
Member

@turbanoff turbanoff commented Jan 16, 2024

There are 3 methods in java.util.TimeZone which are public static and marked as synchronized:

  1. getTimeZone(String)
  2. getAvailableIDs(int)
  3. getAvailableIDs()

This means it is a bottle neck for the whole VM.
I've checked the implementation and concluded that synchronized is unnecessary.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8291027: Some of TimeZone methods marked 'synchronized' unnecessarily (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17441/head:pull/17441
$ git checkout pull/17441

Update a local copy of the PR:
$ git checkout pull/17441
$ git pull https://git.openjdk.org/jdk.git pull/17441/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17441

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17441.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 16, 2024

👋 Welcome back aturbanov! 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 bot commented Jan 16, 2024

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

  • core-libs

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 core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review labels Jan 16, 2024
@mlbridge
Copy link

mlbridge bot commented Jan 16, 2024

Webrevs

@@ -625,15 +625,15 @@ private static TimeZone getTimeZone(String ID, boolean fallback) {
* both have GMT-07:00, but differ in daylight saving behavior.
* @see #getRawOffset()
*/
public static synchronized String[] getAvailableIDs(int rawOffset) {
public static String[] getAvailableIDs(int rawOffset) {
return ZoneInfo.getAvailableIDs(rawOffset);
Copy link
Member Author

@turbanoff turbanoff Jan 16, 2024

Choose a reason for hiding this comment

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

BTW can we call ZoneInfoFile.getZoneIds here directly?
ZoneInfo.getAvailableIDs bridge seems redudnant.

Copy link
Member

Choose a reason for hiding this comment

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

TimeZone is an abstract class, and ZoneInfo is an implementation. So to me, it is clearer to call the overriden method in the implementation even though the reason you mentioned.

Copy link
Member Author

Choose a reason for hiding this comment

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

From OOP point of view - it's strange to call subclass method from a super class.

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 21, 2024

@turbanoff 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!

@turbanoff
Copy link
Member Author

keep open. Waiting for review

@openjdk
Copy link

openjdk bot commented Mar 13, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 11, 2024

@turbanoff 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review
2 participants