/** * When a method is accessed via SourceTypeBinding.resolveTypesFor(MethodBinding) * we create the argument binding and resolve annotations in order to compute null annotation tagbits. */ public void createArgumentBindings() { if (this.arguments != null && this.binding != null) { for (int i = 0, length = this.arguments.length; i < length; i++) { Argument argument = this.arguments[i]; argument.createBinding(this.scope, this.binding.parameters[i]); // createBinding() has resolved annotations, now transfer nullness info from the argument to the method: if ((argument.binding.tagBits & (TagBits.AnnotationNonNull|TagBits.AnnotationNullable)) != 0) { if (this.binding.parameterNonNullness == null) this.binding.parameterNonNullness = new Boolean[this.arguments.length]; this.binding.parameterNonNullness[i] = Boolean.valueOf((argument.binding.tagBits & TagBits.AnnotationNonNull) != 0); } } } }
static void createArgumentBindings(Argument[] arguments, MethodBinding binding, MethodScope scope) { boolean useTypeAnnotations = scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8; if (arguments != null && binding != null) { for (int i = 0, length = arguments.length; i < length; i++) { Argument argument = arguments[i]; binding.parameters[i] = argument.createBinding(scope, binding.parameters[i]); if (useTypeAnnotations) continue; // no business with SE7 null annotations in the 1.8 case. // createBinding() has resolved annotations, now transfer nullness info from the argument to the method: long argTypeTagBits = (argument.binding.tagBits & TagBits.AnnotationNullMASK); if (argTypeTagBits != 0) { if (binding.parameterNonNullness == null) { binding.parameterNonNullness = new Boolean[arguments.length]; binding.tagBits |= TagBits.IsNullnessKnown; } binding.parameterNonNullness[i] = Boolean.valueOf(argTypeTagBits == TagBits.AnnotationNonNull); } } } }
static void createArgumentBindings(Argument[] arguments, MethodBinding binding, MethodScope scope) { boolean useTypeAnnotations = scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8; if (arguments != null && binding != null) { for (int i = 0, length = arguments.length; i < length; i++) { Argument argument = arguments[i]; binding.parameters[i] = argument.createBinding(scope, binding.parameters[i]); if (useTypeAnnotations) continue; // no business with SE7 null annotations in the 1.8 case. // createBinding() has resolved annotations, now transfer nullness info from the argument to the method: long argTypeTagBits = (argument.binding.tagBits & TagBits.AnnotationNullMASK); if (argTypeTagBits != 0) { if (binding.parameterNonNullness == null) { binding.parameterNonNullness = new Boolean[arguments.length]; binding.tagBits |= TagBits.IsNullnessKnown; } binding.parameterNonNullness[i] = Boolean.valueOf(argTypeTagBits == TagBits.AnnotationNonNull); } } } }
static void createArgumentBindings(Argument[] arguments, MethodBinding binding, MethodScope scope) { boolean useTypeAnnotations = scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8; if (arguments != null && binding != null) { for (int i = 0, length = arguments.length; i < length; i++) { Argument argument = arguments[i]; binding.parameters[i] = argument.createBinding(scope, binding.parameters[i]); if (useTypeAnnotations) continue; // no business with SE7 null annotations in the 1.8 case. // createBinding() has resolved annotations, now transfer nullness info from the argument to the method: long argTypeTagBits = (argument.binding.tagBits & TagBits.AnnotationNullMASK); if (argTypeTagBits != 0) { if (binding.parameterNonNullness == null) { binding.parameterNonNullness = new Boolean[arguments.length]; binding.tagBits |= TagBits.IsNullnessKnown; } binding.parameterNonNullness[i] = Boolean.valueOf(argTypeTagBits == TagBits.AnnotationNonNull); } } } }
static void createArgumentBindings(Argument[] arguments, MethodBinding binding, MethodScope scope) { boolean useTypeAnnotations = scope.environment().usesNullTypeAnnotations(); if (arguments != null && binding != null) { for (int i = 0, length = arguments.length; i < length; i++) { Argument argument = arguments[i]; binding.parameters[i] = argument.createBinding(scope, binding.parameters[i]); if (useTypeAnnotations) continue; // no business with SE7 null annotations in the 1.8 case. // createBinding() has resolved annotations, now transfer nullness info from the argument to the method: long argTypeTagBits = (argument.binding.tagBits & TagBits.AnnotationNullMASK); if (argTypeTagBits != 0) { if (binding.parameterNonNullness == null) { binding.parameterNonNullness = new Boolean[arguments.length]; binding.tagBits |= TagBits.IsNullnessKnown; } binding.parameterNonNullness[i] = Boolean.valueOf(argTypeTagBits == TagBits.AnnotationNonNull); } } } }
static void createArgumentBindings(Argument[] arguments, MethodBinding binding, MethodScope scope) { boolean useTypeAnnotations = scope.environment().usesNullTypeAnnotations(); if (arguments != null && binding != null) { for (int i = 0, length = arguments.length; i < length; i++) { Argument argument = arguments[i]; binding.parameters[i] = argument.createBinding(scope, binding.parameters[i]); if (useTypeAnnotations) continue; // no business with SE7 null annotations in the 1.8 case. // createBinding() has resolved annotations, now transfer nullness info from the argument to the method: long argTypeTagBits = (argument.binding.tagBits & TagBits.AnnotationNullMASK); if (argTypeTagBits != 0) { if (binding.parameterNonNullness == null) { binding.parameterNonNullness = new Boolean[arguments.length]; binding.tagBits |= TagBits.IsNullnessKnown; } binding.parameterNonNullness[i] = Boolean.valueOf(argTypeTagBits == TagBits.AnnotationNonNull); } } } }
static void createArgumentBindings(Argument[] arguments, MethodBinding binding, MethodScope scope) { boolean useTypeAnnotations = scope.environment().usesNullTypeAnnotations(); if (arguments != null && binding != null) { for (int i = 0, length = arguments.length; i < length; i++) { Argument argument = arguments[i]; binding.parameters[i] = argument.createBinding(scope, binding.parameters[i]); if (useTypeAnnotations) continue; // no business with SE7 null annotations in the 1.8 case. // createBinding() has resolved annotations, now transfer nullness info from the argument to the method: long argTypeTagBits = (argument.binding.tagBits & TagBits.AnnotationNullMASK); if (argTypeTagBits != 0) { if (binding.parameterNonNullness == null) { binding.parameterNonNullness = new Boolean[arguments.length]; binding.tagBits |= TagBits.IsNullnessKnown; } binding.parameterNonNullness[i] = Boolean.valueOf(argTypeTagBits == TagBits.AnnotationNonNull); } } } }
static void createArgumentBindings(Argument[] arguments, MethodBinding binding, MethodScope scope) { boolean useTypeAnnotations = scope.environment().usesNullTypeAnnotations(); if (arguments != null && binding != null) { for (int i = 0, length = arguments.length; i < length; i++) { Argument argument = arguments[i]; binding.parameters[i] = argument.createBinding(scope, binding.parameters[i]); if (useTypeAnnotations) continue; // no business with SE7 null annotations in the 1.8 case. // createBinding() has resolved annotations, now transfer nullness info from the argument to the method: long argTypeTagBits = (argument.binding.tagBits & TagBits.AnnotationNullMASK); if (argTypeTagBits != 0) { if (binding.parameterNonNullness == null) { binding.parameterNonNullness = new Boolean[arguments.length]; binding.tagBits |= TagBits.IsNullnessKnown; } binding.parameterNonNullness[i] = Boolean.valueOf(argTypeTagBits == TagBits.AnnotationNonNull); } } } }
static void createArgumentBindings(Argument[] arguments, MethodBinding binding, MethodScope scope) { boolean useTypeAnnotations = scope.environment().usesNullTypeAnnotations(); if (arguments != null && binding != null) { for (int i = 0, length = arguments.length; i < length; i++) { Argument argument = arguments[i]; binding.parameters[i] = argument.createBinding(scope, binding.parameters[i]); if (useTypeAnnotations) continue; // no business with SE7 null annotations in the 1.8 case. // createBinding() has resolved annotations, now transfer nullness info from the argument to the method: long argTypeTagBits = (argument.binding.tagBits & TagBits.AnnotationNullMASK); if (argTypeTagBits != 0) { if (binding.parameterNonNullness == null) { binding.parameterNonNullness = new Boolean[arguments.length]; binding.tagBits |= TagBits.IsNullnessKnown; } binding.parameterNonNullness[i] = Boolean.valueOf(argTypeTagBits == TagBits.AnnotationNonNull); } } } }
public void bind(MethodScope scope, TypeBinding typeBinding, boolean used) { createBinding(scope, typeBinding); // basically a no-op if createBinding() was called before // record the resolved type into the type reference Binding existingVariable = scope.getBinding(this.name, Binding.VARIABLE, this, false /*do not resolve hidden field*/); if (existingVariable != null && existingVariable.isValidBinding()){ if (existingVariable instanceof LocalVariableBinding && this.hiddenVariableDepth == 0) { scope.problemReporter().redefineArgument(this); } else { boolean isSpecialArgument = false; if (existingVariable instanceof FieldBinding) { if (scope.isInsideConstructor()) { isSpecialArgument = true; // constructor argument } else { AbstractMethodDeclaration methodDecl = scope.referenceMethod(); if (methodDecl != null && CharOperation.prefixEquals(SET, methodDecl.selector)) { isSpecialArgument = true; // setter argument } } } scope.problemReporter().localVariableHiding(this, existingVariable, isSpecialArgument); } } scope.addLocalVariable(this.binding); this.binding.useFlag = used ? LocalVariableBinding.USED : LocalVariableBinding.UNUSED; }
public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { TypeBinding newTypeBinding = createBinding(scope, typeBinding); // basically a no-op if createBinding() was called before
public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { TypeBinding newTypeBinding = createBinding(scope, typeBinding); // basically a no-op if createBinding() was called before // record the resolved type into the type reference Binding existingVariable = scope.getBinding(this.name, Binding.VARIABLE, this, false /*do not resolve hidden field*/); if (existingVariable != null && existingVariable.isValidBinding()){ final boolean localExists = existingVariable instanceof LocalVariableBinding; if (localExists && (this.bits & ASTNode.ShadowsOuterLocal) != 0 && scope.isLambdaSubscope()) { scope.problemReporter().lambdaRedeclaresArgument(this); } else if (localExists && this.hiddenVariableDepth == 0) { scope.problemReporter().redefineArgument(this); } else { boolean isSpecialArgument = false; if (existingVariable instanceof FieldBinding) { if (scope.isInsideConstructor()) { isSpecialArgument = true; // constructor argument } else { AbstractMethodDeclaration methodDecl = scope.referenceMethod(); if (methodDecl != null && CharOperation.prefixEquals(SET, methodDecl.selector)) { isSpecialArgument = true; // setter argument } } } scope.problemReporter().localVariableHiding(this, existingVariable, isSpecialArgument); } } scope.addLocalVariable(this.binding); this.binding.useFlag = used ? LocalVariableBinding.USED : LocalVariableBinding.UNUSED; return newTypeBinding; }
public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { TypeBinding newTypeBinding = createBinding(scope, typeBinding); // basically a no-op if createBinding() was called before // record the resolved type into the type reference Binding existingVariable = scope.getBinding(this.name, Binding.VARIABLE, this, false /*do not resolve hidden field*/); if (existingVariable != null && existingVariable.isValidBinding()){ final boolean localExists = existingVariable instanceof LocalVariableBinding; if (localExists && (this.bits & ASTNode.ShadowsOuterLocal) != 0 && scope.isLambdaSubscope()) { scope.problemReporter().lambdaRedeclaresArgument(this); } else if (localExists && this.hiddenVariableDepth == 0) { scope.problemReporter().redefineArgument(this); } else { boolean isSpecialArgument = false; if (existingVariable instanceof FieldBinding) { if (scope.isInsideConstructor()) { isSpecialArgument = true; // constructor argument } else { AbstractMethodDeclaration methodDecl = scope.referenceMethod(); if (methodDecl != null && CharOperation.prefixEquals(SET, methodDecl.selector)) { isSpecialArgument = true; // setter argument } } } scope.problemReporter().localVariableHiding(this, existingVariable, isSpecialArgument); } } scope.addLocalVariable(this.binding); this.binding.useFlag = used ? LocalVariableBinding.USED : LocalVariableBinding.UNUSED; return newTypeBinding; }
public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { TypeBinding newTypeBinding = createBinding(scope, typeBinding); // basically a no-op if createBinding() was called before // record the resolved type into the type reference Binding existingVariable = scope.getBinding(this.name, Binding.VARIABLE, this, false /*do not resolve hidden field*/); if (existingVariable != null && existingVariable.isValidBinding()){ final boolean localExists = existingVariable instanceof LocalVariableBinding; if (localExists && (this.bits & ASTNode.ShadowsOuterLocal) != 0 && scope.isLambdaSubscope()) { scope.problemReporter().lambdaRedeclaresArgument(this); } else if (localExists && this.hiddenVariableDepth == 0) { scope.problemReporter().redefineArgument(this); } else { boolean isSpecialArgument = false; if (existingVariable instanceof FieldBinding) { if (scope.isInsideConstructor()) { isSpecialArgument = true; // constructor argument } else { AbstractMethodDeclaration methodDecl = scope.referenceMethod(); if (methodDecl != null && CharOperation.prefixEquals(SET, methodDecl.selector)) { isSpecialArgument = true; // setter argument } } } scope.problemReporter().localVariableHiding(this, existingVariable, isSpecialArgument); } } scope.addLocalVariable(this.binding); this.binding.useFlag = used ? LocalVariableBinding.USED : LocalVariableBinding.UNUSED; return newTypeBinding; }
public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { TypeBinding newTypeBinding = createBinding(scope, typeBinding); // basically a no-op if createBinding() was called before
public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { TypeBinding newTypeBinding = createBinding(scope, typeBinding); // basically a no-op if createBinding() was called before
public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { TypeBinding newTypeBinding = createBinding(scope, typeBinding); // basically a no-op if createBinding() was called before
public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used) { TypeBinding newTypeBinding = createBinding(scope, typeBinding); // basically a no-op if createBinding() was called before