svn commit: r1188961 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java

2011-10-25 Thread mcucchiara
Author: mcucchiara
Date: Tue Oct 25 23:09:53 2011
New Revision: 1188961

URL: http://svn.apache.org/viewvc?rev=1188961&view=rev
Log:
Replaced while loop with foreach

Modified:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java?rev=1188961&r1=1188960&r2=1188961&view=diff
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java
 Tue Oct 25 23:09:53 2011
@@ -22,7 +22,6 @@
 package org.apache.struts2.util;
 
 import java.lang.reflect.Array;
-import java.util.Iterator;
 import java.util.Map;
 
 
@@ -81,13 +80,11 @@ public class ContainUtil {
 return true;
 }
 } if (obj1 instanceof Iterable) {
-   Iterator iter = ((Iterable) obj1).iterator();
-   while(iter.hasNext()) {
-   Object value = iter.next();
-   if (obj2.equals(value) || 
obj2.toString().equals(value)) {
-   return true;
-   }
-   }
+for (Object value : ((Iterable) obj1)) {
+if (obj2.equals(value) || obj2.toString().equals(value)) {
+return true;
+}
+}
 } else if (obj1.getClass().isArray()) {
 for (int i = 0; i < Array.getLength(obj1); i++) {
 Object value = null;




svn commit: r1188962 - /struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java

2011-10-25 Thread mcucchiara
Author: mcucchiara
Date: Tue Oct 25 23:12:56 2011
New Revision: 1188962

URL: http://svn.apache.org/viewvc?rev=1188962&view=rev
Log:
Changed return type to checked conversion

Modified:

struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java

Modified: 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java?rev=1188962&r1=1188961&r2=1188962&view=diff
==
--- 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java
 (original)
+++ 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java
 Tue Oct 25 23:12:56 2011
@@ -21,13 +21,13 @@
 
 package org.apache.struts2.views.jsp.ui;
 
+import org.apache.struts2.TestAction;
+import org.apache.struts2.views.jsp.AbstractUITagTest;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Map;
 
-import org.apache.struts2.TestAction;
-import org.apache.struts2.views.jsp.AbstractUITagTest;
-
 
 /**
  * Test case for CheckboxList.
@@ -43,8 +43,8 @@ public class CheckboxListTest extends Ab
  * @return A Map of PropertyHolders values bound to {@link 
org.apache.struts2.views.jsp.AbstractUITagTest.PropertyHolder#getName()}
  * as key.
  */
-protected Map initializedGenericTagTestProperties() {
-Map result = super.initializedGenericTagTestProperties();
+protected Map 
initializedGenericTagTestProperties() {
+Map result = 
super.initializedGenericTagTestProperties();
 new PropertyHolder("value", "hello").addToMap(result);
 return result;
 }
@@ -63,7 +63,7 @@ public class CheckboxListTest extends Ab
 
 private void prepareTagGeneric(CheckboxListTag tag) {
 TestAction testAction = (TestAction) action;
-Collection collection = new ArrayList(2);
+Collection collection = new ArrayList(2);
 collection.add("hello");
 collection.add("foo");
 testAction.setCollection(collection);
@@ -79,7 +79,7 @@ public class CheckboxListTest extends Ab
 
 public void testMultiple() throws Exception {
 TestAction testAction = (TestAction) action;
-Collection collection = new ArrayList(2);
+Collection collection = new ArrayList(2);
 collection.add("hello");
 collection.add("foo");
 testAction.setCollection(collection);
@@ -105,7 +105,7 @@ public class CheckboxListTest extends Ab
 
 public void testMultipleWithDisabledOn() throws Exception {
 TestAction testAction = (TestAction) action;
-Collection collection = new ArrayList(2);
+Collection collection = new ArrayList(2);
 collection.add("hello");
 collection.add("foo");
 testAction.setCollection(collection);




svn commit: r1188963 - in /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher: ServletActionRedirectResult.java ServletRedirectResult.java

2011-10-25 Thread mcucchiara
Author: mcucchiara
Date: Tue Oct 25 23:14:09 2011
New Revision: 1188963

URL: http://svn.apache.org/viewvc?rev=1188963&view=rev
Log:
WW-3652 - Add example for "anchor" (aka "hash" or "fragment") to 
RedirectActionResult docs (patch submitted by Jeff Black)

Modified:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java

struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java?rev=1188963&r1=1188962&r2=1188963&view=diff
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java
 Tue Oct 25 23:14:09 2011
@@ -56,17 +56,22 @@ import com.opensymphony.xwork2.util.refl
  * 
  * 
  * 
- * actionName (default) - the name of the action that will be
- * redirect to
+ * actionName (default) - The name of the action that will be
+ * redirected to.
  * 
- * namespace - used to determine which namespace the action is in
- * that we're redirecting to . If namespace is null, this defaults to the
- * current namespace
+ * namespace - Used to determine which namespace the action is in
+ * that we're redirecting to.  If namespace is null, the default will be the
+ * current namespace.
  * 
- * suppressEmptyParameters - optional boolean (defaults to false) 
that
+ * suppressEmptyParameters - Optional boolean (defaults to false) 
that
  * can prevent parameters with no values from being included in the redirect
  * URL.
- * 
+ *
+ * parse - Boolean, true by default.  If set to false, the 
actionName 
+ * param will not be parsed for Ognl expressions.
+ *
+ * anchor - Optional.  Also known as "fragment" or colloquially as 
+ * "hash".  You can specify an anchor for a result.
  * 
  * 
  * 
@@ -98,10 +103,10 @@ import com.opensymphony.xwork2.util.refl
  * 
  * 
  * 
- *<-- Pass parameters (reportType, width and height) -->
+ *
  *
  *
  *   
@@ -112,6 +117,7 @@ import com.opensymphony.xwork2.util.refl
  *  100
  *  
  *  true
+ *  summary
  *   
  *
  * 

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java?rev=1188963&r1=1188962&r2=1188963&view=diff
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
 Tue Oct 25 23:14:09 2011
@@ -72,8 +72,8 @@ import com.opensymphony.xwork2.util.refl
  * parse - true by default. If set to false, the location param will
  * not be parsed for Ognl expressions.
  * 
- * anchor - optional, you can specify an anchor for result.
- * 
+ * anchor - Optional.  Also known as "fragment" or colloquially as 
+ * "hash".  You can specify an anchor for a result.
  * 
  * 
  * 
@@ -86,6 +86,10 @@ import com.opensymphony.xwork2.util.refl
  * 
  * 
  * 
+ * 
  * 
  *   foo.jsp
  *   false




svn commit: r1188965 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java

2011-10-25 Thread mcucchiara
Author: mcucchiara
Date: Tue Oct 25 23:19:48 2011
New Revision: 1188965

URL: http://svn.apache.org/viewvc?rev=1188965&view=rev
Log:
Code optimization

Modified:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java?rev=1188965&r1=1188964&r2=1188965&view=diff
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
 Tue Oct 25 23:19:48 2011
@@ -21,23 +21,6 @@
 
 package org.apache.struts2.dispatcher;
 
-import static javax.servlet.http.HttpServletResponse.SC_FOUND;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.ServletActionContext;
-import org.apache.struts2.dispatcher.mapper.ActionMapper;
-import org.apache.struts2.dispatcher.mapper.ActionMapping;
-import org.apache.struts2.views.util.UrlHelper;
-
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.config.entities.ResultConfig;
@@ -46,6 +29,17 @@ import com.opensymphony.xwork2.util.logg
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
 import com.opensymphony.xwork2.util.reflection.ReflectionException;
 import com.opensymphony.xwork2.util.reflection.ReflectionExceptionHandler;
+import org.apache.struts2.ServletActionContext;
+import org.apache.struts2.dispatcher.mapper.ActionMapper;
+import org.apache.struts2.dispatcher.mapper.ActionMapping;
+import org.apache.struts2.views.util.UrlHelper;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+
+import static javax.servlet.http.HttpServletResponse.SC_FOUND;
 
 /**
  * 
@@ -221,17 +215,16 @@ public class ServletRedirectResult exten
 ResultConfig resultConfig = 
invocation.getProxy().getConfig().getResults().get(invocation.getResultCode());
 if (resultConfig != null)
 {
-Map resultConfigParams = resultConfig.getParams();
-for (Iterator i = resultConfigParams.entrySet().iterator(); 
i.hasNext();)
-{
-Map.Entry e = (Map.Entry) i.next();
+Map resultConfigParams = 
resultConfig.getParams();
 
+for (Map.Entry e : 
resultConfigParams.entrySet())
+{
 if (!getProhibitedResultParams().contains(e.getKey()))
 {
-String potentialValue = e.getValue() == null ? "" : 
conditionalParse(e.getValue().toString(), invocation);
+String potentialValue = e.getValue() == null ? "" : 
conditionalParse(e.getValue(), invocation);
 if (!suppressEmptyParameters || ((potentialValue != 
null) && (potentialValue.length() > 0)))
 {
-requestParameters.put(e.getKey().toString(), 
potentialValue);
+requestParameters.put(e.getKey(), potentialValue);
 }
 }
 }
@@ -259,9 +252,7 @@ public class ServletRedirectResult exten
 
 protected List getProhibitedResultParams()
 {
-return Arrays.asList(new String[] {
-DEFAULT_PARAM, "namespace", "method", "encode", "parse", 
"location", "prependServletContext", "suppressEmptyParameters", "anchor"
-});
+return Arrays.asList(DEFAULT_PARAM, "namespace", "method", "encode", 
"parse", "location", "prependServletContext", "suppressEmptyParameters", 
"anchor");
 }
 
 /**




svn commit: r1188966 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java

2011-10-25 Thread mcucchiara
Author: mcucchiara
Date: Tue Oct 25 23:21:21 2011
New Revision: 1188966

URL: http://svn.apache.org/viewvc?rev=1188966&view=rev
Log:
Removed unused private Log, avoid explicit array creation

Modified:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java?rev=1188966&r1=1188965&r2=1188966&view=diff
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java
 Tue Oct 25 23:21:21 2011
@@ -135,8 +135,6 @@ public class ServletActionRedirectResult
 /** The default parameter */
 public static final String DEFAULT_PARAM = "actionName";
 
-private static final Logger LOG = 
LoggerFactory.getLogger(ServletActionRedirectResult.class);
-
 protected String actionName;
 protected String namespace;
 protected String method;
@@ -229,8 +227,6 @@ public class ServletActionRedirectResult
 
 protected List getProhibitedResultParams()
 {
-return Arrays.asList(new String[] {
-DEFAULT_PARAM, "namespace", "method", "encode", "parse", 
"location", "prependServletContext", "suppressEmptyParameters", "anchor"
-});
+return Arrays.asList(DEFAULT_PARAM, "namespace", "method", "encode", 
"parse", "location", "prependServletContext", "suppressEmptyParameters", 
"anchor");
 }
 }




svn commit: r1188968 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java

2011-10-25 Thread mcucchiara
Author: mcucchiara
Date: Tue Oct 25 23:24:56 2011
New Revision: 1188968

URL: http://svn.apache.org/viewvc?rev=1188968&view=rev
Log:
Inline variable assignment

Modified:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java?rev=1188968&r1=1188967&r2=1188968&view=diff
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ContainUtil.java
 Tue Oct 25 23:24:56 2011
@@ -87,8 +87,7 @@ public class ContainUtil {
 }
 } else if (obj1.getClass().isArray()) {
 for (int i = 0; i < Array.getLength(obj1); i++) {
-Object value = null;
-value = Array.get(obj1, i);
+Object value = Array.get(obj1, i);
 
 if (obj2.equals(value)) {
 //log.debug("obj1 is an array and contains obj2");




svn commit: r1188978 - /struts/site/src/site/resources/images/starting-struts2.jpg

2011-10-25 Thread mcucchiara
Author: mcucchiara
Date: Wed Oct 26 00:36:20 2011
New Revision: 1188978

URL: http://svn.apache.org/viewvc?rev=1188978&view=rev
Log:
Added missing image

Added:
struts/site/src/site/resources/images/starting-struts2.jpg   (with props)

Added: struts/site/src/site/resources/images/starting-struts2.jpg
URL: 
http://svn.apache.org/viewvc/struts/site/src/site/resources/images/starting-struts2.jpg?rev=1188978&view=auto
==
Binary file - no diff available.

Propchange: struts/site/src/site/resources/images/starting-struts2.jpg
--
svn:mime-type = image/jpeg




[CONF] Confluence Changes in the last 24 hours

2011-10-25 Thread confluence
This is a daily summary of all recent changes in Confluence.

-
Updated Spaces:
-


Apache ActiveMQ (https://cwiki.apache.org/confluence/display/ACTIVEMQ)

Pages
-
Cross Language Clients edited by  tmielke  (06:08 AM)
https://cwiki.apache.org/confluence/display/ACTIVEMQ/Cross+Language+Clients

Python edited by  tmielke  (05:58 AM)
https://cwiki.apache.org/confluence/display/ACTIVEMQ/Python



Apache Camel (https://cwiki.apache.org/confluence/display/CAMEL)

Pages
-
Camel 2.9.0 Release edited by  davsclaus  (04:11 PM)
https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.9.0+Release

XQuery edited by  davsclaus  (04:09 PM)
https://cwiki.apache.org/confluence/display/CAMEL/XQuery

XSLT edited by  davsclaus  (09:19 AM)
https://cwiki.apache.org/confluence/display/CAMEL/XSLT

File2 edited by  davsclaus  (07:34 AM)
https://cwiki.apache.org/confluence/display/CAMEL/File2

Polling Consumer edited by  davsclaus  (07:32 AM)
https://cwiki.apache.org/confluence/display/CAMEL/Polling+Consumer

Creating a new Camel Component edited by  davsclaus  (05:26 AM)
https://cwiki.apache.org/confluence/display/CAMEL/Creating+a+new+Camel+Component

Apache Camel 2.8.2 and 2.7.4 Released created by davsclaus (05:15 AM)
https://cwiki.apache.org/confluence/display/CAMEL/2011/10/25/Apache+Camel+2.8.2+and+2.7.4+Released

Camel 2.7.4 Release created by davsclaus (05:19 AM)
https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.7.4+Release

Asynchronous Routing Engine edited by  davsclaus  (04:02 AM)
https://cwiki.apache.org/confluence/display/CAMEL/Asynchronous+Routing+Engine

JMS edited by  davsclaus  (03:57 AM)
https://cwiki.apache.org/confluence/display/CAMEL/JMS



Apache Felix (https://cwiki.apache.org/confluence/display/FELIX)

Pages
-
Committers edited by  he...@ungoverned.org  (12:33 PM)
https://cwiki.apache.org/confluence/display/FELIX/Committers



Apache Hive (https://cwiki.apache.org/confluence/display/Hive)

Pages
-
Literals created by jonch...@fb.com (04:57 PM)
https://cwiki.apache.org/confluence/display/Hive/Literals

LanguageManual UDF edited by  jonch...@fb.com  (04:51 PM)
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF



Apache Ode (https://cwiki.apache.org/confluence/display/ODExSITE)

Pages
-
Board Report 2011-10 created by vanto (04:49 AM)
https://cwiki.apache.org/confluence/display/ODExSITE/Board+Report+2011-10

Board Reports edited by  vanto  (04:40 AM)
https://cwiki.apache.org/confluence/display/ODExSITE/Board+Reports



OFBiz (Open For Business) Project Open Wiki 
(https://cwiki.apache.org/confluence/display/OFBIZ)

Pages
-
Jackrabbit Branch Development edited by  sascha  (03:06 AM)
https://cwiki.apache.org/confluence/display/OFBIZ/Jackrabbit+Branch+Development



Apache OpenOffice.org Community 
(https://cwiki.apache.org/confluence/display/OOOUSERS)

Pages
-
Email Migration Post created by robweir (08:50 AM)
https://cwiki.apache.org/confluence/display/OOOUSERS/Email+Migration+Post



Apache OpenNLP (https://cwiki.apache.org/confluence/display/OPENNLP)

Pages
-
TestPlan1.5.2 edited by  joern  (02:13 PM)
https://cwiki.apache.org/confluence/display/OPENNLP/TestPlan1.5.2



Apache Tapestry (https://cwiki.apache.org/confluence/display/TAPESTRY)

Pages
-
Component Templates edited by  bobharner  (09:02 PM)
https://cwiki.apache.org/confluence/display/TAPESTRY/Component+Templates

Release Notes 5.3 edited by  hlship  (06:56 PM)
https://cwiki.apache.org/confluence/display/TAPESTRY/Release+Notes+5.3



Apache VCL (https://cwiki.apache.org/confluence/display/VCL)

Pages
-
Index edited by  fapeeler  (10:59 AM)
https://cwiki.apache.org/confluence/display/VCL/Index

VCL 2.2.1 - Further Steps if Using VMware edited by  fapeeler  (10:07 AM)
https://cwiki.apache.org/confluence/display/VCL/VCL+2.2.1+-+Further+Steps+if+Using+VMware



Apache Whirr (https://cwiki.apache.org/confluence/display/WHIRR)

Pages
-
MailingLists edited by  tomwhite  (06:49 PM)
https://cwiki.apache.org/confluence/display/WHIRR/MailingLists



Apache Wicket (https://cwiki.apache.org/confluence/display/WICKET)

Pages