myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1797057 - /myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java
Date Wed, 31 May 2017 15:17:47 GMT
Author: lofwyr
Date: Wed May 31 15:17:47 2017
New Revision: 1797057

URL: http://svn.apache.org/viewvc?rev=1797057&view=rev
Log:
codestyle: SonarQube

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java?rev=1797057&r1=1797056&r2=1797057&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java
Wed May 31 15:17:47 2017
@@ -60,7 +60,7 @@ public class ThemeImpl implements Theme,
 
   private void checkLocked() throws IllegalStateException {
     if (unmodifiable) {
-      throw new RuntimeException("The configuration must not be changed after initialization!");
+      throw new IllegalStateException("The configuration must not be changed after initialization!");
     }
   }
 
@@ -124,9 +124,11 @@ public class ThemeImpl implements Theme,
     }
     fallbackList = Collections.unmodifiableList(fallbackList);
     if (LOG.isDebugEnabled()) {
+      LOG.debug("fallbackList: {");
       for (final Theme theme : fallbackList) {
-        LOG.debug("fallbackList: {}", theme.getName());
+        LOG.debug("  theme: {}", theme.getName());
       }
+      LOG.debug("}");
     }
   }
 
@@ -136,34 +138,30 @@ public class ThemeImpl implements Theme,
       renderersConfig = new RenderersConfigImpl();
     }
     if (!renderersConfig.isMerged()) {
-      final ThemeImpl fallback = getFallback();
-      if (fallback != null) {
-        fallback.resolveRendererConfig(rendererConfigFromTobagoConfig);
-        final RenderersConfigImpl fallbackRenderersConfig = fallback.getRenderersConfigImpl();
+      final ThemeImpl fallbackTheme = getFallback();
+      if (fallbackTheme != null) {
+        fallbackTheme.resolveRendererConfig(rendererConfigFromTobagoConfig);
+        final RenderersConfigImpl fallbackRenderersConfig = fallbackTheme.getRenderersConfigImpl();
         if (fallbackRenderersConfig != null) {
           renderersConfig.merge(fallbackRenderersConfig, false);
-          if (LOG.isDebugEnabled()) {
-            LOG.debug("merge markupconfig from {} for {}", fallback.getName(), getName());
-          }
+          LOG.debug("merge markupconfig from {} for {}", fallbackTheme.getName(), getName());
         }
       }
       if (rendererConfigFromTobagoConfig != null) {
         renderersConfig.merge(rendererConfigFromTobagoConfig, true);
       }
       renderersConfig.setMerged(true);
-      if (LOG.isDebugEnabled()) {
-        LOG.debug("{} {}", getName(), renderersConfig);
-      }
+      LOG.debug("{} {}", getName(), renderersConfig);
     }
   }
 
   public void resolveResources() {
     checkLocked();
-    final ThemeImpl fallback = getFallback();
-    if (fallback != null) {
-      fallback.resolveResources();
-      addResources(fallback.getProductionResources());
-      addResources(fallback.getResources());
+    final ThemeImpl fallbackTheme = getFallback();
+    if (fallbackTheme != null) {
+      fallbackTheme.resolveResources();
+      addResources(fallbackTheme.getProductionResources());
+      addResources(fallbackTheme.getResources());
     }
   }
 



Mime
View raw message