Skip to content

Commit

Permalink
Fix compiler errors from new settings
Browse files Browse the repository at this point in the history
  • Loading branch information
briandealwis committed Jan 26, 2018
1 parent d4051d1 commit 0d2aa5e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class AppEngineJreWhitelist {

private static Set<String> WHITELIST =
new HashSet<String>(
new HashSet<>(
Arrays.asList(
"java.beans.Transient",
"java.lang.BootstrapMethodError",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ bin.includes = plugin.xml,\
.,\
icons/
additional.bundles = org.eclipse.core.databinding
jars.extra.classpath = platform:/plugin/org.eclipse.core.databinding

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testConstructor_nullCallable() {
@Test
public void testConstructor_nullStalenessCheck() {
try {
new PluggableJob<Void>("name", Callables.returning((Void) null), null);
new PluggableJob<>("name", Callables.returning((Void) null), null);
fail("Expected NPE");
} catch (NullPointerException ex) {
}
Expand All @@ -61,7 +61,7 @@ public void testConstructor_nullStalenessCheck() {
@Test
public void testScheduled() throws InterruptedException, ExecutionException {
Object obj = new Object();
PluggableJob<Object> job = new PluggableJob<Object>("name", Callables.returning(obj));
PluggableJob<Object> job = new PluggableJob<>("name", Callables.returning(obj));
assertFalse(job.getFuture().isDone());
assertFalse(job.getFuture().isCancelled());
job.schedule();
Expand All @@ -75,7 +75,7 @@ public void testScheduled() throws InterruptedException, ExecutionException {
@Test
public void testJobCancelingCancelsFuture() throws InterruptedException, BrokenBarrierException {
final CyclicBarrier barrier = new CyclicBarrier(2);
PluggableJob<Object> job = new PluggableJob<Object>("name", new Callable<Object>() {
PluggableJob<Object> job = new PluggableJob<>("name", new Callable<Object>() {
public Object call() {
try {
barrier.await(); // job started: should release main thread
Expand All @@ -98,7 +98,7 @@ public Object call() {
@Test
public void testFutureCancelingCancelsJob() throws InterruptedException, BrokenBarrierException {
final CyclicBarrier barrier = new CyclicBarrier(2);
PluggableJob<Object> job = new PluggableJob<Object>("name", new Callable<Object>() {
PluggableJob<Object> job = new PluggableJob<>("name", new Callable<Object>() {
public Object call() {
try {
barrier.await(); // job started: should release main thread
Expand All @@ -122,7 +122,7 @@ public Object call() {
public void testStaleCancelsFuture() throws InterruptedException {
Object obj = new Object();
PluggableJob<Object> job =
new PluggableJob<Object>("name", Callables.returning(obj), Predicates.alwaysTrue());
new PluggableJob<>("name", Callables.returning(obj), Predicates.alwaysTrue());
job.schedule();
job.join();
assertEquals("Should be CANCEL", IStatus.CANCEL, job.getResult().getSeverity());
Expand All @@ -133,7 +133,7 @@ public void testStaleCancelsFuture() throws InterruptedException {
public void testStaleFiresFutureListener() throws InterruptedException {
Object obj = new Object();
final PluggableJob<Object> job =
new PluggableJob<Object>("name", Callables.returning(obj), Predicates.alwaysTrue());
new PluggableJob<>("name", Callables.returning(obj), Predicates.alwaysTrue());
assertFalse(job.getFuture().isDone());
final boolean[] listenerRun = new boolean[] {false};
job.getFuture().addListener(new Runnable() {
Expand All @@ -153,7 +153,7 @@ public void run() {
@Test
public void testCompleteness_normal() throws InterruptedException {
Object obj = new Object();
PluggableJob<Object> job = new PluggableJob<Object>("name", Callables.returning(obj));
PluggableJob<Object> job = new PluggableJob<>("name", Callables.returning(obj));
assertFalse(job.isComputationComplete());
job.schedule();
job.join();
Expand All @@ -167,7 +167,7 @@ public void testCompleteness_normal() throws InterruptedException {
@Test
public void testCompleteness_error() throws InterruptedException {
final Exception exception = new Exception("test");
PluggableJob<Object> job = new PluggableJob<Object>("name", new Callable<Object>() {
PluggableJob<Object> job = new PluggableJob<>("name", new Callable<Object>() {
@Override
public Object call() throws Exception {
throw exception;
Expand All @@ -186,7 +186,7 @@ public Object call() throws Exception {
@Test
public void testOnSuccess_normal() throws InterruptedException {
Object obj = new Object();
PluggableJob<Object> job = new PluggableJob<Object>("name", Callables.returning(obj));
PluggableJob<Object> job = new PluggableJob<>("name", Callables.returning(obj));
final boolean[] listenerRun = new boolean[] {false};
job.onSuccess(MoreExecutors.directExecutor(), new Runnable() {
@Override
Expand All @@ -205,7 +205,7 @@ public void run() {
public void testOnSuccess_abandon() throws InterruptedException {
Object obj = new Object();
PluggableJob<Object> job =
new PluggableJob<Object>("name", Callables.returning(obj), Predicates.alwaysTrue());
new PluggableJob<>("name", Callables.returning(obj), Predicates.alwaysTrue());
final boolean[] listenerRun = new boolean[] {false};
job.onSuccess(MoreExecutors.directExecutor(), new Runnable() {
@Override
Expand All @@ -221,7 +221,7 @@ public void run() {

@Test
public void testOnError() throws InterruptedException {
PluggableJob<Object> job = new PluggableJob<Object>("name", new Callable<Object>() {
PluggableJob<Object> job = new PluggableJob<>("name", new Callable<Object>() {
@Override
public Object call() throws Exception {
throw new Exception("test");
Expand All @@ -243,7 +243,7 @@ public void accept(Exception result) {
@Test
public void testIsCurrent_abandon() throws InterruptedException {
Object obj = new Object();
PluggableJob<Object> job = new PluggableJob<Object>("name", Callables.returning(obj));
PluggableJob<Object> job = new PluggableJob<>("name", Callables.returning(obj));
assertTrue(job.isCurrent());
job.schedule(); // should be stale and cancelled
job.join();
Expand All @@ -256,7 +256,7 @@ public void testIsCurrent_abandon() throws InterruptedException {
public void testIsCurrent_stale() throws InterruptedException {
Object obj = new Object();
final boolean[] isStale = new boolean[] { false };
PluggableJob<Object> job = new PluggableJob<Object>("name", Callables.returning(obj),
PluggableJob<Object> job = new PluggableJob<>("name", Callables.returning(obj),
new Predicate<FuturisticJob<?>>() {
@Override
public boolean apply(FuturisticJob<?> job) {
Expand Down

0 comments on commit 0d2aa5e

Please sign in to comment.