You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/05/05 09:06:05 UTC
[skywalking-java] branch main updated: Fix ClassCastException when mssql inserting data (#10741) (#524)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git
The following commit(s) were added to refs/heads/main by this push:
new e09809f318 Fix ClassCastException when mssql inserting data (#10741) (#524)
e09809f318 is described below
commit e09809f318b5afccf5d3fb57b766a418703ff1ed
Author: 破晓长空 <89...@qq.com>
AuthorDate: Fri May 5 17:05:59 2023 +0800
Fix ClassCastException when mssql inserting data (#10741) (#524)
---
CHANGES.md | 1 +
.../apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/CHANGES.md b/CHANGES.md
index 57548a3eb8..e255147dce 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -10,6 +10,7 @@ Release Notes.
* Support clickhouse-jdbc-plugin trace sql parameters
* Support monitor jetty server work thread pool metric
* Support Jersey REST framework
+* Fix ClassCastException when SQLServer inserts data
#### Documentation
diff --git a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java
index 1d5ae87135..109dee19ed 100644
--- a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java
+++ b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java
@@ -26,6 +26,7 @@ import org.apache.skywalking.apm.plugin.jdbc.define.Constants;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.none;
+import static net.bytebuddy.matcher.ElementMatchers.isPublic;
import static org.apache.skywalking.apm.plugin.jdbc.define.Constants.PS_IGNORABLE_SETTERS;
import static org.apache.skywalking.apm.plugin.jdbc.define.Constants.PS_SETTERS;
@@ -43,7 +44,7 @@ public class PSSetterDefinitionOfJDBCInstrumentation implements InstanceMethodsI
// remove TRACE_SQL_PARAMETERS judgement for dynamic config
final Set<String> setters = ignorable ? PS_IGNORABLE_SETTERS : PS_SETTERS;
for (String setter : setters) {
- matcher = matcher.or(named(setter));
+ matcher = matcher.or(named(setter).and(isPublic()));
}
return matcher;