Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Unhelpful XLint:unmatchedSuperTypeInCall warning


Hi,

We have an Xlint warning that is issued in the case where a pointcut might not be matching what you intended.  
It is intended to catch users who specify a declaring type pattern but the method they want to match is declared on a different type elsewhere in the class hierarchy.

This can sometimes result in unhelpful messages.  Look at this program:

interface I { }

class L implements I  { }

public aspect F {

  before(): call (* L.*(..)) { }

  public static void main(String[] argv) {
    new L().toString();
  }
}

When compiled, it produces this warning:

C:\bugs\60015\F.java:8 warning does not match because declaring type is java.lang.Object, if match desired use target(L)
 [Xlint:unmatchedSuperTypeInCall]
before(): call (* L.*(..)) { }
          ^^^^^^^^^^^^^

        see also: C:\bugs\60015\F.java:11

1 warning

Is it helpful to report unmatched methods that were unmatched because they were defined on java.lang.Object?
Bug 60015 discusses this situation, and I have a fix that will avoid producing this message if it is an Object method.

I wanted to collect thoughts about this before I go ahead and make the change?
Does anyone feel strongly that I *shouldnt* make my change?

Andy.

Back to the top