/** * Answer true if the receiver is suitable for assigning final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean allowBlankFinalFieldAssignment(FieldBinding binding) { if (TypeBinding.notEquals(enclosingReceiverType(), binding.declaringClass)) return false; MethodScope methodScope = methodScope(); if (methodScope.isStatic != binding.isStatic()) return false; if (methodScope.isLambdaScope()) return false; return methodScope.isInsideInitializer() // inside initializer || ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit }
/** * Answer true if the receiver is suitable for assigning final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean allowBlankFinalFieldAssignment(FieldBinding binding) { if (TypeBinding.notEquals(enclosingReceiverType(), binding.declaringClass)) return false; MethodScope methodScope = methodScope(); if (methodScope.isStatic != binding.isStatic()) return false; if (methodScope.isLambdaScope()) return false; return methodScope.isInsideInitializer() // inside initializer || ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit }
/** * Answer true if the receiver is suitable for assigning final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean allowBlankFinalFieldAssignment(FieldBinding binding) { if (TypeBinding.notEquals(enclosingReceiverType(), binding.declaringClass)) return false; MethodScope methodScope = methodScope(); if (methodScope.isStatic != binding.isStatic()) return false; if (methodScope.isLambdaScope()) return false; return methodScope.isInsideInitializer() // inside initializer || ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit }
/** * Answer true if the receiver is suitable for assigning final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean allowBlankFinalFieldAssignment(FieldBinding binding) { if (TypeBinding.notEquals(enclosingReceiverType(), binding.declaringClass)) return false; MethodScope methodScope = methodScope(); if (methodScope.isStatic != binding.isStatic()) return false; if (methodScope.isLambdaScope()) return false; return methodScope.isInsideInitializer() // inside initializer || ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit }
/** * Answer true if the receiver is suitable for assigning final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean allowBlankFinalFieldAssignment(FieldBinding binding) { if (TypeBinding.notEquals(enclosingReceiverType(), binding.declaringClass)) return false; MethodScope methodScope = methodScope(); if (methodScope.isStatic != binding.isStatic()) return false; if (methodScope.isLambdaScope()) return false; return methodScope.isInsideInitializer() // inside initializer || ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit }
/** * Answer true if the receiver is suitable for assigning final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean allowBlankFinalFieldAssignment(FieldBinding binding) { if (TypeBinding.notEquals(enclosingReceiverType(), binding.declaringClass)) return false; MethodScope methodScope = methodScope(); if (methodScope.isStatic != binding.isStatic()) return false; if (methodScope.isLambdaScope()) return false; return methodScope.isInsideInitializer() // inside initializer || ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit }
/** * Answer true if the receiver is suitable for assigning final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean allowBlankFinalFieldAssignment(FieldBinding binding) { if (TypeBinding.notEquals(enclosingReceiverType(), binding.declaringClass)) return false; MethodScope methodScope = methodScope(); if (methodScope.isStatic != binding.isStatic()) return false; if (methodScope.isLambdaScope()) return false; return methodScope.isInsideInitializer() // inside initializer || ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit }
protected IJavaElement findLocalElement(int pos, MethodScope scope) { if (scope != null && scope.isLambdaScope()) { IJavaElement parent = findLocalElement(pos, scope.enclosingMethodScope()); LambdaExpression expression = (LambdaExpression) scope.originalReferenceContext(); if (expression != null && expression.resolvedType != null && expression.resolvedType.isValidBinding()) { org.eclipse.jdt.internal.core.LambdaExpression lambdaElement = LambdaFactory.createLambdaExpression((JavaElement) parent, expression); return lambdaElement.getMethod(); } return parent; } return findLocalElement(pos); }
protected IJavaElement findLocalElement(int pos, MethodScope scope) { if (scope != null && scope.isLambdaScope()) { IJavaElement parent = findLocalElement(pos, scope.enclosingMethodScope()); LambdaExpression expression = (LambdaExpression) scope.originalReferenceContext(); if (expression != null && expression.resolvedType != null && expression.resolvedType.isValidBinding()) { org.eclipse.jdt.internal.core.LambdaExpression lambdaElement = LambdaFactory.createLambdaExpression((JavaElement) parent, expression); return lambdaElement.getMethod(); } return parent; } return findLocalElement(pos); }
/** * Answer true if the receiver is suitable for assigning final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean allowBlankFinalFieldAssignment(FieldBinding binding) { if (TypeBinding.notEquals(enclosingReceiverType(), binding.declaringClass)) return false; MethodScope methodScope = methodScope(); if (methodScope.isStatic != binding.isStatic()) return false; if (methodScope.isLambdaScope()) return false; return methodScope.isInsideInitializer() // inside initializer || ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit }
protected IJavaElement findLocalElement(int pos, MethodScope scope) { if (scope != null && scope.isLambdaScope()) { IJavaElement parent = findLocalElement(pos, scope.enclosingMethodScope()); LambdaExpression expression = (LambdaExpression) scope.originalReferenceContext(); if (expression != null && expression.resolvedType != null && expression.resolvedType.isValidBinding()) { org.eclipse.jdt.internal.core.LambdaExpression lambdaElement = LambdaFactory.createLambdaExpression((JavaElement) parent, expression); return lambdaElement.getMethod(); } return parent; } return findLocalElement(pos); }
protected IJavaElement findLocalElement(int pos, MethodScope scope) { if (scope != null && scope.isLambdaScope()) { IJavaElement parent = findLocalElement(pos, scope.enclosingMethodScope()); LambdaExpression expression = (LambdaExpression) scope.originalReferenceContext(); if (expression != null && expression.resolvedType != null && expression.resolvedType.isValidBinding()) { org.eclipse.jdt.internal.core.LambdaExpression lambdaElement = LambdaFactory.createLambdaExpression((JavaElement) parent, expression); return lambdaElement.getMethod(); } return parent; } return findLocalElement(pos); }
protected IJavaElement findLocalElement(int pos, MethodScope scope) { if (scope != null && scope.isLambdaScope()) { IJavaElement parent = findLocalElement(pos, scope.enclosingMethodScope()); LambdaExpression expression = (LambdaExpression) scope.originalReferenceContext(); if (expression != null && expression.resolvedType != null && expression.resolvedType.isValidBinding()) { org.eclipse.jdt.internal.core.LambdaExpression lambdaElement = LambdaFactory.createLambdaExpression((JavaElement) parent, expression); return lambdaElement.getMethod(); } return parent; } return findLocalElement(pos); }
if (currentMethodScope.isLambdaScope()) { LambdaExpression lambda = (LambdaExpression) currentMethodScope.referenceContext; SyntheticArgumentBinding syntheticArgument;
if (currentMethodScope.isLambdaScope()) { LambdaExpression lambda = (LambdaExpression) currentMethodScope.referenceContext; SyntheticArgumentBinding syntheticArgument;
if (currentMethodScope.isLambdaScope()) { LambdaExpression lambda = (LambdaExpression) currentMethodScope.referenceContext; SyntheticArgumentBinding syntheticArgument;
if (currentMethodScope.isLambdaScope()) { LambdaExpression lambda = (LambdaExpression) currentMethodScope.referenceContext; SyntheticArgumentBinding syntheticArgument;
/** * Returns true if the context requires to check initialization of final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean needBlankFinalFieldInitializationCheck(FieldBinding binding) { boolean isStatic = binding.isStatic(); ReferenceBinding fieldDeclaringClass = binding.declaringClass; // loop in enclosing context, until reaching the field declaring context MethodScope methodScope = methodScope(); while (methodScope != null) { if (methodScope.isStatic != isStatic) return false; if (methodScope.isLambdaScope()) return false; if (!methodScope.isInsideInitializer() // inside initializer && !((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod()) { // inside constructor or clinit return false; // found some non-initializer context } ReferenceBinding enclosingType = methodScope.enclosingReceiverType(); if (TypeBinding.equalsEquals(enclosingType, fieldDeclaringClass)) { return true; // found the field context, no need to check any further } if (!enclosingType.erasure().isAnonymousType()) { return false; // only check inside anonymous type } methodScope = methodScope.enclosingMethodScope(); } return false; }
/** * Returns true if the context requires to check initialization of final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean needBlankFinalFieldInitializationCheck(FieldBinding binding) { boolean isStatic = binding.isStatic(); ReferenceBinding fieldDeclaringClass = binding.declaringClass; // loop in enclosing context, until reaching the field declaring context MethodScope methodScope = methodScope(); while (methodScope != null) { if (methodScope.isStatic != isStatic) return false; if (methodScope.isLambdaScope()) return false; if (!methodScope.isInsideInitializer() // inside initializer && !((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod()) { // inside constructor or clinit return false; // found some non-initializer context } ReferenceBinding enclosingType = methodScope.enclosingReceiverType(); if (TypeBinding.equalsEquals(enclosingType, fieldDeclaringClass)) { return true; // found the field context, no need to check any further } if (!enclosingType.erasure().isAnonymousType()) { return false; // only check inside anonymous type } methodScope = methodScope.enclosingMethodScope(); } return false; }
/** * Returns true if the context requires to check initialization of final blank fields. * in other words, it is inside an initializer, a constructor or a clinit */ public final boolean needBlankFinalFieldInitializationCheck(FieldBinding binding) { boolean isStatic = binding.isStatic(); ReferenceBinding fieldDeclaringClass = binding.declaringClass; // loop in enclosing context, until reaching the field declaring context MethodScope methodScope = methodScope(); while (methodScope != null) { if (methodScope.isStatic != isStatic) return false; if (methodScope.isLambdaScope()) return false; if (!methodScope.isInsideInitializer() // inside initializer && !((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod()) { // inside constructor or clinit return false; // found some non-initializer context } ReferenceBinding enclosingType = methodScope.enclosingReceiverType(); if (TypeBinding.equalsEquals(enclosingType, fieldDeclaringClass)) { return true; // found the field context, no need to check any further } if (!enclosingType.erasure().isAnonymousType()) { return false; // only check inside anonymous type } methodScope = methodScope.enclosingMethodScope(); } return false; }