diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java index b307b19e0..ea6217c63 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java @@ -539,12 +539,6 @@ public class Configuration return getBooleanProperty(Defn.IGNORE_BRACES_PROP); } - /** @return whether to ignore 'public' keyword in interface definitions **/ - boolean isIgnorePublicInInterface() - { - return getBooleanProperty(Defn.IGNORE_PUBLIC_IN_INTERFACE_PROP); - } - /** @return whether to ignore max line length for import statements **/ boolean isIgnoreImportLength() { diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Defn.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Defn.java index 04fabee12..7f545a1a4 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Defn.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Defn.java @@ -78,9 +78,6 @@ public interface Defn String IGNORE_CAST_WHITESPACE_PROP = "checkstyle.ignore.whitespace.cast"; /** property name for ignoring braces **/ String IGNORE_BRACES_PROP = "checkstyle.ignore.braces"; - /** property name for ignoring 'public' in interface definitions **/ - String IGNORE_PUBLIC_IN_INTERFACE_PROP = - "checkstyle.ignore.public.in.interface"; /** property name for cache file **/ String CACHE_FILE_PROP = "checkstyle.cache.file"; /** property name for ignoring line length of import statements **/ @@ -122,7 +119,6 @@ public interface Defn IGNORE_BRACES_PROP, IGNORE_CAST_WHITESPACE_PROP, IGNORE_IMPORT_LENGTH_PROP, - IGNORE_PUBLIC_IN_INTERFACE_PROP, IGNORE_WHITESPACE_PROP, JAVADOC_CHECK_UNUSED_THROWS_PROP, REQUIRE_PACKAGE_HTML_PROP, diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java index f02dcf2e5..15d8f6fad 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java @@ -238,21 +238,7 @@ class Verifier aSig.getFirstColNo(), "maxParam", new Integer(mConfig.getMaxParameters())); } - // JLS, chapter 9.4 - public in interface is strongly discouraged - if (!mConfig.isIgnorePublicInInterface() && inInterfaceBlock() - && aSig.getModSet().containsPublic()) - { - mMessages.add(aSig.getModSet().getFirstLineNo(), - aSig.getModSet().getFirstColNo(), - "redundantModifier", "public"); - } - // Check for redunant abstract - if (inInterfaceBlock() && aSig.getModSet().containsAbstract()) { - mMessages.add(aSig.getModSet().getFirstLineNo(), - aSig.getModSet().getFirstColNo(), - "redundantModifier", "abstract"); - } // now check the javadoc final Scope methodScope = inInterfaceBlock() ? Scope.PUBLIC diff --git a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java index b763e8184..7211c59fa 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java @@ -522,8 +522,6 @@ public class CheckerTest filepath + ":14:10: 'final' modifier out of order with the JLS suggestions.", filepath + ":18:12: 'private' modifier out of order with the JLS suggestions.", filepath + ":24:14: 'private' modifier out of order with the JLS suggestions.", - filepath + ":32:9: Redundant 'public' modifier.", - filepath + ":38:9: Redundant 'abstract' modifier.", }; verify(c, filepath, expected); } @@ -614,7 +612,6 @@ public class CheckerTest throws Exception { mProps.setProperty(Defn.JAVADOC_CHECKSCOPE_PROP, Scope.PUBLIC.getName()); - mProps.setProperty(Defn.IGNORE_PUBLIC_IN_INTERFACE_PROP, "true"); final Checker c = createChecker(); final String filepath = getPath("InputScopeInnerInterfaces.java"); assertNotNull(c);