private boolean methodHasMissingSwitchDefault() { MethodScope methodScope = null; if (this.referenceContext instanceof Block) { methodScope = ((Block)this.referenceContext).scope.methodScope(); } else if (this.referenceContext instanceof AbstractMethodDeclaration) { methodScope = ((AbstractMethodDeclaration)this.referenceContext).scope; } return methodScope != null && methodScope.hasMissingSwitchDefault; } public void unmatchedBracket(int position, ReferenceContext context, CompilationResult compilationResult) {
private boolean methodHasMissingSwitchDefault() { MethodScope methodScope = null; if (this.referenceContext instanceof Block) { methodScope = ((Block)this.referenceContext).scope.methodScope(); } else if (this.referenceContext instanceof AbstractMethodDeclaration) { methodScope = ((AbstractMethodDeclaration)this.referenceContext).scope; } return methodScope != null && methodScope.hasMissingSwitchDefault; } public void unmatchedBracket(int position, ReferenceContext context, CompilationResult compilationResult) {
private boolean methodHasMissingSwitchDefault() { MethodScope methodScope = null; if (this.referenceContext instanceof Block) { methodScope = ((Block)this.referenceContext).scope.methodScope(); } else if (this.referenceContext instanceof AbstractMethodDeclaration) { methodScope = ((AbstractMethodDeclaration)this.referenceContext).scope; } return methodScope != null && methodScope.hasMissingSwitchDefault; } public void unmatchedBracket(int position, ReferenceContext context, CompilationResult compilationResult) {
private boolean methodHasMissingSwitchDefault() { MethodScope methodScope = null; if (this.referenceContext instanceof Block) { methodScope = ((Block)this.referenceContext).scope.methodScope(); } else if (this.referenceContext instanceof AbstractMethodDeclaration) { methodScope = ((AbstractMethodDeclaration)this.referenceContext).scope; } return methodScope != null && methodScope.hasMissingSwitchDefault; } public void unmatchedBracket(int position, ReferenceContext context, CompilationResult compilationResult) {
private boolean methodHasMissingSwitchDefault() { MethodScope methodScope = null; if (this.referenceContext instanceof Block) { methodScope = ((Block)this.referenceContext).scope.methodScope(); } else if (this.referenceContext instanceof AbstractMethodDeclaration) { methodScope = ((AbstractMethodDeclaration)this.referenceContext).scope; } return methodScope != null && methodScope.hasMissingSwitchDefault; } public void unmatchedBracket(int position, ReferenceContext context, CompilationResult compilationResult) {
private FakedTrackingVariable(BlockScope scope, ASTNode location, FlowInfo flowInfo, int nullStatus) { super(UNASSIGNED_CLOSEABLE_NAME, location.sourceStart, location.sourceEnd); this.type = new SingleTypeReference( TypeConstants.OBJECT, ((long)this.sourceStart <<32)+this.sourceEnd); this.methodScope = scope.methodScope(); this.originalBinding = null; resolve(scope); if (nullStatus != 0) flowInfo.markNullStatus(this.binding, nullStatus); // mark that this flow has seen the resource }
private void recordCallingClose(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Expression closeTarget) { FakedTrackingVariable trackingVariable = FakedTrackingVariable.getCloseTrackingVariable(closeTarget, flowInfo, flowContext); if (trackingVariable != null) { // null happens if target is not a local variable or not an AutoCloseable if (trackingVariable.methodScope == currentScope.methodScope()) { trackingVariable.markClose(flowInfo, flowContext); } else { trackingVariable.markClosedInNestedMethod(); } } }
private FakedTrackingVariable(BlockScope scope, ASTNode location, FlowInfo flowInfo, int nullStatus) { super(UNASSIGNED_CLOSEABLE_NAME, location.sourceStart, location.sourceEnd); this.type = new SingleTypeReference( TypeConstants.OBJECT, ((long)this.sourceStart <<32)+this.sourceEnd); this.methodScope = scope.methodScope(); this.originalBinding = null; resolve(scope); if (nullStatus != 0) flowInfo.markNullStatus(this.binding, nullStatus); // mark that this flow has seen the resource }
private void recordCallingClose(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Expression closeTarget) { FakedTrackingVariable trackingVariable = FakedTrackingVariable.getCloseTrackingVariable(closeTarget, flowInfo, flowContext); if (trackingVariable != null) { // null happens if target is not a local variable or not an AutoCloseable if (trackingVariable.methodScope == currentScope.methodScope()) { trackingVariable.markClose(flowInfo, flowContext); } else { trackingVariable.markClosedInNestedMethod(); } } }
public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; if (!isImplicitThis() &&!checkAccess(scope.methodScope())) { return null; } return this.resolvedType = scope.enclosingReceiverType(); }
private FakedTrackingVariable(BlockScope scope, ASTNode location, FlowInfo flowInfo, int nullStatus) { super(UNASSIGNED_CLOSEABLE_NAME, location.sourceStart, location.sourceEnd); this.type = new SingleTypeReference( TypeConstants.OBJECT, ((long)this.sourceStart <<32)+this.sourceEnd); this.methodScope = scope.methodScope(); this.originalBinding = null; resolve(scope); if (nullStatus != 0) flowInfo.markNullStatus(this.binding, nullStatus); // mark that this flow has seen the resource }
private void recordCallingClose(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Expression closeTarget) { FakedTrackingVariable trackingVariable = FakedTrackingVariable.getCloseTrackingVariable(closeTarget, flowInfo, flowContext); if (trackingVariable != null) { // null happens if target is not a local variable or not an AutoCloseable if (trackingVariable.methodScope == currentScope.methodScope()) { trackingVariable.markClose(flowInfo, flowContext); } else { trackingVariable.markClosedInNestedMethod(); } } }
private void recordCallingClose(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Expression closeTarget) { FakedTrackingVariable trackingVariable = FakedTrackingVariable.getCloseTrackingVariable(closeTarget, flowInfo, flowContext); if (trackingVariable != null) { // null happens if target is not a local variable or not an AutoCloseable if (trackingVariable.methodScope == currentScope.methodScope()) { trackingVariable.markClose(flowInfo, flowContext); } else { trackingVariable.markClosedInNestedMethod(); } } }
private void recordCallingClose(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Expression closeTarget) { FakedTrackingVariable trackingVariable = FakedTrackingVariable.getCloseTrackingVariable(closeTarget, flowInfo, flowContext); if (trackingVariable != null) { // null happens if target is not a local variable or not an AutoCloseable if (trackingVariable.methodScope == currentScope.methodScope()) { trackingVariable.markClose(flowInfo, flowContext); } else { trackingVariable.markClosedInNestedMethod(); } } }
private void recordCallingClose(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Expression closeTarget) { FakedTrackingVariable trackingVariable = FakedTrackingVariable.getCloseTrackingVariable(closeTarget, flowInfo, flowContext); if (trackingVariable != null) { // null happens if target is not a local variable or not an AutoCloseable if (trackingVariable.methodScope == currentScope.methodScope()) { trackingVariable.markClose(flowInfo, flowContext); } else { trackingVariable.markClosedInNestedMethod(); } } }
private void recordCallingClose(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Expression closeTarget) { FakedTrackingVariable trackingVariable = FakedTrackingVariable.getCloseTrackingVariable(closeTarget, flowInfo, flowContext); if (trackingVariable != null) { // null happens if target is not a local variable or not an AutoCloseable if (trackingVariable.methodScope == currentScope.methodScope()) { trackingVariable.markClose(flowInfo, flowContext); } else { trackingVariable.markClosedInNestedMethod(); } } }
private FakedTrackingVariable(BlockScope scope, ASTNode location, FlowInfo flowInfo, int nullStatus) { super(UNASSIGNED_CLOSEABLE_NAME, location.sourceStart, location.sourceEnd); this.type = new SingleTypeReference( TypeConstants.OBJECT, ((long)this.sourceStart <<32)+this.sourceEnd); this.methodScope = scope.methodScope(); this.originalBinding = null; resolve(scope); if (nullStatus != 0) flowInfo.markNullStatus(this.binding, nullStatus); // mark that this flow has seen the resource }
public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; if (!checkAccess(scope.methodScope())) return null; ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType(); if (enclosingReceiverType.id == T_JavaLangObject) { scope.problemReporter().cannotUseSuperInJavaLangObject(this); return null; } return this.resolvedType = enclosingReceiverType.superclass(); }
public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; if (!checkAccess(scope.methodScope())) return null; ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType(); if (enclosingReceiverType.id == T_JavaLangObject) { scope.problemReporter().cannotUseSuperInJavaLangObject(this); return null; } return this.resolvedType = enclosingReceiverType.superclass(); }
private boolean shouldGenerateImplicitLambda(BlockScope currentScope) { // these cases are either too complicated, impossible to handle or result in significant code duplication return (this.binding.isVarargs() || (isConstructorReference() && this.receiverType.syntheticOuterLocalVariables() != null && currentScope.methodScope().isStatic) || this.expectedType instanceof IntersectionCastTypeBinding || // marker interfaces require alternate meta factory. this.expectedType.findSuperTypeOriginatingFrom(currentScope.getJavaIoSerializable()) != null || // serialization support. this.requiresBridges()); // bridges. // To fix: We should opt for direct code generation wherever possible. }