RM-4542: refactoring perfectly valid code due to Bamboo pulling Java 1.7 and complaining about the lambda

This commit is contained in:
Kristijan Conkas
2016-12-12 17:54:36 +00:00
parent 295e85067d
commit bdb3436569

View File

@@ -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;
@@ -185,7 +186,10 @@ public class FilePlanComponentAPI extends RestAPI<FilePlanComponentAPI>
ObjectMapper mapper = new ObjectMapper();
JsonNode root = mapper.readTree(toJson(electronicRecordModel));
root.fieldNames().forEachRemaining(f -> {
Iterator<String> fieldNames = root.fieldNames();
while (fieldNames.hasNext())
{
String f = fieldNames.next();
try
{
builder.addMultiPart(f, root.get(f).asText(), ContentType.JSON.name());
@@ -194,7 +198,7 @@ public class FilePlanComponentAPI extends RestAPI<FilePlanComponentAPI>
{
LOG.error("Failed to set " + f + " error: " + error);
}
});
}
builder.addMultiPart("filedata", recordContent, ContentType.BINARY.name());