Skip to content

Commit 1527a3a

Browse files
authored
chore: move generator into jdbc package (#2055)
1 parent 7c7e3f8 commit 1527a3a

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

clirr-ignored-differences.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,8 @@
123123
<className>com/google/cloud/spanner/jdbc/CloudSpannerJdbcConnection</className>
124124
<method>com.google.cloud.spanner.DatabaseId getDatabaseId()</method>
125125
</difference>
126+
<difference>
127+
<differenceType>8001</differenceType>
128+
<className>com/google/cloud/spanner/connection/ConnectionPropertiesHelper</className>
129+
</difference>
126130
</differences>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@
351351
<goal>java</goal>
352352
</goals>
353353
<configuration>
354-
<mainClass>com.google.cloud.spanner.connection.ConnectionPropertiesFileGenerator</mainClass>
354+
<mainClass>com.google.cloud.spanner.jdbc.ConnectionPropertiesFileGenerator</mainClass>
355355
<classpathScope>test</classpathScope>
356356
<skip>false</skip>
357357
</configuration>

src/main/java/com/google/cloud/spanner/connection/ConnectionPropertiesHelper.java renamed to src/main/java/com/google/cloud/spanner/jdbc/ConnectionPropertiesHelper.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.cloud.spanner.connection;
17+
package com.google.cloud.spanner.jdbc;
1818

19-
import com.google.api.core.InternalApi;
19+
import com.google.cloud.spanner.connection.ConnectionProperties;
20+
import com.google.cloud.spanner.connection.ConnectionProperty;
2021
import com.google.common.collect.ImmutableList;
2122
import java.sql.DriverPropertyInfo;
2223
import java.util.Arrays;
@@ -26,16 +27,14 @@
2627
import java.util.regex.Pattern;
2728
import java.util.stream.Collectors;
2829

29-
// TODO: Remove this class when the Connection API has made the list of properties public.
30-
@InternalApi
31-
public class ConnectionPropertiesHelper {
32-
public static ImmutableList<ConnectionProperty<?>> VALID_CONNECTION_PROPERTIES =
30+
class ConnectionPropertiesHelper {
31+
static ImmutableList<ConnectionProperty<?>> VALID_CONNECTION_PROPERTIES =
3332
ImmutableList.copyOf(
34-
ConnectionProperties.CONNECTION_PROPERTIES.values().stream()
33+
ConnectionProperties.VALID_CONNECTION_PROPERTIES.stream()
3534
.sorted(Comparator.comparing(ConnectionProperty::getName))
3635
.collect(Collectors.toList()));
3736

38-
public static DriverPropertyInfo toDriverPropertyInfo(
37+
static DriverPropertyInfo toDriverPropertyInfo(
3938
String connectionUri, ConnectionProperty<?> connectionProperty) {
4039
DriverPropertyInfo result =
4140
new DriverPropertyInfo(
@@ -56,7 +55,7 @@ public static DriverPropertyInfo toDriverPropertyInfo(
5655
return result;
5756
}
5857

59-
public static String getConnectionPropertyName(ConnectionProperty<?> connectionProperty) {
58+
static String getConnectionPropertyName(ConnectionProperty<?> connectionProperty) {
6059
return connectionProperty.getName();
6160
}
6261

src/main/java/com/google/cloud/spanner/jdbc/JdbcDriver.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.google.cloud.spanner.SpannerException;
2424
import com.google.cloud.spanner.connection.ConnectionOptions;
2525
import com.google.cloud.spanner.connection.ConnectionOptionsHelper;
26-
import com.google.cloud.spanner.connection.ConnectionPropertiesHelper;
2726
import com.google.cloud.spanner.connection.ConnectionProperty;
2827
import com.google.common.annotations.VisibleForTesting;
2928
import com.google.common.base.Suppliers;

src/test/java/com/google/cloud/spanner/connection/ConnectionPropertiesFileGenerator.java renamed to src/test/java/com/google/cloud/spanner/jdbc/ConnectionPropertiesFileGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.cloud.spanner.connection;
17+
package com.google.cloud.spanner.jdbc;
1818

19+
import com.google.cloud.spanner.connection.ConnectionProperty;
1920
import java.io.BufferedWriter;
2021
import java.io.FileWriter;
2122
import java.io.IOException;

src/test/java/com/google/cloud/spanner/jdbc/JdbcDriverTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import com.google.cloud.ServiceOptions;
2828
import com.google.cloud.spanner.MockSpannerServiceImpl;
29-
import com.google.cloud.spanner.connection.ConnectionPropertiesHelper;
3029
import com.google.cloud.spanner.connection.SpannerPool;
3130
import com.google.common.collect.Collections2;
3231
import com.google.common.collect.ImmutableList;

0 commit comments

Comments
 (0)