Java 11 migrate c-d (remaining) (#1111)
* Moves converter pattern to Java 11 * Moves cqrs pattern to Java 11 * Moves dao pattern to Java 11 * Moves data-bus pattern to Java 11 * Moves data-locality pattern to Java 11 * Moves data-mapper pattern to Java 11 * Moves data-transfer-object pattern to Java 11 * Moves decorator pattern to Java 11 * Moves delegation pattern to Java 11 * Moves dependency-injection to Java 11 * Moves dirty-flag to Java 11 * Moves double-buffer to Java 11 * Moves double-checked-locking to Java 11 * Moves double-dispatch to Java 11 * Corrects with changes thats breaking test cases
This commit is contained in:
committed by
Ilkka Seppälä
parent
5681684157
commit
ea57934db6
@ -59,11 +59,11 @@ import java.time.LocalDateTime;
|
||||
class App {
|
||||
|
||||
public static void main(String[] args) {
|
||||
final DataBus bus = DataBus.getInstance();
|
||||
final var bus = DataBus.getInstance();
|
||||
bus.subscribe(new StatusMember(1));
|
||||
bus.subscribe(new StatusMember(2));
|
||||
final MessageCollectorMember foo = new MessageCollectorMember("Foo");
|
||||
final MessageCollectorMember bar = new MessageCollectorMember("Bar");
|
||||
final var foo = new MessageCollectorMember("Foo");
|
||||
final var bar = new MessageCollectorMember("Bar");
|
||||
bus.subscribe(foo);
|
||||
bus.publish(StartingData.of(LocalDateTime.now()));
|
||||
bus.publish(MessageData.of("Only Foo should see this"));
|
||||
|
@ -27,7 +27,6 @@ import com.iluwatar.databus.DataType;
|
||||
import com.iluwatar.databus.Member;
|
||||
import com.iluwatar.databus.data.MessageData;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@ -61,6 +60,6 @@ public class MessageCollectorMember implements Member {
|
||||
}
|
||||
|
||||
public List<String> getMessages() {
|
||||
return Collections.unmodifiableList(messages);
|
||||
return List.copyOf(messages);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user