From ab8339852515f04236d41b9af486ea9f0c50c6c7 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Sun, 24 Sep 2017 22:00:25 -0700 Subject: Various changes to get tests passing on 1.8 and 1.9 --- .../src/org/aspectj/weaver/patterns/HasMemberTypePattern.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'org.aspectj.matcher') diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/HasMemberTypePattern.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/HasMemberTypePattern.java index 6aa55a45a..2b1f28fd4 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/HasMemberTypePattern.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/HasMemberTypePattern.java @@ -87,11 +87,18 @@ public class HasMemberTypePattern extends TypePattern { continue; } if (signaturePattern.matches(method, type.getWorld(), false)) { - if (method.getDeclaringType().resolve(world) != type) { + ResolvedType declaringType = method.getDeclaringType().resolve(world); + if (declaringType != type) { if (Modifier.isPrivate(method.getModifiers())) { continue; } } + // J9: Object.finalize() is marked Deprecated it seems... triggers unhelpful messages + if (method.getName().equals("finalize") && declaringType.equals(ResolvedType.OBJECT) + && (signaturePattern.getAnnotationPattern() instanceof ExactAnnotationTypePattern) + && ((ExactAnnotationTypePattern)signaturePattern.getAnnotationPattern()).getAnnotationType().getSignature().equals("Ljava/lang/Deprecated;")) { + continue; + } return true; } } -- cgit v1.2.3