Example usage for org.eclipse.jdt.internal.compiler.parser RecoveredType add

List of usage examples for org.eclipse.jdt.internal.compiler.parser RecoveredType add

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.parser RecoveredType add.

Prototype

public void add(TypeParameter[] parameters, int startPos) 

Source Link

Usage

From source file:org.eclipse.jdt.internal.compiler.parser.Parser.java

License:Open Source License

protected void consumeTypeParameters() {
    int startPos = this.intStack[this.intPtr--];

    if (this.currentElement != null) {
        if (this.currentElement instanceof RecoveredType) {
            RecoveredType recoveredType = (RecoveredType) this.currentElement;
            int length = this.genericsLengthStack[this.genericsLengthPtr];
            TypeParameter[] typeParameters = new TypeParameter[length];
            System.arraycopy(this.genericsStack, this.genericsPtr - length + 1, typeParameters, 0, length);

            recoveredType.add(typeParameters, startPos);
        }//from w  w w. j  a  v a 2 s. co m
    }

    if (!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5
            && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
        int length = this.genericsLengthStack[this.genericsLengthPtr];
        problemReporter().invalidUsageOfTypeParameters(
                (TypeParameter) this.genericsStack[this.genericsPtr - length + 1],
                (TypeParameter) this.genericsStack[this.genericsPtr]);
    }
}