From bdb3436569a238439a09b01b9ca8f8736b4aaad0 Mon Sep 17 00:00:00 2001 From: Kristijan Conkas Date: Mon, 12 Dec 2016 17:54:36 +0000 Subject: [PATCH] RM-4542: refactoring perfectly valid code due to Bamboo pulling Java 1.7 and complaining about the lambda --- .../rm/community/requests/FilePlanComponentAPI.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/FilePlanComponentAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/FilePlanComponentAPI.java index f738adea83..39431a9cef 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/FilePlanComponentAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/FilePlanComponentAPI.java @@ -41,6 +41,7 @@ import static org.springframework.http.HttpMethod.PUT; import static org.testng.Assert.fail; import java.io.File; +import java.util.Iterator; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -184,8 +185,11 @@ public class FilePlanComponentAPI extends RestAPI ObjectMapper mapper = new ObjectMapper(); JsonNode root = mapper.readTree(toJson(electronicRecordModel)); - - root.fieldNames().forEachRemaining(f -> { + + Iterator fieldNames = root.fieldNames(); + while (fieldNames.hasNext()) + { + String f = fieldNames.next(); try { builder.addMultiPart(f, root.get(f).asText(), ContentType.JSON.name()); @@ -194,8 +198,8 @@ public class FilePlanComponentAPI extends RestAPI { LOG.error("Failed to set " + f + " error: " + error); } - }); - + } + builder.addMultiPart("filedata", recordContent, ContentType.BINARY.name()); /*