You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2020/04/13 17:51:50 UTC

[myfaces] 01/02: MYFACES-3477 cosmetics

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

commit 2bc8b3c77216275c2d6f4166ed1b110ce47714a6
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Mon Apr 13 19:49:24 2020 +0200

    MYFACES-3477 cosmetics
---
 .../org/apache/myfaces/application/viewstate/StateUtils.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/application/viewstate/StateUtils.java b/impl/src/main/java/org/apache/myfaces/application/viewstate/StateUtils.java
index cd9d3ef..29903c2 100644
--- a/impl/src/main/java/org/apache/myfaces/application/viewstate/StateUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/application/viewstate/StateUtils.java
@@ -237,15 +237,16 @@ public final class StateUtils
     public static final String construct(Object object, ExternalContext ctx)
     {
         byte[] bytes = getAsByteArray(object, ctx);
-        if( enableCompression(ctx) )
+        if (enableCompression(ctx))
         {
             bytes = compress(bytes);
         }
-        if(isSecure(ctx))
+        if (isSecure(ctx))
         {
             bytes = encrypt(bytes, ctx);
         }
         bytes = encode(bytes);
+
         try
         {
             return new String(bytes, ZIP_CHARSET);
@@ -375,21 +376,22 @@ public final class StateUtils
         byte[] bytes;
         try
         {
-            if(log.isLoggable(Level.FINE))
+            if (log.isLoggable(Level.FINE))
             {
                 log.fine("Processing state : " + string);
             }
 
             bytes = string.getBytes(ZIP_CHARSET);
             bytes = decode(bytes);
-            if(isSecure(ctx))
+            if (isSecure(ctx))
             {
                 bytes = decrypt(bytes, ctx);
             }
-            if( enableCompression(ctx) )
+            if (enableCompression(ctx))
             {
                 bytes = decompress(bytes);
             }
+
             return getAsObject(bytes, ctx);
         }
         catch (Throwable e)