Skip to content

Commit 443566a

Browse files
Copilottrask
andauthored
Revert ProxyStatementFactory throws narrowing in jdbc tests
Agent-Logs-Url: https://github.com/open-telemetry/opentelemetry-java-instrumentation/sessions/16a931f8-bf41-4615-bfcf-a0c57800589e Co-authored-by: trask <218610+trask@users.noreply.github.com>
1 parent 4ae0537 commit 443566a

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

instrumentation/jdbc/testing/src/main/java/io/opentelemetry/instrumentation/jdbc/testing/AbstractJdbcInstrumentationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ void testHandleRecursiveStatements(
15841584
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/6015
15851585
@DisplayName("test proxy statement")
15861586
@Test
1587-
void testProxyStatement() throws SQLException {
1587+
void testProxyStatement() throws Exception {
15881588
Connection connection = wrap(new org.h2.Driver().connect(jdbcUrls.get("h2"), null));
15891589
cleanup.deferCleanup(connection);
15901590
Statement statement = connection.createStatement();

instrumentation/jdbc/testing/src/main/java/io/opentelemetry/instrumentation/jdbc/testing/ProxyStatementFactory.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,9 @@
1414

1515
class ProxyStatementFactory {
1616

17-
static Statement proxyStatementWithCustomClassLoader(Statement statement) {
17+
static Statement proxyStatementWithCustomClassLoader(Statement statement) throws Exception {
1818
TestClassLoader classLoader = new TestClassLoader(ProxyStatementFactory.class.getClassLoader());
19-
Class<?> testInterface;
20-
try {
21-
testInterface = classLoader.loadClass(TestInterface.class.getName());
22-
} catch (ClassNotFoundException e) {
23-
throw new IllegalStateException("failed to load test interface", e);
24-
}
19+
Class<?> testInterface = classLoader.loadClass(TestInterface.class.getName());
2520
if (testInterface.getClassLoader() != classLoader) {
2621
throw new IllegalStateException("wrong class loader");
2722
}

0 commit comments

Comments
 (0)