myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: refactored
Date Thu, 11 Jul 2019 08:33:29 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 8c047f3  refactored
8c047f3 is described below

commit 8c047f35efe4cd1aff32bdcde42cb91b849a8167
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Thu Jul 11 10:33:21 2019 +0200

    refactored
---
 .../org/apache/myfaces/application/NavigationHandlerImpl.java  |  2 +-
 .../org/apache/myfaces/application/ResourceHandlerImpl.java    |  4 ++--
 .../application/viewstate/RandomCsrfSessionTokenFactory.java   |  2 +-
 .../application/viewstate/SerializedViewCollection.java        |  4 ++--
 .../main/java/org/apache/myfaces/renderkit/RendererUtils.java  |  6 +++---
 .../myfaces/renderkit/html/base/HtmlCheckboxRendererBase.java  |  2 +-
 .../myfaces/renderkit/html/base/HtmlGridRendererBase.java      |  5 ++---
 .../apache/myfaces/renderkit/html/util/SelectItemsUtils.java   |  2 +-
 impl/src/main/java/org/apache/myfaces/util/ContainerUtils.java |  4 ++--
 .../view/facelets/DefaultFaceletsStateManagementStrategy.java  |  3 +--
 .../myfaces/view/facelets/FaceletViewDeclarationLanguage.java  |  2 +-
 .../tag/composite/CompositeComponentResourceTagHandler.java    | 10 +++++-----
 .../tag/composite/CreateDynamicCompositeComponentListener.java |  6 +++---
 .../main/java/org/apache/myfaces/webapp/MyFacesServlet.java    |  2 +-
 .../apache/myfaces/webapp/StartupServletContextListener.java   |  2 +-
 .../org/apache/myfaces/test/core/AbstractMyFacesTestCase.java  |  6 +++---
 16 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
b/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
index 051e807..9464458 100755
--- a/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
@@ -1192,7 +1192,7 @@ public class NavigationHandlerImpl extends ConfigurableNavigationHandler
             String cazeOutcome = caze.getFromOutcome();
             String cazeActionRef = caze.getFromAction();
             Boolean cazeIf = caze.getCondition(context);
-            boolean ifMatches = (cazeIf == null ? false : cazeIf.booleanValue());
+            boolean ifMatches = cazeIf == null ? false : cazeIf;
             // JSF 2.0: support conditional navigation via <if>.
             // Use for later cases.
             
diff --git a/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java b/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
index 82e6a56..8e410ae 100644
--- a/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
@@ -799,13 +799,13 @@ public class ResourceHandlerImpl extends ResourceHandler
             libraryFound = getResourceLoaderCache().libraryExists(pathToLib);
             if (libraryFound != null)
             {
-                return libraryFound.booleanValue();
+                return libraryFound;
             }
         }
         libraryFound = getResourceLoaderCache().libraryExists(libraryName);
         if (libraryFound != null)
         {
-            return libraryFound.booleanValue();
+            return libraryFound;
         }
         
         if (localePrefix != null)
diff --git a/impl/src/main/java/org/apache/myfaces/application/viewstate/RandomCsrfSessionTokenFactory.java
b/impl/src/main/java/org/apache/myfaces/application/viewstate/RandomCsrfSessionTokenFactory.java
index 5215b42..20003cb 100644
--- a/impl/src/main/java/org/apache/myfaces/application/viewstate/RandomCsrfSessionTokenFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/application/viewstate/RandomCsrfSessionTokenFactory.java
@@ -55,7 +55,7 @@ class RandomCsrfSessionTokenFactory extends CsrfSessionTokenFactory
         {
             Map<String, Object> map = externalContext.getSessionMap();
             sequence = (Integer) map.get(RendererUtils.SEQUENCE_PARAM);
-            if (sequence == null || sequence.intValue() == Integer.MAX_VALUE)
+            if (sequence == null || sequence == Integer.MAX_VALUE)
             {
                 sequence = Integer.valueOf(1);
             }
diff --git a/impl/src/main/java/org/apache/myfaces/application/viewstate/SerializedViewCollection.java
b/impl/src/main/java/org/apache/myfaces/application/viewstate/SerializedViewCollection.java
index d7eca5d..127afbc 100644
--- a/impl/src/main/java/org/apache/myfaces/application/viewstate/SerializedViewCollection.java
+++ b/impl/src/main/java/org/apache/myfaces/application/viewstate/SerializedViewCollection.java
@@ -169,7 +169,7 @@ class SerializedViewCollection implements Serializable
                         {
                             Integer vscount = _viewScopeIdCounts.get(oldViewScopeId);
                             vscount = vscount - 1;
-                            if (vscount != null && vscount.intValue() < 1)
+                            if (vscount != null && vscount < 1)
                             {
                                 _viewScopeIdCounts.remove(oldViewScopeId);
                                 viewScopeProvider.destroyViewScopeMap(context, oldViewScopeId);
@@ -212,7 +212,7 @@ class SerializedViewCollection implements Serializable
                 {
                     Integer vscount = _viewScopeIdCounts.get(oldViewScopeId);
                     vscount = vscount - 1;
-                    if (vscount != null && vscount.intValue() < 1)
+                    if (vscount != null && vscount < 1)
                     {
                         _viewScopeIdCounts.remove(oldViewScopeId);
                         viewScopeProvider.destroyViewScopeMap(context, oldViewScopeId);
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/RendererUtils.java b/impl/src/main/java/org/apache/myfaces/renderkit/RendererUtils.java
index 7e535f8..323c568 100755
--- a/impl/src/main/java/org/apache/myfaces/renderkit/RendererUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/RendererUtils.java
@@ -341,7 +341,7 @@ public final class RendererUtils
         }
         else if (value instanceof Boolean)
         {
-            return !((Boolean) value).booleanValue();
+            return !((Boolean) value);
         }
         else if (value instanceof Number)
         {
@@ -835,14 +835,14 @@ public final class RendererUtils
             String attrName, boolean defaultValue)
     {
         Boolean b = (Boolean) component.getAttributes().get(attrName);
-        return b != null ? b.booleanValue() : defaultValue;
+        return b != null ? b : defaultValue;
     }
 
     public static int getIntegerAttribute(UIComponent component,
             String attrName, int defaultValue)
     {
         Integer i = (Integer) component.getAttributes().get(attrName);
-        return i != null ? i.intValue() : defaultValue;
+        return i != null ? i : defaultValue;
     }
 
     public static boolean getBooleanValue(String attribute, Object value, boolean defaultValue)
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlCheckboxRendererBase.java
b/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlCheckboxRendererBase.java
index 13b9f28..0cd792e 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlCheckboxRendererBase.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlCheckboxRendererBase.java
@@ -74,7 +74,7 @@ public class HtmlCheckboxRendererBase extends HtmlRenderer
         if (uiComponent instanceof UISelectBoolean)
         {
             Boolean value = RendererUtils.getBooleanValue( uiComponent );
-            boolean isChecked = value != null ? value.booleanValue() : false;
+            boolean isChecked = value != null ? value : false;
             renderCheckbox(facesContext, uiComponent, EXTERNAL_TRUE_VALUE, false,isChecked,
true, null); 
             //TODO: the selectBoolean is never disabled
         }
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlGridRendererBase.java
b/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlGridRendererBase.java
index 0d98ef6..88aed80 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlGridRendererBase.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlGridRendererBase.java
@@ -91,9 +91,8 @@ public class HtmlGridRendererBase extends HtmlRenderer
         }
         else
         {
-            Integer i = (Integer)component.getAttributes().get(
-                    JSFAttr.COLUMNS_ATTR);
-            columns = i != null ? i.intValue() : 0;
+            Integer i = (Integer)component.getAttributes().get(JSFAttr.COLUMNS_ATTR);
+            columns = i != null ? i : 0;
         }
 
         if (columns <= 0)
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/util/SelectItemsUtils.java
b/impl/src/main/java/org/apache/myfaces/renderkit/html/util/SelectItemsUtils.java
index 76f5739..90289e1 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/util/SelectItemsUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/util/SelectItemsUtils.java
@@ -212,6 +212,6 @@ public class SelectItemsUtils
         {
             return false;
         }
-        return ((Boolean) obj).booleanValue();
+        return ((Boolean) obj);
     }
 }
diff --git a/impl/src/main/java/org/apache/myfaces/util/ContainerUtils.java b/impl/src/main/java/org/apache/myfaces/util/ContainerUtils.java
index a5b9b6d..1491211 100644
--- a/impl/src/main/java/org/apache/myfaces/util/ContainerUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/util/ContainerUtils.java
@@ -76,7 +76,7 @@ public class ContainerUtils
     {
         if (runningOnGoogleAppEngine != null)
         {
-            return runningOnGoogleAppEngine.booleanValue();
+            return runningOnGoogleAppEngine;
         }
         else
         {
@@ -93,7 +93,7 @@ public class ContainerUtils
 
         if (runningOnGoogleAppEngine != null)
         {
-            return runningOnGoogleAppEngine.booleanValue();
+            return runningOnGoogleAppEngine;
         }
         else
         {
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
index d980888..21516e8 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
@@ -418,8 +418,7 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
                 if (lastUniqueIdCounter != null)
                 {
                     Integer newUniqueIdCounter = (Integer) view.getAttributes().get(UNIQUE_ID_COUNTER_KEY);
-                    if (newUniqueIdCounter != null && 
-                        lastUniqueIdCounter.intValue() > newUniqueIdCounter.intValue())
+                    if (newUniqueIdCounter != null && lastUniqueIdCounter > newUniqueIdCounter)
                     {
                         // The unique counter was restored by a side effect of 
                         // restoreState() over UIViewRoot with a lower count,
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
index a5d2198..fb51d7f 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
@@ -1046,7 +1046,7 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
                                     required = Boolean.valueOf(requiredValue.toString());
                                 }
 
-                                if (required != null && required.booleanValue())
+                                if (required != null && required)
                                 {
                                     if (log.isLoggable(Level.SEVERE))
                                     {
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
index c88a958..0389115 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
@@ -156,7 +156,7 @@ public class CompositeComponentResourceTagHandler extends ComponentHandler
                         required = Boolean.valueOf(value.toString());
                     } 
                     
-                    if (required != null && required.booleanValue())
+                    if (required != null && required)
                     {
                         Object attrValue = this.tag.getAttributes().get (propertyDescriptor.getName());
                         
@@ -200,11 +200,11 @@ public class CompositeComponentResourceTagHandler extends ComponentHandler
                     // Add the flag and return.
                     c.getAttributes().put(CREATE_CC_ON_POST_ADD_TO_VIEW, 0);
                 }
-                else if (step.intValue() == 0)
+                else if (step == 0)
                 {
                     // Should not happen, stop processing
                 }
-                else if (step.intValue() == 1)
+                else if (step == 1)
                 {
                     // The component was created, and the listener attached to PostAddToViewEvent
                     // is executing right now. Do the necessary steps to process the 
@@ -551,7 +551,7 @@ public class CompositeComponentResourceTagHandler extends ComponentHandler
             // In a programatical addition, the code that process the composite component
only takes effect
             // when the composite component is added to the view.
             Integer step = (Integer) innerCompositeComponent.getAttributes().get(CREATE_CC_ON_POST_ADD_TO_VIEW);
-            if (step != null && step.intValue() == 1)
+            if (step != null && step == 1)
             {
                 if (name != null)
                 {
@@ -605,7 +605,7 @@ public class CompositeComponentResourceTagHandler extends ComponentHandler
                     return true;
                 }
             }
-            else if (step != null && step.intValue() > 1)
+            else if (step != null && step > 1)
             {
                 // refresh case, in facet case it is not necessary to remove/add the facet,
because there
                 // is no relative order (it is always on the same spot).
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CreateDynamicCompositeComponentListener.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CreateDynamicCompositeComponentListener.java
index efcdf63..6865dd1 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CreateDynamicCompositeComponentListener.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CreateDynamicCompositeComponentListener.java
@@ -96,7 +96,7 @@ public class CreateDynamicCompositeComponentListener
         // have any side effect (counts as a refresh).
         Integer step = (Integer) component.getAttributes().get(
             CompositeComponentResourceTagHandler.CREATE_CC_ON_POST_ADD_TO_VIEW); 
-        if (step != null && step.intValue() == 0)
+        if (step != null && step == 0)
         {
             component.getAttributes().put(CompositeComponentResourceTagHandler.CREATE_CC_ON_POST_ADD_TO_VIEW,
1);
         }
@@ -234,10 +234,10 @@ public class CreateDynamicCompositeComponentListener
         else if (values[0] instanceof Object[])
         {
             Object[] def = (Object[])values[0];
-            String ns = ( ((Integer)def[0]).intValue() == 0) ? 
+            String ns = (((Integer) def[0]) == 0) ? 
                 CompositeResourceLibrary.NAMESPACE_PREFIX :
                 CompositeResourceLibrary.ALIAS_NAMESPACE_PREFIX;
-            taglibURI = ns + (String)(((Object[])values[0])[1]);
+            taglibURI = ns + (String) ((Object[]) values[0])[1];
         }
         tagName = (String)values[1];
         attributes = (Map<String,Object>) values[2];
diff --git a/impl/src/main/java/org/apache/myfaces/webapp/MyFacesServlet.java b/impl/src/main/java/org/apache/myfaces/webapp/MyFacesServlet.java
index 4527fab..6216f12 100755
--- a/impl/src/main/java/org/apache/myfaces/webapp/MyFacesServlet.java
+++ b/impl/src/main/java/org/apache/myfaces/webapp/MyFacesServlet.java
@@ -85,7 +85,7 @@ public class MyFacesServlet implements Servlet, DelegatedFacesServlet
               
         // Check, if ServletContextListener was already called
         Boolean b = (Boolean)servletContext.getAttribute(StartupServletContextListener.FACES_INIT_DONE);
-        if (b == null || b.booleanValue() == false)
+        if (b == null || b == false)
         {
             if(log.isLoggable(Level.WARNING))
             {
diff --git a/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
b/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
index 14baf98..b97d828 100755
--- a/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
+++ b/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
@@ -78,7 +78,7 @@ public class StartupServletContextListener implements ServletContextListener
         _servletContext = event.getServletContext();
 
         Boolean b = (Boolean) _servletContext.getAttribute(FACES_INIT_DONE);
-        if (b == null || b.booleanValue() == false)
+        if (b == null || b == false)
         {
             long start = System.currentTimeMillis();
 
diff --git a/impl/src/test/java/org/apache/myfaces/test/core/AbstractMyFacesTestCase.java
b/impl/src/test/java/org/apache/myfaces/test/core/AbstractMyFacesTestCase.java
index cc2c4a5..2c9239a 100644
--- a/impl/src/test/java/org/apache/myfaces/test/core/AbstractMyFacesTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/test/core/AbstractMyFacesTestCase.java
@@ -701,18 +701,18 @@ public abstract class AbstractMyFacesTestCase
                 }
                 else
                 {
-                    if (BEFORE_RENDER_STEP == step.intValue())
+                    if (BEFORE_RENDER_STEP == step)
                     {
                         executeBuildViewCycle(facesContext);
                         executeViewHandlerRender(facesContext);
                         executeAfterRender(facesContext);
                     }
-                    else if (BUILD_VIEW_CYCLE_STEP == step.intValue())
+                    else if (BUILD_VIEW_CYCLE_STEP == step)
                     {
                         executeViewHandlerRender(facesContext);
                         executeAfterRender(facesContext);
                     }
-                    else if (VIEWHANDLER_RENDER_STEP == step.intValue())
+                    else if (VIEWHANDLER_RENDER_STEP == step)
                     {
                         executeAfterRender(facesContext);
                     }


Mime
View raw message