excilys/androidannotations — comment on commit 73a46254719b29cb2e83706e55672868c8a5b3d7
File: AndroidAnnotations/androidannotations/src/main/java/com/googlecode/androidannotations/helper/ValidatorHelper.java line 168
By pyricau:

@shuya-inc This is definitely wrong. I just realized that when reading through the code to change the behavior to support other components (services, receivers, etc).

Why is that wrong ? Because you are basically only checking if the annotation is available or not. If it's there you consider the inner element valid, and if not, you consider it invalid.

In fact, there are 3 cases :

1) The annotation is there and has been validated => OK
2) The annotation is there but has not been validated (for example, using @EActivity on a class that is not an activity) => invalid, but no compile time error, because there is already one on the enclosing annotation
3) The annotation is not there => invalid, and a compile time error.

I'm going to fix that as part of the #9 work.