Skip to content

Commit f74a429

Browse files
committed
Use constants if the variable can't be modified
1 parent 2e67bc0 commit f74a429

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/fluentd/logger/sender/ConstantDelayReconnector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ConstantDelayReconnector implements Reconnector {
1414

1515
private double wait = 50; // Default wait to 50 ms
1616

17-
private int maxErrorHistorySize = 100;
17+
private static final int MAX_ERROR_HISTORY_SIZE = 100;
1818

1919
private Deque<Long> errorHistory = new LinkedList<Long>();
2020

@@ -29,7 +29,7 @@ public ConstantDelayReconnector(int wait) {
2929

3030
public void addErrorHistory(long timestamp) {
3131
errorHistory.addLast(timestamp);
32-
if (errorHistory.size() > maxErrorHistorySize) {
32+
if (errorHistory.size() > MAX_ERROR_HISTORY_SIZE) {
3333
errorHistory.removeFirst();
3434
}
3535
}

0 commit comments

Comments
 (0)