Skip to content

Commit

Permalink
Cleanup imports
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal committed Aug 11, 2020
1 parent 22b2564 commit 380f275
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import org.junit.jupiter.api.assertThrows
import org.mockito.Mockito.mock
import org.mockito.Mockito.times
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoInteractions

@DisplayName("Regression tests")
class RegressionTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,7 @@
package eh;


import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.internal.RegistrationUtil.requireOptional;
import static org.enginehub.piston.part.CommandParts.arg;
import static org.enginehub.piston.part.CommandParts.flag;

import com.google.common.collect.ImmutableList;
import java.lang.Object;
import java.lang.String;
import java.lang.Throwable;
import java.lang.reflect.Method;
import java.util.Collection;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.TranslatableComponent;
import org.enginehub.piston.CommandManager;
Expand All @@ -43,6 +30,15 @@
import org.enginehub.piston.inject.Key;
import org.enginehub.piston.part.CommandArgument;

import java.lang.reflect.Method;
import java.util.Collection;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.part.CommandParts.arg;

final class CollectionArgRegistration implements CommandRegistration<CollectionArg> {
private static final Key<String> string_Key = Key.of(String.class);
private static final Key<Object> object_Key = Key.of(Object.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,7 @@
package eh;


import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.internal.RegistrationUtil.requireOptional;
import static org.enginehub.piston.part.CommandParts.arg;
import static org.enginehub.piston.part.CommandParts.flag;

import com.google.common.collect.ImmutableList;
import java.lang.Throwable;
import java.lang.reflect.Method;
import java.util.Collection;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.TranslatableComponent;
import org.enginehub.piston.CommandManager;
Expand All @@ -41,6 +30,15 @@
import org.enginehub.piston.gen.CommandRegistration;
import org.enginehub.piston.part.CommandArgument;

import java.lang.reflect.Method;
import java.util.Collection;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.part.CommandParts.arg;

final class CommandValueArgRegistration implements CommandRegistration<CommandValueArg> {
private CommandManager commandManager;

Expand Down
21 changes: 9 additions & 12 deletions core-ap/processor/src/test/resources/gen/FlagsRegistration.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,7 @@

package eh;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.internal.RegistrationUtil.requireOptional;
import static org.enginehub.piston.part.CommandParts.arg;
import static org.enginehub.piston.part.CommandParts.flag;

import com.google.common.collect.ImmutableList;
import java.lang.String;
import java.lang.Throwable;
import java.lang.reflect.Method;
import java.util.Collection;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.TranslatableComponent;
import org.enginehub.piston.CommandManager;
Expand All @@ -42,6 +30,15 @@
import org.enginehub.piston.part.ArgAcceptingCommandFlag;
import org.enginehub.piston.part.NoArgCommandFlag;

import java.lang.reflect.Method;
import java.util.Collection;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.part.CommandParts.flag;

final class FlagsRegistration implements CommandRegistration<Flags> {
private static final Key<String> string_Key = Key.of(String.class);
private CommandManager commandManager;
Expand Down
28 changes: 11 additions & 17 deletions core-ap/processor/src/test/resources/gen/IntArgRegistration.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,7 @@

package eh;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.internal.RegistrationUtil.requireOptional;
import static org.enginehub.piston.part.CommandParts.arg;
import static org.enginehub.piston.part.CommandParts.flag;

import com.google.common.collect.ImmutableList;
import java.lang.Integer;
import java.lang.NoSuchMethodException;
import java.lang.Object;
import java.lang.RuntimeException;
import java.lang.Throwable;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.List;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.TranslatableComponent;
import org.enginehub.piston.CommandManager;
Expand All @@ -49,6 +32,17 @@
import org.enginehub.piston.inject.Key;
import org.enginehub.piston.part.CommandArgument;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.List;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.part.CommandParts.arg;

final class IntArgRegistration implements CommandRegistration<IntArg> {
private static final Key<Integer> integer_Key = Key.of(Integer.class);
private static final Key<Integer> integer_injectGamma_something_to_match__Key = Key.of(Integer.class, new Object() {
Expand Down
20 changes: 8 additions & 12 deletions core-ap/processor/src/test/resources/gen/NoArgRegistration.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,7 @@

package eh;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.internal.RegistrationUtil.requireOptional;
import static org.enginehub.piston.part.CommandParts.arg;
import static org.enginehub.piston.part.CommandParts.flag;

import com.google.common.collect.ImmutableList;
import java.lang.Exception;
import java.lang.Throwable;
import java.lang.reflect.Method;
import java.util.Collection;
import net.kyori.adventure.text.TextComponent;
import org.enginehub.piston.Command;
import org.enginehub.piston.CommandManager;
Expand All @@ -40,6 +28,14 @@
import org.enginehub.piston.gen.CommandCallListener;
import org.enginehub.piston.gen.CommandRegistration;

import java.lang.reflect.Method;
import java.util.Collection;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;

final class NoArgRegistration implements CommandRegistration<NoArg> {
private CommandManager commandManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,25 @@

package eh;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.internal.RegistrationUtil.requireOptional;
import static org.enginehub.piston.part.CommandParts.arg;
import static org.enginehub.piston.part.CommandParts.flag;

import com.google.common.collect.ImmutableList;
import com.google.common.reflect.TypeToken;
import java.lang.Object;
import java.lang.Throwable;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.concurrent.Callable;
import net.kyori.adventure.text.TextComponent;
import org.enginehub.piston.CommandManager;
import org.enginehub.piston.CommandParameters;
import org.enginehub.piston.gen.CommandCallListener;
import org.enginehub.piston.gen.CommandRegistration;
import org.enginehub.piston.inject.Key;

import java.lang.reflect.Method;
import java.util.Collection;
import java.util.concurrent.Callable;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.internal.RegistrationUtil.requireOptional;

final class NonArgParametersRegistration implements CommandRegistration<NonArgParameters> {
private static final Key<Callable<Object>> callable$Object_Key = Key.of(new TypeToken<Callable<Object>>() {
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,21 @@

package eh;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.internal.RegistrationUtil.requireOptional;
import static org.enginehub.piston.part.CommandParts.arg;
import static org.enginehub.piston.part.CommandParts.flag;

import com.google.common.collect.ImmutableList;
import java.lang.Exception;
import java.lang.Throwable;
import java.lang.reflect.Method;
import java.util.Collection;
import net.kyori.adventure.text.TextComponent;
import org.enginehub.piston.CommandManager;
import org.enginehub.piston.CommandParameters;
import org.enginehub.piston.gen.CommandCallListener;
import org.enginehub.piston.gen.CommandRegistration;

import java.lang.reflect.Method;
import java.util.Collection;

import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;

final class Outer_BasicNestedRegistration implements CommandRegistration<Outer.BasicNested> {
private CommandManager commandManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,15 @@
package eh;


import static org.enginehub.piston.internal.RegistrationUtil.getCommandMethod;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterCall;
import static org.enginehub.piston.internal.RegistrationUtil.listenersAfterThrow;
import static org.enginehub.piston.internal.RegistrationUtil.listenersBeforeCall;
import static org.enginehub.piston.internal.RegistrationUtil.requireOptional;
import static org.enginehub.piston.part.CommandParts.arg;
import static org.enginehub.piston.part.CommandParts.flag;

import com.google.common.collect.ImmutableList;
import java.util.Collection;
import org.enginehub.piston.CommandManager;
import org.enginehub.piston.gen.CommandCallListener;
import org.enginehub.piston.gen.CommandRegistration;
import org.enginehub.piston.gen.EmptySuperClass;
import org.enginehub.piston.gen.EmptySuperInterface;

import java.util.Collection;

final class SuperTypeRegistration extends EmptySuperClass implements CommandRegistration<SuperType>, EmptySuperInterface {
private CommandManager commandManager;

Expand Down
1 change: 0 additions & 1 deletion core/src/test/java/org/enginehub/piston/ConditionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.enginehub.piston;

import org.enginehub.piston.inject.InjectedValueAccess;
import org.junit.jupiter.api.Test;

import static org.enginehub.piston.Command.Condition.FALSE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@

package org.enginehub.piston.impl;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;


import javax.annotation.Nullable;
import java.util.HashSet;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
import java.util.function.Consumer;
import java.util.stream.Collectors;

import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -68,6 +52,21 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nullable;
import java.util.HashSet;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
import java.util.function.Consumer;
import java.util.stream.Collectors;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;

class CommandParser {

private static final Logger LOGGER = LoggerFactory.getLogger(CommandParser.class);
Expand Down

0 comments on commit 380f275

Please sign in to comment.