You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/10/25 15:27:58 UTC

[GitHub] [skywalking] aderm commented on a change in pull request #3695: [WIP]Add postgresql agent sql query param show

aderm commented on a change in pull request #3695: [WIP]Add postgresql agent sql query param show 
URL: https://github.com/apache/skywalking/pull/3695#discussion_r339111566
 
 

 ##########
 File path: apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/define/StatementEnhanceInfos.java
 ##########
 @@ -55,29 +54,14 @@ public String getStatementName() {
     }
 
     public void setParameter(int index, final Object parameter) {
-        maxIndex = maxIndex > index ? maxIndex : index;
-        index--; // start from 1
-        if (parameters == null) {
-            final int initialSize = Math.max(20, maxIndex);
-            parameters = new Object[initialSize];
-            Arrays.fill(parameters, null);
-        }
-        int length = parameters.length;
-        if (index >= length) {
-            int newSize = Math.max(index + 1, length * 2);
-            Object[] newParameters = new Object[newSize];
-            System.arraycopy(parameters, 0, newParameters, 0, length);
-            Arrays.fill(newParameters, length, newSize, null);
-            parameters = newParameters;
+        // start from 1
+        index--;
+        if (index >= 0) {
+            parameters.set(index, parameter);
 
 Review comment:
   @wu-sheng ok,  I having change the code , runing the test at the motent.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services