Skip to content

Commit 4b61b82

Browse files
committed
fix(bigquery-jdbc): remove redundant loadDriverVersionProperties method
This method was refactored into BigQueryJdbcVersionUtility but was incorrectly kept during a merge conflict resolution, causing compilation errors due to missing fields. TAG=agy CONV=93eab217-ad90-45ea-8b0b-dbfaea52887d
1 parent abbc0c6 commit 4b61b82

1 file changed

Lines changed: 1 addition & 44 deletions

File tree

java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5229,50 +5229,7 @@ String replaceSqlParameters(String sql, String... params) throws SQLException {
52295229
return String.format(sql, (Object[]) params);
52305230
}
52315231

5232-
private void loadDriverVersionProperties() {
5233-
if (parsedDriverVersion.get() != null) {
5234-
return;
5235-
}
5236-
Properties props = new Properties();
5237-
try (InputStream input =
5238-
getClass().getResourceAsStream("/com/google/cloud/bigquery/jdbc/dependencies.properties")) {
5239-
if (input == null) {
5240-
String errorMessage =
5241-
"Could not find dependencies.properties. Driver version information is unavailable.";
5242-
IllegalStateException ex = new IllegalStateException(errorMessage);
5243-
LOG.severe(errorMessage, ex);
5244-
throw ex;
5245-
}
5246-
props.load(input);
5247-
String versionString = props.getProperty("version.jdbc");
5248-
if (versionString == null || versionString.trim().isEmpty()) {
5249-
String errorMessage =
5250-
"The property version.jdbc not found or empty in dependencies.properties.";
5251-
IllegalStateException ex = new IllegalStateException(errorMessage);
5252-
LOG.severe(errorMessage, ex);
5253-
throw ex;
5254-
}
5255-
parsedDriverVersion.compareAndSet(null, versionString.trim());
5256-
String[] parts = versionString.split("\\.");
5257-
if (parts.length < 2) {
5258-
return;
5259-
}
5260-
parsedDriverMajorVersion.compareAndSet(null, Integer.parseInt(parts[0]));
5261-
String minorPart = parts[1];
5262-
String numericMinor = minorPart.replaceAll("[^0-9].*", "");
5263-
if (!numericMinor.isEmpty()) {
5264-
parsedDriverMinorVersion.compareAndSet(null, Integer.parseInt(numericMinor));
5265-
}
5266-
} catch (IOException | NumberFormatException e) {
5267-
String errorMessage =
5268-
"Error reading dependencies.properties. Driver version information is"
5269-
+ " unavailable. Error: "
5270-
+ e.getMessage();
5271-
IllegalStateException ex = new IllegalStateException(errorMessage, e);
5272-
LOG.severe(errorMessage, ex);
5273-
throw ex;
5274-
}
5275-
}
5232+
52765233

52775234
// TODO(keshav): This is a temporary compatibility bridge to wrap raw Threads into Futures.
52785235
// This should be removed when BigQueryDatabaseMetaData is refactored to use the ExecutorService

0 commit comments

Comments
 (0)