resources.report.rules.pmd.BigIntegerInstantiation.html Maven / Gradle / Ivy
BigIntegerInstantiation
BigIntegerInstantiation
Don’t create instances of already existing BigInteger (BigInteger.ZERO, BigInteger.ONE) and for Java 1.5 onwards, BigInteger.TEN and BigDecimal (BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.TEN)
This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.basic.BigIntegerInstantiationRule
Example(s):
BigInteger bi = new BigInteger(1); // reference BigInteger.ONE instead
BigInteger bi2 = new BigInteger("0"); // reference BigInteger.ZERO instead
BigInteger bi3 = new BigInteger(0.0); // reference BigInteger.ZERO instead
BigInteger bi4;
bi4 = new BigInteger(0); // reference BigInteger.ZERO instead