squid:S1872 for class.getName()

SonarQube 5.2 raise this issue even that it’s not true for .getName() (only for .getSimpleName(), which even is given as example in description) - when using .getName(), package is included in the String.

I understand that this is still not the best practice, but I need to compare against value from another library - and besides, the issue is just false-positive here (at least in my opinion).

@noelo_cohelo, you are right that getName() will include package name, so it will be “correct” in some definition of “correct”, however, it still remains a bad practice (consider environment with different class loaders) and using class literals should be preferred.

I tend to think that rule should remain as is. Even if getName() usage is required, it should not be very common.