Skip to content

Commit

Permalink
Replace ChangeLogParameters with already existing key to remove dupli…
Browse files Browse the repository at this point in the history
…cates

DAT-7294
  • Loading branch information
wwillard7800 committed Jun 16, 2021
1 parent afaabcb commit e157992
Showing 1 changed file with 15 additions and 9 deletions.
Expand Up @@ -103,9 +103,10 @@ public void set(String parameter, Object value) {
* #findParameter() is only catching the first one. So here we should eliminate duplicate entries
*/
ChangeLogParameter param = findParameter(parameter, null);
if (param == null) {
// okay add it
changeLogParameters.add(new ChangeLogParameter(parameter, value));
// okay add it
changeLogParameters.add(new ChangeLogParameter(parameter, value));
if (param != null) {
changeLogParameters.remove(param);
}
}

Expand All @@ -121,15 +122,20 @@ public void set(String key, String value, ContextExpression contexts, Labels lab
* #findParameter() is only catching the first one. So here we should eliminate duplicate entries
**/
if (globalParam) {
// if it is global param ignore additional adds
// if it is global param remove duplicate
ChangeLogParameter param = findParameter(key, null);
if (param == null) {
// okay add it
changeLogParameters.add(new ChangeLogParameter(key, value, contexts, labels, databases, globalParam,
changeLog));
if (param != null) {
changeLogParameters.remove(param);
}
// okay add it
changeLogParameters.add(new ChangeLogParameter(key, value, contexts, labels, databases, globalParam,
changeLog));
} else {
//this is a non-global param, just add it
ChangeLogParameter param = findParameter(key, changeLog);
if (param != null) {
changeLogParameters.remove(param);
}
//this is a non-global param, just add it
changeLogParameters.add(new ChangeLogParameter(key, value, contexts, labels, databases, globalParam, changeLog));
}
}
Expand Down

0 comments on commit e157992

Please sign in to comment.