This code:
:::java
public enum Operation
{
LEFT( Action.PRIVATE_MOVE ), RIGHT( Action.PRIVATE_MOVE ), STOP( Action.PRIVATE_STAY );
private final int action;
private Operation(final int action)
{
this.action = action;
}
public int getAction()
{
return action;
}
private static final class Action
{
private static final int PRIVATE_STAY = 0;
private static final int PRIVATE_MOVE = 1;
}
}
Generates warnings:
Avoid unused private fields such as 'PRIVATE_STAY'.
Avoid unused private fields such as 'PRIVATE_MOVE'.
I would expect that such warning is not given, because those variables are clearly used in the enum above.
I am using PMD 5.0.5 via Eclipse PMD plugin (4.0.2)
Will be fixed with the next PMD release.