Begin implementation of CheckStyle style checking

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-04-23 14:00:30 +10:00
parent a0f2b74c8d
commit 7afe4d02f8
28 changed files with 144 additions and 97 deletions

View File

@@ -68,7 +68,7 @@ public class CraftProfileBanList implements org.bukkit.BanList {
@Override
public Set<org.bukkit.BanEntry> getBanEntries() {
ImmutableSet.Builder<org.bukkit.BanEntry> builder = ImmutableSet.builder();
for (JsonListEntry entry : list.getValues()) {
GameProfile profile = (GameProfile) entry.getKey();
builder.add(new CraftProfileBanEntry(profile, (GameProfileBanEntry) entry, list));

View File

@@ -1327,7 +1327,7 @@ public final class CraftServer implements Server {
for (JsonListEntry entry : playerList.getProfileBans().getValues()) {
result.add(getOfflinePlayer((GameProfile) entry.getKey()));
}
}
return result;
}

View File

@@ -45,14 +45,14 @@ public class CraftWorldBorder implements WorldBorder {
if (time > 0L) {
this.handle.transitionSizeBetween(this.handle.getSize(), newSize, time * 1000L);
} else {
this.handle.setSize(newSize);
this.handle.setSize(newSize);
}
}
@Override
public Location getCenter() {
double x = this.handle.getCenterX();
double z = this.handle.getCenterZ();
double x = this.handle.getCenterX();
double z = this.handle.getCenterZ();
return new Location(this.world, x, 0, z);
}
@@ -63,7 +63,7 @@ public class CraftWorldBorder implements WorldBorder {
x = Math.min(3.0E7D, Math.max(-3.0E7D, x));
z = Math.min(3.0E7D, Math.max(-3.0E7D, z));
this.handle.setCenter(x, z);
this.handle.setCenter(x, z);
}
@Override
@@ -108,7 +108,7 @@ public class CraftWorldBorder implements WorldBorder {
@Override
public void setWarningDistance(int distance) {
this.handle.setWarningDistance(distance);
this.handle.setWarningDistance(distance);
}
@Override

View File

@@ -273,4 +273,4 @@ public class CraftBlockState implements BlockState {
throw new IllegalStateException("The blockState must be placed to call this method");
}
}
}
}

View File

@@ -1,7 +1,6 @@
package org.bukkit.craftbukkit.block.data;
import org.bukkit.block.data.Waterlogged;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
public abstract class CraftWaterlogged extends CraftBlockData implements Waterlogged {

View File

@@ -61,11 +61,11 @@ public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderD
public void setPhase(Phase phase) {
getHandle().getDragonControllerManager().setControllerPhase(getMinecraftPhase(phase));
}
public static Phase getBukkitPhase(DragonControllerPhase phase) {
return Phase.values()[phase.b()];
}
public static DragonControllerPhase getMinecraftPhase(Phase phase) {
return DragonControllerPhase.getById(phase.ordinal());
}

View File

@@ -31,7 +31,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
@Override
public Type getRabbitType() {
int type = getHandle().getRabbitType();
int type = getHandle().getRabbitType();
return CraftMagicMapping.fromMagic(type);
}
@@ -46,7 +46,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
entity.initializePathFinderGoals();
}
entity.setRabbitType(CraftMagicMapping.toMagic(type));
entity.setRabbitType(CraftMagicMapping.toMagic(type));
}
private static class CraftMagicMapping {

View File

@@ -208,7 +208,7 @@ public class CraftContainer extends Container {
break;
case SMOKER:
delegate = new ContainerSmoker(windowId, bottom, top, new ContainerProperties(4));
break;
break;
case LOOM:
delegate = new ContainerLoom(windowId, bottom);
break;

View File

@@ -31,7 +31,7 @@ class CraftMetaCharge extends CraftMetaItem implements FireworkEffectMeta {
setEffect(SerializableMeta.getObject(FireworkEffect.class, map, EXPLOSION.BUKKIT, true));
}
CraftMetaCharge(NBTTagCompound tag) {
super(tag);

View File

@@ -102,7 +102,7 @@ class CraftMetaMap extends CraftMetaItem implements MapMeta {
if (hasMapId()){
tag.setInt(MAP_ID.NBT, getMapId());
}
if (hasScaling()) {
tag.setBoolean(MAP_SCALING.NBT, isScaling());
}

View File

@@ -61,4 +61,4 @@ public class InventoryIterator implements ListIterator<ItemStack> {
public void remove() {
throw new UnsupportedOperationException("Can't change the size of an inventory!");
}
}
}

View File

@@ -305,7 +305,7 @@ public class CraftScheduler implements BukkitScheduler {
return false;
}
if (task.isSync()) {
return (task == currentTask);
return (task == currentTask);
}
final CraftAsyncTask asyncTask = (CraftAsyncTask) task;
synchronized (asyncTask.getWorkers()) {

View File

@@ -11,8 +11,8 @@ import org.fusesource.jansi.Ansi;
import org.fusesource.jansi.Ansi.Erase;
public class TerminalConsoleWriterThread extends Thread {
final private ConsoleReader reader;
final private OutputStream output;
private final ConsoleReader reader;
private final OutputStream output;
public TerminalConsoleWriterThread(OutputStream output, ConsoleReader reader) {
this.output = output;

View File

@@ -60,19 +60,19 @@ public class ChunkDataTest extends AbstractTestingBase {
testSetRegion(data, 0, 0, 0, 0, 0, 0, RED_WOOL); // minimum == maximum
testSetRegion(data, 0, 0, 0, 16, 16, 16, RED_WOOL); // Whole Chunk Section
data.setRegion(0, 0, 0, 16, 256, 16, AIR);
testSetRegion(data, 0, 8, 0, 16, 24, 16, RED_WOOL); // Start middle of this section, end middle of next
testSetRegion(data, 0, 8, 0, 16, 24, 16, RED_WOOL); // Start middle of this section, end middle of next
data.setRegion(0, 0, 0, 16, 256, 16, AIR);
testSetRegion(data, 0, 4, 0, 16, 12, 16, RED_WOOL); // Start in this section, end in this section
data.setRegion(0, 0, 0, 16, 256, 16, AIR);
testSetRegion(data, 0, 0, 0, 16, 16, 1, RED_WOOL); // Whole Chunk Section
data.setRegion(0, 0, 0, 16, 256, 16, AIR);
testSetRegion(data, 0, 8, 0, 16, 24, 1, RED_WOOL); // Start middle of this section, end middle of next
testSetRegion(data, 0, 8, 0, 16, 24, 1, RED_WOOL); // Start middle of this section, end middle of next
data.setRegion(0, 0, 0, 16, 256, 16, AIR);
testSetRegion(data, 0, 4, 0, 16, 12, 1, RED_WOOL); // Start in this section, end in this section
data.setRegion(0, 0, 0, 16, 256, 16, AIR);
testSetRegion(data, 0, 0, 0, 1, 16, 1, RED_WOOL); // Whole Chunk Section
data.setRegion(0, 0, 0, 16, 256, 16, AIR);
testSetRegion(data, 0, 8, 0, 1, 24, 1, RED_WOOL); // Start middle of this section, end middle of next
testSetRegion(data, 0, 8, 0, 1, 24, 1, RED_WOOL); // Start middle of this section, end middle of next
data.setRegion(0, 0, 0, 16, 256, 16, AIR);
testSetRegion(data, 0, 4, 0, 1, 12, 1, RED_WOOL); // Start in this section, end in this section
data.setRegion(0, 0, 0, 16, 256, 16, AIR);

View File

@@ -26,7 +26,7 @@ public class ItemStackLoreEnchantmentTest extends ItemStackTest {
return CompoundOperator.compound(
Joiner.on('+'),
NAME_PARAMETER,
~0l,
~0L,
Arrays.asList(
new Object[] {
new Operator() {

View File

@@ -36,7 +36,7 @@ import com.google.common.collect.ImmutableList;
@RunWith(Parameterized.class)
public class ItemStackTest extends AbstractTestingBase {
static abstract class StackProvider {
abstract static class StackProvider {
final Material material;
StackProvider(Material material) {

View File

@@ -17,7 +17,7 @@ public class EnderDragonPhaseTest {
assertNotNull(phase.name(), CraftEnderDragon.getBukkitPhase(dragonControllerPhase));
}
}
@Test
public void testBukkitToMinecraft() {
Assert.assertEquals("CIRCLING", CraftEnderDragon.getMinecraftPhase(EnderDragon.Phase.CIRCLING), DragonControllerPhase.HOLDING_PATTERN);
@@ -46,5 +46,5 @@ public class EnderDragonPhaseTest {
Assert.assertEquals("CHARGE_PLAYER", CraftEnderDragon.getBukkitPhase(DragonControllerPhase.CHARGING_PLAYER), EnderDragon.Phase.CHARGE_PLAYER);
Assert.assertEquals("DYING", CraftEnderDragon.getBukkitPhase(DragonControllerPhase.DYING), EnderDragon.Phase.DYING);
Assert.assertEquals("HOVER", CraftEnderDragon.getBukkitPhase(DragonControllerPhase.HOVER), EnderDragon.Phase.HOVER);
}
}
}