Moved listeners from list to set
This commit is contained in:
parent
7c94dea7b5
commit
74c66dcbdd
@ -71,9 +71,10 @@ package net.bigeon.gclc;
|
|||||||
*/
|
*/
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InterruptedIOException;
|
import java.io.InterruptedIOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@ -125,7 +126,7 @@ public final class ConsoleApplication implements ICommandProvider {
|
|||||||
/** The state of this application. */
|
/** The state of this application. */
|
||||||
private boolean running;
|
private boolean running;
|
||||||
/** The listeners. */
|
/** The listeners. */
|
||||||
private final List<CommandRequestListener> listeners = new ArrayList<>();
|
private final Set<CommandRequestListener> listeners = new LinkedHashSet<>();
|
||||||
|
|
||||||
/** Create a console application.
|
/** Create a console application.
|
||||||
*
|
*
|
||||||
@ -188,9 +189,9 @@ public final class ConsoleApplication implements ICommandProvider {
|
|||||||
List<String> args;
|
List<String> args;
|
||||||
try {
|
try {
|
||||||
args = GCLCConstants.splitCommand(cmd);
|
args = GCLCConstants.splitCommand(cmd);
|
||||||
} catch (final CommandParsingException e1) {
|
} catch (final CommandParsingException e) {
|
||||||
out.println("Command line cannot be parsed"); //$NON-NLS-1$
|
out.println("Command line cannot be parsed"); //$NON-NLS-1$
|
||||||
LOGGER.log(Level.FINE, "Invalid user command " + cmd, e1); //$NON-NLS-1$
|
LOGGER.log(Level.FINE, "Invalid user command " + cmd, e); //$NON-NLS-1$
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!args.isEmpty()) {
|
if (!args.isEmpty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user