Adjusting support version of spring-data
Rather than using a somewhat ugly solution of implementing both postProcess method signatures.
I'm restricting the integration to newer versions (1.9 - Sept 2014) of spring-data to start.
MODIFY
dd-java-agent/instrumentation/spring-data/spring-data.gradle
dd-java-agent/instrumentation/spring-data/spring-data.gradle
@@ -21,13 +21,13 @@ testSets {
dependencies {
compileOnly(group: 'aopalliance', name: 'aopalliance', version: '1.0')
- compileOnly(group: 'org.springframework.data', name: 'spring-data-commons', version: '2.0.0.RELEASE')
+ compileOnly(group: 'org.springframework.data', name: 'spring-data-commons', version: '1.9.0.RELEASE')
compileOnly(group: 'org.springframework', name: 'spring-aop', version: '3.0.0.RELEASE')
testCompile project(':dd-java-agent:instrumentation:jdbc')
testCompile group: 'org.spockframework', name: 'spock-spring', version: "$versions.spock"
testCompile group: 'org.springframework', name: 'spring-test', version: '3.0.0.RELEASE'
- testCompile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.2.0.RELEASE'
+ testCompile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.7.0.RELEASE'
// testCompile group: 'org.springframework.data', name: 'spring-data-jdbc', version: '1.0.0.RELEASE'
testCompile group: 'com.mysema.querydsl', name: 'querydsl-jpa', version: '3.7.4'
testCompile group: 'org.hsqldb', name: 'hsqldb', version: '2.0.0'
@@ -35,9 +35,9 @@ dependencies {
latestDepTestCompile group: 'org.springframework', name: 'spring-test', version: '+'
latestDepTestCompile group: 'org.springframework', name: 'spring-context', version: '+'
- latestDepTestCompile group: 'org.springframework.data', name: 'spring-data-commons', version: '+'
+ latestDepTestCompile group: 'org.springframework.data', name: 'spring-data-commons', version: '1.9.+'
latestDepTestCompile group: 'org.springframework', name: 'spring-aop', version: '+'
- latestDepTestCompile group: 'org.springframework.data', name: 'spring-data-jpa', version: '+'
- latestDepTestCompile group: 'org.springframework.data', name: 'spring-data-jdbc', version: '+'
+ latestDepTestCompile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.7.+'
+ // latestDepTestCompile group: 'org.springframework.data', name: 'spring-data-jdbc', version: '+'
}

MODIFY
dd-java-agent/instrumentation/spring-data/src/main/java/datadog/trace/instrumentation/springdata/SpringRepositoryInstrumentation.java
dd-java-agent/instrumentation/spring-data/src/main/java/datadog/trace/instrumentation/springdata/SpringRepositoryInstrumentation.java
@@ -67,13 +67,14 @@ public final class SpringRepositoryInstrumentation extends Instrumenter.Default
public static final RepositoryProxyPostProcessor INSTANCE =
new InterceptingRepositoryProxyPostProcessor();
- // DQH - TODO: Implement old & new signatures of postProcess for version compatibility
- // Probably better to split by version
-
- public void postProcess(final ProxyFactory factory) {
- factory.addAdvice(0, RepositoryInterceptor.INSTANCE);
- }
+ // DQH - TODO: Support older versions?
+ // The signature of postProcess changed to add RepositoryInformation in
+ // spring-data-commons 1.9.0
+ // public void postProcess(final ProxyFactory factory) {
+ // factory.addAdvice(0, RepositoryInterceptor.INSTANCE);
+ // }
+ @Override
public void postProcess(final ProxyFactory factory, final RepositoryInformation repositoryInformation) {
factory.addAdvice(0, RepositoryInterceptor.INSTANCE);
}

Adjusting support version of spring-data

Rather than using a somewhat ugly solution of implementing both postProcess method signatures.

I'm restricting the integration to newer versions (1.9 - Sept 2014) of spring-data to start.