# Using PMD Pick a Java project from Github (see the [instructions](../sujet.md) for suggestions). Run PMD on its source code using any ruleset (see the [pmd install instruction](./pmd-help.md)). Describe below an issue found by PMD that you think should be solved (true positive) and include below the changes you would add to the source code. Describe below an issue found by PMD that is not worth solving (false positive). Explain why you would not solve this issue. ## Answer We clone the project `commons-math` https://github.com/apache/commons-math We found a problem that it's not worth to change `./commons-math/commons-math-core/src/main/java/org/apache/commons/math4/core/jdkmath/AccurateMath.java:396: UselessParentheses: Useless parentheses around `0.5 * t`.` And here is the code that PMD a indiqué: ``` if (x >= LOG_MAX_VALUE) { // Avoid overflow (MATH-905). final double t = exp(0.5 * x); return (0.5 * t) * t; ``` As we can see the parentheses didn't cause any harm here but it is a true positive For a false positive, we found this one: `./commons-math/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/IntegerSequenceTest.java:255: UnusedLocalVariable: Avoid unused local variables such as 'inc'.` ``` @Test(expected = ZeroException.class) public void testIncrementZeroStep() { final int step = 0; final IntegerSequence.Incrementor inc = IntegerSequence.Incrementor.create() .withIncrement(step); } ``` Because the purpose of the test is to trigger the bug when create object.