Skip to content

Commit 5e16809

Browse files
authored
Fix AspectJ pointcut syntax (#5058)
AspectJ pointcuts use the `&&` and `!` operators and the alternative word form syntax with `and` and `not` operators is only allowed for load-time weaving with `aop.xml` which cannot use the symbols in the XML. This fixes compile-time weaving support which failed on the `and not` syntax.
1 parent 6ee08ab commit 5e16809

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

micrometer-core/src/main/java/io/micrometer/core/aop/CountedAspect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public CountedAspect(MeterRegistry registry, Function<ProceedingJoinPoint, Itera
167167
this.shouldSkip = shouldSkip;
168168
}
169169

170-
@Around("@within(io.micrometer.core.annotation.Counted) and not @annotation(io.micrometer.core.annotation.Counted)")
170+
@Around("@within(io.micrometer.core.annotation.Counted) && !@annotation(io.micrometer.core.annotation.Counted)")
171171
@Nullable
172172
public Object countedClass(ProceedingJoinPoint pjp) throws Throwable {
173173
if (shouldSkip.test(pjp)) {

micrometer-core/src/main/java/io/micrometer/core/aop/TimedAspect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public TimedAspect(MeterRegistry registry, Function<ProceedingJoinPoint, Iterabl
161161
this.shouldSkip = shouldSkip;
162162
}
163163

164-
@Around("@within(io.micrometer.core.annotation.Timed) and not @annotation(io.micrometer.core.annotation.Timed)")
164+
@Around("@within(io.micrometer.core.annotation.Timed) && !@annotation(io.micrometer.core.annotation.Timed)")
165165
@Nullable
166166
public Object timedClass(ProceedingJoinPoint pjp) throws Throwable {
167167
if (shouldSkip.test(pjp)) {

micrometer-observation/src/main/java/io/micrometer/observation/aop/ObservedAspect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public ObservedAspect(ObservationRegistry registry,
105105
this.shouldSkip = shouldSkip;
106106
}
107107

108-
@Around("@within(io.micrometer.observation.annotation.Observed) and not @annotation(io.micrometer.observation.annotation.Observed)")
108+
@Around("@within(io.micrometer.observation.annotation.Observed) && !@annotation(io.micrometer.observation.annotation.Observed)")
109109
@Nullable
110110
public Object observeClass(ProceedingJoinPoint pjp) throws Throwable {
111111
if (shouldSkip.test(pjp)) {

0 commit comments

Comments
 (0)