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

FIX performance java.util.TimeZone.getTimeZone(TimeZone.java:516) is synchronized #318

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.forgerock.opendj.ldap;

import java.time.ZoneId;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
Expand All @@ -25,6 +26,7 @@
import org.forgerock.i18n.LocalizedIllegalArgumentException;
import org.forgerock.util.Reject;


import static com.forgerock.opendj.ldap.CoreMessages.*;

/**
Expand Down Expand Up @@ -790,7 +792,11 @@ private static TimeZone getTimeZoneForOffset(final String value, final int start

// If we've gotten here, then it looks like a valid offset. We can
// create a time zone by using "GMT" followed by the offset.
return TimeZone.getTimeZone("GMT" + offSetStr);
try {
return TimeZone.getTimeZone(ZoneId.of("GMT"+offSetStr));
}catch (java.time.DateTimeException e) {
return TimeZone.getTimeZone("GMT"+offSetStr);
}
}

/** Lazily constructed internal representations. */
Expand Down
Loading