I see in the code of AbstractClassCouplingCheck that java.lang are meant to be excluded:
private boolean isSignificant(String aClassName)
return (aClassName.length() > 0)
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: https://raw.github.com/xwiki/xwiki-commons/a10d6f9ef079c08ef3fd01dd6c1e2ff2a9cc6120/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java
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.