mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-13 10:15:44 +00:00
Java 11 migrate remaining p (#1122)
* Moves partial-response to Java 11 * Moves pipeline to Java 11 * Moves poison-pill to Java 11 * Moves priority-queue to Java 11 * Moves private-class-data to Java 11 * Moves producer-consumer to Java 11 * Moves promise to Java 11 * Moves property to Java 11 * Moves prototype to Java 11 * Moves proxy to Java 11 * Corrects checkstyle errors * Fixes build for pipeline pattern
This commit is contained in:
1 parent
1401accb4f
commit
428efc7d53
82 files changed
+532
-601
No files matched your search
@@ -30,7 +30,7 @@ import java.util.Random;
|
||||
* to queue.
|
||||
*/
|
||||
public class Producer {
|
||||
|
||||
|
||||
private static final Random RANDOM = new Random();
|
||||
|
||||
private final ItemQueue queue;
|
||||
@@ -49,7 +49,7 @@ public class Producer {
|
||||
*/
|
||||
public void produce() throws InterruptedException {
|
||||
|
||||
Item item = new Item(name, itemId++);
|
||||
var item = new Item(name, itemId++);
|
||||
queue.put(item);
|
||||
Thread.sleep(RANDOM.nextInt(2000));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user