Description
The change in DELTASPIKE-1329 logs a message every time the project stage is set, even is the new value is the same as the previous one, and it can flood your log with numerous messages "change project-stage from UnitTest to UnitTest" when running unit tests.
I think it's better if the message is only logged if the new value is actually different from the previous one - which also seems to have been the intention of DELTASPIKE-1329 according to its summary.
Example for an implementation:
String psNameOld = projectStage == null ? "" : projectStage.toString(); String psNameNew = ps == null ? "" : ps.toString(); if (!psNameNew.equals(psNameOld)) { LOG.info("change project-stage from " + projectStage + " to " + ps); }
For DeltaSpike versions which require at least Java 1.7. and later, and if ProjectStage had a proper equals method, this could be simplified to:
if (!Objects.equals(projectStage, ps)) { LOG.info("change project-stage from " + projectStage + " to " + ps); }