Fix new Sonar smell

This commit is contained in:
Artem Bilan
2020-01-09 16:46:53 -05:00
parent 370e943428
commit d74f9e8b86

View File

@@ -35,18 +35,17 @@ import org.springframework.util.Assert;
*
* @author Gunnar Hillert
* @author Gary Russell
* @author Artem Bilan
*
* @since 4.2
*/
public class DynamicPeriodicTrigger implements Trigger {
private volatile Duration initialDuration = Duration.ofMillis(0);
private Duration initialDuration = Duration.ofMillis(0);
private volatile Duration duration;
private Duration duration;
private volatile TimeUnit timeUnit = TimeUnit.MILLISECONDS;
private volatile boolean fixedRate = false;
private boolean fixedRate = false;
/**
* Create a trigger with the given period in milliseconds. The underlying
@@ -177,14 +176,11 @@ public class DynamicPeriodicTrigger implements Trigger {
return false;
}
if (this.initialDuration == null) {
if (other.initialDuration != null) {
return false;
}
return other.initialDuration == null;
}
else if (!this.initialDuration.equals(other.initialDuration)) {
return false;
else {
return this.initialDuration.equals(other.initialDuration);
}
return true;
}