AbbreviationAsWordInName: problem detection of 2 char abbreviation with length limit 1 #116

Closed
romani opened this Issue Jun 16, 2013 · 3 comments

Projects

None yet

3 participants

@romani
Member
romani commented Jun 16, 2013

Config:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
  <property name="severity" value="warning"/>
  <module name="TreeWalker">
    <module name="AbbreviationAsWordInName">
      <property name="allowedAbbreviationLength" value="1"/>
      <property name="targets" value="CLASS_DEF,INTERFACE_DEF,ENUM_DEF,ANNOTATION_DEF,ANNOTATION_FIELD_DEF,ENUM_CONSTANT_DEF,PARAMETER_DEF,VARIABLE_DEF,METHOD_DEF"/>
    </module>
  </module>
</module>

Code:

public class FIleNameFormatException extends Exception {

    private static final long serialVersionUID = 1L;

    public FIleNameFormatException(Exception e) {
        super(e);
    }
}

Detected: no warning on class name.

Expected: warring on class name. Please create UT for this.

@kostas1981 kostas1981 was assigned Jul 15, 2013
@baratali baratali was assigned Aug 2, 2013
@romani
Member
romani commented Aug 12, 2013

Reported problem is valid case, to cover this we need to make allowedAbbreviationLength=0.
extend ignore list to have "IT" and "I" to suppress most false-positives.
but in this case we have problem on following cases, when capital letter is a last. Message is "Abbreviation As Word In Name: Abbreviation in name must contain no more than '0' capital letters."

            double scaleX = getWidth() / (double) backgroundImage.getWidth(null);
            double scaleY = getHeight() / (double) backgroundImage.getHeight(null);

so please fix this problem.

@baratali
Contributor

So, it shouldn't display warning on scaleX and should display warning on FIleNameFormatException when allowedAbbreviationLength=0. Right?

@romani
Member
romani commented Aug 24, 2013

right.

@baratali baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Sep 7, 2013
@baratali baratali Fixes #116. Update for AbbreviationAsWordInNameCheck. b0b11fa
@baratali baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Sep 7, 2013
@baratali baratali Fixes #116. Update for AbbreviationAsWordInNameCheck. 8be0a52
@romani romani closed this in e64d40c Sep 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment