diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataTranslatedException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataTranslatedException.java index bb3bf72ef..dd4e400e6 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataTranslatedException.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataTranslatedException.java @@ -35,9 +35,11 @@ import org.slf4j.LoggerFactory; public abstract class ODataTranslatedException extends ODataException { private static final long serialVersionUID = -1210541002198287561L; - private static final Logger log = LoggerFactory.getLogger(ODataTranslatedException.class); + private static final Logger LOG = LoggerFactory.getLogger(ODataTranslatedException.class); private static final Locale DEFAULT_LOCALE = Locale.ENGLISH; + protected static final String DEFAULT_SERVER_BUNDLE_NAME = "server-core-exceptions-i18n"; + public static interface MessageKey { public String getKey(); } @@ -96,7 +98,7 @@ public abstract class ODataTranslatedException extends ODataException { try { return ResourceBundle.getBundle(getBundleName(), locale == null ? DEFAULT_LOCALE : locale); } catch (final MissingResourceException e) { - log.error(e.getMessage(), e); + LOG.error(e.getMessage(), e); return null; } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ODataSerializerException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ODataSerializerException.java index b4fcd1978..615ee3de1 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ODataSerializerException.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ODataSerializerException.java @@ -54,6 +54,6 @@ public class ODataSerializerException extends ODataTranslatedException { @Override protected String getBundleName() { - return "server-core-exceptions-i18n"; + return DEFAULT_SERVER_BUNDLE_NAME; } } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java index 0b1eb60f0..b30bd8a58 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java @@ -50,6 +50,6 @@ public class ContentNegotiatorException extends ODataTranslatedException { @Override protected String getBundleName() { - return "server-core-exceptions-i18n"; + return DEFAULT_SERVER_BUNDLE_NAME; } } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java index 8c92ce06f..01048a67e 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java @@ -44,6 +44,6 @@ public class ODataHandlerException extends ODataTranslatedException { @Override protected String getBundleName() { - return "server-core-exceptions-i18n"; + return DEFAULT_SERVER_BUNDLE_NAME; } } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java index 598172262..31804a457 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java @@ -35,6 +35,6 @@ abstract public class UriParserException extends ODataTranslatedException { @Override protected String getBundleName() { - return "server-core-exceptions-i18n"; + return DEFAULT_SERVER_BUNDLE_NAME; } } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java index e70c6aa9e..f7156cdee 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java @@ -69,6 +69,6 @@ public class UriValidationException extends ODataTranslatedException { @Override protected String getBundleName() { - return "server-core-exceptions-i18n"; + return DEFAULT_SERVER_BUNDLE_NAME; } }