Apply and enforce import ordering rules

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2019-04-23 14:33:57 +10:00
parent c240b58f66
commit e9ae9842f0
230 changed files with 321 additions and 548 deletions

View File

@@ -1,9 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class ArtTest {

View File

@@ -2,12 +2,12 @@ package org.bukkit;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -15,9 +15,6 @@ import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
@RunWith(Parameterized.class)
public class BukkitMirrorTest {

View File

@@ -1,9 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class ChatColorTest {

View File

@@ -1,12 +1,10 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.bukkit.util.ChatPaginator;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertThat;
public class ChatPaginatorTest {
@Test
public void testWordWrap1() {

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class CoalTypeTest {

View File

@@ -2,7 +2,6 @@ package org.bukkit;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import org.bukkit.configuration.file.YamlConfiguration;
import org.junit.Test;

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class CropStateTest {

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class DifficultyTest {

View File

@@ -1,11 +1,9 @@
package org.bukkit;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.material.Colorable;
import org.bukkit.material.Dye;
import org.bukkit.material.Wool;

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class EffectTest {

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class EntityEffectTest {

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class GameModeTest {

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class GrassSpeciesTest {

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class InstrumentTest {

View File

@@ -2,10 +2,9 @@ package org.bukkit;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import com.google.common.collect.ImmutableList;
import java.util.List;
import java.util.Random;
import org.bukkit.util.Vector;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -13,8 +12,6 @@ import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import com.google.common.collect.ImmutableList;
@RunWith(Parameterized.class)
public class LocationTest {
private static final double delta = 1.0 / 1000000;

View File

@@ -2,7 +2,6 @@ package org.bukkit;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import org.bukkit.material.MaterialData;
import org.junit.Test;

View File

@@ -1,19 +1,10 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Collection;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import com.google.common.collect.Lists;
import java.util.Collection;
import org.junit.Test;
public class NoteTest {
@Test

View File

@@ -1,17 +1,15 @@
package org.bukkit;
import com.google.common.collect.ImmutableMap;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Map;
import java.util.logging.Logger;
import org.bukkit.command.SimpleCommandMap;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.SimplePluginManager;
import com.google.common.collect.ImmutableMap;
public final class TestServer implements InvocationHandler {
private static interface MethodHandler {
Object handle(TestServer server, Object[] args);

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class TreeSpeciesTest {

View File

@@ -1,8 +1,7 @@
package org.bukkit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
public class WorldTypeTest {

View File

@@ -1,15 +1,15 @@
package org.bukkit.configuration;
import org.bukkit.Material;
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;
import org.junit.Test;
import static org.junit.Assert.*;
public abstract class ConfigurationSectionTest {
public abstract ConfigurationSection getConfigurationSection();

View File

@@ -1,14 +1,14 @@
package org.bukkit.configuration;
import java.util.LinkedHashMap;
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import org.bukkit.util.Vector;
import org.junit.Test;
import static org.junit.Assert.*;
public abstract class ConfigurationTest {
public abstract Configuration getConfig();

View File

@@ -1,5 +1,6 @@
package org.bukkit.configuration.file;
import static org.junit.Assert.*;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
@@ -8,7 +9,6 @@ import org.bukkit.configuration.MemoryConfigurationTest;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import static org.junit.Assert.*;
public abstract class FileConfigurationTest extends MemoryConfigurationTest {
@Rule

View File

@@ -1,7 +1,7 @@
package org.bukkit.configuration.file;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Test;
public class YamlConfigurationTest extends FileConfigurationTest {

View File

@@ -1,10 +1,9 @@
package org.bukkit.conversations;
import org.junit.Test;
import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
/**
*/

View File

@@ -1,8 +1,8 @@
package org.bukkit.conversations;
import static org.junit.Assert.*;
import org.bukkit.plugin.TestPlugin;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*/

View File

@@ -1,13 +1,12 @@
package org.bukkit.conversations;
import java.util.Set;
import org.bukkit.Server;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
import java.util.Set;
/**
*/
public class FakeConversable implements Conversable {

View File

@@ -1,8 +1,7 @@
package org.bukkit.conversations;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Test;
/**
*/

View File

@@ -1,14 +1,12 @@
package org.bukkit.event;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import com.google.common.collect.ImmutableList;
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
import org.bukkit.plugin.messaging.TestPlayer;
import org.junit.Test;
import com.google.common.collect.ImmutableList;
public class PlayerChatTabCompleteEventTest {
@Test

View File

@@ -1,15 +1,14 @@
package org.bukkit.materials;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import org.bukkit.CropState;
import org.bukkit.Material;
import org.bukkit.NetherWartsState;
import org.bukkit.TreeSpecies;
import org.bukkit.block.BlockFace;
import org.bukkit.material.Crops;
import org.bukkit.material.Comparator;
import org.bukkit.material.Crops;
import org.bukkit.material.Diode;
import org.bukkit.material.Door;
import org.bukkit.material.Hopper;

View File

@@ -1,8 +1,6 @@
package org.bukkit.metadata;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.*;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.TestPlugin;
import org.junit.Test;

View File

@@ -1,12 +1,10 @@
package org.bukkit.metadata;
import static org.junit.Assert.*;
import java.util.concurrent.Callable;
import org.bukkit.plugin.TestPlugin;
import org.junit.Test;
import java.util.concurrent.Callable;
import static org.junit.Assert.*;
public class LazyMetadataValueTest {
private LazyMetadataValue subject;
private TestPlugin plugin = new TestPlugin("x");

View File

@@ -15,12 +15,11 @@
package org.bukkit.metadata;
import static org.junit.Assert.*;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.TestPlugin;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
*/
public class MetadataConversionTest {

View File

@@ -1,12 +1,8 @@
package org.bukkit.metadata;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
import java.util.List;
import java.util.concurrent.Callable;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.TestPlugin;
import org.junit.Test;

View File

@@ -1,7 +1,6 @@
package org.bukkit.metadata;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.*;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.TestPlugin;
import org.junit.Test;

View File

@@ -2,12 +2,10 @@ package org.bukkit.plugin;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import org.bukkit.TestServer;
import org.bukkit.event.Event;
import org.bukkit.event.TestEvent;
import org.bukkit.permissions.Permission;
import org.junit.After;
import org.junit.Test;

View File

@@ -3,7 +3,6 @@ package org.bukkit.plugin;
import java.io.File;
import java.io.InputStream;
import java.util.List;
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

View File

@@ -2,7 +2,6 @@ package org.bukkit.plugin;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import org.bukkit.event.Event;
import org.bukkit.event.EventException;
import org.bukkit.event.EventPriority;

View File

@@ -1,12 +1,12 @@
package org.bukkit.plugin.messaging;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.util.Collection;
import org.bukkit.entity.Player;
import org.bukkit.plugin.TestPlugin;
import java.util.Collection;
import org.junit.Test;
import org.junit.Assert;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.junit.Test;
public class StandardMessengerTest {
public StandardMessenger getMessenger() {

View File

@@ -1,7 +1,7 @@
package org.bukkit.plugin.messaging;
import org.bukkit.entity.Player;
import static org.junit.Assert.*;
import org.bukkit.entity.Player;
public class TestMessageListener implements PluginMessageListener {
private final String channel;

View File

@@ -5,7 +5,6 @@ import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import org.bukkit.entity.Player;

View File

@@ -2,9 +2,7 @@ package org.bukkit.util;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.util.Map;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.junit.Test;

View File

@@ -2,17 +2,14 @@ package org.bukkit.util;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import com.google.common.collect.ImmutableList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import com.google.common.collect.ImmutableList;
@RunWith(Parameterized.class)
public class StringUtilStartsWithTest {

View File

@@ -2,15 +2,12 @@ package org.bukkit.util;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import com.google.common.collect.ImmutableList;
public class StringUtilTest {
@Test(expected=NullPointerException.class)

View File

@@ -1,8 +1,8 @@
package org.bukkit.util;
import static org.junit.Assert.*;
import org.bukkit.block.BlockFace;
import org.junit.Test;
import static org.junit.Assert.*;
public class VectorTest {

View File

@@ -2,14 +2,13 @@ package org.bukkit.util.io;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import com.google.common.collect.ImmutableList;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.FireworkEffect.Type;
@@ -23,8 +22,6 @@ import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;
import com.google.common.collect.ImmutableList;
@RunWith(Parameterized.class)
public class BukkitObjectStreamTest {