[Checkers] Package @DefaultQualifier annotations
Mahmood Ali
mahmood at MIT.EDU
Wed Jun 10 09:15:59 EDT 2009
Greetings,
I'm debugging this now. There is a chance that it's a compiler bug.
- Mahmood
On Jun 10, 2009, at 12:37 AM, Michael Ernst wrote:
> Mahmood-
>
> Are @DefaultQualifier annotations respected when they appear on a
> package?
> They don't seem to be. Using the attached zip file, when I run these
> commands in the parent directory of testPackage:
>
>
> javac typequals/*.java
> javac -processor checkers.basic.BasicChecker -
> Aquals
> =typequals.Prototype,typequals.NonPrototype,typequals.PrototypeOrNot
> -implicit:class -Xlint:-processing -cp .:$CLASSPATH ./testPackage/
> package-info.java ./testPackage/innerPackage/MyFile.java ./
> testPackage/innerPackage/package-info.java
>
>
> I get this output:
>
>
> ./testPackage/innerPackage/MyFile.java:9: incompatible types.
> return f;
> ^
> found : @PrototypeOrNot Float
> required: @NonPrototype Float
> 1 error
>
>
> I think that the checker should succeed without issuing any errors,
> because
> the default should be @NonPrototype, but for some reason the default
> is
> being treated as @PrototypeOrNot.
>
> Additionally, if the
> testPackage/innerPackage/package-info.java
> file is removed, I think type-checking should still succeed, because I
> would assume that the default for testPackage applies to all
> subpackages as
> well.
>
>
> Request: In addition to fixing the above problem and adding tests,
> can you
> please update the @DefaultQualifier Javadoc? I would like it
> to say what is the meaning of an annotation on a package (does it
> apply to
> sub-packages?), and I would like it to say what the default is if no
> @DefaultQualifier annotation is present.
>
>
> When all this is done, I will proceed with the Daikon nullness case
> study.
>
> Thanks!
>
> -Mike
>
> _______________________________________________
> checkers mailing list
> checkers at lists.csail.mit.edu
> https://lists.csail.mit.edu/mailman/listinfo/checkers
More information about the checkers
mailing list