changeset 3353:9955c0097d4d

8153551: jshell tool: no longer a mechanism to see current feedback modes Reviewed-by: jlahoda
author rfield
date Wed, 20 Apr 2016 08:35:44 -0700
parents d59948777810
children 9b37d0f28609
files src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java test/jdk/jshell/ToolFormatTest.java
diffstat 2 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java	Wed Apr 20 08:30:30 2016 -0700
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java	Wed Apr 20 08:35:44 2016 -0700
@@ -606,6 +606,7 @@
                 fluffmsg("jshell.msg.feedback.mode", mode.name);
             } else {
                 fluffmsg("jshell.msg.see", "/help /set feedback");
+                printFeedbackModes();
             }
             return valid;
         }
@@ -671,13 +672,17 @@
                 } 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();
--- a/test/jdk/jshell/ToolFormatTest.java	Wed Apr 20 08:30:30 2016 -0700
+++ b/test/jdk/jshell/ToolFormatTest.java	Wed Apr 20 08:35:44 2016 -0700
@@ -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 void testShowFeedbackModes() {
+        test(
+                (a) -> assertCommandOutputContains(a, "/set feedback", "normal")
+        );
+    }
+
     public void testSetNewModeQuiet() {
         try {
             test(