[fix] Remove use of deprecated code
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
c500c3c046
commit
14007f4d9a
@ -72,20 +72,16 @@ import java.io.InterruptedIOException;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import net.bigeon.gclc.manager.ConsoleInput;
|
||||
import net.bigeon.gclc.tools.ConstantString;
|
||||
|
||||
/** A console input that can be connected to and diconnected from.
|
||||
*
|
||||
* @author Emmanuel Bigeon */
|
||||
public final class ConnectingConsoleInput implements ConsoleInput {
|
||||
|
||||
/** The empty string provider. */
|
||||
private static final ConstantString EMPTY_STRING = new ConstantString("");
|
||||
|
||||
/** If the input is closed. */
|
||||
private boolean close = false;
|
||||
/** The prompt string. */
|
||||
private Supplier<String> prompt = EMPTY_STRING;
|
||||
private Supplier<String> prompt = () -> "";
|
||||
/** If the input is currently in prompting state.
|
||||
* <p>
|
||||
* To change it you should be in a promptLock. */
|
||||
@ -307,7 +303,7 @@ public final class ConnectingConsoleInput implements ConsoleInput {
|
||||
* @see fr.bigeon.gclc.manager.ConsoleInput#setPrompt(java.lang.String) */
|
||||
@Override
|
||||
public void setPrompt(final String prompt) {
|
||||
this.prompt = new ConstantString(prompt);
|
||||
this.prompt = () -> prompt;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -51,7 +51,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.bigeon.gclc.manager.ConsoleInput;
|
||||
import net.bigeon.gclc.tools.ConstantString;
|
||||
import net.bigeon.gclc.utils.ReadingRunnable;
|
||||
|
||||
/** A console input where the stream can be plugged.
|
||||
@ -78,7 +77,7 @@ public final class PluggableConsoleInput implements ConsoleInput {
|
||||
/** If the element is closed. */
|
||||
private boolean closed = false;
|
||||
/** The default prompt. */
|
||||
private Supplier<String> prompt = new ConstantString("> "); //$NON-NLS-1$
|
||||
private Supplier<String> prompt = () -> "> "; //$NON-NLS-1$
|
||||
/** If the input is plugged or buffering. */
|
||||
private boolean connected = false;
|
||||
/** The current connexion (if any). */
|
||||
@ -263,7 +262,7 @@ public final class PluggableConsoleInput implements ConsoleInput {
|
||||
* @see net.bigeon.gclc.manager.ConsoleInput#setPrompt(java.lang.String) */
|
||||
@Override
|
||||
public void setPrompt(final String prompt) {
|
||||
setPrompt(new ConstantString(prompt));
|
||||
setPrompt(() -> prompt);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
Loading…
Reference in New Issue
Block a user