diff --git a/atlasdb-cli/src/main/java/com/palantir/atlasdb/cli/command/SingleBackendCommand.java b/atlasdb-cli/src/main/java/com/palantir/atlasdb/cli/command/SingleBackendCommand.java index df168faa023..ee05dd0726f 100644 --- a/atlasdb-cli/src/main/java/com/palantir/atlasdb/cli/command/SingleBackendCommand.java +++ b/atlasdb-cli/src/main/java/com/palantir/atlasdb/cli/command/SingleBackendCommand.java @@ -46,7 +46,7 @@ private AtlasDbServices connect() throws IOException { return DaggerAtlasDbServices.builder().servicesConfigModule(scm).build(); } - public T connect(AtlasDbServicesFactory factory) throws IOException { + public AtlasDbServices connect(AtlasDbServicesFactory factory) throws IOException { return factory.connect(ServicesConfigModule.create(getAtlasDbConfig(), getAtlasDbRuntimeConfig())); } diff --git a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestSweepCommand.java b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestSweepCommand.java index 281ddff03ee..9e1491ae871 100644 --- a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestSweepCommand.java +++ b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestSweepCommand.java @@ -100,7 +100,7 @@ private InMemoryTestRunner makeRunner(String... args) { public void testSweepTable() throws Exception { try (SingleBackendCliTestRunner runner = makeRunner(paramsWithDryRunSet(SWEEP_COMMAND, "-t", TABLE_ONE.getQualifiedName()))) { - TestAtlasDbServices services = runner.connect(moduleFactory); + TestAtlasDbServices services = (TestAtlasDbServices) runner.connect(moduleFactory); SerializableTransactionManager txm = services.getTransactionManager(); TimestampService tss = services.getManagedTimestampService(); KeyValueService kvs = services.getKeyValueService(); @@ -135,7 +135,7 @@ public void testSweepTable() throws Exception { public void testSweepNonExistingTable() throws Exception { try (SingleBackendCliTestRunner runner = makeRunner(paramsWithDryRunSet(SWEEP_COMMAND, "-t", NON_EXISTING_TABLE.getQualifiedName()))) { - TestAtlasDbServices services = runner.connect(moduleFactory); + TestAtlasDbServices services = (TestAtlasDbServices) runner.connect(moduleFactory); long ts5 = services.getManagedTimestampService().getFreshTimestamp(); String stdout = sweep(runner, ts5); @@ -149,7 +149,7 @@ public void testSweepNonExistingTable() throws Exception { @Test public void testSweepNamespace() throws Exception { try (SingleBackendCliTestRunner runner = makeRunner(paramsWithDryRunSet(SWEEP_COMMAND, "-n", NS1.getName()))) { - TestAtlasDbServices services = runner.connect(moduleFactory); + TestAtlasDbServices services = (TestAtlasDbServices) runner.connect(moduleFactory); SerializableTransactionManager txm = services.getTransactionManager(); TimestampService tss = services.getManagedTimestampService(); KeyValueService kvs = services.getKeyValueService(); @@ -181,7 +181,7 @@ public void testSweepNamespace() throws Exception { @Test public void testSweepAll() throws Exception { try (SingleBackendCliTestRunner runner = makeRunner(paramsWithDryRunSet(SWEEP_COMMAND, "-a"))) { - TestAtlasDbServices services = runner.connect(moduleFactory); + TestAtlasDbServices services = (TestAtlasDbServices) runner.connect(moduleFactory); SerializableTransactionManager txm = services.getTransactionManager(); TimestampService tss = services.getManagedTimestampService(); KeyValueService kvs = services.getKeyValueService(); @@ -218,7 +218,7 @@ public void testSweepStartRow() throws Exception { TABLE_ONE.getQualifiedName(), "-r", BaseEncoding.base16().encode("foo".getBytes(StandardCharsets.UTF_8))))) { - TestAtlasDbServices services = runner.connect(moduleFactory); + TestAtlasDbServices services = (TestAtlasDbServices) runner.connect(moduleFactory); SerializableTransactionManager txm = services.getTransactionManager(); TimestampService tss = services.getManagedTimestampService(); KeyValueService kvs = services.getKeyValueService(); diff --git a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestTimestampCommand.java b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestTimestampCommand.java index 6c14a6cb0c2..94b6d1cbfd2 100644 --- a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestTimestampCommand.java +++ b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestTimestampCommand.java @@ -237,7 +237,7 @@ private void runAndVerifyCliForFile(String inputFileString) throws Exception { private void runAndVerifyCli(Verifier verifier) throws Exception { try (SingleBackendCliTestRunner runner = makeRunner(cliArgs.toArray(new String[0]))) { - TestAtlasDbServices services = runner.connect(moduleFactory); + TestAtlasDbServices services = (TestAtlasDbServices) runner.connect(moduleFactory); LockService lockService = services.getLockService(); TimestampService tss = services.getManagedTimestampService(); LockClient client = services.getTestLockClient(); diff --git a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/AbstractTestRunner.java b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/AbstractTestRunner.java index e3404ef5daf..ab3e8c51786 100644 --- a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/AbstractTestRunner.java +++ b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/AbstractTestRunner.java @@ -27,13 +27,13 @@ import java.util.concurrent.Callable; import org.apache.commons.lang3.ArrayUtils; -public abstract class AbstractTestRunner implements SingleBackendCliTestRunner { +public abstract class AbstractTestRunner implements SingleBackendCliTestRunner { private final Class cmdClass; private String[] args; private SingleBackendCommand cmd; - private S services; + private AtlasDbServices services; protected AbstractTestRunner(Class cmdClass, String... args) { this.cmdClass = cmdClass; @@ -41,7 +41,7 @@ protected AbstractTestRunner(Class cmdClass, Str } @Override - public S connect(AtlasDbServicesFactory factory) throws Exception { + public AtlasDbServices connect(AtlasDbServicesFactory factory) throws Exception { cmd = buildCommand(cmdClass, buildArgs()); services = cmd.connect(factory); return services; diff --git a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/InMemoryTestRunner.java b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/InMemoryTestRunner.java index e67c9c79c1c..5557192d455 100644 --- a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/InMemoryTestRunner.java +++ b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/InMemoryTestRunner.java @@ -16,10 +16,9 @@ package com.palantir.atlasdb.cli.runner; import com.palantir.atlasdb.cli.command.SingleBackendCommand; -import com.palantir.atlasdb.services.AtlasDbServices; import com.palantir.atlasdb.spi.KeyValueServiceConfig; -public class InMemoryTestRunner extends AbstractTestRunner { +public class InMemoryTestRunner extends AbstractTestRunner { public static final String CONFIG_LOCATION = "cli_test_config.yml"; diff --git a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/SingleBackendCliTestRunner.java b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/SingleBackendCliTestRunner.java index 0fb5eb770b4..0db105c30e4 100644 --- a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/SingleBackendCliTestRunner.java +++ b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/runner/SingleBackendCliTestRunner.java @@ -21,7 +21,7 @@ public interface SingleBackendCliTestRunner extends AutoCloseable { - T connect(AtlasDbServicesFactory factory) throws Exception; + AtlasDbServices connect(AtlasDbServicesFactory factory) throws Exception; void parse(String... args); diff --git a/atlasdb-dagger/src/main/java/com/palantir/atlasdb/services/AtlasDbServicesFactory.java b/atlasdb-dagger/src/main/java/com/palantir/atlasdb/services/AtlasDbServicesFactory.java index d939caa92f3..35b2b22b8d4 100644 --- a/atlasdb-dagger/src/main/java/com/palantir/atlasdb/services/AtlasDbServicesFactory.java +++ b/atlasdb-dagger/src/main/java/com/palantir/atlasdb/services/AtlasDbServicesFactory.java @@ -16,5 +16,5 @@ package com.palantir.atlasdb.services; public interface AtlasDbServicesFactory { - T connect(ServicesConfigModule servicesConfigModule); + AtlasDbServices connect(ServicesConfigModule servicesConfigModule); } diff --git a/atlasdb-processors-tests/src/main/java/com/palantir/processors/GenericsTester.java b/atlasdb-processors-tests/src/main/java/com/palantir/processors/GenericsTester.java index 6556e904d64..ae624e84ad7 100644 --- a/atlasdb-processors-tests/src/main/java/com/palantir/processors/GenericsTester.java +++ b/atlasdb-processors-tests/src/main/java/com/palantir/processors/GenericsTester.java @@ -30,7 +30,7 @@ default Set hello() { throw new UnsupportedOperationException("This class doesn't know how to say hello."); } - static D hidingParameter(A argument) { - return null; + static boolean hidingParameter(A argument) { + return true; } } diff --git a/build.gradle b/build.gradle index c2c52e74d80..8d704901f48 100644 --- a/build.gradle +++ b/build.gradle @@ -129,7 +129,6 @@ allprojects { 'ThreadPriorityCheck', 'ThrowSpecificity', 'TooManyArguments', - 'TypeParameterUnusedInFormals', 'ValidateConstantMessage' } }