Skip to content

Commit

Permalink
issue #22: convert to action hints
Browse files Browse the repository at this point in the history
  • Loading branch information
markiewb committed May 4, 2014
1 parent 300b8dc commit beb62c5
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class MakePackageProtected {
private static final EnumSet<Modifier> oppositeModifiers = EnumSet.of(Modifier.PRIVATE, Modifier.PUBLIC, Modifier.PROTECTED);

@Hint(displayName = "#DN_MakePackageProtected", description = "#DESC_MakePackageProtected", category = "suggestions",
hintKind = Hint.Kind.INSPECTION, severity = Severity.HINT)
hintKind = Hint.Kind.ACTION, severity = Severity.HINT)
@TriggerTreeKind({Tree.Kind.CLASS, Tree.Kind.METHOD, Tree.Kind.VARIABLE})
public static ErrorDescription convert(HintContext ctx) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class MakePrivate {
private static final EnumSet<Modifier> oppositeModifiers = EnumSet.of(Modifier.PUBLIC, Modifier.PROTECTED);

@Hint(displayName = "#DN_MakePrivate", description = "#DESC_MakePrivate", category = "suggestions",
hintKind = Hint.Kind.INSPECTION, severity = Severity.HINT)
hintKind = Hint.Kind.ACTION, severity = Severity.HINT)
@TriggerTreeKind({Tree.Kind.CLASS, Tree.Kind.METHOD, Tree.Kind.VARIABLE})
public static ErrorDescription convert(HintContext ctx) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class MakeProtected {
private static final EnumSet<Modifier> oppositeModifiers = EnumSet.of(Modifier.PRIVATE, Modifier.PUBLIC);

@Hint(displayName = "#DN_MakeProtected", description = "#DESC_MakeProtected", category = "suggestions",
hintKind = Hint.Kind.INSPECTION, severity = Severity.HINT)
hintKind = Hint.Kind.ACTION, severity = Severity.HINT)
@TriggerTreeKind({Tree.Kind.CLASS, Tree.Kind.METHOD, Tree.Kind.VARIABLE})
public static ErrorDescription convert(HintContext ctx) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class MakePublic {
private static final EnumSet<Modifier> oppositeModifiers = EnumSet.of(Modifier.PRIVATE, Modifier.PROTECTED);

@Hint(displayName = "#DN_MakePublic", description = "#DESC_MakePublic", category = "suggestions",
hintKind = Hint.Kind.INSPECTION, severity = Severity.HINT)
hintKind = Hint.Kind.ACTION, severity = Severity.HINT)
@TriggerTreeKind({Tree.Kind.CLASS, Tree.Kind.METHOD, Tree.Kind.VARIABLE})
public static ErrorDescription convert(HintContext ctx) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class MakePackageProtectedTest {

@Test
public void testFixWorking_Private_Field() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " private String s = null;\n"
Expand All @@ -23,7 +23,7 @@ public void testFixWorking_Private_Field() throws Exception {

@Test
public void testFixWorking_Private_Inner_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " private class Inner {}\n"
Expand All @@ -40,7 +40,7 @@ public void testFixWorking_Private_Inner_Class() throws Exception {

@Test
public void testFixWorking_Private_Method() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " private static void main(String[] args) {\n"
Expand All @@ -64,14 +64,14 @@ public void testFixWorking_Private_Method() throws Exception {
*/
@Test(expected = AssertionError.class)
public void testFixWorking_Private_TopLevel_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test; private class Test {}")
.run(MakePackageProtected.class);
}

@Test
public void testFixWorking_Protected_Field() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " protected String s = null;\n"
Expand All @@ -87,7 +87,7 @@ public void testFixWorking_Protected_Field() throws Exception {

@Test
public void testFixWorking_Protected_Inner_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " protected class Inner {}\n"
Expand All @@ -103,7 +103,7 @@ public void testFixWorking_Protected_Inner_Class() throws Exception {

@Test
public void testFixWorking_Protected_Method() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " protected static void main(String[] args) {\n"
Expand All @@ -127,14 +127,14 @@ public void testFixWorking_Protected_Method() throws Exception {
*/
@Test(expected = AssertionError.class)
public void testFixWorking_Protected_TopLevel_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test; protected class Test {}")
.run(MakePackageProtected.class);
}

@Test
public void testFixWorking_Public_Field() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " public String s = null;\n"
Expand All @@ -151,7 +151,7 @@ public void testFixWorking_Public_Field() throws Exception {

@Test
public void testFixWorking_Public_Inner_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " public class Inner {}\n"
Expand All @@ -168,7 +168,7 @@ public void testFixWorking_Public_Inner_Class() throws Exception {

@Test
public void testFixWorking_Public_Method() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " public static void main(String[] args) {\n"
Expand All @@ -187,7 +187,7 @@ public void testFixWorking_Public_Method() throws Exception {

@Test
public void testFixWorking_Public_TopLevel_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test; public class Test {}")
.run(MakePackageProtected.class)
.findWarning("0:27-0:31:hint:" + Bundle.ERR_MakePackageProtected())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class MakePrivateTest {

@Test
public void testFixWorking_PackageProtected_Field() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " String s = null;\n"
Expand All @@ -24,7 +24,7 @@ public void testFixWorking_PackageProtected_Field() throws Exception {

@Test
public void testFixWorking_PackageProtected_Inner_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " class Inner {}\n"
Expand All @@ -41,7 +41,7 @@ public void testFixWorking_PackageProtected_Inner_Class() throws Exception {

@Test
public void testFixWorking_PackageProtected_Method() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " static void main(String[] args) {\n"
Expand All @@ -64,15 +64,15 @@ public void testFixWorking_PackageProtected_Method() throws Exception {
*/
@Test
public void testFixWorking_PackageProtected_TopLevel_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test; class Test {}")
.run(MakePrivate.class)
.assertNotContainsWarnings("0:20-0:24:hint:" + Bundle.ERR_MakePrivate());
}

@Test
public void testFixWorking_Protected_Field() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " protected String s = null;\n"
Expand All @@ -83,7 +83,7 @@ public void testFixWorking_Protected_Field() throws Exception {

@Test
public void testFixWorking_Protected_Inner_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " protected class Inner {}\n"
Expand All @@ -94,7 +94,7 @@ public void testFixWorking_Protected_Inner_Class() throws Exception {

@Test
public void testFixWorking_Protected_Method() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " protected static void main(String[] args) {\n"
Expand All @@ -111,14 +111,14 @@ public void testFixWorking_Protected_Method() throws Exception {
*/
@Test(expected = AssertionError.class)
public void testFixWorking_Protected_TopLevel_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test; protected class Test {}")
.run(MakePrivate.class);
}

@Test
public void testFixWorking_Public_Field() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " public String s = null;\n"
Expand All @@ -136,7 +136,7 @@ public void testFixWorking_Public_Field() throws Exception {

@Test
public void testFixWorking_Public_Inner_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " public class Inner {}\n"
Expand All @@ -153,7 +153,7 @@ public void testFixWorking_Public_Inner_Class() throws Exception {

@Test
public void testFixWorking_Public_Method() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " static void main(String[] args) {\n"
Expand All @@ -177,7 +177,7 @@ public void testFixWorking_Public_Method() throws Exception {
*/
@Test
public void testFixWorking_Public_TopLevel_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|').setCaretMarker('|')
.input("package test; public class Test {}")
.run(MakePrivate.class)
.assertNotContainsWarnings("0:27-1:31:hint:" + Bundle.ERR_MakePrivate());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class MakeProtectedTest {

@Test
public void testFixWorking_PackageProtected_Field() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " String s = null;\n"
Expand All @@ -24,7 +24,7 @@ public void testFixWorking_PackageProtected_Field() throws Exception {

@Test
public void testFixWorking_PackageProtected_Inner_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " class Inner {}\n"
Expand All @@ -41,7 +41,7 @@ public void testFixWorking_PackageProtected_Inner_Class() throws Exception {

@Test
public void testFixWorking_PackageProtected_Method() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " static void main(String[] args) {\n"
Expand All @@ -64,15 +64,15 @@ public void testFixWorking_PackageProtected_Method() throws Exception {
*/
@Test
public void testFixWorking_PackageProtected_TopLevel_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test; class Test {}")
.run(MakeProtected.class)
.assertNotContainsWarnings("0:20-0:24:hint:" + Bundle.ERR_MakeProtected());
}

@Test
public void testFixWorking_Private_Field() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " private String s = null;\n"
Expand All @@ -89,7 +89,7 @@ public void testFixWorking_Private_Field() throws Exception {

@Test
public void testFixWorking_Private_Inner_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " private class Inner {}\n"
Expand All @@ -106,7 +106,7 @@ public void testFixWorking_Private_Inner_Class() throws Exception {

@Test
public void testFixWorking_Private_Method() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " private static void main(String[] args) {\n"
Expand All @@ -130,14 +130,14 @@ public void testFixWorking_Private_Method() throws Exception {
*/
@Test(expected = AssertionError.class)
public void testFixWorking_Private_TopLevel_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test; private class Test {}")
.run(MakeProtected.class);
}

@Test
public void testFixWorking_Public_Field() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " public String s = null;\n"
Expand All @@ -155,7 +155,7 @@ public void testFixWorking_Public_Field() throws Exception {

@Test
public void testFixWorking_Public_Inner_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " public class Inner {}\n"
Expand All @@ -172,7 +172,7 @@ public void testFixWorking_Public_Inner_Class() throws Exception {

@Test
public void testFixWorking_Public_Method() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test;\n"
+ "public class Test {\n"
+ " static void main(String[] args) {\n"
Expand All @@ -192,7 +192,7 @@ public void testFixWorking_Public_Method() throws Exception {

@Test
public void testFixWorking_Public_TopLevel_Class() throws Exception {
HintTest.create()
HintTest.create().setCaretMarker('|')
.input("package test; public class Test {}")
.run(MakeProtected.class)
.assertNotContainsWarnings("0:20-1:24:hint:" + Bundle.ERR_MakeProtected());
Expand Down
Loading

0 comments on commit beb62c5

Please sign in to comment.