mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
Some small classpath tweaks to be compatible with openJDK's api
This commit is contained in:
parent
a53ffc1792
commit
32a1fb21f2
@ -38,7 +38,11 @@ public class Collections {
|
||||
public static void sort(List list) {
|
||||
sort(list, new Comparator() {
|
||||
public int compare(Object a, Object b) {
|
||||
return ((Comparable) a).compareTo(b);
|
||||
if (a instanceof Comparable) {
|
||||
return ((Comparable) a).compareTo(b);
|
||||
} else {
|
||||
return a.hashCode() - b.hashCode();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -49,6 +49,14 @@ public class ConcurrentHashMap<K,V>
|
||||
this();
|
||||
}
|
||||
|
||||
public ConcurrentHashMap(int initialCapacity, float loadFactor) {
|
||||
this();
|
||||
}
|
||||
|
||||
public ConcurrentHashMap(int initialCapacity, float loadFactor, int concurrencyLevel) {
|
||||
this();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return content.size == 0;
|
||||
}
|
||||
|
@ -10,6 +10,6 @@
|
||||
|
||||
package java.util.concurrent;
|
||||
|
||||
public interface Delayed {
|
||||
public interface Delayed extends Comparable<Delayed> {
|
||||
public long getDelay(TimeUnit unit);
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ import java.util.Collection;
|
||||
|
||||
public interface ExecutorService extends Executor {
|
||||
public void shutdown();
|
||||
|
||||
public List<Runnable> shutdownNow();
|
||||
|
||||
public boolean isShutdown();
|
||||
|
||||
|
24
classpath/java/util/concurrent/Executors.java
Normal file
24
classpath/java/util/concurrent/Executors.java
Normal file
@ -0,0 +1,24 @@
|
||||
/* Copyright (c) 2008-2014, Avian Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice appear
|
||||
in all copies.
|
||||
|
||||
There is NO WARRANTY for this software. See license.txt for
|
||||
details. */
|
||||
|
||||
package java.util.concurrent;
|
||||
|
||||
public class Executors {
|
||||
public static <T> Callable<T> callable(final Runnable task, final T result) {
|
||||
return new Callable<T>() {
|
||||
@Override
|
||||
public T call() throws Exception {
|
||||
task.run();
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user