Skip to content

Commit

Permalink
Record classes are now handled the same as normal classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisCode committed Dec 2, 2024
1 parent 9c7fbe4 commit 9dba2c3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9dba2c3

Please sign in to comment.