[Checkers] Greetings
Mahmood Ali
mahmood at MIT.EDU
Thu Sep 18 23:17:44 EDT 2008
Greetings Phokham,
Thank you for your notice. I appreciate your input. Hopefully, we
will address the issues.
> - checkers-windows contains the files which I have modified for
> plattform specific issues. Also I had to comment out some IGJ tests
> because they didn't run on windows.
I will look into your modification in checkeres-windows, and might
include them in the release scheduled tomorrow (Friday).
I believe that we have fixed the IGJ tests. The testing framework
made false assumptions about the path name in Windows.
> As we tried to figure out the errors we tried to change the line in
> our qualifiers:
> @Target({TYPE})
> to
> @Target({FIELD, LOCAL_VARIABLE, PARAMETER, TYPE})
> Our qualifiers only support classes. They should not apply to
> fields, local variables and parameters. However this solved one of
> our errors.
Umm... Your test file has Peer and Any annotations which annotating a
parameter and variable.
Do you mean that qualifiers only support declared types (types of
classes and interfaces, as apposed to primitives)? TYPE target allows
annotation to appear only on a class declaration, i.e. 'class
@Immutable String { ... }'. Thus you would need the other ones to
make it into a type annotation. It's quite unfortunate that TYPE
target is actually for type declaration rather than simply types.
> The second error was fixed by adding [isValidUse]
So the issue is not your need to override isValidUse. Since your
qualifier hierarchy does not include Unannotated, the checker expects
all types to have one of your valid annotations. However, your
checker does not add annotations to type declarations, hence you
getting errors when using isValidUse which relies on a type
declaration having a valid annotation.
The proper solution to have Any be the default annotation for all
types unless the user specifically inserted something else. To do so,
you would need to add
@ImplicitFor(typeClasses="AnnotatedTypeMirror.class")
to the declaration of Any (the root of the annotations).
This should fix your problem and other problems that you haven't
noticed yet =).
Also, I have few comments about your checker (so far):
- Pure annotation is not a type annotation and it does not have any
semantical meaning yet.
- It's better for a type factory to extend BasicAnnotatedTypeFactory
rather than AnnotatedTypeFactory. BasicAnnotatedTypeFactory comes
with much needed functionalities: implicit annotations (ImplicitFor),
qualifier polymorphism (PolymorphicQualifier), and flow sensitive type
inference.
- You don't need to create empty classes for UtsAnnotatedtypeFactory
or UtsVisitor. BaseTypeChecker (and your UtsChecker) would create
BasicAnnotatedTypeFactory and BaseTypeVisitor if you don't supply a
specific type factory or a visitor.
Hope this helps,
Mahmood
More information about the checkers
mailing list