Skip to content

Commit

Permalink
Fix ClassCastException in convert field name quick assist (#1106)
Browse files Browse the repository at this point in the history
- fixes #1096
  • Loading branch information
jjohnstn committed Jan 18, 2024
1 parent 36a9f78 commit b8999d3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -3704,8 +3704,8 @@ private boolean getConvertFieldNamingConventionProposal(IInvocationContextCore c
}

CompilationUnit cu= context.getASTRoot();
VariableDeclarationFragment vdf= (VariableDeclarationFragment) ASTNodes.findDeclaration(binding, cu);
if (vdf == null) {
ASTNode decl= ASTNodes.findDeclaration(binding, cu);
if (!(decl instanceof VariableDeclarationFragment vdf)) {
return false;
}
FieldDeclaration fd= (FieldDeclaration) vdf.getParent();
Expand Down

0 comments on commit b8999d3

Please sign in to comment.