History log of /external/annotation-tools/scene-lib/src/annotations/AnnotationFactory.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
43367280222c6f50f8085ae8d12a985c257b3ea0 01-Jun-2016 Michael Ernst <mernst@cs.washington.edu> Revert "Move plume-lib classes to a different package to prevent conflicts"

This reverts commit 6ded22f83487938efe4709d95c807e8288ed86d1.
/external/annotation-tools/scene-lib/src/annotations/AnnotationFactory.java
6ded22f83487938efe4709d95c807e8288ed86d1 29-Apr-2016 Michael Ernst <mernst@cs.washington.edu> Move plume-lib classes to a different package to prevent conflicts
/external/annotation-tools/scene-lib/src/annotations/AnnotationFactory.java
3aff85d01d84fa9d8551ca791036a733ae4a4f39 21-Apr-2016 Michael Ernst <mernst@cs.washington.edu> Remove mentions of IGJ and Javari
/external/annotation-tools/scene-lib/src/annotations/AnnotationFactory.java
79db425002236129f25393fe1a6bac1f5186794e 15-Mar-2014 Werner Dietl <wdietl@gmail.com> Adapt to Checker Framework changes.
/external/annotation-tools/scene-lib/src/annotations/AnnotationFactory.java
a74f2668d253bb9375805db0f23a01e30ddfba8f 01-Feb-2013 wdietl <wdietl@gmail.com> General code cleanup to largely reduce the number of warnings: put qualifier imports into Voodoo comments, remove unused imports, adapt whitespace, comment-out dead code, ...
/external/annotation-tools/scene-lib/src/annotations/AnnotationFactory.java
4b5ac15073b79be49253c1e85a9dd41cf5731326 06-Nov-2009 Michael Ernst <mernst@cs.washington.edu> Improve comments
/external/annotation-tools/scene-lib/src/annotations/AnnotationFactory.java
02ac307c0d3fa53b83666972e0a75bc098500700 13-Sep-2009 Michael Ernst <mernst@cs.washington.edu> Handle meta-annotations, read annotations from classfiles.

The four major user-visible changes are:


1. Handle meta-annotations.
Previously, the Annotation File Utilities didn't handle meta-annotations
(annotations that are written on an annotation type declaration); in fact,
AFU simply fabricated retention information. Now, meta-annotations are
handled uniformly with other annotations.

Make AnnotationDef a subclass of AElement, because it can be subtyped.
This introduces recursion in the data structure and requires a number of
changes.


2. Distinguish type annotations from declaration annotations.
Previously, AFU assumed that all annotations were type annotations. Now,
this information is looked up from the meta-annotations.

In AMethod, add returnType field. (Forgetting to add it to prune() was a
source of bugs.) AMethod now only extends AElement, not ATypeElement,
because it can be annotated, but not with type annotations.


3. Read annotations from classfiles.
Previously, AFU created partial information for annotations in an ad hoc
way, and classfile reading did not work. (The focus was on inserting
annotations in class files, not reading annotations from class files.)
Now, classfile reading is operational, and it is often not necessary to
declare annotations in an annotation file. However, if the annotation is
declared in the annotation file, it should be consistent with its
declaration in the class file.


4. Changes to annotation file format.

1. Indicating meta-annotations

annotation visible @Nullable:

becomes

annotation @Nullable: @Retention(value=RUNTIME)

and if it's a type annotation, it should be

annotation @Nullable: @Retention(value=RUNTIME) @java.lang.annotation.Target(value={TYPE_USE})

2. Locations for type and declaration annotations

If p2.B is a declaration annotation on a method, it is written as before:

method foo(Ljava/util/Set;)V: @p2.B

If p2.B is a type annotation on a method return type, it is written in a
new location:

method foo(Ljava/util/Set;)V:
return: @p2.B

Fields should perhaps be treated similarly, but are not (yet).

3. Permit qualified names in several places that only identifiers were
permitted before. This enables use of names that contain periods, such
as inner classes, and also fully-qualified names.

4. Permit two shorthands in annotation uses, as in Java. If there is a
single field named "value", then its name may be omitted: @A(1) instead
of @A(value=1). If an array has only one element, the braces may be
omitted: @A(value=1) instead of @A(value={1}). Naturally, both
shorthands may be combined.


Move changelog to a separate webpage.


Code changes for constructing an annotation:

In Annotations, programmatically build a few useful Annotation and
AnnotationDef objects.

When creating an annotation, sanity-check the field names and values. This
forced many bug fixes and some representation changes. New method
AnnotationFieldType.isValidValue is part of this change.

In AnnotationBuilder, permit passing an AnnotationDef to the constructor.
This is now the preferred usage model, even when when reading from a
classfile, and should perhaps be required, with other uses not supported.
Previously a new AnnotationDef was always inferred from the fields that
were read. AnnotationBuilder can create the AnnotationDef from a
java.lang.annotation.Annotation.

Use a map of all definitions (AnnotationDef) to avoid re-computation or
inconsistencies.


Other code changes:

Code cleanup:
Remove RetentionPolicy.
Eliminate confusing "isVisible" terminology in favor of more standard
"isRuntimeRetention".
Eliminate uses of Annotations.fieldValuesMap, which was only an
optimization (that doesn't seem to help any) and was a source of bugs.

Make explicit the hack where ArrayAnnotationSceneReader extends
AnnotationSceneReader (this hack is not proper behavioral subtyping) by
passing "dummy" from the subclass to the superclass to turn off some
undesired superclass behavior in that case.

Debugging improvements:
Add debugging statements.
ClassAnnotationSceneReader: add tracing
Print classpath if annotation cannot be found on it.


Scene library tests:
Rename files scene-lib/test/annotations/tests/classfile/cases/*.expected to
*_Expected.class; this name permits javap to be run on the file.
Likewise for files *.generated.
Don't delete temp class file if test fails.
Improve error & failure messages.
Improve documentation.
Add helper methods.
Specific changes to AnnotationVerifier and AnnotationRecorder follow.

AnnotationVerifier:
Improve error/failure messages.
Add pretty-printing.

AnnotationRecorder:
Improve field names
fieldArgs1 => fieldArgsName
fieldArgs2 => fieldArgsValue
enumArgs1 => enumArgsName
enumArgs2 =>enumArgsDesc
enumArgs3 =>enumArgsValue
innerAnnotationArgs1 =>innerAnnotationArgsName
innerAnnotationArgs2 =>innerAnnotationArgsDesc
/external/annotation-tools/scene-lib/src/annotations/AnnotationFactory.java
10353ed766fc48a0af6bd33d934439e695c03e32 06-Jul-2009 Mahmood Ali <msaeed43@gmail.com> initial import
/external/annotation-tools/scene-lib/src/annotations/AnnotationFactory.java