[fix] Remove use of deprecated code

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
2021-11-12 10:00:06 +01:00
parent c500c3c046
commit 14007f4d9a
2 changed files with 4 additions and 9 deletions

View File

@@ -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)