public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue, boolean isArgument) { /* default behavior is to delegate recording to parent if any, do not consider elements passed the known end (if set) it must be belonging to an enclosing element */ if (this.methodDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.methodDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null){ return this; // ignore } else { return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace && !isArgument){ this.foundOpeningBrace = true; this.bracketBalance++; } if (this.methodBody != null) { this.methodBody.addBlockStatement(new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue)); } else { this.methodBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); } if (nestedBlockDeclaration.sourceEnd == 0) return this.methodBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue, boolean isArgument) { /* default behavior is to delegate recording to parent if any, do not consider elements passed the known end (if set) it must be belonging to an enclosing element */ if (this.methodDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.methodDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null){ return this; // ignore } else { return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace && !isArgument){ this.foundOpeningBrace = true; this.bracketBalance++; } if (this.methodBody != null) { this.methodBody.addBlockStatement(new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue)); } else { this.methodBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); } if (nestedBlockDeclaration.sourceEnd == 0) return this.methodBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*
@Override public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { 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 && nestedBlockDeclaration.sourceStart > this.blockDeclaration.sourceEnd){ return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } RecoveredBlock element = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); // if we have a pending Argument, promote it into the new block if (this.pendingArgument != null){ element.attach(this.pendingArgument); this.pendingArgument = null; } if(parser().statementRecoveryActivated) { addBlockStatement(element); } attach(element); if (nestedBlockDeclaration.sourceEnd == 0) return element; return this; } /*