public boolean isNestmateOf(SourceTypeBinding other) { CompilerOptions options = this.scope.compilerOptions(); if (options.targetJDK < ClassFileConstants.JDK11 || options.complianceLevel < ClassFileConstants.JDK11) return false; // default false if level less than 11 SourceTypeBinding otherHost = other.getNestHost(); return TypeBinding.equalsEquals(this, other) || TypeBinding.equalsEquals(this.nestHost == null ? this : this.nestHost, otherHost == null ? other : otherHost); } public void addNestMember(SourceTypeBinding member) {
private void buildTypeVariables() { SourceTypeBinding sourceType = this.referenceContext.binding; TypeParameter[] typeParameters = this.referenceContext.typeParameters; // do not construct type variables if source < 1.5 if (typeParameters == null || compilerOptions().sourceLevel < ClassFileConstants.JDK1_5) { sourceType.typeVariables = Binding.NO_TYPE_VARIABLES; return; } sourceType.typeVariables = Binding.NO_TYPE_VARIABLES; // safety if (sourceType.id == TypeIds.T_JavaLangObject) { // handle the case of redefining java.lang.Object up front problemReporter().objectCannotBeGeneric(this.referenceContext); return; } sourceType.typeVariables = createTypeVariables(typeParameters, sourceType); sourceType.modifiers |= ExtraCompilerModifiers.AccGenericSignature; }
public synchronized ClassFile acquire(SourceTypeBinding typeBinding) { for (int i = 0; i < POOL_SIZE; i++) { ClassFile classFile = this.classFiles[i]; if (classFile == null) { ClassFile newClassFile = new ClassFile(typeBinding); this.classFiles[i] = newClassFile; newClassFile.isShared = true; return newClassFile; } if (!classFile.isShared) { classFile.reset(typeBinding, typeBinding.scope.compilerOptions()); classFile.isShared = true; return classFile; } } return new ClassFile(typeBinding); } public synchronized ClassFile acquireForModule(ModuleBinding moduleBinding, CompilerOptions options) {
public synchronized ClassFile acquire(SourceTypeBinding typeBinding) { for (int i = 0; i < POOL_SIZE; i++) { ClassFile classFile = this.classFiles[i]; if (classFile == null) { ClassFile newClassFile = new ClassFile(typeBinding); this.classFiles[i] = newClassFile; newClassFile.isShared = true; return newClassFile; } if (!classFile.isShared) { classFile.reset(typeBinding, typeBinding.scope.compilerOptions()); classFile.isShared = true; return classFile; } } return new ClassFile(typeBinding); } public synchronized ClassFile acquireForModule(ModuleBinding moduleBinding, CompilerOptions options) {
boolean areReturnTypesCompatible(MethodBinding one, MethodBinding two) { if (one.returnType == two.returnType) return true; if (this.type.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { return areReturnTypesCompatible0(one, two); } else { return areTypesEqual(one.returnType.erasure(), two.returnType.erasure()); } } boolean areTypesEqual(TypeBinding one, TypeBinding two) {
boolean areReturnTypesCompatible(MethodBinding one, MethodBinding two) { if (one.returnType == two.returnType) return true; if (this.type.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { return areReturnTypesCompatible0(one, two); } else { return areTypesEqual(one.returnType.erasure(), two.returnType.erasure()); } } boolean areTypesEqual(TypeBinding one, TypeBinding two) {
public ClassFile(SourceTypeBinding typeBinding) { // default constructor for subclasses this.constantPool = new ConstantPool(this); final CompilerOptions options = typeBinding.scope.compilerOptions(); this.targetJDK = options.targetJDK; this.produceAttributes = options.produceDebugAttributes; this.referenceBinding = typeBinding; this.isNestedType = typeBinding.isNestedType(); if (this.targetJDK >= ClassFileConstants.JDK1_6) { this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP_TABLE; this.codeStream = new StackMapFrameCodeStream(this); } else if (this.targetJDK == ClassFileConstants.CLDC_1_1) { this.targetJDK = ClassFileConstants.JDK1_1; // put back 45.3 this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP; this.codeStream = new StackMapFrameCodeStream(this); } else { this.codeStream = new CodeStream(this); } initByteArrays(); }
public ClassFile(SourceTypeBinding typeBinding) { // default constructor for subclasses this.constantPool = new ConstantPool(this); final CompilerOptions options = typeBinding.scope.compilerOptions(); this.targetJDK = options.targetJDK; this.produceAttributes = options.produceDebugAttributes; this.referenceBinding = typeBinding; this.isNestedType = typeBinding.isNestedType(); if (this.targetJDK >= ClassFileConstants.JDK1_6) { this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP_TABLE; this.codeStream = new StackMapFrameCodeStream(this); } else if (this.targetJDK == ClassFileConstants.CLDC_1_1) { this.targetJDK = ClassFileConstants.JDK1_1; // put back 45.3 this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP; this.codeStream = new StackMapFrameCodeStream(this); } else { this.codeStream = new CodeStream(this); } initByteArrays(); }
public ClassFile(SourceTypeBinding typeBinding) { // default constructor for subclasses this.constantPool = new ConstantPool(this); final CompilerOptions options = typeBinding.scope.compilerOptions(); this.targetJDK = options.targetJDK; this.produceAttributes = options.produceDebugAttributes; this.referenceBinding = typeBinding; this.isNestedType = typeBinding.isNestedType(); if (this.targetJDK >= ClassFileConstants.JDK1_6) { this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP_TABLE; this.codeStream = new StackMapFrameCodeStream(this); } else if (this.targetJDK == ClassFileConstants.CLDC_1_1) { this.targetJDK = ClassFileConstants.JDK1_1; // put back 45.3 this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP; this.codeStream = new StackMapFrameCodeStream(this); } else { this.codeStream = new CodeStream(this); } initByteArrays(); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, null /* anonymous super type*/, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }
void buildLocalTypeBinding(SourceTypeBinding enclosingType) { LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage); connectTypeHierarchy(); if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { checkParameterizedTypeBounds(); checkParameterizedSuperTypeCollisions(); } buildFieldsAndMethods(); localType.faultInTypesForFieldsAndMethods(); this.referenceContext.binding.verifyMethods(environment().methodVerifier()); }