File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 4949import org .eclipse .jdt .core .dom .Type ;
5050import org .eclipse .jdt .core .dom .TypeParameter ;
5151import org .eclipse .jdt .core .dom .VariableDeclaration ;
52+ import org .eclipse .jdt .core .dom .VariableDeclarationExpression ;
5253import org .eclipse .jdt .core .dom .VariableDeclarationFragment ;
5354import org .eclipse .jdt .core .dom .VariableDeclarationStatement ;
5455
@@ -100,6 +101,11 @@ public static IJavaElement getLocalJavaElement(ASTNode node) {
100101 if ( vb != null )
101102 return vb .getJavaElement ();
102103 }
104+ if (node instanceof VariableDeclarationExpression variable && !variable .fragments ().isEmpty ()) {
105+ IVariableBinding vb = ((List <VariableDeclarationFragment >)variable .fragments ()).iterator ().next ().resolveBinding ();
106+ if ( vb != null )
107+ return vb .getJavaElement ();
108+ }
103109 if (node instanceof TypeParameter typeParam ) {
104110 return typeParam .resolveBinding ().getJavaElement ();
105111 }
Original file line number Diff line number Diff line change 1313import java .util .Arrays ;
1414import java .util .Objects ;
1515
16+ import javax .lang .model .element .ElementKind ;
17+
1618import org .eclipse .core .runtime .ILog ;
1719import org .eclipse .jdt .core .IField ;
1820import org .eclipse .jdt .core .IJavaElement ;
@@ -282,7 +284,9 @@ public boolean isEnumConstant() {
282284
283285 @ Override
284286 public boolean isParameter () {
285- return this .variableSymbol .owner instanceof MethodSymbol && (this .variableSymbol .flags () & Flags .PARAMETER ) != 0 ;
287+ return this .variableSymbol .owner instanceof MethodSymbol ownerMethod
288+ && (this .variableSymbol .flags () & Flags .PARAMETER ) != 0
289+ && this .variableSymbol .getKind () != ElementKind .EXCEPTION_PARAMETER ;
286290 }
287291
288292 @ Override
You can’t perform that action at this time.
0 commit comments