// may be in a non necessary <clinit> for innerclass with static final constant fields
if (this.binding.isAbstract() || this.binding.isNative())
return;
ExceptionHandlingFlowContext methodContext =
new ExceptionHandlingFlowContext(
flowContext,
this,
this.binding.thrownExceptions,
null,
this.scope,
FlowInfo.DEAD_END);
// nullity and mark as assigned
analyseArguments(flowInfo);
if (this.arguments != null) {
for (int i = 0, count = this.arguments.length; i < count; i++) {
// if this method uses a type parameter declared by the declaring class,
// it can't be static. https://bugs.eclipse.org/bugs/show_bug.cgi?id=318682
if (this.arguments[i].binding != null && (this.arguments[i].binding.type instanceof TypeVariableBinding)) {
Binding declaringElement = ((TypeVariableBinding)this.arguments[i].binding.type).declaringElement;
if (this.binding != null && this.binding.declaringClass == declaringElement)
this.bits &= ~ASTNode.CanBeStatic;
}
}
}
if (this.binding.declaringClass instanceof MemberTypeBinding && !this.binding.declaringClass.isStatic()) {
// method of a non-static member type can't be static.
this.bits &= ~ASTNode.CanBeStatic;
}
// propagate to statements
if (this.statements != null) {
int complaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) == 0 ? Statement.NOT_COMPLAINED : Statement.COMPLAINED_FAKE_REACHABLE;
for (int i = 0, count = this.statements.length; i < count; i++) {
Statement stat = this.statements[i];
if ((complaintLevel = stat.complainIfUnreachable(flowInfo, this.scope, complaintLevel, true)) < Statement.COMPLAINED_UNREACHABLE) {
flowInfo = stat.analyseCode(this.scope, methodContext, flowInfo);
}
}
} else {
// method with empty body should not be flagged as static.
this.bits &= ~ASTNode.CanBeStatic;
}
// check for missing returning path
TypeBinding returnTypeBinding = this.binding.returnType;
if ((returnTypeBinding == TypeBinding.VOID) || isAbstract()) {
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0) {
this.bits |= ASTNode.NeedFreeReturn;
}
} else {
if (flowInfo != FlowInfo.DEAD_END) {
this.scope.problemReporter().shouldReturn(returnTypeBinding, this);
}
}
// check unreachable catch blocks
methodContext.complainIfUnusedExceptionHandlers(this);
// check unused parameters
this.scope.checkUnusedParameters(this.binding);
// check if the method could have been static
if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0) {
if(!this.binding.isOverriding() && !this.binding.isImplementing()) {