diff --git a/1.sources/MyHealth/src/common/Utils.java b/1.sources/MyHealth/src/common/Utils.java index 0926f7e..278b248 100644 --- a/1.sources/MyHealth/src/common/Utils.java +++ b/1.sources/MyHealth/src/common/Utils.java @@ -1,6 +1,7 @@ package common; import java.text.Normalizer; +import java.util.Objects; /** * @@ -11,9 +12,18 @@ public class Utils { public static String stripAccents(String input) { return input == null ? null : Normalizer.normalize(input, Normalizer.Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); } - + public static String normalizeTerm(String input) { - //return stripAccents(input).toLowerCase(); + // return stripAccents(input).toLowerCase(); return input.toLowerCase(); } + + public static Throwable getExceptionRootCause(Throwable throwable) { + Objects.requireNonNull(throwable); + Throwable rootCause = throwable; + while (rootCause.getCause() != null && rootCause.getCause() != rootCause) { + rootCause = rootCause.getCause(); + } + return rootCause; + } }