Skip to content

Commit

Permalink
Update ThenComment.java
Browse files Browse the repository at this point in the history
check if note not empty new note append to exist note
  • Loading branch information
Arshiya0x7 authored Oct 9, 2024
1 parent 5925e59 commit 7b5f3a2
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ public RuleResponse perform(EventInfo eventInfo) {
boolean hasError = true;
try {
if (eventInfo.getAnnotations() != null) {
eventInfo.getAnnotations().setNotes(text.getText(eventInfo));
hasError = false;
if (!eventInfo.getAnnotations().notes().isEmpty()) {
if (!eventInfo.getAnnotations().notes().toLowerCase().contains(text.getText(eventInfo).toLowerCase())) {
eventInfo.getAnnotations().setNotes(eventInfo.getAnnotations().notes() + " , " + text.getText(eventInfo));
}
hasError = false;
}
else {
eventInfo.getAnnotations().setNotes(text.getText(eventInfo));
hasError = false;
}
}
} finally {
if (eventInfo.getDiagnostics().isEnabled()) eventInfo.getDiagnostics().logValue(this, hasError, VariableString.getTextOrDefault(eventInfo, text, null));
Expand Down

0 comments on commit 7b5f3a2

Please sign in to comment.