Skip to content

Commit

Permalink
fix: prevent from duplicate Qute parameter key
Browse files Browse the repository at this point in the history
Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr committed Aug 28, 2024
1 parent 40c008c commit 974a7fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public static void collectParameters(PsiMethod method, ITypeResolver typeResolve
if (templateOrFragment.getParameter(parameter.getKey()) == null) {
// Add parameter if it doesn't exist
// to avoid parameters duplication
templateOrFragment.getParameters().add(parameter);
templateOrFragment.addParameter(parameter);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ private static DataModelTemplate<DataModelParameter> createTemplateDataModel(Psi
DataModelParameter parameter = new DataModelParameter();
parameter.setKey(field.getName());
parameter.setSourceType(PsiTypeUtils.resolveSignature(field.getType(), field.isVarArgs()));
template.getParameters().add(parameter);
if (template.getParameter(parameter.getKey()) == null) {
// Add parameter if it doesn't exist
// to avoid parameters duplication
template.addParameter(parameter);
}
}

// Collect data parameters for the given template
Expand Down

0 comments on commit 974a7fc

Please sign in to comment.