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/24 05:56:57 UTC
[GitHub] [skywalking] wu-sheng commented on a change in pull request #3695:
Add postgresql agent sql query param show
wu-sheng commented on a change in pull request #3695: Add postgresql agent sql query param show
URL: https://github.com/apache/skywalking/pull/3695#discussion_r338392504
##########
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:
Then why tests pass? I am assuming the test is not covering accurately.
----------------------------------------------------------------
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