Lambdas for Remaining Modules JPA -> ZK

Polishing - PR Comments and Closeable Warnings

Eclipse emits bogus warnings with exceptions in lambdas.
Even though the lambda might run on another thread, elipse thinks it could
cause the context to not be closed.

SPR-14854: MessageChannel is now a @FunctionalInterface

* Additional Lambda polishing and some code style fixes
This commit is contained in:
Gary Russell
2016-10-28 12:07:06 -04:00
committed by Artem Bilan
parent 16be9fc47d
commit 67d6cd0c89
83 changed files with 870 additions and 1324 deletions

View File

@@ -185,6 +185,10 @@ public class DefaultXmlPayloadConverterTests {
private static class MySource implements Source {
MySource() {
super();
}
@Override
public void setSystemId(String systemId) {
}

View File

@@ -28,9 +28,9 @@ import javax.xml.transform.dom.DOMResult;
import org.junit.Test;
import org.springframework.integration.xml.result.StringResultFactory;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.integration.xml.result.StringResultFactory;
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.XmlMappingException;
import org.springframework.xml.transform.StringResult;
@@ -81,10 +81,16 @@ public class MarshallingTransformerTests {
private final List<Object> payloads = new ArrayList<Object>();
TestMarshaller() {
super();
}
@Override
public boolean supports(Class<?> clazz) {
return true;
}
@Override
public void marshal(Object source, Result result) throws XmlMappingException, IOException {
if (source instanceof Message) {
this.messages.add((Message<?>) source);

View File

@@ -32,10 +32,10 @@ import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
import org.springframework.messaging.Message;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.integration.xml.XmlPayloadConverter;
import org.springframework.integration.xml.xpath.XPathEvaluationType;
import org.springframework.messaging.Message;
import org.springframework.xml.xpath.NodeMapper;
import org.springframework.xml.xpath.XPathExpression;
import org.springframework.xml.xpath.XPathExpressionFactory;
@@ -139,6 +139,11 @@ public class XPathTransformerTests {
private static class TestNodeMapper implements NodeMapper<Object> {
TestNodeMapper() {
super();
}
@Override
public Object mapNode(Node node, int nodeNum) throws DOMException {
return node.getTextContent() + "-mapped";
}
@@ -147,10 +152,16 @@ public class XPathTransformerTests {
private static class TestXmlPayloadConverter implements XmlPayloadConverter {
TestXmlPayloadConverter() {
super();
}
@Override
public Source convertToSource(Object object) {
throw new UnsupportedOperationException();
}
@Override
public Node convertToNode(Object object) {
try {
return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(
@@ -161,6 +172,7 @@ public class XPathTransformerTests {
}
}
@Override
public Document convertToDocument(Object object) {
throw new UnsupportedOperationException();
}