You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2017/11/29 16:33:51 UTC

[myfaces-tobago] branch master updated: TOBAGO-1782: Clean up * code checker...

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 48afc49  TOBAGO-1782: Clean up * code checker...
48afc49 is described below

commit 48afc493885a947374aa54366f8780f81de50898
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Wed Nov 29 17:33:44 2017 +0100

    TOBAGO-1782: Clean up
    * code checker...
---
 .../tobago/internal/config/TobagoConfigBuilder.java      | 14 ++++++++------
 .../org/apache/myfaces/tobago/util/ComparatorBase.java   | 16 +---------------
 2 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigBuilder.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigBuilder.java
index 46df385..8e62484 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigBuilder.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigBuilder.java
@@ -59,16 +59,18 @@ public class TobagoConfigBuilder {
       final TobagoConfigBuilder builder = new TobagoConfigBuilder(servletContext);
       builder.build();
     } catch (final Throwable e) {
-      if (LOG.isErrorEnabled()) {
-        final String error = "Error while deploy process. Tobago can't be initialized! Application will not run!";
-        LOG.error(error, e);
+      final String error = "Error while deploy process. Tobago can't be initialized! Application will not run!";
+      LOG.error(error, e);
+      if (e instanceof Error) {
+        throw (Error) e;
+      } else {
         throw new RuntimeException(error, e);
       }
     }
   }
 
-  public TobagoConfig build() throws URISyntaxException, SAXException,
-     ParserConfigurationException, ServletException, IOException {
+  public TobagoConfig build()
+      throws URISyntaxException, SAXException, ParserConfigurationException, ServletException, IOException {
     final TobagoConfigImpl tobagoConfig = initializeConfigFromFiles();
     // prepare themes
     tobagoConfig.resolveThemes();
@@ -80,7 +82,7 @@ public class TobagoConfigBuilder {
   }
 
   protected TobagoConfigImpl initializeConfigFromFiles()
-     throws ServletException, IOException, SAXException, ParserConfigurationException, URISyntaxException {
+      throws ServletException, IOException, SAXException, ParserConfigurationException, URISyntaxException {
     configFromClasspath();
     configFromWebInf();
     final TobagoConfigSorter sorter = new TobagoConfigSorter(configFragmentList);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComparatorBase.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComparatorBase.java
index e10ff7c..8ee577a 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComparatorBase.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComparatorBase.java
@@ -88,9 +88,6 @@ public abstract class ComparatorBase implements Comparator {
     return reverse ? -result : result;
   }
 
-  /*
-
-  // TODO use this??
   public boolean equals(Object o) {
     if (this == o) {
       return true;
@@ -101,19 +98,8 @@ public abstract class ComparatorBase implements Comparator {
 
     final ComparatorBase that = (ComparatorBase) o;
 
-    return !(comparator != null ? !comparator.equals(that.comparator) : that.comparator != null);
-
-  }
+    return comparator != null ? comparator.equals(that.comparator) : that.comparator == null;
 
-  public int hashCode() {
-    return (comparator != null ? comparator.hashCode() : 0);
-  } */
-
-  public boolean equals(final Object o) {
-    if (o == null) {
-      return false;
-    }
-    return ((ComparatorBase) o).getComparator().equals(comparator);
   }
 
   public int hashCode() {

-- 
To stop receiving notification emails like this one, please contact
['"commits@myfaces.apache.org" <co...@myfaces.apache.org>'].