Skip to content

Commit c008d50

Browse files
author
Simon MacMullen
committed
Don't use Arrays.copyOfRange() as it's a 1.6ism and we can just as easily use the rabbitmqctl "-q" flag...
1 parent 9217db9 commit c008d50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/src/com/rabbitmq/tools/Host.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ public int getPeerPort() {
128128
}
129129

130130
public static List<ConnectionInfo> listConnections() throws IOException {
131-
String output = capture(rabbitmqctl("list_connections pid peer_port").getInputStream());
131+
String output = capture(rabbitmqctl("list_connections -q pid peer_port").getInputStream());
132132
String[] allLines = output.split("\n");
133133

134134
ArrayList<ConnectionInfo> result = new ArrayList<ConnectionInfo>();
135-
for (String line : Arrays.copyOfRange(allLines, 1, allLines.length - 1)) {
135+
for (String line : allLines) {
136136
// line: <rabbit@mercurio.1.11491.0> 58713
137137
String[] columns = line.split("\t");
138138
result.add(new ConnectionInfo(columns[0], Integer.valueOf(columns[1])));

0 commit comments

Comments
 (0)