public IAnnotation[] getAnnotations() throws JavaModelException { IBinaryField info = (IBinaryField) getElementInfo(); IBinaryAnnotation[] binaryAnnotations = info.getAnnotations(); return getAnnotations(binaryAnnotations, info.getTagBits()); } /*
public IAnnotation[] getAnnotations() throws JavaModelException { IBinaryField info = (IBinaryField) getElementInfo(); IBinaryAnnotation[] binaryAnnotations = info.getAnnotations(); return getAnnotations(binaryAnnotations, info.getTagBits()); } /*
public IAnnotation[] getAnnotations() throws JavaModelException { IBinaryField info = (IBinaryField) getElementInfo(); IBinaryAnnotation[] binaryAnnotations = info.getAnnotations(); return getAnnotations(binaryAnnotations, info.getTagBits()); } /*
@Override public IAnnotation[] getAnnotations() throws JavaModelException { IBinaryField info = (IBinaryField) getElementInfo(); IBinaryAnnotation[] binaryAnnotations = info.getAnnotations(); return getAnnotations(binaryAnnotations, info.getTagBits()); } /*
public IAnnotation[] getAnnotations() throws JavaModelException { IBinaryField info = (IBinaryField) getElementInfo(); IBinaryAnnotation[] binaryAnnotations = info.getAnnotations(); return getAnnotations(binaryAnnotations, info.getTagBits()); } /*
public IAnnotation[] getAnnotations() throws JavaModelException { IBinaryField info = (IBinaryField) getElementInfo(); IBinaryAnnotation[] binaryAnnotations = info.getAnnotations(); return getAnnotations(binaryAnnotations, info.getTagBits()); } /*
/** * Creates the handles and infos for the fields of the given binary type. * Adds new handles to the given vector. */ private void generateFieldInfos(IType type, IBinaryType typeInfo, HashMap newElements, ArrayList childrenHandles) { // Make the fields IBinaryField[] fields = typeInfo.getFields(); if (fields == null) { return; } JavaModelManager manager = JavaModelManager.getJavaModelManager(); for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) { IBinaryField fieldInfo = fields[i]; BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName()))); newElements.put(field, fieldInfo); childrenHandles.add(field); generateAnnotationsInfos(field, fieldInfo.getAnnotations(), fieldInfo.getTagBits(), newElements); } } /**
/** * Creates the handles and infos for the fields of the given binary type. * Adds new handles to the given vector. */ private void generateFieldInfos(IType type, IBinaryType typeInfo, HashMap newElements, ArrayList childrenHandles) { // Make the fields IBinaryField[] fields = typeInfo.getFields(); if (fields == null) { return; } JavaModelManager manager = JavaModelManager.getJavaModelManager(); for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) { IBinaryField fieldInfo = fields[i]; BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName()))); newElements.put(field, fieldInfo); childrenHandles.add(field); generateAnnotationsInfos(field, fieldInfo.getAnnotations(), fieldInfo.getTagBits(), newElements); } } /**
/** * Creates the handles and infos for the fields of the given binary type. * Adds new handles to the given vector. */ private void generateFieldInfos(IType type, IBinaryType typeInfo, HashMap newElements, ArrayList childrenHandles) { // Make the fields IBinaryField[] fields = typeInfo.getFields(); if (fields == null) { return; } JavaModelManager manager = JavaModelManager.getJavaModelManager(); for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) { IBinaryField fieldInfo = fields[i]; BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName()))); newElements.put(field, fieldInfo); childrenHandles.add(field); generateAnnotationsInfos(field, fieldInfo.getAnnotations(), fieldInfo.getTagBits(), newElements); } } /**
/** * Creates the handles and infos for the fields of the given binary type. * Adds new handles to the given vector. */ private void generateFieldInfos(IType type, IBinaryType typeInfo, HashMap newElements, ArrayList childrenHandles) { // Make the fields IBinaryField[] fields = typeInfo.getFields(); if (fields == null) { return; } JavaModelManager manager = JavaModelManager.getJavaModelManager(); for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) { IBinaryField fieldInfo = fields[i]; BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName()))); newElements.put(field, fieldInfo); childrenHandles.add(field); generateAnnotationsInfos(field, fieldInfo.getAnnotations(), fieldInfo.getTagBits(), newElements); } } /**
/** * Creates the handles and infos for the fields of the given binary type. * Adds new handles to the given vector. */ private void generateFieldInfos(IType type, IBinaryType typeInfo, HashMap newElements, ArrayList childrenHandles) { // Make the fields IBinaryField[] fields = typeInfo.getFields(); if (fields == null) { return; } JavaModelManager manager = JavaModelManager.getJavaModelManager(); for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) { IBinaryField fieldInfo = fields[i]; BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName()))); newElements.put(field, fieldInfo); childrenHandles.add(field); generateAnnotationsInfos(field, fieldInfo.getAnnotations(), fieldInfo.getTagBits(), newElements); } } /**
/** * Creates the handles and infos for the fields of the given binary type. * Adds new handles to the given vector. */ private void generateFieldInfos(IType type, IBinaryType typeInfo, HashMap newElements, ArrayList childrenHandles) { // Make the fields IBinaryField[] fields = typeInfo.getFields(); if (fields == null) { return; } JavaModelManager manager = JavaModelManager.getJavaModelManager(); for (int i = 0, fieldCount = fields.length; i < fieldCount; i++) { IBinaryField fieldInfo = fields[i]; BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName()))); newElements.put(field, fieldInfo); childrenHandles.add(field); generateAnnotationsInfos(field, fieldInfo.getAnnotations(), fieldInfo.getTagBits(), newElements); } } /**
private static void compareFields(String contextPrefix, IBinaryField field1, IBinaryField field2) { contextPrefix = contextPrefix + "." + safeString(field1.getName()); //$NON-NLS-1$ compareAnnotations(contextPrefix, field1.getAnnotations(), field2.getAnnotations()); assertEquals(contextPrefix + ": Constants not equal", field1.getConstant(), field2.getConstant()); //$NON-NLS-1$ compareGenericSignatures(contextPrefix + ": The generic signature did not match", field1.getGenericSignature(), //$NON-NLS-1$ field2.getGenericSignature()); assertEquals(contextPrefix + ": The modifiers did not match", field1.getModifiers(), field2.getModifiers()); //$NON-NLS-1$ assertEquals(contextPrefix + ": The tag bits did not match", field1.getTagBits(), field2.getTagBits()); //$NON-NLS-1$ assertEquals(contextPrefix + ": The names did not match", field1.getName(), field2.getName()); //$NON-NLS-1$ compareTypeAnnotations(contextPrefix, field1.getTypeAnnotations(), field2.getTypeAnnotations()); assertEquals(contextPrefix + ": The type names did not match", field1.getTypeName(), field2.getTypeName()); //$NON-NLS-1$ }
private static void compareFields(String contextPrefix, IBinaryField field1, IBinaryField field2) { contextPrefix = contextPrefix + "." + safeString(field1.getName()); //$NON-NLS-1$ compareAnnotations(contextPrefix, field1.getAnnotations(), field2.getAnnotations()); assertEquals(contextPrefix + ": Constants not equal", field1.getConstant(), field2.getConstant()); //$NON-NLS-1$ compareGenericSignatures(contextPrefix + ": The generic signature did not match", field1.getGenericSignature(), //$NON-NLS-1$ field2.getGenericSignature()); assertEquals(contextPrefix + ": The modifiers did not match", field1.getModifiers(), field2.getModifiers()); //$NON-NLS-1$ assertEquals(contextPrefix + ": The tag bits did not match", field1.getTagBits(), field2.getTagBits()); //$NON-NLS-1$ assertEquals(contextPrefix + ": The names did not match", field1.getName(), field2.getName()); //$NON-NLS-1$ compareTypeAnnotations(contextPrefix, field1.getTypeAnnotations(), field2.getTypeAnnotations()); assertEquals(contextPrefix + ": The type names did not match", field1.getTypeName(), field2.getTypeName()); //$NON-NLS-1$ }
field.tagBits |= binaryField.getTagBits(); if (hasRestrictedAccess) field.modifiers |= ExtraCompilerModifiers.AccRestrictedAccess;
field.tagBits |= binaryField.getTagBits(); if (hasRestrictedAccess) field.modifiers |= ExtraCompilerModifiers.AccRestrictedAccess;
field.tagBits |= binaryField.getTagBits(); if (hasRestrictedAccess) field.modifiers |= ExtraCompilerModifiers.AccRestrictedAccess;
field.tagBits |= binaryField.getTagBits(); if (hasRestrictedAccess) field.modifiers |= ExtraCompilerModifiers.AccRestrictedAccess;
/** * Adds the given field to the given type */ private void addField(NdType type, IBinaryField nextField) throws CoreException { NdVariable variable = type.createVariable(); variable.setName(nextField.getName()); if (nextField.getGenericSignature() != null) { variable.setVariableFlag(NdVariable.FLG_GENERIC_SIGNATURE_PRESENT); } attachAnnotations(variable, nextField.getAnnotations()); variable.setConstant(NdConstant.create(getNd(), nextField.getConstant())); variable.setModifiers(nextField.getModifiers()); SignatureWrapper nextTypeSignature = GenericSignatures.getGenericSignatureFor(nextField); IBinaryTypeAnnotation[] typeAnnotations = nextField.getTypeAnnotations(); if (typeAnnotations != null) { variable.allocateTypeAnnotations(typeAnnotations.length); for (IBinaryTypeAnnotation next : typeAnnotations) { NdTypeAnnotation annotation = variable.createTypeAnnotation(); initTypeAnnotation(annotation, next); } } variable.setType(createTypeSignature(nextTypeSignature, nextField.getTypeName())); variable.setTagBits(nextField.getTagBits()); }
/** * Adds the given field to the given type */ private void addField(NdType type, IBinaryField nextField) throws CoreException { NdVariable variable = type.createVariable(); variable.setName(nextField.getName()); if (nextField.getGenericSignature() != null) { variable.setVariableFlag(NdVariable.FLG_GENERIC_SIGNATURE_PRESENT); } attachAnnotations(variable, nextField.getAnnotations()); variable.setConstant(NdConstant.create(getNd(), nextField.getConstant())); variable.setModifiers(nextField.getModifiers()); SignatureWrapper nextTypeSignature = GenericSignatures.getGenericSignatureFor(nextField); IBinaryTypeAnnotation[] typeAnnotations = nextField.getTypeAnnotations(); if (typeAnnotations != null) { variable.allocateTypeAnnotations(typeAnnotations.length); for (IBinaryTypeAnnotation next : typeAnnotations) { NdTypeAnnotation annotation = variable.createTypeAnnotation(); initTypeAnnotation(annotation, next); } } variable.setType(createTypeSignature(nextTypeSignature, nextField.getTypeName())); variable.setTagBits(nextField.getTagBits()); }