8153551: jshell tool: no longer a mechanism to see current feedback modes

Reviewed-by: jlahoda
This commit is contained in:
Robert Field 2016-04-20 08:35:44 -07:00
parent 6921adecb8
commit ecfc09db16
2 changed files with 15 additions and 4 deletions

View File

@ -606,6 +606,7 @@ class Feedback {
fluffmsg("jshell.msg.feedback.mode", mode.name);
} else {
fluffmsg("jshell.msg.see", "/help /set feedback");
printFeedbackModes();
}
return valid;
}
@ -671,13 +672,17 @@ class Feedback {
} else {
errorat("jshell.err.feedback.ambiguous.mode", umode);
}
fluffmsg("jshell.msg.feedback.mode.following");
modeMap.keySet().stream()
.forEach(mk -> fluff(" %s", mk));
printFeedbackModes();
return null;
}
}
void printFeedbackModes() {
fluffmsg("jshell.msg.feedback.mode.following");
modeMap.keySet().stream()
.forEach(mk -> fluff(" %s", mk));
}
// Test if the format string is correctly
final String nextFormat() {
String format = at.next();

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8148316 8148317 8151755 8152246
* @bug 8148316 8148317 8151755 8152246 8153551
* @summary Tests for output customization
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
@ -155,6 +155,12 @@ public class ToolFormatTest extends ReplToolTesting {
}
}
public void testShowFeedbackModes() {
test(
(a) -> assertCommandOutputContains(a, "/set feedback", "normal")
);
}
public void testSetNewModeQuiet() {
try {
test(