public IAnnotationBinding[] getAnnotations() {
try {
INameEnvironment nameEnvironment = this.binding.environment.nameEnvironment;
if (!(nameEnvironment instanceof SearchableEnvironment))
return AnnotationBinding.NoAnnotations;
NameLookup nameLookup = ((SearchableEnvironment) nameEnvironment).nameLookup;
if (nameLookup == null)
return AnnotationBinding.NoAnnotations;
final String pkgName = getName();
IPackageFragment[] pkgs = nameLookup.findPackageFragments(pkgName, false/*exact match*/);
if (pkgs == null)
return AnnotationBinding.NoAnnotations;
for (int i = 0, len = pkgs.length; i < len; i++) {
int fragType = pkgs[i].getKind();