@Override
        public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {
            InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);

            target.addField(DatabaseInfoAccessor.class);

            // 9.4.1207 has setX methods in PgStatement
            final PreparedStatementBindingMethodFilter excludes = PreparedStatementBindingMethodFilter.excludes("setRowId", "setNClob", "setSQLXML");
            final List<InstrumentMethod> declaredMethods = target.getDeclaredMethods(excludes);
            if (!declaredMethods.isEmpty()) {
                target.addField(ParsingResultAccessor.class);
                target.addField(BindValueAccessor.class);

                int maxBindValueSize = config.getMaxSqlBindValueSize();

                final Class<? extends Interceptor> preparedStatementInterceptor = PreparedStatementExecuteQueryInterceptor.class;
                InstrumentUtils.findMethod(target, "execute")
                        .addScopedInterceptor(preparedStatementInterceptor, va(maxBindValueSize), POSTGRESQL_SCOPE);
                InstrumentUtils.findMethod(target, "executeQuery")
                        .addScopedInterceptor(preparedStatementInterceptor, va(maxBindValueSize), POSTGRESQL_SCOPE);
                InstrumentUtils.findMethod(target, "executeUpdate")
                        .addScopedInterceptor(preparedStatementInterceptor, va(maxBindValueSize), POSTGRESQL_SCOPE);

                if (config.isTraceSqlBindValue()) {
                    for (InstrumentMethod method : declaredMethods) {
                        method.addScopedInterceptor(PreparedStatementBindVariableInterceptor.class, POSTGRESQL_SCOPE, ExecutionPolicy.BOUNDARY);
                    }
                }
            }

            return target.toBytecode();
        }
@author Brad Hong
@author HyunGil Jeong
agent-module/plugins/postgresql-jdbc/src/main/java/com/navercorp/pinpoint/plugin/jdbc/postgresql/PostgreSqlPlugin.java