diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/codemining/CalleeJavaMethodParameterVisitor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/codemining/CalleeJavaMethodParameterVisitor.java index 11f14a89ef0..7f3adecb504 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/codemining/CalleeJavaMethodParameterVisitor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/codemining/CalleeJavaMethodParameterVisitor.java @@ -129,7 +129,7 @@ protected void collectParameterNamesCodeMinings(IMethod method, List argument protected void collectParameterNamesCodeMinings(IMethodBinding mbinding, List arguments, boolean isVarArgs) { // synthetic method of a record - if (mbinding.getDeclaringClass().isRecord()) { + if (mbinding.getDeclaringClass().isRecord() && !skipParameterNamesCodeMinings(mbinding)) { String[] parameterNames= mbinding.getParameterNames(); for (int i= 0; i < Math.min(arguments.size(), parameterNames.length); i++) { if (!skipParameterNameCodeMining(parameterNames, arguments, i)) { @@ -168,6 +168,10 @@ private boolean skipParameterNamesCodeMinings(IMethod method) { return method.getNumberOfParameters() <= 1; } + private boolean skipParameterNamesCodeMinings(IMethodBinding methodBinding) { + return methodBinding.getParameterNames().length <= 1; + } + private boolean skipParameterNamesCodeMinings(IMethod method, String[] parameterNames) { IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore(); boolean filter= store.getBoolean(PreferenceConstants.EDITOR_JAVA_CODEMINING_DEFAULT_FILTER_FOR_PARAMETER_NAMES);