Skip to content

Commit e09809f

Browse files
authored
Fix ClassCastException when mssql inserting data (#10741) (#524)
1 parent dc9f7d1 commit e09809f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Release Notes.
1010
* Support clickhouse-jdbc-plugin trace sql parameters
1111
* Support monitor jetty server work thread pool metric
1212
* Support Jersey REST framework
13+
* Fix ClassCastException when SQLServer inserts data
1314

1415
#### Documentation
1516

apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java

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

2727
import static net.bytebuddy.matcher.ElementMatchers.named;
2828
import static net.bytebuddy.matcher.ElementMatchers.none;
29+
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
2930
import static org.apache.skywalking.apm.plugin.jdbc.define.Constants.PS_IGNORABLE_SETTERS;
3031
import static org.apache.skywalking.apm.plugin.jdbc.define.Constants.PS_SETTERS;
3132

@@ -43,7 +44,7 @@ public ElementMatcher<MethodDescription> getMethodsMatcher() {
4344
// remove TRACE_SQL_PARAMETERS judgement for dynamic config
4445
final Set<String> setters = ignorable ? PS_IGNORABLE_SETTERS : PS_SETTERS;
4546
for (String setter : setters) {
46-
matcher = matcher.or(named(setter));
47+
matcher = matcher.or(named(setter).and(isPublic()));
4748
}
4849

4950
return matcher;

0 commit comments

Comments
 (0)