Add protection against reading wrong parameter index in the Prepared statement
The agent logs an error in the secondAfterBody-part when common/sql-parameters.cfg is included in the configuration and the broadleaf heatclinic demo is instrumented:
Error: extracted from line 216 HookDispatcher.java, Agent project
Had a look on this bug.. I think this is not the first time we see it.. The problem is that we are reading the index of the parameter to be 0, which is wrong actually as by specification (even the hsqldb) parameters start from 1:
Thus eventually we get index to be -1 and thus exception.. However, we must deal with the situation if the method is called with 0 parameter.. Hopefully this will be exception in the implementation, but anyway we should not stop the execution.. I will rename the ticket and add it to the current Sprint.
, : fyi