Skip to content

Commit 1bb4f86

Browse files
garyrussellartembilan
authored andcommitted
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")`
1 parent 032c8fa commit 1bb4f86

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

spring-integration-core/src/main/java/org/springframework/integration/json/JsonPropertyAccessor.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @author Eric Bottard
4141
* @author Artem Bilan
4242
* @author Paul Martin
43+
* @author Gary Russell
4344
*
4445
* @since 3.0
4546
*/
@@ -164,7 +165,7 @@ private static TypedValue typedValue(JsonNode json) {
164165
}
165166
}
166167

167-
public static WrappedJsonNode wrap(JsonNode json) {
168+
public static WrappedJsonNode<?> wrap(JsonNode json) {
168169
if (json == null) {
169170
return null;
170171
}
@@ -243,7 +244,8 @@ public int hashCode() {
243244
* An {@link AbstractList} implementation around {@link ArrayNode} with {@link WrappedJsonNode} aspect.
244245
* @since 5.0
245246
*/
246-
public static class ArrayNodeAsList extends AbstractList<WrappedJsonNode> implements WrappedJsonNode<ArrayNode> {
247+
public static class ArrayNodeAsList extends AbstractList<WrappedJsonNode<?>>
248+
implements WrappedJsonNode<ArrayNode> {
247249

248250
private final ArrayNode node;
249251

@@ -257,7 +259,7 @@ public ArrayNode getTarget() {
257259
}
258260

259261
@Override
260-
public WrappedJsonNode get(int index) {
262+
public WrappedJsonNode<?> get(int index) {
261263
return wrap(this.node.get(index));
262264
}
263265

@@ -267,9 +269,9 @@ public int size() {
267269
}
268270

269271
@Override
270-
public Iterator<WrappedJsonNode> iterator() {
272+
public Iterator<WrappedJsonNode<?>> iterator() {
271273

272-
return new Iterator<WrappedJsonNode>() {
274+
return new Iterator<WrappedJsonNode<?>>() {
273275

274276
private final Iterator<JsonNode> delegate = ArrayNodeAsList.this.node.iterator();
275277

@@ -279,7 +281,7 @@ public boolean hasNext() {
279281
}
280282

281283
@Override
282-
public WrappedJsonNode next() {
284+
public WrappedJsonNode<?> next() {
283285
return wrap(this.delegate.next());
284286
}
285287

spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpTestSupport.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015 the original author or authors.
2+
* Copyright 2015-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
1818

1919
import java.util.Arrays;
2020

21+
import org.apache.commons.net.ftp.FTPClient;
2122
import org.apache.commons.net.ftp.FTPFile;
2223
import org.apache.ftpserver.FtpServer;
2324
import org.apache.ftpserver.FtpServerFactory;
@@ -85,6 +86,7 @@ public static SessionFactory<FTPFile> sessionFactory() {
8586
sf.setPort(port);
8687
sf.setUsername("foo");
8788
sf.setPassword("foo");
89+
sf.setClientMode(FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE);
8890

8991
return new CachingSessionFactory<FTPFile>(sf);
9092
}

0 commit comments

Comments
 (0)