refactor: adjust specific Nullable annotations used (#3869)

This commit is contained in:
Jordan 2022-12-02 12:39:38 +00:00 committed by GitHub
parent 3a8fae47a0
commit f3bc504a6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 20 deletions

View File

@ -33,7 +33,6 @@ import org.bukkit.Chunk;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;
import java.util.Random; import java.util.Random;
@ -51,7 +50,7 @@ final class LegacyBlockStatePopulator extends BlockPopulator {
} }
@Override @Override
public void populate(@NotNull final World world, @NotNull final Random random, @NotNull final Chunk source) { public void populate(@NonNull final World world, @NonNull final Random random, @NonNull final Chunk source) {
int chunkMinX = source.getX() << 4; int chunkMinX = source.getX() << 4;
int chunkMinZ = source.getZ() << 4; int chunkMinZ = source.getZ() << 4;
PlotArea area = Location.at(world.getName(), chunkMinX, 0, chunkMinZ).getPlotArea(); PlotArea area = Location.at(world.getName(), chunkMinX, 0, chunkMinZ).getPlotArea();

View File

@ -36,8 +36,7 @@ import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull; import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.Nullable;
import java.util.Set; import java.util.Set;
@ -46,10 +45,7 @@ public class FaweRegionManager extends BukkitRegionManager {
private final FaweDelegateRegionManager delegate = new FaweDelegateRegionManager(); private final FaweDelegateRegionManager delegate = new FaweDelegateRegionManager();
@Inject @Inject
public FaweRegionManager( public FaweRegionManager(WorldUtil worldUtil, GlobalBlockQueue blockQueue, ProgressSubscriberFactory subscriberFactory) {
@NonNull WorldUtil worldUtil, @NonNull GlobalBlockQueue blockQueue, @NonNull
ProgressSubscriberFactory subscriberFactory
) {
super(worldUtil, blockQueue, subscriberFactory); super(worldUtil, blockQueue, subscriberFactory);
} }
@ -76,9 +72,9 @@ public class FaweRegionManager extends BukkitRegionManager {
@Override @Override
public boolean handleClear( public boolean handleClear(
@NotNull Plot plot, @NonNull Plot plot,
@Nullable Runnable whenDone, @Nullable Runnable whenDone,
@NotNull PlotManager manager, @NonNull PlotManager manager,
final @Nullable PlotPlayer<?> player final @Nullable PlotPlayer<?> player
) { ) {
if (!Settings.FAWE_Components.CLEAR || !(manager instanceof HybridPlotManager)) { if (!Settings.FAWE_Components.CLEAR || !(manager instanceof HybridPlotManager)) {

View File

@ -29,7 +29,7 @@ import com.plotsquared.core.util.SchematicHandler;
import com.plotsquared.core.util.WorldUtil; import com.plotsquared.core.util.WorldUtil;
import com.plotsquared.core.util.task.RunnableVal; import com.plotsquared.core.util.task.RunnableVal;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import org.jetbrains.annotations.NotNull; import org.checkerframework.checker.nullness.qual.NonNull;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
@ -40,7 +40,7 @@ public class FaweSchematicHandler extends SchematicHandler {
private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler(); private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler();
@Inject @Inject
public FaweSchematicHandler(@NotNull WorldUtil worldUtil, @NotNull ProgressSubscriberFactory subscriberFactory) { public FaweSchematicHandler(WorldUtil worldUtil, ProgressSubscriberFactory subscriberFactory) {
super(worldUtil, subscriberFactory); super(worldUtil, subscriberFactory);
} }
@ -75,7 +75,7 @@ public class FaweSchematicHandler extends SchematicHandler {
} }
@Override @Override
public Schematic getSchematic(@NotNull InputStream is) { public Schematic getSchematic(@NonNull InputStream is) {
return delegate.getSchematic(is); return delegate.getSchematic(is);
} }

View File

@ -21,16 +21,15 @@ package com.plotsquared.core.configuration.caption;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Set; import java.util.Set;
final class ClickStripTransform implements ComponentTransform { final class ClickStripTransform implements ComponentTransform {
private final Set<ClickEvent.@NotNull Action> actionsToStrip; private final Set<ClickEvent.@NonNull Action> actionsToStrip;
public ClickStripTransform(final Set<ClickEvent.@NotNull Action> actionsToStrip) { public ClickStripTransform(final Set<ClickEvent.@NonNull Action> actionsToStrip) {
this.actionsToStrip = EnumSet.copyOf(actionsToStrip); this.actionsToStrip = EnumSet.copyOf(actionsToStrip);
} }

View File

@ -93,10 +93,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
@Inject @Inject
public HybridPlotWorld( public HybridPlotWorld(
@Assisted("world") final String worldName, @Assisted("world") final String worldName,
@Nullable @Assisted("id") final String id, @javax.annotation.Nullable @Assisted("id") final String id,
@Assisted final @NonNull IndependentPlotGenerator generator, @Assisted final @NonNull IndependentPlotGenerator generator,
@Nullable @Assisted("min") final PlotId min, @javax.annotation.Nullable @Assisted("min") final PlotId min,
@Nullable @Assisted("max") final PlotId max, @javax.annotation.Nullable @Assisted("max") final PlotId max,
@WorldConfig final @NonNull YamlConfiguration worldConfiguration, @WorldConfig final @NonNull YamlConfiguration worldConfiguration,
final @NonNull GlobalBlockQueue blockQueue final @NonNull GlobalBlockQueue blockQueue
) { ) {

View File

@ -18,7 +18,8 @@
*/ */
package com.plotsquared.core.plot; package com.plotsquared.core.plot;
import javax.annotation.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Objects; import java.util.Objects;
public class PlotTitle { public class PlotTitle {