Skip to content

Commit

Permalink
Merge pull request #999 from mrglavas/956#fix-code-action-resolve-data
Browse files Browse the repository at this point in the history
Casts values to a Number in order to tolerate type conversion from Integer to Double.
  • Loading branch information
mrglavas authored Oct 9, 2024
2 parents cc45ff0 + 1e859e8 commit 4cd5131
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.concurrent.CancellationException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;

/**
* Quick fix for the ResourceMethodMultipleEntityParams diagnostic in
Expand Down Expand Up @@ -110,8 +111,10 @@ public CodeAction resolveCodeAction(JavaCodeActionResolveContext context) {
final PsiMethod parentMethod = PsiTreeUtil.getParentOfType(node, PsiMethod.class);
String title = toResolve.getTitle();
CodeActionResolveData data = (CodeActionResolveData) toResolve.getData();
Integer currentEntityParamIndex = (Integer) data.getExtendedDataEntry(ENTITY_PARAM_INDEX_KEY);
List<Integer> entityParamIndexes = (List<Integer>) data.getExtendedDataEntry(ENTITY_PARAM_INDEXES_KEY);
Integer currentEntityParamIndex = ((Number) data.getExtendedDataEntry(ENTITY_PARAM_INDEX_KEY)).intValue();
List<Integer> entityParamIndexes =
((List<Number>) data.getExtendedDataEntry(ENTITY_PARAM_INDEXES_KEY)).
stream().map(x -> Integer.valueOf(x.intValue())).collect(Collectors.toList());

assert parentMethod != null;
final PsiParameter[] parameters = parentMethod.getParameterList().getParameters();
Expand Down

0 comments on commit 4cd5131

Please sign in to comment.