With the attached test case, the following error occurs from APT:
------
$ apt -J-Duser.language=en -version -nocompile -cp . foo/A.java
apt 1.5.0_01
error: Could not create declaration for annotation type foo.A
do nothing
1 error
------
I noticed that DeclarationMaker.getTypeDeclaration returns a PackageSymbol
(where it should be ClassSymbol), and that causes this method to return
null, which in turn causes this failure. This PackageSymbol's EXISTS flag
is false.
Further looking at the code, this bogus PackageSymbol was created from
around MemberEnter line 898:
-------------
// check that no package exists with same fully qualified name,
// but admit classes in the empty package which have the same
// name as a top-level package.
if (checkClash &&
c.owner.kind == PCK && c.owner != syms.emptyPackage &&
reader.packageExists(c.fullname))
{
log.error(tree.pos, "clash.with.pkg.of.same.name", c);
}
-------------
###@###.### 2005-1-10 19:09:29 GMT
------
$ apt -J-Duser.language=en -version -nocompile -cp . foo/A.java
apt 1.5.0_01
error: Could not create declaration for annotation type foo.A
do nothing
1 error
------
I noticed that DeclarationMaker.getTypeDeclaration returns a PackageSymbol
(where it should be ClassSymbol), and that causes this method to return
null, which in turn causes this failure. This PackageSymbol's EXISTS flag
is false.
Further looking at the code, this bogus PackageSymbol was created from
around MemberEnter line 898:
-------------
// check that no package exists with same fully qualified name,
// but admit classes in the empty package which have the same
// name as a top-level package.
if (checkClash &&
c.owner.kind == PCK && c.owner != syms.emptyPackage &&
reader.packageExists(c.fullname))
{
log.error(tree.pos, "clash.with.pkg.of.same.name", c);
}
-------------
###@###.### 2005-1-10 19:09:29 GMT