Skip to content

Commit d74f9e8

Browse files
committed
Fix new Sonar smell
1 parent 370e943 commit d74f9e8

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

spring-integration-core/src/main/java/org/springframework/integration/util/DynamicPeriodicTrigger.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,17 @@
3535
*
3636
* @author Gunnar Hillert
3737
* @author Gary Russell
38+
* @author Artem Bilan
3839
*
3940
* @since 4.2
4041
*/
4142
public class DynamicPeriodicTrigger implements Trigger {
4243

43-
private volatile Duration initialDuration = Duration.ofMillis(0);
44+
private Duration initialDuration = Duration.ofMillis(0);
4445

45-
private volatile Duration duration;
46+
private Duration duration;
4647

47-
private volatile TimeUnit timeUnit = TimeUnit.MILLISECONDS;
48-
49-
private volatile boolean fixedRate = false;
48+
private boolean fixedRate = false;
5049

5150
/**
5251
* Create a trigger with the given period in milliseconds. The underlying
@@ -177,14 +176,11 @@ else if (!this.duration.equals(other.duration)) {
177176
return false;
178177
}
179178
if (this.initialDuration == null) {
180-
if (other.initialDuration != null) {
181-
return false;
182-
}
179+
return other.initialDuration == null;
183180
}
184-
else if (!this.initialDuration.equals(other.initialDuration)) {
185-
return false;
181+
else {
182+
return this.initialDuration.equals(other.initialDuration);
186183
}
187-
return true;
188184
}
189185

190186

0 commit comments

Comments
 (0)