Skip to content

Commit 8299c29

Browse files
committed
resolve merge conflicts
2 parents 83297be + abd4b30 commit 8299c29

89 files changed

Lines changed: 4465 additions & 511 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/sdk-platform-java-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
JOB_TYPE: install
163163
- name: Integration Tests
164164
run: |
165-
bazelisk --batch test //sdk-platform-java/test/integration/...
165+
bazelisk --batch test //sdk-platform-java/test/integration/... --test_output=errors
166166
167167
bazel-25:
168168
needs: filter

generation_config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3039,10 +3039,9 @@ libraries:
30393039
release_level: stable
30403040
client_documentation: https://cloud.google.com/java/docs/reference/proto-google-common-protos/latest/history
30413041
distribution_name: com.google.api.grpc:proto-google-common-protos
3042-
excluded_dependencies: proto-google-common-protos,grpc-google-common-protos,proto-google-common-protos-parent
3042+
excluded_dependencies: grpc-google-common-protos,proto-google-common-protos,proto-google-common-protos-parent
30433043
excluded_poms: proto-google-common-protos-bom,proto-google-common-protos
30443044
library_type: OTHER
3045-
30463045
GAPICs:
30473046
- proto_path: google/api
30483047
- proto_path: google/apps/card/v1

google-auth-library-java/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@
8080
<project.appengine.version>2.0.33</project.appengine.version>
8181
<project.findbugs.version>3.0.2</project.findbugs.version>
8282
<deploy.autorelease>false</deploy.autorelease>
83-
<project.error-prone.version>2.45.0</project.error-prone.version>
83+
<project.error-prone.version>2.48.0</project.error-prone.version>
8484
<project.protobuf.version>4.33.2</project.protobuf.version>
8585
<project.cel.version>0.9.0-proto3</project.cel.version>
8686
<project.tink.version>1.15.0</project.tink.version>
8787
<project.slf4j.version>2.0.17</project.slf4j.version>
88-
<project.gson.version>2.12.1</project.gson.version>
88+
<project.gson.version>2.13.2</project.gson.version>
8989
<project.api-common.version>2.63.0-SNAPSHOT</project.api-common.version><!-- {x-version-update:api-common:current} -->
9090
<surefire.version>3.5.2</surefire.version>
9191
<clirr.skip>true</clirr.skip>

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
public class BigQueryConversionException extends SQLException {
2525

2626
public BigQueryConversionException(String message, Throwable cause) {
27-
super(message, cause);
27+
super(BigQueryJdbcExceptionUtils.formatMessage(message, cause), cause);
2828
}
2929
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ public class BigQueryJdbcCoercionException extends RuntimeException {
3131
* @param cause the actual cause which was thrown while performing the coercion.
3232
*/
3333
public BigQueryJdbcCoercionException(Exception cause) {
34-
super("Coercion error", cause);
34+
super(BigQueryJdbcExceptionUtils.formatMessage("Coercion error", cause), cause);
3535
}
3636
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public BigQueryJdbcException(InterruptedException ex) {
4747
* @param ex The BigQueryException to be thrown.
4848
*/
4949
public BigQueryJdbcException(String message, BigQueryException ex) {
50-
super(message, ex);
50+
super(BigQueryJdbcExceptionUtils.formatMessage(message, ex), ex);
5151
this.bigQueryException = ex;
5252
}
5353

@@ -58,7 +58,7 @@ public BigQueryJdbcException(String message, BigQueryException ex) {
5858
* @param cause Throwable that is being converted.
5959
*/
6060
public BigQueryJdbcException(String message, Throwable cause) {
61-
super(message, cause);
61+
super(BigQueryJdbcExceptionUtils.formatMessage(message, cause), cause);
6262
}
6363

6464
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.bigquery.exception;
18+
19+
/** Utility class for JDBC exceptions. */
20+
final class BigQueryJdbcExceptionUtils {
21+
22+
private BigQueryJdbcExceptionUtils() {
23+
// Utility class, prevent instantiation
24+
}
25+
26+
/**
27+
* Formats the exception message by appending the cause's message (or toString if null) on a
28+
* newline.
29+
*
30+
* @param message The custom detail message.
31+
* @param cause The underlying cause of the exception.
32+
* @return The formatted message.
33+
*/
34+
public static String formatMessage(String message, Throwable cause) {
35+
return message
36+
+ (cause != null
37+
? "\n" + (cause.getMessage() != null ? cause.getMessage() : cause.toString())
38+
: "");
39+
}
40+
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcRuntimeException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ public BigQueryJdbcRuntimeException(String message, InterruptedException ex) {
4747
}
4848

4949
public BigQueryJdbcRuntimeException(String message, Throwable ex) {
50-
super(message, ex);
50+
super(BigQueryJdbcExceptionUtils.formatMessage(message, ex), ex);
5151
}
5252
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public BigQueryJdbcSqlSyntaxErrorException(BigQueryException ex) {
3636
}
3737

3838
public BigQueryJdbcSqlSyntaxErrorException(String message, BigQueryException ex) {
39-
super(message, ex);
39+
super(BigQueryJdbcExceptionUtils.formatMessage(message, ex), ex);
4040
}
4141
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.bigquery.exception;
18+
19+
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
21+
import com.google.cloud.bigquery.BigQueryException;
22+
import java.util.stream.Stream;
23+
import org.junit.jupiter.api.Test;
24+
import org.junit.jupiter.params.ParameterizedTest;
25+
import org.junit.jupiter.params.provider.Arguments;
26+
import org.junit.jupiter.params.provider.MethodSource;
27+
28+
public class BigQueryJdbcExceptionTest {
29+
30+
@FunctionalInterface
31+
interface ExceptionCreator {
32+
Throwable create(String message, Throwable cause);
33+
}
34+
35+
static Stream<Arguments> exceptionProvider() {
36+
return Stream.of(
37+
Arguments.of(
38+
(ExceptionCreator)
39+
(msg, cause) -> new BigQueryJdbcException(msg, (BigQueryException) cause)),
40+
Arguments.of((ExceptionCreator) BigQueryJdbcException::new),
41+
Arguments.of((ExceptionCreator) BigQueryJdbcRuntimeException::new),
42+
Arguments.of((ExceptionCreator) BigQueryConversionException::new),
43+
Arguments.of(
44+
(ExceptionCreator)
45+
(msg, cause) -> new BigQueryJdbcCoercionException((Exception) cause)),
46+
Arguments.of(
47+
(ExceptionCreator)
48+
(msg, cause) ->
49+
new BigQueryJdbcSqlSyntaxErrorException(msg, (BigQueryException) cause)));
50+
}
51+
52+
@ParameterizedTest
53+
@MethodSource("exceptionProvider")
54+
public void testExceptionMessageFormatting(ExceptionCreator creator) {
55+
String message = "Custom error message";
56+
Throwable cause = new BigQueryException(500, "Underlying error");
57+
58+
Throwable ex = creator.create(message, cause);
59+
60+
String expectedPrefix =
61+
ex instanceof BigQueryJdbcCoercionException ? "Coercion error" : message;
62+
String expectedMessage = expectedPrefix + "\n" + cause.getMessage();
63+
64+
assertEquals(expectedMessage, ex.getMessage());
65+
assertEquals(cause, ex.getCause());
66+
}
67+
68+
@Test
69+
public void testException_withCauseHavingNullMessage() {
70+
String message = "Custom error message";
71+
Throwable cause = new RuntimeException(); // Null message
72+
73+
BigQueryJdbcException ex = new BigQueryJdbcException(message, cause);
74+
75+
String expectedMessage = message + "\n" + cause.toString();
76+
assertEquals(expectedMessage, ex.getMessage());
77+
}
78+
}

0 commit comments

Comments
 (0)