public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
@Override public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) { resetPendingModifiers(); /* do not consider a nested block starting passed the block end (if set) it must be belonging to an enclosing block */ if (this.blockDeclaration.sourceEnd != 0 && stmt.sourceStart > this.blockDeclaration.sourceEnd){ if (delegatedByParent) return this; //ignore return this.parent.add(stmt, bracketBalanceValue); } RecoveredStatement element = new RecoveredStatement(stmt, this, bracketBalanceValue); attach(element); if (stmt.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) { resetPendingModifiers(); /* do not consider a nested block starting passed the block end (if set) it must be belonging to an enclosing block */ if (this.blockDeclaration.sourceEnd != 0 && stmt.sourceStart > this.blockDeclaration.sourceEnd){ if (delegatedByParent) return this; //ignore return this.parent.add(stmt, bracketBalanceValue); } RecoveredStatement element = new RecoveredStatement(stmt, this, bracketBalanceValue); attach(element); if (stmt.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) { resetPendingModifiers(); /* do not consider a nested block starting passed the block end (if set) it must be belonging to an enclosing block */ if (this.blockDeclaration.sourceEnd != 0 && stmt.sourceStart > this.blockDeclaration.sourceEnd){ if (delegatedByParent) return this; //ignore return this.parent.add(stmt, bracketBalanceValue); } RecoveredStatement element = new RecoveredStatement(stmt, this, bracketBalanceValue); attach(element); if (stmt.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) { resetPendingModifiers(); /* do not consider a nested block starting passed the block end (if set) it must be belonging to an enclosing block */ if (this.blockDeclaration.sourceEnd != 0 && stmt.sourceStart > this.blockDeclaration.sourceEnd){ if (delegatedByParent) return this; //ignore return this.parent.add(stmt, bracketBalanceValue); } RecoveredStatement element = new RecoveredStatement(stmt, this, bracketBalanceValue); attach(element); if (stmt.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) { resetPendingModifiers(); /* do not consider a nested block starting passed the block end (if set) it must be belonging to an enclosing block */ if (this.blockDeclaration.sourceEnd != 0 && stmt.sourceStart > this.blockDeclaration.sourceEnd){ if (delegatedByParent) return this; //ignore return this.parent.add(stmt, bracketBalanceValue); } RecoveredStatement element = new RecoveredStatement(stmt, this, bracketBalanceValue); attach(element); if (stmt.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) { resetPendingModifiers(); /* do not consider a nested block starting passed the block end (if set) it must be belonging to an enclosing block */ if (this.blockDeclaration.sourceEnd != 0 && stmt.sourceStart > this.blockDeclaration.sourceEnd){ if (delegatedByParent) return this; //ignore return this.parent.add(stmt, bracketBalanceValue); } RecoveredStatement element = new RecoveredStatement(stmt, this, bracketBalanceValue); attach(element); if (stmt.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) { resetPendingModifiers(); /* do not consider a nested block starting passed the block end (if set) it must be belonging to an enclosing block */ if (this.blockDeclaration.sourceEnd != 0 && stmt.sourceStart > this.blockDeclaration.sourceEnd){ if (delegatedByParent) return this; //ignore return this.parent.add(stmt, bracketBalanceValue); } RecoveredStatement element = new RecoveredStatement(stmt, this, bracketBalanceValue); attach(element); if (stmt.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) { if (stmt instanceof LambdaExpression) // lambdas are recovered up to the containing statement anyways. return this; resetPendingModifiers(); /* do not consider a nested block starting passed the block end (if set) it must be belonging to an enclosing block */ if (this.blockDeclaration.sourceEnd != 0 && stmt.sourceStart > this.blockDeclaration.sourceEnd){ if (delegatedByParent) return this; //ignore return this.parent.add(stmt, bracketBalanceValue); } RecoveredStatement element = new RecoveredStatement(stmt, this, bracketBalanceValue); attach(element); if (stmt.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) { resetPendingModifiers(); /* do not consider a nested block starting passed the block end (if set) it must be belonging to an enclosing block */ if (this.blockDeclaration.sourceEnd != 0 && stmt.sourceStart > this.blockDeclaration.sourceEnd){ if (delegatedByParent) return this; //ignore return this.parent.add(stmt, bracketBalanceValue); } RecoveredStatement element = new RecoveredStatement(stmt, this, bracketBalanceValue); attach(element); if (!isEndKnown(stmt)) return element; return this; } boolean isEndKnown(Statement stmt) {