diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java index 4881f15c0..d88301371 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java @@ -87,8 +87,6 @@ public class Configuration /** map of int properties **/ private final Map mIntProps = new HashMap(); { - mIntProps.put(Defn.MAX_LINE_LENGTH_PROP, new Integer(80)); - mIntProps.put(Defn.MAX_METHOD_LENGTH_PROP, new Integer(150)); mIntProps.put(Defn.MAX_CONSTRUCTOR_LENGTH_PROP, new Integer(150)); mIntProps.put(Defn.TAB_WIDTH_PROP, new Integer(8)); } @@ -377,18 +375,6 @@ public class Configuration return getRegexpProperty(Defn.LOCAL_FINAL_VAR_PATTERN_PROP); } - /** @return the maximum line length **/ - int getMaxLineLength() - { - return getIntProperty(Defn.MAX_LINE_LENGTH_PROP); - } - - /** @return the maximum method length **/ - int getMaxMethodLength() - { - return getIntProperty(Defn.MAX_METHOD_LENGTH_PROP); - } - /** @return the maximum constructor length **/ int getMaxConstructorLength() { diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Defn.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Defn.java index 32a4f0727..ac0b2296f 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Defn.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Defn.java @@ -43,10 +43,6 @@ public interface Defn String LOCAL_VAR_PATTERN_PROP = "checkstyle.pattern.localvar"; /** property name for the method local final variable pattern **/ String LOCAL_FINAL_VAR_PATTERN_PROP = "checkstyle.pattern.localfinalvar"; - /** property name for the maximum line length **/ - String MAX_LINE_LENGTH_PROP = "checkstyle.maxlinelen"; - /** property name for length of methods **/ - String MAX_METHOD_LENGTH_PROP = "checkstyle.maxmethodlen"; /** property name for length of constructors **/ String MAX_CONSTRUCTOR_LENGTH_PROP = "checkstyle.maxconstructorlen"; /** property name for allowing protected data **/ @@ -121,8 +117,6 @@ public interface Defn String[] ALL_INT_PROPS = new String[] { MAX_CONSTRUCTOR_LENGTH_PROP, - MAX_LINE_LENGTH_PROP, - MAX_METHOD_LENGTH_PROP, TAB_WIDTH_PROP, }; diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java index 77318fbcc..2489c5a2b 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java @@ -531,11 +531,6 @@ class Verifier */ void verifyMethodLength(int aLineNo, int aLength) { - if (aLength > mConfig.getMaxMethodLength()) { - mMessages.add(aLineNo, "maxLen.method", - new Integer(aLength), - new Integer(mConfig.getMaxMethodLength())); - } } diff --git a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java index 75ccad6c6..21f315a9d 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java @@ -330,7 +330,6 @@ public class CheckerTest public void testSimple() throws Exception { - mProps.setProperty(Defn.MAX_METHOD_LENGTH_PROP, "19"); mProps.setProperty(Defn.MAX_CONSTRUCTOR_LENGTH_PROP, "9"); mProps.setProperty(Defn.STATIC_PATTERN_PROP, "^s[A-Z][a-zA-Z0-9]*$"); mProps.setProperty(Defn.MEMBER_PATTERN_PROP, "^m[A-Z][a-zA-Z0-9]*$"); @@ -346,7 +345,6 @@ public class CheckerTest filepath + ":35:17: Name 'badMember' must match pattern '^m[A-Z][a-zA-Z0-9]*$'.", filepath + ":42:40: ',' is not followed by whitespace.", filepath + ":71:30: ',' is not followed by whitespace.", - filepath + ":80: Method length is 20 lines (max allowed is 19).", filepath + ":103: Constructor length is 10 lines (max allowed is 9).", filepath + ":119:13: Name 'ABC' must match pattern '^[a-z][a-zA-Z0-9]*$'.", filepath + ":122:19: Name 'cde' must match pattern '[A-Z]+'.", diff --git a/src/tests/com/puppycrawl/tools/checkstyle/ConfigurationTest.java b/src/tests/com/puppycrawl/tools/checkstyle/ConfigurationTest.java index 90b9d0d2b..2271ec4ed 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/ConfigurationTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/ConfigurationTest.java @@ -15,11 +15,9 @@ public class ConfigurationTest public void test1() throws Exception { final Properties p = new Properties(); - p.setProperty(Defn.MAX_LINE_LENGTH_PROP, "66"); p.setProperty(Defn.CATCH_BLOCK_PROP, "text"); final Configuration c = new Configuration(p, System.out); assertNotNull(c); - assertEquals(66, c.getMaxLineLength()); assertEquals(BlockOption.TEXT, c.getCatchBlock()); } @@ -34,12 +32,9 @@ public class ConfigurationTest public void testGetProperties() throws Exception { final Properties props = new Properties(); - props.setProperty(Defn.MAX_LINE_LENGTH_PROP, "666"); props.setProperty(Defn.MEMBER_PATTERN_PROP, "bulldogs"); final Configuration c = new Configuration(props, System.out); - assertEquals("666", - c.getProperties().getProperty(Defn.MAX_LINE_LENGTH_PROP)); assertEquals("bulldogs", c.getProperties().getProperty(Defn.MEMBER_PATTERN_PROP)); }