Skip to content

Commit

Permalink
Add missing assertInverse (#12409)
Browse files Browse the repository at this point in the history
  • Loading branch information
steverao authored Oct 17, 2024
1 parent c743b6d commit 18a277f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
13 changes: 12 additions & 1 deletion instrumentation/jsp-2.3/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ muzzle {
pass {
group.set("org.apache.tomcat")
module.set("tomcat-jasper")
// version range [7.0.0,7.0.19) is missing from maven
// tomcat 10 uses JSP 3.0
versions.set("[7.0.19,10)")
// version 8.0.9 depends on org.eclipse.jdt.core.compiler:ecj:4.4RC4 which does not exist
skip("8.0.9")
// not using assertInverse.set(true) because org.eclipse.jdt.core.compiler:ecj:xxx dependency
// is missing for versions in range [7.0.0, 7.0.19)
}
fail {
group.set("org.apache.tomcat")
module.set("tomcat-jasper")
versions.set("[,7.0.0)")
}
fail {
group.set("org.apache.tomcat")
module.set("tomcat-jasper")
versions.set("[10,)")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ muzzle {
versions.set("[1.2,)")
// version 1.2.15 has a bad dependency on javax.jms:jms:1.1 which was released as pom only
skip("1.2.15")
assertInverse.set(true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ muzzle {
versions.set("[1.2,)")
// version 1.2.15 has a bad dependency on javax.jms:jms:1.1 which was released as pom only
skip("1.2.15")
assertInverse.set(true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,26 @@

package io.opentelemetry.javaagent.instrumentation.log4j.mdc.v1_2;

import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
import static java.util.Arrays.asList;

import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import java.util.List;
import net.bytebuddy.matcher.ElementMatcher;

@AutoService(InstrumentationModule.class)
public class Log4j1InstrumentationModule extends InstrumentationModule {
public Log4j1InstrumentationModule() {
super("log4j-mdc", "log4j-mdc-1.2");
}

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
return hasClassesNamed("org.apache.log4j.MDC");
}

@Override
public List<TypeInstrumentation> typeInstrumentations() {
return asList(new CategoryInstrumentation(), new LoggingEventInstrumentation());
Expand Down

0 comments on commit 18a277f

Please sign in to comment.