Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] introduction of final methods

I have the following situation:
interface DO{
}

aspect ADO{
final public void DO.doit(){} //method A
}

class Doing implements DO {
 public void doit() { //method B
 }

class DoingAgain extends Doing {
 public void doit(){ //method C
 }
}
I have 2 questions:
1. AspectJ does not complain at all. Instead, a
runtime error is thrown saying "final cannnot be
extended". I think the compiler should disallow at
compile time for "DoingAgain" to re-define "doit".
2. Should method B be even allowed? If I run call
"doit" on Doing, it overrides the "final doit" I
inter-typed in my aspect. That is, if I don't define
"doit" in "Doing", it invokes the "doit" method in the
aspect. 

I'm using 1.2.0. of AJDT. Maybe this is different in
1.2.1, but I haven't upgraded yet.

Thanks,

Charles

Yawn !!


Back to the top