tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkemn...@apache.org
Subject tapestry-5 git commit: adapt to new signature
Date Tue, 19 Apr 2016 12:05:13 GMT
Repository: tapestry-5
Updated Branches:
  refs/heads/master 62f33e3dc -> d241e4902


adapt to new signature


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/d241e490
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/d241e490
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/d241e490

Branch: refs/heads/master
Commit: d241e49023dd0516d30417a670e04886fc10dd6c
Parents: 62f33e3
Author: Jochen Kemnade <jkemnade@apache.org>
Authored: Tue Apr 19 14:04:51 2016 +0200
Committer: Jochen Kemnade <jkemnade@apache.org>
Committed: Tue Apr 19 14:04:51 2016 +0200

----------------------------------------------------------------------
 .../upload/internal/services/MultipartDecoderImpl.java       | 8 +++-----
 .../internal/services/ParametersServletRequestWrapper.java   | 8 ++++----
 .../services/ParametersServletRequestWrapperTest.java        | 2 +-
 3 files changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d241e490/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/MultipartDecoderImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/MultipartDecoderImpl.java
b/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/MultipartDecoderImpl.java
index 8a9f399..d6e423d 100755
--- a/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/MultipartDecoderImpl.java
+++ b/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/MultipartDecoderImpl.java
@@ -99,7 +99,6 @@ public class MultipartDecoderImpl implements MultipartDecoder, ThreadCleanupList
         }
     }
 
-    @SuppressWarnings("unchecked")
     protected List<FileItem> parseRequest(HttpServletRequest request)
     {
         try
@@ -134,11 +133,10 @@ public class MultipartDecoderImpl implements MultipartDecoder, ThreadCleanupList
         ParametersServletRequestWrapper wrapper = new ParametersServletRequestWrapper(request);
 
         // First add parameters from the request
-        for (Object e : request.getParameterMap().entrySet())
+        for (Map.Entry<String, String[]> e : request.getParameterMap().entrySet())
         {
-            Map.Entry<String, String[]> ee = (Map.Entry<String, String[]>) e;
-            for (String s : ee.getValue())
-                wrapper.addParameter(ee.getKey(), s);
+            for (String s : e.getValue())
+                wrapper.addParameter(e.getKey(), s);
         }
 
         for (FileItem item : fileItems)

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d241e490/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapper.java
----------------------------------------------------------------------
diff --git a/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapper.java
b/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapper.java
index 7ed5c6e..be4e4e3 100755
--- a/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapper.java
+++ b/tapestry-upload/src/main/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapper.java
@@ -43,22 +43,22 @@ public class ParametersServletRequestWrapper extends HttpServletRequestWrapper
     }
 
     @Override
-    public Map<String, Object> getParameterMap()
+    public Map<String, String[]> getParameterMap()
     {
-        Map<String, Object> paramMap = newMap();
+        Map<String, String[]> paramMap = newMap();
 
         for (Map.Entry<String, ParameterValue> e : parameters.entrySet())
         {
             ParameterValue value = e.getValue();
 
-            paramMap.put(e.getKey(), value.isMulti() ? value.multi() : value.single());
+            paramMap.put(e.getKey(), value.multi());
         }
 
         return paramMap;
     }
 
     @Override
-    public Enumeration getParameterNames()
+    public Enumeration<String> getParameterNames()
     {
         return Collections.enumeration(parameters.keySet());
     }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d241e490/tapestry-upload/src/test/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapperTest.java
----------------------------------------------------------------------
diff --git a/tapestry-upload/src/test/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapperTest.java
b/tapestry-upload/src/test/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapperTest.java
index 97040be..8f7cdb3 100755
--- a/tapestry-upload/src/test/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapperTest.java
+++ b/tapestry-upload/src/test/java/org/apache/tapestry5/upload/internal/services/ParametersServletRequestWrapperTest.java
@@ -165,7 +165,7 @@ public class ParametersServletRequestWrapperTest
 
         Map parameters = wrapper.getParameterMap();
         assertEquals(parameters.size(), 2);
-        assertEquals(parameters.get("single"), "blah");
+        assertEquals(parameters.get("single"), new String[] { "blah" });
         assertEquals((String[]) parameters.get("multi"), new String[] { "one", "two" });
 
         verify(request);


Mime
View raw message