protected void consumeReferenceExpression(ReferenceExpression referenceExpression) { pushOnExpressionStack(referenceExpression); if (!this.parsingJava8Plus) { problemReporter().referenceExpressionsNotBelow18(referenceExpression); } if (referenceExpression.compilationResult.getCompilationUnit() == null) { // unit built out of model. Stash a textual representation to enable RE.copy(). int length = referenceExpression.sourceEnd - referenceExpression.sourceStart + 1; System.arraycopy(this.scanner.getSource(), referenceExpression.sourceStart, referenceExpression.text = new char [length], 0, length); } this.referenceContext.compilationResult().hasFunctionalTypes = true; markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.METHOD_REFERENCE); } protected void consumeReferenceExpressionTypeArgumentsAndTrunk(boolean qualified) {
protected void consumeReferenceExpression(ReferenceExpression referenceExpression) { pushOnExpressionStack(referenceExpression); if (!this.parsingJava8Plus) { problemReporter().referenceExpressionsNotBelow18(referenceExpression); } if (referenceExpression.compilationResult.getCompilationUnit() == null) { // unit built out of model. Stash a textual representation to enable RE.copy(). int length = referenceExpression.sourceEnd - referenceExpression.sourceStart + 1; System.arraycopy(this.scanner.getSource(), referenceExpression.sourceStart, referenceExpression.text = new char [length], 0, length); } this.referenceContext.compilationResult().hasFunctionalTypes = true; markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.METHOD_REFERENCE); } protected void consumeReferenceExpressionTypeArgumentsAndTrunk(boolean qualified) {
protected void consumeReferenceExpression(ReferenceExpression referenceExpression) { pushOnExpressionStack(referenceExpression); if (!this.parsingJava8Plus) { problemReporter().referenceExpressionsNotBelow18(referenceExpression); } if (referenceExpression.compilationResult.getCompilationUnit() == null) { // unit built out of model. Stash a textual representation to enable RE.copy(). int length = referenceExpression.sourceEnd - referenceExpression.sourceStart + 1; System.arraycopy(this.scanner.getSource(), referenceExpression.sourceStart, referenceExpression.text = new char [length], 0, length); } this.referenceContext.compilationResult().hasFunctionalTypes = true; markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.METHOD_REFERENCE); } protected void consumeReferenceExpressionTypeArgumentsAndTrunk(boolean qualified) {
protected void consumeReferenceExpression(ReferenceExpression referenceExpression) { pushOnExpressionStack(referenceExpression); if (!this.parsingJava8Plus) { problemReporter().referenceExpressionsNotBelow18(referenceExpression); } if (referenceExpression.compilationResult.getCompilationUnit() == null) { // unit built out of model. Stash a textual representation to enable RE.copy(). int length = referenceExpression.sourceEnd - referenceExpression.sourceStart + 1; System.arraycopy(this.scanner.getSource(), referenceExpression.sourceStart, referenceExpression.text = new char [length], 0, length); } this.referenceContext.compilationResult().hasFunctionalTypes = true; markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.METHOD_REFERENCE); } protected void consumeReferenceExpressionTypeArgumentsAndTrunk(boolean qualified) {
protected void consumeReferenceExpression(ReferenceExpression referenceExpression) { pushOnExpressionStack(referenceExpression); if (!this.parsingJava8Plus) { problemReporter().referenceExpressionsNotBelow18(referenceExpression); } if (referenceExpression.compilationResult.getCompilationUnit() == null) { // unit built out of model. Stash a textual representation to enable RE.copy(). int length = referenceExpression.sourceEnd - referenceExpression.sourceStart + 1; System.arraycopy(this.scanner.getSource(), referenceExpression.sourceStart, referenceExpression.text = new char [length], 0, length); } this.referenceContext.compilationResult().hasFunctionalTypes = true; markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.METHOD_REFERENCE); } protected void consumeReferenceExpressionTypeArgumentsAndTrunk(boolean qualified) {
private ReferenceExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); final char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; ReferenceExpression copy = (ReferenceExpression) parser.parseExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); copy.original = this; copy.sourceStart = this.sourceStart; copy.sourceEnd = this.sourceEnd; return copy; }
private ReferenceExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); final char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; ReferenceExpression copy = (ReferenceExpression) parser.parseExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); copy.original = this; copy.sourceStart = this.sourceStart; copy.sourceEnd = this.sourceEnd; return copy; }
LambdaExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final char[] source = this.compilationResult.getCompilationUnit().getContents(); LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, this.sourceStart, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); if (copy != null) { // ==> syntax errors == null copy.original = this; } return copy; }
private ReferenceExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); final char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; parser.scanner = this.scanner; ReferenceExpression copy = (ReferenceExpression) parser.parseExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); copy.original = this; copy.sourceStart = this.sourceStart; copy.sourceEnd = this.sourceEnd; return copy; }
LambdaExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); if (copy != null) { // ==> syntax errors == null copy.original = this; copy.assistNode = this.assistNode; copy.enclosingScope = this.enclosingScope; } return copy; }
LambdaExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final char[] source = this.compilationResult.getCompilationUnit().getContents(); LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, this.sourceStart, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); if (copy != null) { // ==> syntax errors == null copy.original = this; } return copy; }
private ReferenceExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); final char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; parser.scanner = this.scanner; ReferenceExpression copy = (ReferenceExpression) parser.parseExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); copy.original = this; copy.sourceStart = this.sourceStart; copy.sourceEnd = this.sourceEnd; return copy; }
private ReferenceExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); final char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; ReferenceExpression copy = (ReferenceExpression) parser.parseExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); copy.original = this; copy.sourceStart = this.sourceStart; copy.sourceEnd = this.sourceEnd; return copy; }
LambdaExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final char[] source = this.compilationResult.getCompilationUnit().getContents(); LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, this.sourceStart, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); if (copy != null) { // ==> syntax errors == null copy.original = this; } return copy; }
LambdaExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); if (copy != null) { // ==> syntax errors == null copy.original = this; copy.assistNode = this.assistNode; copy.enclosingScope = this.enclosingScope; } return copy; }
LambdaExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); if (copy != null) { // ==> syntax errors == null copy.original = this; copy.assistNode = this.assistNode; copy.enclosingScope = this.enclosingScope; } return copy; }
LambdaExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); if (copy != null) { // ==> syntax errors == null copy.original = this; copy.assistNode = this.assistNode; copy.enclosingScope = this.enclosingScope; } return copy; }
LambdaExpression copy() { final Parser parser = new Parser(this.enclosingScope.problemReporter(), false); final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit(); char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text; LambdaExpression copy = (LambdaExpression) parser.parseLambdaExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, this.enclosingScope.referenceCompilationUnit(), false /* record line separators */); if (copy != null) { // ==> syntax errors == null copy.original = this; copy.assistNode = this.assistNode; copy.enclosingScope = this.enclosingScope; } return copy; }
protected void finishedWith(String sourceLocator, CompilationResult result, char[] mainTypeName, ArrayList definedTypeNames, ArrayList duplicateTypeNames) { char[][] previousTypeNames = this.newState.getDefinedTypeNamesFor(sourceLocator); if (previousTypeNames == null) previousTypeNames = new char[][] {mainTypeName}; IPath packagePath = null; next : for (int i = 0, l = previousTypeNames.length; i < l; i++) { char[] previous = previousTypeNames[i]; for (int j = 0, m = definedTypeNames.size(); j < m; j++) if (CharOperation.equals(previous, (char[]) definedTypeNames.get(j))) continue next; SourceFile sourceFile = (SourceFile) result.getCompilationUnit(); if (packagePath == null) { int count = sourceFile.sourceLocation.sourceFolder.getFullPath().segmentCount(); packagePath = sourceFile.resource.getFullPath().removeFirstSegments(count).removeLastSegments(1); } if (this.secondaryTypesToRemove == null) this.secondaryTypesToRemove = new SimpleLookupTable(); ArrayList types = (ArrayList) this.secondaryTypesToRemove.get(sourceFile.sourceLocation.binaryFolder); if (types == null) types = new ArrayList(definedTypeNames.size()); types.add(packagePath.append(new String(previous))); this.secondaryTypesToRemove.put(sourceFile.sourceLocation.binaryFolder, types); } super.finishedWith(sourceLocator, result, mainTypeName, definedTypeNames, duplicateTypeNames); }
protected void finishedWith(String sourceLocator, CompilationResult result, char[] mainTypeName, ArrayList definedTypeNames, ArrayList duplicateTypeNames) { char[][] previousTypeNames = this.newState.getDefinedTypeNamesFor(sourceLocator); if (previousTypeNames == null) previousTypeNames = new char[][] {mainTypeName}; IPath packagePath = null; next : for (int i = 0, l = previousTypeNames.length; i < l; i++) { char[] previous = previousTypeNames[i]; for (int j = 0, m = definedTypeNames.size(); j < m; j++) if (CharOperation.equals(previous, (char[]) definedTypeNames.get(j))) continue next; SourceFile sourceFile = (SourceFile) result.getCompilationUnit(); if (packagePath == null) { int count = sourceFile.sourceLocation.sourceFolder.getFullPath().segmentCount(); packagePath = sourceFile.resource.getFullPath().removeFirstSegments(count).removeLastSegments(1); } if (this.secondaryTypesToRemove == null) this.secondaryTypesToRemove = new SimpleLookupTable(); ArrayList types = (ArrayList) this.secondaryTypesToRemove.get(sourceFile.sourceLocation.binaryFolder); if (types == null) types = new ArrayList(definedTypeNames.size()); types.add(packagePath.append(new String(previous))); this.secondaryTypesToRemove.put(sourceFile.sourceLocation.binaryFolder, types); } super.finishedWith(sourceLocator, result, mainTypeName, definedTypeNames, duplicateTypeNames); }