final PsiClass aClass = field.getContainingClass();
if (aClass == null || aClass instanceof PsiAnonymousClass) return null;
final String jvmOwnerName = ClassUtil.getJVMClassName(aClass);
final String name = field.getName();
if (name == null || jvmOwnerName == null) return null;
<BUG>return new LightRef.JavaLightFieldRef(names.enumerate(jvmOwnerName), names.enumerate(name));
}</BUG>
else if (element instanceof PsiMethod) {
final PsiClass aClass = ((PsiMethod)element).getContainingClass();
if (aClass == null || aClass instanceof PsiAnonymousClass) return null;

final PsiClass aClass = field.getContainingClass();
if (aClass == null || aClass instanceof PsiAnonymousClass) return null;
final String jvmOwnerName = ClassUtil.getJVMClassName(aClass);
final String name = field.getName();
if (name == null || jvmOwnerName == null) return null;
final int ownerId = names.tryEnumerate(jvmOwnerName);
if (ownerId == 0) return null;
final int nameId = names.tryEnumerate(name);
if (nameId == 0) return null;
return new LightRef.JavaLightFieldRef(ownerId, nameId);
}
else if (element instanceof PsiMethod) {
final PsiClass aClass = ((PsiMethod)element).getContainingClass();
if (aClass == null || aClass instanceof PsiAnonymousClass) return null;
