public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this; } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this; } /*
public RecoveredElement add(LocalDeclaration localDeclaration, int bracketBalanceValue) { /* do not consider a type starting passed the type end (if set) it must be belonging to an enclosing type */ if (this.fieldDeclaration.declarationSourceEnd != 0 && localDeclaration.declarationSourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(localDeclaration, bracketBalanceValue); } /* method body should have been created */ Block block = new Block(0); block.sourceStart = ((Initializer)this.fieldDeclaration).sourceStart; RecoveredElement element = this.add(block, 1); if (this.initializerBody != null) { this.initializerBody.attachPendingModifiers( this.pendingAnnotations, this.pendingAnnotationCount, this.pendingModifiers, this.pendingModifersSourceStart); } resetPendingModifiers(); return element.add(localDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(Statement statement, int bracketBalanceValue) { /* do not consider a statement starting passed the initializer end (if set) it must be belonging to an enclosing type */ if (this.fieldDeclaration.declarationSourceEnd != 0 && statement.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(statement, bracketBalanceValue); } /* initializer body should have been created */ Block block = new Block(0); block.sourceStart = ((Initializer)this.fieldDeclaration).sourceStart; RecoveredElement element = this.add(block, 1); if (this.initializerBody != null) { this.initializerBody.attachPendingModifiers( this.pendingAnnotations, this.pendingAnnotationCount, this.pendingModifiers, this.pendingModifersSourceStart); } resetPendingModifiers(); return element.add(statement, bracketBalanceValue); } public RecoveredElement add(TypeDeclaration typeDeclaration, int bracketBalanceValue) {
public RecoveredElement add(Statement statement, int bracketBalanceValue) { /* do not consider a statement starting passed the initializer end (if set) it must be belonging to an enclosing type */ if (this.fieldDeclaration.declarationSourceEnd != 0 && statement.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(statement, bracketBalanceValue); } /* initializer body should have been created */ Block block = new Block(0); block.sourceStart = ((Initializer)this.fieldDeclaration).sourceStart; RecoveredElement element = this.add(block, 1); if (this.initializerBody != null) { this.initializerBody.attachPendingModifiers( this.pendingAnnotations, this.pendingAnnotationCount, this.pendingModifiers, this.pendingModifersSourceStart); } resetPendingModifiers(); return element.add(statement, bracketBalanceValue); } public RecoveredElement add(TypeDeclaration typeDeclaration, int bracketBalanceValue) {
@Override public RecoveredElement add(Statement statement, int bracketBalanceValue) { /* do not consider a statement starting passed the initializer end (if set) it must be belonging to an enclosing type */ if (this.fieldDeclaration.declarationSourceEnd != 0 && statement.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(statement, bracketBalanceValue); } /* initializer body should have been created */ Block block = new Block(0); block.sourceStart = ((Initializer)this.fieldDeclaration).sourceStart; RecoveredElement element = this.add(block, 1); if (this.initializerBody != null) { this.initializerBody.attachPendingModifiers( this.pendingAnnotations, this.pendingAnnotationCount, this.pendingModifiers, this.pendingModifersSourceStart); } resetPendingModifiers(); return element.add(statement, bracketBalanceValue); } @Override
public RecoveredElement add(LocalDeclaration localDeclaration, int bracketBalanceValue) { /* do not consider a type starting passed the type end (if set) it must be belonging to an enclosing type */ if (this.fieldDeclaration.declarationSourceEnd != 0 && localDeclaration.declarationSourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(localDeclaration, bracketBalanceValue); } /* method body should have been created */ Block block = new Block(0); block.sourceStart = ((Initializer)this.fieldDeclaration).sourceStart; RecoveredElement element = this.add(block, 1); if (this.initializerBody != null) { this.initializerBody.attachPendingModifiers( this.pendingAnnotations, this.pendingAnnotationCount, this.pendingModifiers, this.pendingModifersSourceStart); } resetPendingModifiers(); return element.add(localDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(Statement statement, int bracketBalanceValue) { /* do not consider a statement starting passed the initializer end (if set) it must be belonging to an enclosing type */ if (this.fieldDeclaration.declarationSourceEnd != 0 && statement.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(statement, bracketBalanceValue); } /* initializer body should have been created */ Block block = new Block(0); block.sourceStart = ((Initializer)this.fieldDeclaration).sourceStart; RecoveredElement element = this.add(block, 1); if (this.initializerBody != null) { this.initializerBody.attachPendingModifiers( this.pendingAnnotations, this.pendingAnnotationCount, this.pendingModifiers, this.pendingModifersSourceStart); } resetPendingModifiers(); return element.add(statement, bracketBalanceValue); } public RecoveredElement add(TypeDeclaration typeDeclaration, int bracketBalanceValue) {
public RecoveredElement add(LocalDeclaration localDeclaration, int bracketBalanceValue) { /* do not consider a type starting passed the type end (if set) it must be belonging to an enclosing type */ if (this.fieldDeclaration.declarationSourceEnd != 0 && localDeclaration.declarationSourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(localDeclaration, bracketBalanceValue); } /* method body should have been created */ Block block = new Block(0); block.sourceStart = ((Initializer)this.fieldDeclaration).sourceStart; RecoveredElement element = this.add(block, 1); if (this.initializerBody != null) { this.initializerBody.attachPendingModifiers( this.pendingAnnotations, this.pendingAnnotationCount, this.pendingModifiers, this.pendingModifersSourceStart); } resetPendingModifiers(); return element.add(localDeclaration, bracketBalanceValue); } /*
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } if (this.initializerBody == null) { return this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); } this.initializerBody.blockDeclaration.sourceEnd = 0; /* needed to allow adding more elements to the existing initializerBody */ if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this.initializerBody.add(nestedBlockDeclaration, bracketBalanceValue, true); } /*
@Override public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) { /* 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.fieldDeclaration.declarationSourceEnd > 0 && nestedBlockDeclaration.sourceStart > this.fieldDeclaration.declarationSourceEnd){ resetPendingModifiers(); if (this.parent == null) return this; // ignore return this.parent.add(nestedBlockDeclaration, bracketBalanceValue); } /* consider that if the opening brace was not found, it is there */ if (!this.foundOpeningBrace){ this.foundOpeningBrace = true; this.bracketBalance++; } if (this.initializerBody == null) { return this.initializerBody = new RecoveredBlock(nestedBlockDeclaration, this, bracketBalanceValue); } this.initializerBody.blockDeclaration.sourceEnd = 0; /* needed to allow adding more elements to the existing initializerBody */ if (nestedBlockDeclaration.sourceEnd == 0) return this.initializerBody; return this.initializerBody.add(nestedBlockDeclaration, bracketBalanceValue, true); } /*
@Override public RecoveredElement add(FieldDeclaration newFieldDeclaration, int bracketBalanceValue) { resetPendingModifiers(); /* local variables inside initializer can only be final and non void */ char[][] fieldTypeName; if ((newFieldDeclaration.modifiers & ~ClassFileConstants.AccFinal) != 0 /* local var can only be final */ || (newFieldDeclaration.type == null) // initializer || ((fieldTypeName = newFieldDeclaration.type.getTypeName()).length == 1 // non void && CharOperation.equals(fieldTypeName[0], TypeBinding.VOID.sourceName()))){ if (this.parent == null) return this; // ignore this.updateSourceEndIfNecessary(previousAvailableLineEnd(newFieldDeclaration.declarationSourceStart - 1)); return this.parent.add(newFieldDeclaration, bracketBalanceValue); } /* 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.fieldDeclaration.declarationSourceEnd > 0 && newFieldDeclaration.declarationSourceStart > this.fieldDeclaration.declarationSourceEnd){ if (this.parent == null) return this; // ignore return this.parent.add(newFieldDeclaration, bracketBalanceValue); } // still inside initializer, treat as local variable return this; // ignore } /*
public RecoveredElement add(FieldDeclaration newFieldDeclaration, int bracketBalanceValue) { resetPendingModifiers(); /* local variables inside initializer can only be final and non void */ char[][] fieldTypeName; if ((newFieldDeclaration.modifiers & ~ClassFileConstants.AccFinal) != 0 /* local var can only be final */ || (newFieldDeclaration.type == null) // initializer || ((fieldTypeName = newFieldDeclaration.type.getTypeName()).length == 1 // non void && CharOperation.equals(fieldTypeName[0], TypeBinding.VOID.sourceName()))){ if (this.parent == null) return this; // ignore this.updateSourceEndIfNecessary(previousAvailableLineEnd(newFieldDeclaration.declarationSourceStart - 1)); return this.parent.add(newFieldDeclaration, bracketBalanceValue); } /* 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.fieldDeclaration.declarationSourceEnd > 0 && newFieldDeclaration.declarationSourceStart > this.fieldDeclaration.declarationSourceEnd){ if (this.parent == null) return this; // ignore return this.parent.add(newFieldDeclaration, bracketBalanceValue); } // still inside initializer, treat as local variable return this; // ignore } /*