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 2019/12/05 09:00:09 UTC

[myfaces] branch master updated: refactored

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 b77e5eb  refactored
b77e5eb is described below

commit b77e5eb492e81507f0e2c01b571d6a5e91e69718
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Thu Dec 5 10:00:01 2019 +0100

    refactored
---
 .../apache/myfaces/renderkit/html/util/HTMLEncoder.java  | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/util/HTMLEncoder.java b/impl/src/main/java/org/apache/myfaces/renderkit/html/util/HTMLEncoder.java
index fa9959c..27154f1 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/util/HTMLEncoder.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/util/HTMLEncoder.java
@@ -342,7 +342,6 @@ public abstract class HTMLEncoder
         offset = Math.max(0, offset);
         int realLength = Math.min(length, string.length - offset);
 
-        //StringBuilder sb = null;    //create later on demand
         String app;
         char c = ' ';
         char prevC;
@@ -845,7 +844,6 @@ public abstract class HTMLEncoder
     public static void encodeURIAttribute(Writer writer, final String string, final String characterEncoding)
         throws IOException
     {
-        //StringBuilder sb = null;    //create later on demand
         int start = 0;
         String app;
         char c;
@@ -1010,7 +1008,6 @@ public abstract class HTMLEncoder
                     }
                     else
                     {
-                        //app = percentEncode(c, UTF8);
                         if (start < i)
                         {
                             writer.write(string, start, i-start);
@@ -1021,7 +1018,6 @@ public abstract class HTMLEncoder
                 }
                 else
                 {
-                    //app = percentEncode(c, UTF8);
                     if (start < i)
                     {
                         writer.write(string, start, i-start);
@@ -1036,14 +1032,12 @@ public abstract class HTMLEncoder
                 {
                     // The remaining part of the URI are data that should be encoded
                     // using the document character encoding.
-                    //app = c + encodeURIQuery(string.substring(i+1), characterEncoding);
                     if (start < i)
                     {
                         writer.write(string, start, i-start);
                     }
                     start = i+1;
                     writer.write(c);
-                    //encodeURIQuery(writer, string.substring(i+1), characterEncoding);
                     encodeURIQuery(writer, string, i+1, characterEncoding);
                     endLoop = true;
                 }
@@ -1123,15 +1117,10 @@ public abstract class HTMLEncoder
         byte [] byteArray =  baos.toByteArray();
         for (int i=0; i < byteArray.length; i++)
         {
-            //builder.append('%');
-            //builder.append(HEX_CHARSET.charAt( (( ((short) byteArray[i] & 0xFF ) >> 0x4) % 0x10)) );
-            //builder.append(HEX_CHARSET.charAt( ((short) byteArray[i] & 0xFF ) % 0x10));
             currentWriter.write('%');
             currentWriter.write(HEX_CHARSET.charAt( (( ((short) byteArray[i] & 0xFF ) >> 0x4) % 0x10)) );
             currentWriter.write(HEX_CHARSET.charAt( ((short) byteArray[i] & 0xFF ) % 0x10));
         }
-        
-        //return builder.toString();
     }
     
     /**
@@ -1145,13 +1134,12 @@ public abstract class HTMLEncoder
     private static void encodeURIQuery(Writer writer, final String string, int offset, final String characterEncoding)
             throws IOException
     {
-        //StringBuilder sb = null;    //create later on demand
         int start = offset;
         int length = string.length();
         int realLength = length-offset;
         String app;
         char c;
-        //boolean endLoop = false;
+
         for (int i = offset; i < length; ++i)
         {
             app = null;
@@ -1177,7 +1165,6 @@ public abstract class HTMLEncoder
             {
                 // The percent encoding on this part should be done using UTF-8 charset
                 // as RFC 3986 Section 3.2.2 says
-                //app = percentEncode(c, characterEncoding);
                 if (start < i)
                 {
                     writer.write(string, start, i-start);
@@ -1198,7 +1185,6 @@ public abstract class HTMLEncoder
                     }
                     else
                     {
-                        //app = percentEncode(c, characterEncoding);
                         if (start < i)
                         {
                             writer.write(string, start, i-start);