You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by he...@apache.org on 2008/06/21 11:40:35 UTC
svn commit: r670170 - in /struts/struts2/trunk:
apps/blank/src/test/java/example/
core/src/main/java/org/apache/struts2/components/
core/src/main/java/org/apache/struts2/dispatcher/
core/src/main/java/org/apache/struts2/interceptor/ core/src/main/java/...
Author: hermanns
Date: Sat Jun 21 02:40:34 2008
New Revision: 670170
URL: http://svn.apache.org/viewvc?rev=670170&view=rev
Log:
WW-2537 Fix generics in all codebase
Starting with Java5 enhancements in S2.
This patch applies required changes to S2 related to the "generified xwork"
XWork Java5 enhancements
o added generics where possible
o use parameterizes Collection classes where possible
o converted for to for-each loops
o optimized imports
o updated tests
o aligned parameter types with Struts2
o fixed some minor bugs
Modified:
struts/struts2/trunk/apps/blank/src/test/java/example/ConfigTest.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/FieldError.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ParameterAware.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
struts/struts2/trunk/core/src/site/resources/tags/ajax/a.html
struts/struts2/trunk/core/src/site/resources/tags/ajax/autocompleter.html
struts/struts2/trunk/core/src/site/resources/tags/ajax/datetimepicker.html
struts/struts2/trunk/core/src/site/resources/tags/ajax/div.html
struts/struts2/trunk/core/src/site/resources/tags/ajax/tabbedpanel.html
struts/struts2/trunk/core/src/site/resources/tags/ajax/textarea.html
struts/struts2/trunk/core/src/site/resources/tags/ajax/tree.html
struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ServletConfigInterceptorTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FieldErrorTagTest.java
struts/struts2/trunk/plugins/dojo/src/test/java/org/apache/struts2/dojo/views/jsp/ui/AbstractTagTest.java
struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java
Modified: struts/struts2/trunk/apps/blank/src/test/java/example/ConfigTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/blank/src/test/java/example/ConfigTest.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/apps/blank/src/test/java/example/ConfigTest.java (original)
+++ struts/struts2/trunk/apps/blank/src/test/java/example/ConfigTest.java Sat Jun 21 02:40:34 2008
@@ -44,7 +44,7 @@
ActionSupport.INPUT.equals(result));
}
- protected Map assertFieldErrors(ActionSupport action) throws Exception {
+ protected Map<String, List<String>> assertFieldErrors(ActionSupport action) throws Exception {
assertTrue(action.hasFieldErrors());
return action.getFieldErrors();
}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java Sat Jun 21 02:40:34 2008
@@ -191,7 +191,7 @@
Map application = ctx.getApplication();
Dispatcher du = Dispatcher.getInstance();
- Map extraContext = du.createContextMap(new RequestMap(req),
+ Map<String, Object> extraContext = du.createContextMap(new RequestMap(req),
newParams,
session,
application,
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/FieldError.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/FieldError.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/FieldError.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/FieldError.java Sat Jun 21 02:40:34 2008
@@ -87,7 +87,7 @@
"or partial depending on param tag nested)if they exists")
public class FieldError extends UIBean implements UnnamedParametric {
- private List errorFieldNames = new ArrayList();
+ private List<String> errorFieldNames = new ArrayList<String>();
public FieldError(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -105,7 +105,7 @@
}
}
- public List getFieldErrorFieldNames() {
+ public List<String> getFieldErrorFieldNames() {
return errorFieldNames;
}
}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java Sat Jun 21 02:40:34 2008
@@ -39,12 +39,12 @@
* Note, this will occur lazily - only when the entry set is asked for.
*
*/
-public class SessionMap extends AbstractMap implements Serializable {
+public class SessionMap<K, V> extends AbstractMap<K,V> implements Serializable {
private static final long serialVersionUID = 4678843241638046854L;
protected HttpSession session;
- protected Set<Object> entries;
+ protected Set<Map.Entry<K,V>> entries;
protected HttpServletRequest request;
@@ -101,23 +101,23 @@
*
* @return a Set of attributes from the http session.
*/
- public Set entrySet() {
+ public Set<java.util.Map.Entry<K,V>> entrySet() {
if (session == null) {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
synchronized (session) {
if (entries == null) {
- entries = new HashSet<Object>();
+ entries = new HashSet<Map.Entry<K,V>>();
- Enumeration enumeration = session.getAttributeNames();
+ Enumeration<? extends Object> enumeration = session.getAttributeNames();
while (enumeration.hasMoreElements()) {
final String key = enumeration.nextElement().toString();
final Object value = session.getAttribute(key);
- entries.add(new Map.Entry() {
+ entries.add(new Map.Entry<K,V>() {
public boolean equals(Object obj) {
- Map.Entry entry = (Map.Entry) obj;
+ Map.Entry<K, V> entry = (Map.Entry<K, V>) obj;
return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
}
@@ -126,18 +126,18 @@
return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
}
- public Object getKey() {
- return key;
+ public K getKey() {
+ return (K) key;
}
- public Object getValue() {
- return value;
+ public V getValue() {
+ return (V) value;
}
- public Object setValue(Object obj) {
+ public V setValue(Object obj) {
session.setAttribute(key, obj);
- return value;
+ return (V) value;
}
});
}
@@ -153,13 +153,13 @@
* @param key the name of the session attribute.
* @return the session attribute or <tt>null</tt> if it doesn't exist.
*/
- public Object get(Object key) {
+ public V get(Object key) {
if (session == null) {
return null;
}
synchronized (session) {
- return session.getAttribute(key.toString());
+ return (V) session.getAttribute(key.toString());
}
}
@@ -170,7 +170,7 @@
* @param value the value to set.
* @return the object that was just set.
*/
- public Object put(Object key, Object value) {
+ public V put(K key, V value) {
synchronized (this) {
if (session == null) {
session = request.getSession(true);
@@ -191,7 +191,7 @@
* @param key the name of the attribute to remove.
* @return the value that was removed or <tt>null</tt> if the value was not found (and hence, not removed).
*/
- public Object remove(Object key) {
+ public V remove(Object key) {
if (session == null) {
return null;
}
@@ -199,7 +199,7 @@
synchronized (session) {
entries = null;
- Object value = get(key);
+ V value = get(key);
session.removeAttribute(key.toString());
return value;
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ParameterAware.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ParameterAware.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ParameterAware.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ParameterAware.java Sat Jun 21 02:40:34 2008
@@ -42,5 +42,5 @@
*
* @param parameters a Map of parameters (name/value Strings).
*/
- public void setParameters(Map<String,String[]> parameters);
+ public void setParameters(Map<String, Object> parameters);
}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java Sat Jun 21 02:40:34 2008
@@ -29,6 +29,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.LinkedList;
+import java.util.Collections;
/**
* Helper methods to access text from TextProviders
@@ -50,7 +51,7 @@
*
* @return the message if found, otherwise the defaultMessage
*/
- public static String getText(String key, String defaultMessage, List<String> args, ValueStack stack) {
+ public static String getText(String key, String defaultMessage, List<Object> args, ValueStack stack) {
String msg = null;
TextProvider tp = null;
@@ -101,7 +102,7 @@
*
* @return the message if found, otherwise the defaultMessage
*/
- public static String getText(String key, String defaultMessage,ValueStack stack) {
- return getText(key, defaultMessage, new LinkedList<String>(), stack);
+ public static String getText(String key, String defaultMessage, ValueStack stack) {
+ return getText(key, defaultMessage, Collections.emptyList(), stack);
}
}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java Sat Jun 21 02:40:34 2008
@@ -62,7 +62,7 @@
"has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag.");
}
stack = du.getContainer().getInstance(ValueStackFactory.class).createValueStack();
- Map extraContext = du.createContextMap(new RequestMap(req),
+ Map<String, Object> extraContext = du.createContextMap(new RequestMap(req),
req.getParameterMap(),
new SessionMap(req),
new ApplicationMap(pageContext.getServletContext()),
@@ -77,7 +77,7 @@
ActionContext.setContext(new ActionContext(stack.getContext()));
} else {
// let's make sure that the current page context is in the action context
- Map context = stack.getContext();
+ Map<String, Object> context = stack.getContext();
context.put(ServletActionContext.PAGE_CONTEXT, pageContext);
AttributeMap attrMap = new AttributeMap(context);
Modified: struts/struts2/trunk/core/src/site/resources/tags/ajax/a.html
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/site/resources/tags/ajax/a.html?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/site/resources/tags/ajax/a.html (original)
+++ struts/struts2/trunk/core/src/site/resources/tags/ajax/a.html Sat Jun 21 02:40:34 2008
@@ -20,6 +20,12 @@
<!-- START SNIPPET: tagattributes -->
<table width="100%">
<tr>
+ <td colspan="6"><h4>Dynamic Attributes Allowed:</h4> false</td>
+ </tr>
+ <tr>
+ <td colspan="6"> </td>
+ </tr>
+ <tr>
<th align="left" valign="top"><h4>Name</h4></th>
<th align="left" valign="top"><h4>Required</h4></th>
<th align="left" valign="top"><h4>Default</h4></th>
@@ -209,7 +215,7 @@
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
- <td align="left" valign="top">Label expression used for rendering a element specific label</td>
+ <td align="left" valign="top">Label expression used for rendering an element specific label</td>
</tr>
<tr>
<td align="left" valign="top">labelSeparator</td>
Modified: struts/struts2/trunk/core/src/site/resources/tags/ajax/autocompleter.html
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/site/resources/tags/ajax/autocompleter.html?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/site/resources/tags/ajax/autocompleter.html (original)
+++ struts/struts2/trunk/core/src/site/resources/tags/ajax/autocompleter.html Sat Jun 21 02:40:34 2008
@@ -20,6 +20,12 @@
<!-- START SNIPPET: tagattributes -->
<table width="100%">
<tr>
+ <td colspan="6"><h4>Dynamic Attributes Allowed:</h4> false</td>
+ </tr>
+ <tr>
+ <td colspan="6"> </td>
+ </tr>
+ <tr>
<th align="left" valign="top"><h4>Name</h4></th>
<th align="left" valign="top"><h4>Required</h4></th>
<th align="left" valign="top"><h4>Default</h4></th>
@@ -257,7 +263,7 @@
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
- <td align="left" valign="top">Label expression used for rendering a element specific label</td>
+ <td align="left" valign="top">Label expression used for rendering an element specific label</td>
</tr>
<tr>
<td align="left" valign="top">labelSeparator</td>
Modified: struts/struts2/trunk/core/src/site/resources/tags/ajax/datetimepicker.html
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/site/resources/tags/ajax/datetimepicker.html?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/site/resources/tags/ajax/datetimepicker.html (original)
+++ struts/struts2/trunk/core/src/site/resources/tags/ajax/datetimepicker.html Sat Jun 21 02:40:34 2008
@@ -20,6 +20,12 @@
<!-- START SNIPPET: tagattributes -->
<table width="100%">
<tr>
+ <td colspan="6"><h4>Dynamic Attributes Allowed:</h4> false</td>
+ </tr>
+ <tr>
+ <td colspan="6"> </td>
+ </tr>
+ <tr>
<th align="left" valign="top"><h4>Name</h4></th>
<th align="left" valign="top"><h4>Required</h4></th>
<th align="left" valign="top"><h4>Default</h4></th>
@@ -161,7 +167,7 @@
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
- <td align="left" valign="top">Label expression used for rendering a element specific label</td>
+ <td align="left" valign="top">Label expression used for rendering an element specific label</td>
</tr>
<tr>
<td align="left" valign="top">labelSeparator</td>
Modified: struts/struts2/trunk/core/src/site/resources/tags/ajax/div.html
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/site/resources/tags/ajax/div.html?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/site/resources/tags/ajax/div.html (original)
+++ struts/struts2/trunk/core/src/site/resources/tags/ajax/div.html Sat Jun 21 02:40:34 2008
@@ -20,6 +20,12 @@
<!-- START SNIPPET: tagattributes -->
<table width="100%">
<tr>
+ <td colspan="6"><h4>Dynamic Attributes Allowed:</h4> false</td>
+ </tr>
+ <tr>
+ <td colspan="6"> </td>
+ </tr>
+ <tr>
<th align="left" valign="top"><h4>Name</h4></th>
<th align="left" valign="top"><h4>Required</h4></th>
<th align="left" valign="top"><h4>Default</h4></th>
@@ -225,7 +231,7 @@
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
- <td align="left" valign="top">Label expression used for rendering a element specific label</td>
+ <td align="left" valign="top">Label expression used for rendering an element specific label</td>
</tr>
<tr>
<td align="left" valign="top">labelSeparator</td>
Modified: struts/struts2/trunk/core/src/site/resources/tags/ajax/tabbedpanel.html
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/site/resources/tags/ajax/tabbedpanel.html?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/site/resources/tags/ajax/tabbedpanel.html (original)
+++ struts/struts2/trunk/core/src/site/resources/tags/ajax/tabbedpanel.html Sat Jun 21 02:40:34 2008
@@ -20,6 +20,12 @@
<!-- START SNIPPET: tagattributes -->
<table width="100%">
<tr>
+ <td colspan="6"><h4>Dynamic Attributes Allowed:</h4> false</td>
+ </tr>
+ <tr>
+ <td colspan="6"> </td>
+ </tr>
+ <tr>
<th align="left" valign="top"><h4>Name</h4></th>
<th align="left" valign="top"><h4>Required</h4></th>
<th align="left" valign="top"><h4>Default</h4></th>
@@ -145,7 +151,7 @@
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
- <td align="left" valign="top">Label expression used for rendering a element specific label</td>
+ <td align="left" valign="top">Label expression used for rendering an element specific label</td>
</tr>
<tr>
<td align="left" valign="top">labelSeparator</td>
Modified: struts/struts2/trunk/core/src/site/resources/tags/ajax/textarea.html
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/site/resources/tags/ajax/textarea.html?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/site/resources/tags/ajax/textarea.html (original)
+++ struts/struts2/trunk/core/src/site/resources/tags/ajax/textarea.html Sat Jun 21 02:40:34 2008
@@ -20,6 +20,12 @@
<!-- START SNIPPET: tagattributes -->
<table width="100%">
<tr>
+ <td colspan="6"><h4>Dynamic Attributes Allowed:</h4> false</td>
+ </tr>
+ <tr>
+ <td colspan="6"> </td>
+ </tr>
+ <tr>
<th align="left" valign="top"><h4>Name</h4></th>
<th align="left" valign="top"><h4>Required</h4></th>
<th align="left" valign="top"><h4>Default</h4></th>
@@ -113,7 +119,7 @@
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
- <td align="left" valign="top">Label expression used for rendering a element specific label</td>
+ <td align="left" valign="top">Label expression used for rendering an element specific label</td>
</tr>
<tr>
<td align="left" valign="top">labelSeparator</td>
Modified: struts/struts2/trunk/core/src/site/resources/tags/ajax/tree.html
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/site/resources/tags/ajax/tree.html?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/site/resources/tags/ajax/tree.html (original)
+++ struts/struts2/trunk/core/src/site/resources/tags/ajax/tree.html Sat Jun 21 02:40:34 2008
@@ -20,6 +20,12 @@
<!-- START SNIPPET: tagattributes -->
<table width="100%">
<tr>
+ <td colspan="6"><h4>Dynamic Attributes Allowed:</h4> false</td>
+ </tr>
+ <tr>
+ <td colspan="6"> </td>
+ </tr>
+ <tr>
<th align="left" valign="top"><h4>Name</h4></th>
<th align="left" valign="top"><h4>Required</h4></th>
<th align="left" valign="top"><h4>Default</h4></th>
@@ -233,7 +239,7 @@
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
- <td align="left" valign="top">Label expression used for rendering a element specific label</td>
+ <td align="left" valign="top">Label expression used for rendering an element specific label</td>
</tr>
<tr>
<td align="left" valign="top">labelSeparator</td>
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java Sat Jun 21 02:40:34 2008
@@ -205,7 +205,7 @@
mai.setAction(action);
mai.setResultCode("success");
mai.setInvocationContext(ActionContext.getContext());
- Map<String, Object[]> param = new HashMap<String, Object[]>();
+ Map<String, Object> param = new HashMap<String, Object>();
ActionContext.getContext().setParameters(param);
ActionContext.getContext().put(ServletActionContext.HTTP_REQUEST, createMultipartRequest((HttpServletRequest) req, 2000));
@@ -214,7 +214,6 @@
assertTrue(!action.hasErrors());
assertTrue(param.size() == 3);
- System.err.println("param.get(\"file\"): " + param.get("file").getClass());
File[] files = (File[]) param.get("file");
String[] fileContentTypes = (String[]) param.get("fileContentType");
String[] fileRealFilenames = (String[]) param.get("fileFileName");
@@ -266,7 +265,7 @@
mai.setAction(action);
mai.setResultCode("success");
mai.setInvocationContext(ActionContext.getContext());
- Map<String, Object[]> param = new HashMap<String, Object[]>();
+ Map<String, Object> param = new HashMap<String, Object>();
ActionContext.getContext().setParameters(param);
ActionContext.getContext().put(ServletActionContext.HTTP_REQUEST, createMultipartRequest(req, 2000));
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ServletConfigInterceptorTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ServletConfigInterceptorTest.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ServletConfigInterceptorTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ServletConfigInterceptorTest.java Sat Jun 21 02:40:34 2008
@@ -88,7 +88,7 @@
MockActionInvocation mai = createActionInvocation(mock);
- Map param = new HashMap();
+ Map<String, Object> param = new HashMap<String, Object>();
mai.getInvocationContext().setParameters(param);
mock.setParameters(param);
@@ -105,7 +105,7 @@
MockActionInvocation mai = createActionInvocation(mock);
- Map session = new HashMap();
+ Map<String, Object> session = new HashMap<String, Object>();
mai.getInvocationContext().setSession(session);
mock.setSession(session);
@@ -122,7 +122,7 @@
MockActionInvocation mai = createActionInvocation(mock);
- Map app = new HashMap();
+ Map<String, Object> app = new HashMap<String, Object>();
mai.getInvocationContext().setApplication(app);
mock.setApplication(app);
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java Sat Jun 21 02:40:34 2008
@@ -113,7 +113,7 @@
Dispatcher.setInstance(du);
du.setConfigurationManager(configurationManager);
session = new SessionMap(request);
- Map extraContext = du.createContextMap(new RequestMap(request),
+ Map<String, Object> extraContext = du.createContextMap(new RequestMap(request),
request.getParameterMap(),
session,
new ApplicationMap(pageContext.getServletContext()),
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FieldErrorTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FieldErrorTagTest.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FieldErrorTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FieldErrorTagTest.java Sat Jun 21 02:40:34 2008
@@ -216,7 +216,7 @@
this.returnNullForFieldErrors = returnNullForFieldErrors;
}
- public Map getFieldErrors() {
+ public Map<String, List<String>> getFieldErrors() {
if (haveFieldErrors) {
List err1 = new ArrayList();
err1.add("field error message number 1");
@@ -234,7 +234,7 @@
return null;
}
else {
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
}
}
Modified: struts/struts2/trunk/plugins/dojo/src/test/java/org/apache/struts2/dojo/views/jsp/ui/AbstractTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/test/java/org/apache/struts2/dojo/views/jsp/ui/AbstractTagTest.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/test/java/org/apache/struts2/dojo/views/jsp/ui/AbstractTagTest.java (original)
+++ struts/struts2/trunk/plugins/dojo/src/test/java/org/apache/struts2/dojo/views/jsp/ui/AbstractTagTest.java Sat Jun 21 02:40:34 2008
@@ -43,7 +43,6 @@
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.util.ValueStack;
-import com.opensymphony.xwork2.util.ValueStackFactory;
/**
@@ -52,8 +51,8 @@
*/
public abstract class AbstractTagTest extends StrutsTestCase {
protected Action action;
- protected Map context;
- protected Map session;
+ protected Map<String, Object> context;
+ protected Map<String, Object> session;
protected ValueStack stack;
/**
@@ -110,12 +109,12 @@
pageContext.setServletContext(servletContext);
mockContainer = new Mock(Container.class);
- Dispatcher du = new Dispatcher(pageContext.getServletContext(), new HashMap());
+ Dispatcher du = new Dispatcher(pageContext.getServletContext(), new HashMap<String, String>());
du.init();
Dispatcher.setInstance(du);
du.setConfigurationManager(configurationManager);
- session = new SessionMap(request);
- Map extraContext = du.createContextMap(new RequestMap(request),
+ session = new SessionMap<String, Object>(request);
+ Map<String, Object> extraContext = du.createContextMap(new RequestMap(request),
request.getParameterMap(),
session,
new ApplicationMap(pageContext.getServletContext()),
Modified: struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java?rev=670170&r1=670169&r2=670170&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java (original)
+++ struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java Sat Jun 21 02:40:34 2008
@@ -75,7 +75,7 @@
ServletContext servletContext = WebContextFactory.get().getServletContext();
HttpServletResponse res = WebContextFactory.get().getHttpServletResponse();
- Map requestParams = new HashMap(req.getParameterMap());
+ Map<String, Object> requestParams = new HashMap<String, Object>(req.getParameterMap());
if (params != null) {
requestParams.putAll(params);
} else {
@@ -85,7 +85,7 @@
Map session = new SessionMap(req);
Map application = new ApplicationMap(servletContext);
Dispatcher du = Dispatcher.getInstance();
- HashMap ctx = du.createContextMap(requestMap,
+ HashMap<String, Object> ctx = du.createContextMap(requestMap,
params,
session,
application,
@@ -122,7 +122,7 @@
public static class ValidatorActionInvocation extends DefaultActionInvocation {
private static final long serialVersionUID = -7645433725470191275L;
- protected ValidatorActionInvocation(Map extraContext, boolean pushAction) throws Exception {
+ protected ValidatorActionInvocation(Map<String, Object> extraContext, boolean pushAction) throws Exception {
super(extraContext, pushAction);
}