private Type getType() { if (this.currentType != null) { return this.currentType; } if (this.variableDeclaration == null) return null; switch(this.variableDeclaration.getNodeType()) { case ASTNode.SINGLE_VARIABLE_DECLARATION : SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) this.variableDeclaration; return singleVariableDeclaration.getType(); default : // this is a variable declaration fragment ASTNode parent = this.variableDeclaration.getParent(); switch(parent.getNodeType()) { case ASTNode.VARIABLE_DECLARATION_EXPRESSION : VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) parent; return variableDeclarationExpression.getType(); case ASTNode.VARIABLE_DECLARATION_STATEMENT : VariableDeclarationStatement statement = (VariableDeclarationStatement) parent; return statement.getType(); case ASTNode.FIELD_DECLARATION : FieldDeclaration fieldDeclaration = (FieldDeclaration) parent; return fieldDeclaration.getType(); } } return null; // should not happen }
private Type getType() { if (this.currentType != null) { return this.currentType; } if (this.variableDeclaration == null) return null; switch(this.variableDeclaration.getNodeType()) { case ASTNode.SINGLE_VARIABLE_DECLARATION : SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) this.variableDeclaration; return singleVariableDeclaration.getType(); default : // this is a variable declaration fragment ASTNode parent = this.variableDeclaration.getParent(); switch(parent.getNodeType()) { case ASTNode.VARIABLE_DECLARATION_EXPRESSION : VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) parent; return variableDeclarationExpression.getType(); case ASTNode.VARIABLE_DECLARATION_STATEMENT : VariableDeclarationStatement statement = (VariableDeclarationStatement) parent; return statement.getType(); case ASTNode.FIELD_DECLARATION : FieldDeclaration fieldDeclaration = (FieldDeclaration) parent; return fieldDeclaration.getType(); } } return null; // should not happen }
private Type getType() { if (this.currentType != null) { return this.currentType; } if (this.variableDeclaration == null) return null; switch(this.variableDeclaration.getNodeType()) { case ASTNode.SINGLE_VARIABLE_DECLARATION : SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) this.variableDeclaration; return singleVariableDeclaration.getType(); default : // this is a variable declaration fragment ASTNode parent = this.variableDeclaration.getParent(); switch(parent.getNodeType()) { case ASTNode.VARIABLE_DECLARATION_EXPRESSION : VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) parent; return variableDeclarationExpression.getType(); case ASTNode.VARIABLE_DECLARATION_STATEMENT : VariableDeclarationStatement statement = (VariableDeclarationStatement) parent; return statement.getType(); case ASTNode.FIELD_DECLARATION : FieldDeclaration fieldDeclaration = (FieldDeclaration) parent; return fieldDeclaration.getType(); } } return null; // should not happen }
private Type getType() { if (this.currentType != null) { return this.currentType; } if (this.variableDeclaration == null) return null; switch(this.variableDeclaration.getNodeType()) { case ASTNode.SINGLE_VARIABLE_DECLARATION : SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) this.variableDeclaration; return singleVariableDeclaration.getType(); default : // this is a variable declaration fragment ASTNode parent = this.variableDeclaration.getParent(); switch(parent.getNodeType()) { case ASTNode.VARIABLE_DECLARATION_EXPRESSION : VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) parent; return variableDeclarationExpression.getType(); case ASTNode.VARIABLE_DECLARATION_STATEMENT : VariableDeclarationStatement statement = (VariableDeclarationStatement) parent; return statement.getType(); case ASTNode.FIELD_DECLARATION : FieldDeclaration fieldDeclaration = (FieldDeclaration) parent; return fieldDeclaration.getType(); } } return null; // should not happen }
private Type getType() { if (this.currentType != null) { return this.currentType; } if (this.variableDeclaration == null) return null; switch(this.variableDeclaration.getNodeType()) { case ASTNode.SINGLE_VARIABLE_DECLARATION : SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) this.variableDeclaration; return singleVariableDeclaration.getType(); default : // this is a variable declaration fragment ASTNode parent = this.variableDeclaration.getParent(); switch(parent.getNodeType()) { case ASTNode.VARIABLE_DECLARATION_EXPRESSION : VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) parent; return variableDeclarationExpression.getType(); case ASTNode.VARIABLE_DECLARATION_STATEMENT : VariableDeclarationStatement statement = (VariableDeclarationStatement) parent; return statement.getType(); case ASTNode.FIELD_DECLARATION : FieldDeclaration fieldDeclaration = (FieldDeclaration) parent; return fieldDeclaration.getType(); } } return null; // should not happen }
private Type getType() { if (this.currentType != null) { return this.currentType; } if (this.variableDeclaration == null) return null; switch(this.variableDeclaration.getNodeType()) { case ASTNode.SINGLE_VARIABLE_DECLARATION : SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) this.variableDeclaration; return singleVariableDeclaration.getType(); default : // this is a variable declaration fragment ASTNode parent = this.variableDeclaration.getParent(); switch(parent.getNodeType()) { case ASTNode.VARIABLE_DECLARATION_EXPRESSION : VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) parent; return variableDeclarationExpression.getType(); case ASTNode.VARIABLE_DECLARATION_STATEMENT : VariableDeclarationStatement statement = (VariableDeclarationStatement) parent; return statement.getType(); case ASTNode.FIELD_DECLARATION : FieldDeclaration fieldDeclaration = (FieldDeclaration) parent; return fieldDeclaration.getType(); } } return null; // should not happen } }