wu-sheng commented on a change in pull request #18:
URL: https://github.com/apache/skywalking-java/pull/18#discussion_r701567247



##########
File path: 
apm-sniffer/apm-sdk-plugin/mysql-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/v6/ConnectionCreateOldInterceptor.java
##########
@@ -41,7 +41,12 @@ public void beforeMethod(Class clazz, Method method, 
Object[] allArguments, Clas
     public Object afterMethod(Class clazz, Method method, Object[] 
allArguments, Class<?>[] parameterTypes,
         Object ret) {
         if (ret instanceof EnhancedInstance) {
-            ConnectionInfo connectionInfo = 
ConnectionCache.get(allArguments[1].toString(), allArguments[2].toString());
+            String database = "";
+            try {
+                Method getDbMethod = 
parameterTypes[0].getDeclaredMethod("getDatabase");
+                database = (String) getDbMethod.invoke(allArguments[0]);
+            } catch (Throwable t) { }

Review comment:
       If that method doesn't exist, how your fix is correct? You just try to 
catch a known exception, but don't help for the result.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to