Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Remove useless check for java.lang in AbstractClassCouplingCheck #36

vmassol opened this Issue · 2 comments

2 participants


I see in the code of AbstractClassCouplingCheck that java.lang are meant to be excluded:

private boolean isSignificant(String aClassName)
    return (aClassName.length() > 0)
            && !mIgnoredClassNames.contains(aClassName)
            && !aClassName.startsWith("java.lang.");

However in practice they are not excluded since the class names that are checked do NOT have their full package name computed.
For example "java.lang.Class" gets counted since only "Class" is passed to isSignificant().

This is a a big issue...

Here's the file on which I've traced the issue:


@vmassol vmassol referenced this issue from a commit in vmassol/checkstyle
@vmassol vmassol fix #36 : Remove useless check for java.lang in AbstractClassCoupling…

This seems to have lost in numerous PRs for this line of code (we had 4):

I've tried writing

public java.lang.Integer _integer = new java.lang.Integer(1);

And only this line of code prevent it from being reported. So I'm for closing this issue as "wontfix" in its current form.


Rejecting this issue, since it breaks current functionality.

@isopov isopov closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.