diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-10-06 10:11:35 +0200 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-10-06 10:11:35 +0200 |
commit | 434ad00d88ce24785b9d9edbcd03ffa562fd8a4e (patch) | |
tree | d68c5a06bf49ca8bff6fba48ab6ef068c4ad4804 /pdf-over-commons/src/main | |
parent | e9a7e90fda934dd5d053127470d0b849b1b8fc4b (diff) | |
download | pdf-over-434ad00d88ce24785b9d9edbcd03ffa562fd8a4e.tar.gz pdf-over-434ad00d88ce24785b9d9edbcd03ffa562fd8a4e.tar.bz2 pdf-over-434ad00d88ce24785b9d9edbcd03ffa562fd8a4e.zip |
sanitizing NULLable config values
Diffstat (limited to 'pdf-over-commons/src/main')
-rw-r--r-- | pdf-over-commons/src/main/java/at/asit/pdfover/commons/Messages.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Messages.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Messages.java index 6ed52d5b..04c8583a 100644 --- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Messages.java +++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Messages.java @@ -22,6 +22,8 @@ import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; +import javax.annotation.Nonnull; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,13 +51,13 @@ public class Messages { * Get the closest match to the system default Locale out of the supported locales * @return the default locale */ - public static Locale getDefaultLocale() { + public static @Nonnull Locale getDefaultLocale() { Locale ld = Locale.getDefault(); for (Locale l : Constants.SUPPORTED_LOCALES) { if (l.equals(ld) || l.getLanguage().equals(ld.getLanguage())) return l; } - return Constants.SUPPORTED_LOCALES[0]; + return Constants.ISNOTNULL(Constants.SUPPORTED_LOCALES[0]); } /** |