tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1448099 - in /tomcat/trunk/java/org/apache/tomcat/util/http: Cookies.java HttpMessages.java MimeHeaders.java Parameters.java
Date Wed, 20 Feb 2013 11:42:38 GMT
Author: markt
Date: Wed Feb 20 11:42:38 2013
New Revision: 1448099

URL: http://svn.apache.org/r1448099
Log:
UCDetector
 - use final
 - reduce visibility
 - remove unused code

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java
    tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java
    tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java
    tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java?rev=1448099&r1=1448098&r2=1448099&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java Wed Feb 20 11:42:38 2013
@@ -50,7 +50,7 @@ public final class Cookies {
     int cookieCount=0;
     boolean unprocessed=true;
 
-    MimeHeaders headers;
+    private final MimeHeaders headers;
 
     /**
      *  Construct a new cookie collection, that will extract

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java?rev=1448099&r1=1448098&r2=1448099&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java Wed Feb 20 11:42:38 2013
@@ -29,13 +29,13 @@ import org.apache.tomcat.util.res.String
  */
 public class HttpMessages {
     // XXX move message resources in this package
-    protected static final StringManager sm =
+    private static final StringManager sm =
         StringManager.getManager("org.apache.tomcat.util.http.res");
 
-    static String st_200=null;
-    static String st_302=null;
-    static String st_400=null;
-    static String st_404=null;
+    private static String st_200=null;
+    private static String st_302=null;
+    private static String st_400=null;
+    private static String st_404=null;
 
     /** Get the status string associated with a status code.
      *  No I18N - return the messages defined in the HTTP spec.

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java?rev=1448099&r1=1448098&r2=1448099&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java Wed Feb 20 11:42:38 2013
@@ -385,10 +385,10 @@ public class MimeHeaders {
     we want to keep add O(1).
 */
 class NamesEnumerator implements Enumeration<String> {
-    int pos;
-    int size;
-    String next;
-    MimeHeaders headers;
+    private int pos;
+    private final int size;
+    private String next;
+    private final MimeHeaders headers;
 
     public NamesEnumerator(MimeHeaders headers) {
         this.headers=headers;
@@ -435,11 +435,11 @@ class NamesEnumerator implements Enumera
     value element.
 */
 class ValuesEnumerator implements Enumeration<String> {
-    int pos;
-    int size;
-    MessageBytes next;
-    MimeHeaders headers;
-    String name;
+    private int pos;
+    private final int size;
+    private MessageBytes next;
+    private final MimeHeaders headers;
+    private final String name;
 
     ValuesEnumerator(MimeHeaders headers, String name) {
         this.name=name;
@@ -476,8 +476,8 @@ class ValuesEnumerator implements Enumer
 
 class MimeHeaderField {
 
-    protected final MessageBytes nameB = MessageBytes.newInstance();
-    protected final MessageBytes valueB = MessageBytes.newInstance();
+    private final MessageBytes nameB = MessageBytes.newInstance();
+    private final MessageBytes valueB = MessageBytes.newInstance();
 
     /**
      * Creates a new, uninitialized header field.

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java?rev=1448099&r1=1448098&r2=1448099&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Wed Feb 20 11:42:38 2013
@@ -27,7 +27,6 @@ import java.util.Map;
 
 import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.buf.ByteChunk;
-import org.apache.tomcat.util.buf.CharChunk;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.buf.UDecoder;
 import org.apache.tomcat.util.log.UserDataHelper;
@@ -46,20 +45,20 @@ public final class Parameters {
 
     private static final UserDataHelper maxParamCountLog = new UserDataHelper(log);
 
-    protected static final StringManager sm =
+    private static final StringManager sm =
         StringManager.getManager("org.apache.tomcat.util.http");
 
     private final HashMap<String,ArrayList<String>> paramHashValues =
             new HashMap<>();
     private boolean didQueryParameters=false;
 
-    MessageBytes queryMB;
+    private MessageBytes queryMB;
 
-    UDecoder urlDec;
-    MessageBytes decodedQuery=MessageBytes.newInstance();
+    private UDecoder urlDec;
+    private final MessageBytes decodedQuery = MessageBytes.newInstance();
 
-    String encoding=null;
-    String queryStringEncoding=null;
+    private String encoding=null;
+    private String queryStringEncoding=null;
 
     private int limit = -1;
     private int parameterCount = 0;
@@ -208,11 +207,10 @@ public final class Parameters {
     // -------------------- Parameter parsing --------------------
     // we are called from a single thread - we can do it the hard way
     // if needed
-    ByteChunk tmpName=new ByteChunk();
-    ByteChunk tmpValue=new ByteChunk();
+    private final ByteChunk tmpName=new ByteChunk();
+    private final ByteChunk tmpValue=new ByteChunk();
     private final ByteChunk origName=new ByteChunk();
     private final ByteChunk origValue=new ByteChunk();
-    CharChunk tmpNameC=new CharChunk(1024);
     public static final String DEFAULT_ENCODING = "ISO-8859-1";
     private static final Charset DEFAULT_CHARSET =
         Charset.forName(DEFAULT_ENCODING);
@@ -498,7 +496,8 @@ public final class Parameters {
     /**
      * Debug purpose
      */
-    public String paramsAsString() {
+    @Override
+    public String toString() {
         StringBuilder sb = new StringBuilder();
         for (Map.Entry<String, ArrayList<String>> e : paramHashValues.entrySet())
{
             sb.append(e.getKey()).append('=');



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message