Skip to content

Commit

Permalink
MAT-7995 change to use StringUtils.containsIgnoreCase
Browse files Browse the repository at this point in the history
  • Loading branch information
sb-cecilialiu committed Dec 20, 2024
1 parent e0e26c6 commit 75d64a7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.cqframework.cql.cql2elm.CqlCompilerException;
import org.hl7.elm.r1.VersionedIdentifier;

Expand Down Expand Up @@ -113,7 +114,7 @@ private List<CqlCompilerException> filterBySyntax(
}

/*
* MAT-7995: error: "No Viable Input at 'define :'"
* MAT-7995: error: "No viable alternative at input 'define :'"
* should be customized as: "Definition is missing a name."
* This is done in cql-antlr-parse, so on the frontend we don't want a duplicate error message
* therefore we are filtering it out here.
Expand All @@ -123,9 +124,8 @@ private List<CqlCompilerException> filterOutCustomErrors(
return filteredCqlTranslatorExceptions.stream()
.filter(
cqlCompilerException ->
!cqlCompilerException
.getMessage()
.contains("no viable alternative at input 'define"))
!StringUtils.containsIgnoreCase(
cqlCompilerException.getMessage(), "no viable alternative at input 'define"))
.toList();
}
}

0 comments on commit 75d64a7

Please sign in to comment.