Skip to content

Commit ea68115

Browse files
committed
Apply Spotless formatting
1 parent e369856 commit ea68115

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

rate-limiting-pattern/src/main/java/com/iluwatar/rate/limiting/pattern/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static void main(String[] args) {
104104
Thread.currentThread().interrupt();
105105
} finally {
106106
running.set(false);
107-
if(tb != null) {
107+
if (tb != null) {
108108
tb.shutdown();
109109
}
110110
shutdownExecutor(executor, "mainExecutor");

rate-limiting-pattern/src/main/java/com/iluwatar/rate/limiting/pattern/TokenBucketRateLimiter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private static class TokenBucket {
8282
synchronized boolean tryConsume() {
8383
refillIfNeeded();
8484

85-
if(tokens.get() <= 0) {
85+
if (tokens.get() <= 0) {
8686
return false;
8787
}
8888

@@ -92,7 +92,7 @@ synchronized boolean tryConsume() {
9292

9393
private void refillIfNeeded() {
9494
long now = System.currentTimeMillis();
95-
if(now - lastRefillTime >= 1000) {
95+
if (now - lastRefillTime >= 1000) {
9696
tokens.set(capacity);
9797
lastRefillTime = now;
9898
}

0 commit comments

Comments
 (0)