@Override final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == VAR_PROPERTY) { if (get) { return isVar(); } else { if (Long.compare(this.ast.scanner.complianceLevel, ClassFileConstants.JDK10) < 0) { setVar(false); } else { setVar(value); } return false; } } // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); }
@Override ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); if (this.ast.apiLevel >= AST.JLS10_INTERNAL && Long.compare(this.ast.scanner.complianceLevel, 10) >= 0) { result.setVar(isVar()); } return result; }
protected VariableDeclarationStatement convertToVariableDeclarationStatement(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration) { final VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(localDeclaration); final VariableDeclarationStatement variableDeclarationStatement = new VariableDeclarationStatement(this.ast); variableDeclarationStatement.fragments().add(variableDeclarationFragment); variableDeclarationStatement.setSourceRange(localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd - localDeclaration.declarationSourceStart + 1); Type type = convertType(localDeclaration.type); setTypeForVariableDeclarationStatement(variableDeclarationStatement, type, variableDeclarationFragment.getExtraDimensions()); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, localDeclaration); if (this.ast.apiLevel() >= AST.JLS10_INTERNAL && type.isVar()) { SimpleName varName = (SimpleName) ((SimpleType) type).getName(); varName.setVar(true); recordNodes(varName, localDeclaration); } } if (localDeclaration.modifiersSourceStart != -1) { setModifiers(variableDeclarationStatement, localDeclaration); } return variableDeclarationStatement; }
type = simpleType; if (this.ast.apiLevel() >= AST.JLS10_INTERNAL && type.isVar()) { simpleName.setVar(true);