Renamed MTranslationValueNotFoundTextException to MTranslationValueNotFoundException.
authorMarco Zanon <info@marcozanon.com>
Thu, 22 Oct 2015 13:23:22 +0000 (13:23 +0000)
committerMarco Zanon <info@marcozanon.com>
Thu, 22 Oct 2015 13:23:22 +0000 (13:23 +0000)
4.x/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundException.java [new file with mode: 0644]
4.x/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundTextException.java [deleted file]
4.x/src/java/com/marcozanon/macaco/text/MTranslator.java

diff --git a/4.x/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundException.java b/4.x/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundException.java
new file mode 100644 (file)
index 0000000..bcfdafe
--- /dev/null
@@ -0,0 +1,30 @@
+/**
+ * Macaco
+ * Copyright (c) 2009-2015 Marco Zanon <info@marcozanon.com>.
+ * Released under MIT license (see LICENSE for details).
+ */
+
+package com.marcozanon.macaco.text;
+
+@SuppressWarnings("serial")
+public class MTranslationValueNotFoundException extends MTranslationException {
+
+    /* */
+
+    public MTranslationValueNotFoundException() {
+        super();
+    }
+
+    public MTranslationValueNotFoundException(String message) {
+        super(message);
+    }
+
+    public MTranslationValueNotFoundException(Throwable error) {
+        super(error);
+    }
+
+    public MTranslationValueNotFoundException(String message, Throwable error) {
+        super(message, error);
+    }
+
+}
diff --git a/4.x/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundTextException.java b/4.x/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundTextException.java
deleted file mode 100644 (file)
index 33a016f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Macaco
- * Copyright (c) 2009-2015 Marco Zanon <info@marcozanon.com>.
- * Released under MIT license (see LICENSE for details).
- */
-
-package com.marcozanon.macaco.text;
-
-@SuppressWarnings("serial")
-public class MTranslationValueNotFoundTextException extends MTranslationException {
-
-    /* */
-
-    public MTranslationValueNotFoundTextException() {
-        super();
-    }
-
-    public MTranslationValueNotFoundTextException(String message) {
-        super(message);
-    }
-
-    public MTranslationValueNotFoundTextException(Throwable error) {
-        super(error);
-    }
-
-    public MTranslationValueNotFoundTextException(String message, Throwable error) {
-        super(message, error);
-    }
-
-}
index f7247145d98e73a7998bfcc3c0c5e16ec584c5e0..3e88e5b02bf09a49bf6c33e29eb62104eb915881 100644 (file)
@@ -146,16 +146,16 @@ public class MTranslator extends MObject {
         try {
             translation = this.getTranslation(message, locale, false);
         }
-        catch (MTranslationValueNotFoundTextException exception) { // cannot happen
+        catch (MTranslationValueNotFoundException exception) { // cannot happen
         }
         return translation;
     }
 
-    public String getStrictTranslation(String message, Locale locale) throws MTranslationValueNotFoundTextException {
+    public String getStrictTranslation(String message, Locale locale) throws MTranslationValueNotFoundException {
         return this.getTranslation(message, locale, true);
     }
 
-    protected String getTranslation(String message, Locale locale, boolean strictMode) throws MTranslationValueNotFoundTextException {
+    protected String getTranslation(String message, Locale locale, boolean strictMode) throws MTranslationValueNotFoundException {
         if (MText.isBlank(message)) {
             throw new IllegalArgumentException("Invalid 'message': null or empty.");
         }
@@ -165,7 +165,7 @@ public class MTranslator extends MObject {
         //
         if (!this.getMessagesReference().containsKey(message)) {
             if (strictMode) {
-                throw new MTranslationValueNotFoundTextException(String.format("Invalid 'message': %s: not available.", message));
+                throw new MTranslationValueNotFoundException(String.format("Invalid 'message': %s: not available.", message));
             }
             return message;
         }
@@ -176,7 +176,7 @@ public class MTranslator extends MObject {
         String localeRepresentation = locale.toString();
         if (!messageTranslations.containsKey(localeRepresentation)) {
             if (strictMode) {
-                throw new MTranslationValueNotFoundTextException(String.format("Invalid 'locale': %s: translation not available for message: %s.", localeRepresentation, message));
+                throw new MTranslationValueNotFoundException(String.format("Invalid 'locale': %s: translation not available for message: %s.", localeRepresentation, message));
             }
             String localeFallbackRepresentation = locale.getLanguage();
             if (!messageTranslations.containsKey(localeFallbackRepresentation)) {