Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] A possible compiler bug when using declare error

                       Hi!

  I just run into a weird compiler errors when using "declare error".

  Here is what I declared inside a class that acts as a base for
different test cases. The aspect is intended to watch that the hook
methods are not called by others, they are only intended to be
overridden as necessary:

  private static aspect HookMethodCallControlAspect {
    declare error : !within(TransferTableTestBase) && 
        call(* TransferTableTestBase.do*(..)) : 
        "Hook methods are not to be called outside the parent class
TransferTableTestBase";
  }

  At least to me this seems like a perfectly sensible error declaration.
However, it causes very strange compiler errors that are totally
unrelated to the above declaration (TransferTableTestBase is the class
that contains the above aspect:

can't find type [Lfi.napa.tabletransfer.link.Column;
Key.java
can not resolve this member: java.lang.Object [I.clone()
[Xlint:unresolvableMember]		TransferTableTestBase.java 
can not resolve this member: java.lang.Object
[Lfi.napa.tabletransfer.link.Column;.clone() [Xlint:unresolvableMember]
TransferTableTestBase.java
can not resolve this member: java.lang.Object
[Lfi.napa.tabletransfer.link.Column;.clone() [Xlint:unresolvableMember]
TransferTableTestBase.java
can't find type [I	TableSimpleImpl.java

  These error messages do not make much sense, e.g. the last one claims
it can not find type of int[].

  All these errors disappear once I comment out the above declare error
statement.


  Any ideas? It seems like a compiler bug.


        -Antti-







Back to the top