Skip to content

Commit

Permalink
#787 Fix for Java 8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mrotteveel committed Mar 9, 2024
1 parent d69dcdf commit 3b32c77
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/org/firebirdsql/gds/impl/GDSHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import java.sql.SQLException;
import java.util.TimeZone;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static java.util.Objects.requireNonNull;
Expand All @@ -42,8 +42,7 @@
*/
public final class GDSHelper {

private static final Predicate<String> OFFSET_ZONE_NAME_PREDICATE =
Pattern.compile("[+-]\\d{2}:\\d{2}").asMatchPredicate();
private static final Pattern OFFSET_ZONE_NAME_PATTERN= Pattern.compile("[+-]\\d{2}:\\d{2}");

/**
* @deprecated will be removed in Jaybird 6, use {@link org.firebirdsql.jaybird.props.PropertyConstants#DEFAULT_BLOB_BUFFER_SIZE}
Expand Down Expand Up @@ -283,7 +282,8 @@ private TimeZone initSessionTimeZone() {
}

private static TimeZone getTimeZone(String timeZoneName) {
if (OFFSET_ZONE_NAME_PREDICATE.test(timeZoneName)) {
Matcher matcher = OFFSET_ZONE_NAME_PATTERN.matcher(timeZoneName);
if (matcher.matches()) {
timeZoneName = "GMT" + timeZoneName;
}
return TimeZone.getTimeZone(timeZoneName);
Expand Down

0 comments on commit 3b32c77

Please sign in to comment.