Minor Fixes

- use passive mode for FTP tests
(active fails on one of my machines for some reason)

* Fix generic args instead of `@SuppressWarnings("rawtypes")`
This commit is contained in:
Gary Russell
2018-01-16 14:22:20 -05:00
committed by Artem Bilan
parent 032c8fa55d
commit 1bb4f86151
2 changed files with 11 additions and 7 deletions

View File

@@ -40,6 +40,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
* @author Eric Bottard
* @author Artem Bilan
* @author Paul Martin
* @author Gary Russell
*
* @since 3.0
*/
@@ -164,7 +165,7 @@ public class JsonPropertyAccessor implements PropertyAccessor {
}
}
public static WrappedJsonNode wrap(JsonNode json) {
public static WrappedJsonNode<?> wrap(JsonNode json) {
if (json == null) {
return null;
}
@@ -243,7 +244,8 @@ public class JsonPropertyAccessor implements PropertyAccessor {
* An {@link AbstractList} implementation around {@link ArrayNode} with {@link WrappedJsonNode} aspect.
* @since 5.0
*/
public static class ArrayNodeAsList extends AbstractList<WrappedJsonNode> implements WrappedJsonNode<ArrayNode> {
public static class ArrayNodeAsList extends AbstractList<WrappedJsonNode<?>>
implements WrappedJsonNode<ArrayNode> {
private final ArrayNode node;
@@ -257,7 +259,7 @@ public class JsonPropertyAccessor implements PropertyAccessor {
}
@Override
public WrappedJsonNode get(int index) {
public WrappedJsonNode<?> get(int index) {
return wrap(this.node.get(index));
}
@@ -267,9 +269,9 @@ public class JsonPropertyAccessor implements PropertyAccessor {
}
@Override
public Iterator<WrappedJsonNode> iterator() {
public Iterator<WrappedJsonNode<?>> iterator() {
return new Iterator<WrappedJsonNode>() {
return new Iterator<WrappedJsonNode<?>>() {
private final Iterator<JsonNode> delegate = ArrayNodeAsList.this.node.iterator();
@@ -279,7 +281,7 @@ public class JsonPropertyAccessor implements PropertyAccessor {
}
@Override
public WrappedJsonNode next() {
public WrappedJsonNode<?> next() {
return wrap(this.delegate.next());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package org.springframework.integration.ftp;
import java.util.Arrays;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.ftpserver.FtpServer;
import org.apache.ftpserver.FtpServerFactory;
@@ -85,6 +86,7 @@ public class FtpTestSupport extends RemoteFileTestSupport {
sf.setPort(port);
sf.setUsername("foo");
sf.setPassword("foo");
sf.setClientMode(FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE);
return new CachingSessionFactory<FTPFile>(sf);
}