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
base: master
Are you sure you want to change the base?
8291027: Some of TimeZone methods marked 'synchronized' unnecessarily #17441
Conversation
👋 Welcome back aturbanov! A progress list of the required criteria for merging this PR into |
@turbanoff The following label will be automatically applied to this pull request:
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. |
@@ -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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@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! |
keep open. Waiting for review |
❗ This change is not yet ready to be integrated. |
@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! |
There are 3 methods in
java.util.TimeZone
which arepublic static
and marked assynchronized
:This means it is a bottle neck for the whole VM.
I've checked the implementation and concluded that
synchronized
is unnecessary.Progress
Issue
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