[jira] [Updated] (DELTASPIKE-1346) ProjectStageProducer should log changed values only if the value changed

2018-05-23 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-1346:
-
Issue Type: Improvement  (was: Bug)

> ProjectStageProducer should log changed values only if the value changed
> 
>
> Key: DELTASPIKE-1346
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1346
> Project: DeltaSpike
>  Issue Type: Improvement
>  Components: Core
>Affects Versions: 1.8.2
>Reporter: Jens Berke
>Priority: Minor
>
> 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:
> {code:java}
> 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);
> }{code}
> 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:
> {code:java}
> if (!Objects.equals(projectStage, ps)) {
> LOG.info("change project-stage from " + projectStage + " to " + ps);
> }{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (DELTASPIKE-1346) ProjectStageProducer should log changed values only if the value changed

2018-05-23 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek reassigned DELTASPIKE-1346:


Assignee: Gerhard Petracek

> ProjectStageProducer should log changed values only if the value changed
> 
>
> Key: DELTASPIKE-1346
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1346
> Project: DeltaSpike
>  Issue Type: Improvement
>  Components: Core
>Affects Versions: 1.8.2
>Reporter: Jens Berke
>Assignee: Gerhard Petracek
>Priority: Minor
>
> 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:
> {code:java}
> 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);
> }{code}
> 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:
> {code:java}
> if (!Objects.equals(projectStage, ps)) {
> LOG.info("change project-stage from " + projectStage + " to " + ps);
> }{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (DELTASPIKE-1346) ProjectStageProducer should log changed values only if the value changed

2018-05-23 Thread Jens Berke (JIRA)
Jens Berke created DELTASPIKE-1346:
--

 Summary: ProjectStageProducer should log changed values only if 
the value changed
 Key: DELTASPIKE-1346
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1346
 Project: DeltaSpike
  Issue Type: Bug
  Components: Core
Affects Versions: 1.8.2
Reporter: Jens Berke


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:
{code:java}
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);
}{code}
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:
{code:java}
if (!Objects.equals(projectStage, ps)) {
LOG.info("change project-stage from " + projectStage + " to " + ps);
}{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)