hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r765644 - in /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie: BestMatchSpec.java BrowserCompatSpec.java
Date Thu, 16 Apr 2009 14:11:51 GMT
Author: sebb
Date: Thu Apr 16 14:11:51 2009
New Revision: 765644

URL: http://svn.apache.org/viewvc?rev=765644&view=rev
Log:
Ensure final String array cannot be changed accidentally or maliciously

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java?rev=765644&r1=765643&r2=765644&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java
Thu Apr 16 14:11:51 2009
@@ -94,7 +94,7 @@
         if (this.netscape == null) {
             String[] patterns = this.datepatterns;
             if (patterns == null) {
-                patterns = BrowserCompatSpec.DATE_PATTERNS;
+                patterns = BrowserCompatSpec.getDATE_PATTERNS();
             }
             this.netscape = new NetscapeDraftSpec(patterns);
         }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java?rev=765644&r1=765643&r2=765644&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java
Thu Apr 16 14:11:51 2009
@@ -58,7 +58,7 @@
 public class BrowserCompatSpec extends CookieSpecBase {
     
     /** Valid date patterns used per default */
-    protected static final String[] DATE_PATTERNS = new String[] {
+    private static final String[] DATE_PATTERNS = new String[] {
             DateUtils.PATTERN_RFC1123,
             DateUtils.PATTERN_RFC1036,
             DateUtils.PATTERN_ASCTIME,
@@ -188,5 +188,9 @@
     public Header getVersionHeader() {
         return null;
     }
+
+    protected static String[] getDATE_PATTERNS() {
+        return DATE_PATTERNS.clone();
+    }
     
 }



Mime
View raw message