Java Code Examples for org.eclipse.jdt.core.dom.VariableDeclarationExpression#getLocationInParent()
The following examples show how to use
org.eclipse.jdt.core.dom.VariableDeclarationExpression#getLocationInParent() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExtractMethodAnalyzer.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 5 votes |
@Override public void endVisit(VariableDeclarationExpression node) { if (getSelection().getEndVisitSelectionMode(node) == Selection.SELECTED && getFirstSelectedNode() == node) { if (node.getLocationInParent() == TryStatement.RESOURCES_PROPERTY) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_resource_in_try_with_resources, JavaStatusContext.create(fCUnit, getSelection())); } } checkTypeInDeclaration(node.getType()); super.endVisit(node); }
Example 2
Source File: AbstractExceptionAnalyzer.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 5 votes |
@Override public boolean visit(VariableDeclarationExpression node) { if (node.getLocationInParent() == TryStatement.RESOURCES_PROPERTY) { Type type = node.getType(); ITypeBinding resourceTypeBinding = type.resolveBinding(); if (resourceTypeBinding != null) { IMethodBinding methodBinding = Bindings.findMethodInHierarchy(resourceTypeBinding, "close", new ITypeBinding[0]); //$NON-NLS-1$ if (methodBinding != null) { addExceptions(methodBinding.getExceptionTypes(), node.getAST()); } } } return super.visit(node); }
Example 3
Source File: ExtractMethodAnalyzer.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@Override public void endVisit(VariableDeclarationExpression node) { if (getSelection().getEndVisitSelectionMode(node) == Selection.SELECTED && getFirstSelectedNode() == node) { if (node.getLocationInParent() == TryStatement.RESOURCES_PROPERTY) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_resource_in_try_with_resources, JavaStatusContext.create(fCUnit, getSelection())); } } checkTypeInDeclaration(node.getType()); super.endVisit(node); }
Example 4
Source File: AbstractExceptionAnalyzer.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@Override public boolean visit(VariableDeclarationExpression node) { if (node.getLocationInParent() == TryStatement.RESOURCES_PROPERTY) { Type type= node.getType(); ITypeBinding resourceTypeBinding= type.resolveBinding(); if (resourceTypeBinding != null) { IMethodBinding methodBinding= Bindings.findMethodInHierarchy(resourceTypeBinding, "close", new ITypeBinding[0]); //$NON-NLS-1$ if (methodBinding != null) { addExceptions(methodBinding.getExceptionTypes(), node.getAST()); } } } return super.visit(node); }