[09/11] git commit: Removes override which isn't used anymore

2014-05-12 Thread lukaszlenart
Removes override which isn't used anymore


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/7857b869
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/7857b869
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/7857b869

Branch: refs/heads/feature/exclude-object-class
Commit: 7857b869a05b12779e35bfe8751828dfbf328fff
Parents: 62ee6b1
Author: Lukasz Lenart 
Authored: Mon May 5 21:33:44 2014 +0200
Committer: Lukasz Lenart 
Committed: Mon May 5 21:33:44 2014 +0200

--
 .../xwork2/interceptor/ParametersInterceptorTest.java | 14 --
 1 file changed, 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/struts/blob/7857b869/xwork-core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java
--
diff --git 
a/xwork-core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java
 
b/xwork-core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java
index 6ffb3ff..359618f 100644
--- 
a/xwork-core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java
+++ 
b/xwork-core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java
@@ -187,10 +187,6 @@ public class ParametersInterceptorTest extends 
XWorkTestCase {
 return result;
 }
 
-@Override
-protected void initializeHardCodedExcludePatterns() {
-excludeParams = new HashSet();
-}
 };
 
 container.inject(pi);
@@ -307,11 +303,6 @@ public class ParametersInterceptorTest extends 
XWorkTestCase {
 ParametersInterceptor pi = new ParametersInterceptor() {
 
 @Override
-protected void initializeHardCodedExcludePatterns() {
-this.excludeParams = new HashSet();
-}
-
-@Override
 protected boolean isExcluded(String paramName) {
 boolean result = super.isExcluded(paramName);
 excluded.put(paramName, result);
@@ -744,11 +735,6 @@ public class ParametersInterceptorTest extends 
XWorkTestCase {
 assertEquals(expected, actual);
 }
 
-public void testExcludedPatternsGetInitialized() throws Exception {
-ParametersInterceptor parametersInterceptor = new 
ParametersInterceptor();
-assertEquals(ExcludedPatterns.EXCLUDED_PATTERNS.length, 
parametersInterceptor.excludeParams.size());
-}
-
 private ValueStack injectValueStack(Map actual) {
 ValueStack stack = createStubValueStack(actual);
 container.inject(stack);



[CONF] Confluence Changes in the last 24 hours

2014-05-12 Thread Anonymous (Confluence)
















  Confluence Changes in the last 24 hours  




 Apache ActiveMQ 

Pages

 Page: Security edited by Timothy Bish [02:17 PM] (View Changes) 


 Apache Airavata 

Pages

 Home page: Home edited by Eroma [05:23 PM] (View Changes) 


 Apache Ambari 

Pages

 Page: Blueprints edited by Jeff Sposetti [07:22 PM] (View Changes) 


 Apache Open Climate Workbench 

Pages

 Page: Easy-OCW - A Guide to Simplifying OCW Installation edited by Lewis John McGibbney [11:52 PM] (View Changes) 
 Page: Guides and Demos created by Lewis John McGibbney [11:17 PM] 
 Page: Developer Area created by Lewis John McGibbney [11:14 PM] 
 Page: Getting Started edited by Lewis John McGibbney [11:06 PM] (View Changes) 
 Home page: Home edited by Lewis John McGibbney [11:04 PM] (View Changes) 
 Page: Open Climate Workbench User and Developer One Stop Shop created by Lewis John McGibbney [05:07 PM] 
 Page: Open Climate Workbench User Interface Installation and Overview edited by Lewis John McGibbney [04:22 PM] (View Changes) 


 Apache Cloudstack 

Pages

 Page: VM Snapshots in Hyper-V created by Anshul Gangwar [06:08 AM] 
 Page: VR Service Failure Alerting edited by prashant kumar mishra [11:54 AM] (View Changes) 



Comments

 Page: Proposal - Ability to add new guest OS mappings has 3 new comments [ Manan Shah , Amogh Vasekar ] 


 Apache cTAKES 

Pages

 Page: Semantic Similarity edited by Vijay Garla [01:17 PM] (View Changes) 


 Apache Hive 

Pages

 Page: LanguageManual DDL edited by Thejas M Nair 

[02/11] git commit: Uses the same logic as in ParametersInterceptor to use st of patterns to exclude cookies which tries to access Struts internal state

2014-05-12 Thread lukaszlenart
Uses the same logic as in ParametersInterceptor to use st of patterns
to exclude cookies which tries to access Struts internal state


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/1a668af7
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/1a668af7
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/1a668af7

Branch: refs/heads/master
Commit: 1a668af7f1ffccea4a3b46d8d8c1fe1c7331ff02
Parents: dbcdbd0
Author: Lukasz Lenart 
Authored: Thu May 1 11:31:12 2014 +0200
Committer: Lukasz Lenart 
Committed: Thu May 1 11:31:12 2014 +0200

--
 .../struts2/interceptor/CookieInterceptor.java  | 45 +++--
 .../interceptor/CookieInterceptorTest.java  | 53 
 2 files changed, 82 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/struts/blob/1a668af7/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java
--
diff --git 
a/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java 
b/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java
index 3e2e81d..340b57f 100644
--- a/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java
+++ b/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java
@@ -33,6 +33,7 @@ import org.apache.struts2.ServletActionContext;
 
 import javax.servlet.http.Cookie;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
@@ -175,7 +176,13 @@ public class CookieInterceptor extends AbstractInterceptor 
{
 
 // Allowed names of cookies
 private Pattern acceptedPattern = Pattern.compile(ACCEPTED_PATTERN, 
Pattern.CASE_INSENSITIVE);
-private Pattern excludedPattern = 
Pattern.compile(ExcludedPatterns.CLASS_ACCESS_PATTERN, 
Pattern.CASE_INSENSITIVE);
+private Set excludedPatterns = new HashSet();
+
+public CookieInterceptor() {
+for (String pattern : ExcludedPatterns.EXCLUDED_PATTERNS) {
+excludedPatterns.add(Pattern.compile(pattern, 
Pattern.CASE_INSENSITIVE));
+}
+}
 
 /**
  * Set the cookiesName which if matched will allow the cookie
@@ -253,13 +260,16 @@ public class CookieInterceptor extends 
AbstractInterceptor {
  * @return true|false
  */
 protected boolean isAcceptableValue(String value) {
-boolean matches = !excludedPattern.matcher(value).matches();
-if (!matches) {
-if (LOG.isTraceEnabled()) {
-LOG.trace("Cookie value [#0] matches excludedPattern [#1]", 
value, ExcludedPatterns.CLASS_ACCESS_PATTERN);
+for (Pattern excludedPattern : excludedPatterns) {
+boolean matches = !excludedPattern.matcher(value).matches();
+if (!matches) {
+if (LOG.isTraceEnabled()) {
+LOG.trace("Cookie value [#0] matches excludedPattern 
[#1]", value, excludedPattern.toString());
+}
+return false;
 }
 }
-return matches;
+return true;
 }
 
 /**
@@ -293,23 +303,26 @@ public class CookieInterceptor extends 
AbstractInterceptor {
 }
 
 /**
- * Checks if name of Cookie match {@link #excludedPattern}
+ * Checks if name of Cookie match {@link #excludedPatterns}
  *
  * @param name of Cookie
  * @return true|false
  */
 protected boolean isExcluded(String name) {
-boolean matches = excludedPattern.matcher(name).matches();
-if (matches) {
-if (LOG.isTraceEnabled()) {
-LOG.trace("Cookie [#0] matches excludedPattern [#1]", name, 
ExcludedPatterns.CLASS_ACCESS_PATTERN);
-}
-} else {
-if (LOG.isTraceEnabled()) {
-LOG.trace("Cookie [#0] doesn't match excludedPattern [#1]", 
name, ExcludedPatterns.CLASS_ACCESS_PATTERN);
+for (Pattern excludedPattern : excludedPatterns) {
+boolean matches = excludedPattern.matcher(name).matches();
+if (matches) {
+if (LOG.isTraceEnabled()) {
+LOG.trace("Cookie [#0] matches excludedPattern [#1]", 
name, excludedPattern.toString());
+}
+return true;
+} else {
+if (LOG.isTraceEnabled()) {
+LOG.trace("Cookie [#0] doesn't match excludedPattern 
[#1]", name, excludedPattern.toString());
+}
 }
 }
-return matches;
+return false;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/struts/blob/1a668af7/core/src/test/java/org/apache/struts2/interceptor/CookieInterceptorTest.java