Affects PMD Version: 7.0.0-rc3
Description:
TypeTestUtil.isA is used by PrimitiveWrapperInstantiationRule to check if a type is a primitive like a Character. The implementation is not correct, because with this code:
src/Character.java
public class Character {
public Character(String string, Integer integer) {}
}
src/Test.java
public class Test {
public void execute() {
Character character = new Character("a", 1);
}
}
the lint reports the new Character line, which is wrong. The code does compile and the constructor does not exist in java.lang.Character.
Affects PMD Version: 7.0.0-rc3
Description:
TypeTestUtil.isAis used byPrimitiveWrapperInstantiationRuleto check if a type is a primitive like aCharacter. The implementation is not correct, because with this code:src/Character.javasrc/Test.javathe lint reports the
new Characterline, which is wrong. The code does compile and the constructor does not exist injava.lang.Character.