Add java 11 support for #987 (o-t) (#1051)

* Use java 11

* Use .of
- Replace Arrays.asList with List.of
- Replace HashSet<>(List.of()) with Set.of

* Formatting
This commit is contained in:
Leon Mak
2019-10-29 14:37:40 +08:00
committed by Ilkka Seppälä
parent dd971d8c19
commit c8a481bb77
37 changed files with 176 additions and 257 deletions

View File

@ -43,7 +43,7 @@ public abstract class Service {
public ArrayList<Exception> exceptionsList;
private static final Random RANDOM = new Random();
private static final String ALL_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
private static final Hashtable<String, Boolean> USED_IDS = new Hashtable<String, Boolean>();
private static final Hashtable<String, Boolean> USED_IDS = new Hashtable<>();
protected Service(Database db, Exception...exc) {
this.database = db;

View File

@ -45,9 +45,9 @@ class RetryTest {
Retry.HandleErrorIssue<Order> handleError = (o,e) -> {
return;
};
Retry<Order> r1 = new Retry<Order>(op, handleError, 3, 30000,
Retry<Order> r1 = new Retry<>(op, handleError, 3, 30000,
e -> DatabaseUnavailableException.class.isAssignableFrom(e.getClass()));
Retry<Order> r2 = new Retry<Order>(op, handleError, 3, 30000,
Retry<Order> r2 = new Retry<>(op, handleError, 3, 30000,
e -> DatabaseUnavailableException.class.isAssignableFrom(e.getClass()));
User user = new User("Jim", "ABCD");
Order order = new Order(user, "book", 10f);