diff -r 44d30e3656f5 -r 5843b57ce3a6 langtools/test/jdk/jshell/ModifiersTest.java --- a/langtools/test/jdk/jshell/ModifiersTest.java Thu Oct 27 21:22:12 2016 +0000 +++ b/langtools/test/jdk/jshell/ModifiersTest.java Thu Oct 27 17:11:16 2016 -0700 @@ -22,7 +22,7 @@ */ /* - * @test + * @test 8167643 * @summary Tests for modifiers * @build KullaTesting TestingInputStream ExpectedDiagnostic * @run testng ModifiersTest @@ -43,7 +43,7 @@ public Object[][] getTestCases() { List testCases = new ArrayList<>(); String[] ignoredModifiers = new String[] { - "public", "protected", "private", "static", "final" + "static", "final" }; for (String ignoredModifier : ignoredModifiers) { for (ClassType classType : ClassType.values()) { @@ -62,6 +62,28 @@ assertActiveKeys(); } + @DataProvider(name = "silentlyIgnoredModifiers") + public Object[][] getSilentTestCases() { + List testCases = new ArrayList<>(); + String[] ignoredModifiers = new String[] { + "public", "protected", "private" + }; + for (String ignoredModifier : ignoredModifiers) { + for (ClassType classType : ClassType.values()) { + testCases.add(new Object[] { ignoredModifier, classType }); + } + } + return testCases.toArray(new Object[testCases.size()][]); + } + + @Test(dataProvider = "silentlyIgnoredModifiers") + public void silentlyIgnoredModifiers(String modifier, ClassType classType) { + assertEval(String.format("%s %s A {}", modifier, classType)); + assertNumberOfActiveClasses(1); + assertClasses(clazz(classType, "A")); + assertActiveKeys(); + } + public void accessToStaticFieldsOfClass() { assertEval("class A {" + "int x = 14;" +