Skip to content

Commit d2df60d

Browse files
committed
Chapter 5: Kafka: Mark Random as final
1 parent b3a09eb commit d2df60d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

chapter-5/chapter-5-quarkus-kafka-streams/src/main/java/org/acme/service/PriceGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@ApplicationScoped
1717
public class PriceGenerator {
1818

19-
private Random random = new Random();
19+
private final Random random = new Random();
2020

2121
@Outgoing("generated-price")
2222
public Multi<Integer> generate() {

chapter-5/chapter-5-spring-kafka-streams/src/main/java/org/acme/service/PriceGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
@Component("generateprice")
1212
public class PriceGenerator implements Supplier<Flux<Integer>> {
13-
private Random random = new Random();
13+
private final Random random = new Random();
1414

1515
@Override
1616
public Flux<Integer> get() {

0 commit comments

Comments
 (0)