mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4542: refactoring perfectly valid code due to Bamboo pulling Java 1.7 and complaining about the lambda
This commit is contained in:
@@ -41,6 +41,7 @@ import static org.springframework.http.HttpMethod.PUT;
|
|||||||
import static org.testng.Assert.fail;
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
@@ -185,7 +186,10 @@ public class FilePlanComponentAPI extends RestAPI<FilePlanComponentAPI>
|
|||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
JsonNode root = mapper.readTree(toJson(electronicRecordModel));
|
JsonNode root = mapper.readTree(toJson(electronicRecordModel));
|
||||||
|
|
||||||
root.fieldNames().forEachRemaining(f -> {
|
Iterator<String> fieldNames = root.fieldNames();
|
||||||
|
while (fieldNames.hasNext())
|
||||||
|
{
|
||||||
|
String f = fieldNames.next();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
builder.addMultiPart(f, root.get(f).asText(), ContentType.JSON.name());
|
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);
|
LOG.error("Failed to set " + f + " error: " + error);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
builder.addMultiPart("filedata", recordContent, ContentType.BINARY.name());
|
builder.addMultiPart("filedata", recordContent, ContentType.BINARY.name());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user