This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 5bb158f649f2c2640c878e2cdec81066b7ece2f7
Author: wujimin <[email protected]>
AuthorDate: Wed Dec 13 10:50:26 2017 +0800

    JAV-548 do not use part.getName() to get parameter name, because pojo 
consumer not easy to set name to part
---
 .../common/rest/codec/param/RestClientRequestImpl.java      | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/common/common-rest/src/main/java/io/servicecomb/common/rest/codec/param/RestClientRequestImpl.java
 
b/common/common-rest/src/main/java/io/servicecomb/common/rest/codec/param/RestClientRequestImpl.java
index 19d6f4f..2eda363 100644
--- 
a/common/common-rest/src/main/java/io/servicecomb/common/rest/codec/param/RestClientRequestImpl.java
+++ 
b/common/common-rest/src/main/java/io/servicecomb/common/rest/codec/param/RestClientRequestImpl.java
@@ -153,21 +153,22 @@ public class RestClientRequestImpl implements 
RestClientRequest {
   }
 
   private void attachFiles(String boundary) {
-    Iterator<Part> uploadsIterator = uploads.values().iterator();
+    Iterator<Entry<String, Part>> uploadsIterator = 
uploads.entrySet().iterator();
     attachFile(boundary, uploadsIterator);
   }
 
-  private void attachFile(String boundary, Iterator<Part> uploadsIterator) {
+  private void attachFile(String boundary, Iterator<Entry<String, Part>> 
uploadsIterator) {
     if (!uploadsIterator.hasNext()) {
       request.write(boundaryEndInfo(boundary));
       request.end();
       return;
     }
 
-    // maybe it's a memory file, now we do not support this
-    // not easy to wrapping inputstream to readStream
-    Part part = uploadsIterator.next();
-    String name = part.getName();
+    Entry<String, Part> entry = uploadsIterator.next();
+    // do not use part.getName() to get parameter name
+    // because pojo consumer not easy to set name to part
+    String name = entry.getKey();
+    Part part = entry.getValue();
     String filename = part.getSubmittedFileName();
 
     InputStreamToReadStream fileStream = null;

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to