From 0d2aa5e53ec5560993d8008febf3fd6e7763c3b2 Mon Sep 17 00:00:00 2001 From: Brian de Alwis Date: Fri, 26 Jan 2018 09:10:02 -0500 Subject: [PATCH] Fix compiler errors from new settings --- .../validation/AppEngineJreWhitelist.java | 2 +- .../build.properties | 1 + .../eclipse/util/jobs/PluggableJobTest.java | 26 +++++++++---------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.validation/src/com/google/cloud/tools/eclipse/appengine/validation/AppEngineJreWhitelist.java b/plugins/com.google.cloud.tools.eclipse.appengine.validation/src/com/google/cloud/tools/eclipse/appengine/validation/AppEngineJreWhitelist.java index 2d7a4b97a0..48f2ec05e8 100644 --- a/plugins/com.google.cloud.tools.eclipse.appengine.validation/src/com/google/cloud/tools/eclipse/appengine/validation/AppEngineJreWhitelist.java +++ b/plugins/com.google.cloud.tools.eclipse.appengine.validation/src/com/google/cloud/tools/eclipse/appengine/validation/AppEngineJreWhitelist.java @@ -33,7 +33,7 @@ public class AppEngineJreWhitelist { private static Set WHITELIST = - new HashSet( + new HashSet<>( Arrays.asList( "java.beans.Transient", "java.lang.BootstrapMethodError", diff --git a/plugins/com.google.cloud.tools.eclipse.dataflow.ui/build.properties b/plugins/com.google.cloud.tools.eclipse.dataflow.ui/build.properties index a051a2ec9f..d8efa16ac2 100644 --- a/plugins/com.google.cloud.tools.eclipse.dataflow.ui/build.properties +++ b/plugins/com.google.cloud.tools.eclipse.dataflow.ui/build.properties @@ -6,4 +6,5 @@ bin.includes = plugin.xml,\ .,\ icons/ additional.bundles = org.eclipse.core.databinding +jars.extra.classpath = platform:/plugin/org.eclipse.core.databinding diff --git a/plugins/com.google.cloud.tools.eclipse.util.test/src/com/google/cloud/tools/eclipse/util/jobs/PluggableJobTest.java b/plugins/com.google.cloud.tools.eclipse.util.test/src/com/google/cloud/tools/eclipse/util/jobs/PluggableJobTest.java index e298f6cf59..bad19aa478 100644 --- a/plugins/com.google.cloud.tools.eclipse.util.test/src/com/google/cloud/tools/eclipse/util/jobs/PluggableJobTest.java +++ b/plugins/com.google.cloud.tools.eclipse.util.test/src/com/google/cloud/tools/eclipse/util/jobs/PluggableJobTest.java @@ -52,7 +52,7 @@ public void testConstructor_nullCallable() { @Test public void testConstructor_nullStalenessCheck() { try { - new PluggableJob("name", Callables.returning((Void) null), null); + new PluggableJob<>("name", Callables.returning((Void) null), null); fail("Expected NPE"); } catch (NullPointerException ex) { } @@ -61,7 +61,7 @@ public void testConstructor_nullStalenessCheck() { @Test public void testScheduled() throws InterruptedException, ExecutionException { Object obj = new Object(); - PluggableJob job = new PluggableJob("name", Callables.returning(obj)); + PluggableJob job = new PluggableJob<>("name", Callables.returning(obj)); assertFalse(job.getFuture().isDone()); assertFalse(job.getFuture().isCancelled()); job.schedule(); @@ -75,7 +75,7 @@ public void testScheduled() throws InterruptedException, ExecutionException { @Test public void testJobCancelingCancelsFuture() throws InterruptedException, BrokenBarrierException { final CyclicBarrier barrier = new CyclicBarrier(2); - PluggableJob job = new PluggableJob("name", new Callable() { + PluggableJob job = new PluggableJob<>("name", new Callable() { public Object call() { try { barrier.await(); // job started: should release main thread @@ -98,7 +98,7 @@ public Object call() { @Test public void testFutureCancelingCancelsJob() throws InterruptedException, BrokenBarrierException { final CyclicBarrier barrier = new CyclicBarrier(2); - PluggableJob job = new PluggableJob("name", new Callable() { + PluggableJob job = new PluggableJob<>("name", new Callable() { public Object call() { try { barrier.await(); // job started: should release main thread @@ -122,7 +122,7 @@ public Object call() { public void testStaleCancelsFuture() throws InterruptedException { Object obj = new Object(); PluggableJob job = - new PluggableJob("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()); @@ -133,7 +133,7 @@ public void testStaleCancelsFuture() throws InterruptedException { public void testStaleFiresFutureListener() throws InterruptedException { Object obj = new Object(); final PluggableJob job = - new PluggableJob("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() { @@ -153,7 +153,7 @@ public void run() { @Test public void testCompleteness_normal() throws InterruptedException { Object obj = new Object(); - PluggableJob job = new PluggableJob("name", Callables.returning(obj)); + PluggableJob job = new PluggableJob<>("name", Callables.returning(obj)); assertFalse(job.isComputationComplete()); job.schedule(); job.join(); @@ -167,7 +167,7 @@ public void testCompleteness_normal() throws InterruptedException { @Test public void testCompleteness_error() throws InterruptedException { final Exception exception = new Exception("test"); - PluggableJob job = new PluggableJob("name", new Callable() { + PluggableJob job = new PluggableJob<>("name", new Callable() { @Override public Object call() throws Exception { throw exception; @@ -186,7 +186,7 @@ public Object call() throws Exception { @Test public void testOnSuccess_normal() throws InterruptedException { Object obj = new Object(); - PluggableJob job = new PluggableJob("name", Callables.returning(obj)); + PluggableJob job = new PluggableJob<>("name", Callables.returning(obj)); final boolean[] listenerRun = new boolean[] {false}; job.onSuccess(MoreExecutors.directExecutor(), new Runnable() { @Override @@ -205,7 +205,7 @@ public void run() { public void testOnSuccess_abandon() throws InterruptedException { Object obj = new Object(); PluggableJob job = - new PluggableJob("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 @@ -221,7 +221,7 @@ public void run() { @Test public void testOnError() throws InterruptedException { - PluggableJob job = new PluggableJob("name", new Callable() { + PluggableJob job = new PluggableJob<>("name", new Callable() { @Override public Object call() throws Exception { throw new Exception("test"); @@ -243,7 +243,7 @@ public void accept(Exception result) { @Test public void testIsCurrent_abandon() throws InterruptedException { Object obj = new Object(); - PluggableJob job = new PluggableJob("name", Callables.returning(obj)); + PluggableJob job = new PluggableJob<>("name", Callables.returning(obj)); assertTrue(job.isCurrent()); job.schedule(); // should be stale and cancelled job.join(); @@ -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 job = new PluggableJob("name", Callables.returning(obj), + PluggableJob job = new PluggableJob<>("name", Callables.returning(obj), new Predicate>() { @Override public boolean apply(FuturisticJob job) {