mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 08:58:49 +00:00
Add java 11 (#1048)
This commit is contained in:
@@ -23,10 +23,8 @@
|
||||
|
||||
package com.iluwatar.commander;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Random;
|
||||
import java.util.*;
|
||||
|
||||
import com.iluwatar.commander.exceptions.DatabaseUnavailableException;
|
||||
|
||||
/**
|
||||
@@ -49,7 +47,7 @@ public abstract class Service {
|
||||
|
||||
protected Service(Database db, Exception...exc) {
|
||||
this.database = db;
|
||||
this.exceptionsList = new ArrayList<Exception>(Arrays.asList(exc));
|
||||
this.exceptionsList = new ArrayList<>(List.of(exc));
|
||||
}
|
||||
|
||||
public abstract String receiveRequest(Object...parameters) throws DatabaseUnavailableException;
|
||||
|
||||
@@ -23,12 +23,13 @@
|
||||
|
||||
package com.iluwatar.commander.queue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import com.iluwatar.commander.Database;
|
||||
import com.iluwatar.commander.exceptions.DatabaseUnavailableException;
|
||||
import com.iluwatar.commander.exceptions.IsEmptyException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* QueueDatabase id where the instructions to be implemented are queued.
|
||||
*/
|
||||
@@ -39,8 +40,8 @@ public class QueueDatabase extends Database<QueueTask> {
|
||||
public ArrayList<Exception> exceptionsList;
|
||||
|
||||
public QueueDatabase(Exception...exc) {
|
||||
this.data = new Queue<QueueTask>();
|
||||
this.exceptionsList = new ArrayList<Exception>(Arrays.asList(exc));
|
||||
this.data = new Queue<>();
|
||||
this.exceptionsList = new ArrayList<>(List.of(exc));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user