Skip to content

Commit 1fc6299

Browse files
committed
Uppercase static final constants
1 parent 1fab30d commit 1fc6299

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

complete-kotlin/src/main/kotlin/com/example/restservice/GreetingController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import org.springframework.web.bind.annotation.RestController
1010
class GreetingController {
1111

1212
companion object {
13-
private const val template = "Hello, %s!"
13+
private const val TEMPLATE = "Hello, %s!"
1414
}
1515
private val counter = AtomicLong()
1616

1717
@GetMapping("/greeting")
1818
fun greeting(@RequestParam name: String = "World") =
19-
Greeting(counter.incrementAndGet(), String.format(template, name))
19+
Greeting(counter.incrementAndGet(), String.format(TEMPLATE, name))
2020

2121
}

complete/src/main/java/com/example/restservice/GreetingController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
@RestController
1010
public class GreetingController {
1111

12-
private static final String template = "Hello, %s!";
12+
private static final String TEMPLATE = "Hello, %s!";
1313
private final AtomicLong counter = new AtomicLong();
1414

1515
@GetMapping("/greeting")
1616
public Greeting greeting(@RequestParam(defaultValue = "World") String name) {
17-
return new Greeting(counter.incrementAndGet(), String.format(template, name));
17+
return new Greeting(counter.incrementAndGet(), String.format(TEMPLATE, name));
1818
}
1919
}

0 commit comments

Comments
 (0)