Repository: cayenne
Updated Branches:
  refs/heads/master e0ed68170 -> bc0429d9e


cleanup


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/bc0429d9
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/bc0429d9
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/bc0429d9

Branch: refs/heads/master
Commit: bc0429d9e5b5827f131042c24af37feadc7e8668
Parents: e0ed681
Author: Nikita Timofeev <stari...@gmail.com>
Authored: Thu Mar 23 12:39:45 2017 +0300
Committer: Nikita Timofeev <stari...@gmail.com>
Committed: Thu Mar 23 12:39:45 2017 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/cayenne/CayenneException.java  | 8 +-------
 .../org/apache/cayenne/util/LocalizedStringsHandler.java    | 9 +++------
 2 files changed, 4 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/bc0429d9/cayenne-server/src/main/java/org/apache/cayenne/CayenneException.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/CayenneException.java 
b/cayenne-server/src/main/java/org/apache/cayenne/CayenneException.java
index 5205c20..0026a4c 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/CayenneException.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/CayenneException.java
@@ -33,13 +33,7 @@ public class CayenneException extends Exception {
     static {
         String version = LocalizedStringsHandler.getString("cayenne.version");
         String date = LocalizedStringsHandler.getString("cayenne.build.date");
-
-        if (version != null || date != null) {
-            exceptionLabel = "[v." + version + " " + date + "] ";
-        }
-        else {
-            exceptionLabel = "";
-        }
+        exceptionLabel = "[v." + version + " " + date + "] ";
     }
 
     public static String getExceptionLabel() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/bc0429d9/cayenne-server/src/main/java/org/apache/cayenne/util/LocalizedStringsHandler.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/util/LocalizedStringsHandler.java
 
b/cayenne-server/src/main/java/org/apache/cayenne/util/LocalizedStringsHandler.java
index b202a31..dc7783e 100644
--- 
a/cayenne-server/src/main/java/org/apache/cayenne/util/LocalizedStringsHandler.java
+++ 
b/cayenne-server/src/main/java/org/apache/cayenne/util/LocalizedStringsHandler.java
@@ -42,8 +42,7 @@ public class LocalizedStringsHandler {
 
         try {
             return getBundle().getString(key);
-        }
-        catch (Throwable e) {
+        } catch (Throwable e) {
             return "";
         }
     }
@@ -52,12 +51,10 @@ public class LocalizedStringsHandler {
         if (bundle == null) {
             try {
                 bundle = ResourceBundle.getBundle(DEFAULT_MESSAGE_BUNDLE);
-            }
-            catch (MissingResourceException e) {
+            } catch (MissingResourceException e) {
                 // do not throw Cayenne exceptions, as they rely on
                 // LocalizedStringsHandler, and we can get into infinite loop
-                throw new RuntimeException("Can't load properties: "
-                        + DEFAULT_MESSAGE_BUNDLE, e);
+                throw new RuntimeException("Can't load properties: " + 
DEFAULT_MESSAGE_BUNDLE, e);
             }
         }
         return bundle;

Reply via email to