Skip to content

Commit bb3fdcc

Browse files
committed
Renamed InvalidFlagFormat to InvalidFlagFormatException
1 parent 8d5953a commit bb3fdcc

26 files changed

+79
-52
lines changed

worldguard-core/src/main/java/com/sk89q/worldguard/commands/CommandInputContext.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import com.sk89q.worldedit.extension.platform.Actor;
2323
import com.sk89q.worldguard.LocalPlayer;
24-
import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
2524

2625
import javax.annotation.Nullable;
2726
import java.util.Map;

worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionCommands.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
import com.sk89q.worldguard.protection.flags.Flag;
6060
import com.sk89q.worldguard.protection.flags.FlagContext;
6161
import com.sk89q.worldguard.protection.flags.Flags;
62-
import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
62+
import com.sk89q.worldguard.protection.flags.InvalidFlagFormatException;
6363
import com.sk89q.worldguard.protection.flags.RegionGroup;
6464
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
6565
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
@@ -587,7 +587,7 @@ public void flag(CommandContext args, Actor sender) throws CommandException {
587587
// the [value] part throws an error.
588588
try {
589589
groupValue = groupFlag.parseInput(FlagContext.create().setSender(sender).setInput(group).setObject("region", existing).build());
590-
} catch (InvalidFlagFormat e) {
590+
} catch (InvalidFlagFormatException e) {
591591
throw new CommandException(e.getMessage());
592592
}
593593

@@ -598,7 +598,7 @@ public void flag(CommandContext args, Actor sender) throws CommandException {
598598
// Set the flag if [value] was given even if [-g group] was given as well
599599
try {
600600
value = setFlag(existing, foundFlag, sender, value).toString();
601-
} catch (InvalidFlagFormat e) {
601+
} catch (InvalidFlagFormatException e) {
602602
throw new CommandException(e.getMessage());
603603
}
604604

worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionCommandsBase.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,11 @@
4141
import com.sk89q.worldedit.world.World;
4242
import com.sk89q.worldguard.LocalPlayer;
4343
import com.sk89q.worldguard.WorldGuard;
44-
import com.sk89q.worldguard.domains.CustomDomain;
45-
import com.sk89q.worldguard.domains.DefaultDomain;
46-
import com.sk89q.worldguard.domains.registry.CustomDomainContext;
47-
import com.sk89q.worldguard.domains.registry.InvalidDomainFormat;
4844
import com.sk89q.worldguard.internal.permission.RegionPermissionModel;
4945
import com.sk89q.worldguard.protection.ApplicableRegionSet;
5046
import com.sk89q.worldguard.protection.flags.Flag;
5147
import com.sk89q.worldguard.protection.flags.FlagContext;
52-
import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
48+
import com.sk89q.worldguard.protection.flags.InvalidFlagFormatException;
5349
import com.sk89q.worldguard.protection.managers.RegionManager;
5450
import com.sk89q.worldguard.protection.regions.GlobalProtectedRegion;
5551
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
@@ -419,9 +415,9 @@ protected static void setPlayerSelection(Actor actor, ProtectedRegion region, Wo
419415
* @param flag the flag
420416
* @param sender the sender
421417
* @param value the value
422-
* @throws InvalidFlagFormat thrown if the value is invalid
418+
* @throws InvalidFlagFormatException thrown if the value is invalid
423419
*/
424-
protected static <V> V setFlag(ProtectedRegion region, Flag<V> flag, Actor sender, String value) throws InvalidFlagFormat {
420+
protected static <V> V setFlag(ProtectedRegion region, Flag<V> flag, Actor sender, String value) throws InvalidFlagFormatException {
425421
V val = flag.parseInput(FlagContext.create().setSender(sender).setInput(value).setObject("region", region).build());
426422
region.setFlag(flag, val);
427423
return val;

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/BooleanFlag.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public BooleanFlag(String name) {
3333
}
3434

3535
@Override
36-
public Boolean parseInput(FlagContext context) throws InvalidFlagFormat {
36+
public Boolean parseInput(FlagContext context) throws InvalidFlagFormatException {
3737
String input = context.getUserInput();
3838

3939
if (input.equalsIgnoreCase("true") || input.equalsIgnoreCase("yes")
@@ -45,7 +45,7 @@ public Boolean parseInput(FlagContext context) throws InvalidFlagFormat {
4545
|| input.equalsIgnoreCase("0")) {
4646
return false;
4747
} else {
48-
throw new InvalidFlagFormat("Not a yes/no value: " + input);
48+
throw new InvalidFlagFormatException("Not a yes/no value: " + input);
4949
}
5050
}
5151

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/CommandStringFlag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public CommandStringFlag(String name) {
3333
}
3434

3535
@Override
36-
public String parseInput(FlagContext context) throws InvalidFlagFormat {
36+
public String parseInput(FlagContext context) throws InvalidFlagFormatException {
3737
String input = context.getUserInput();
3838
input = input.trim();
3939
if (!input.startsWith("/")) {

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/DoubleFlag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public DoubleFlag(String name) {
3333
}
3434

3535
@Override
36-
public Double parseInput(FlagContext context) throws InvalidFlagFormat {
36+
public Double parseInput(FlagContext context) throws InvalidFlagFormatException {
3737
return context.getUserInputAsDouble();
3838
}
3939

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/EntityTypeFlag.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ protected EntityTypeFlag(String name) {
4040
}
4141

4242
@Override
43-
public EntityType parseInput(FlagContext context) throws InvalidFlagFormat {
43+
public EntityType parseInput(FlagContext context) throws InvalidFlagFormatException {
4444
String input = context.getUserInput();
4545
input = input.trim();
4646
EntityType entityType = unmarshal(input);
4747
if (entityType == null) {
48-
throw new InvalidFlagFormat("Unknown entity type: " + input);
48+
throw new InvalidFlagFormatException("Unknown entity type: " + input);
4949
}
5050
return entityType;
5151
}

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/EnumFlag.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ public T detectValue(String input) {
7474
}
7575

7676
@Override
77-
public T parseInput(FlagContext context) throws InvalidFlagFormat {
77+
public T parseInput(FlagContext context) throws InvalidFlagFormatException {
7878
String input = context.getUserInput();
7979
try {
8080
return findValue(input);
8181
} catch (IllegalArgumentException e) {
82-
throw new InvalidFlagFormat("Unknown value '" + input + "' in "
82+
throw new InvalidFlagFormatException("Unknown value '" + input + "' in "
8383
+ enumClass.getName());
8484
}
8585
}

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/Flag.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ public final RegionGroupFlag getRegionGroupFlag() {
181181
*
182182
* @param context the {@link FlagContext}
183183
* @return The coerced type
184-
* @throws InvalidFlagFormat Raised if the input is invalid
184+
* @throws InvalidFlagFormatException Raised if the input is invalid
185185
*/
186-
public abstract T parseInput(FlagContext context) throws InvalidFlagFormat;
186+
public abstract T parseInput(FlagContext context) throws InvalidFlagFormatException;
187187

188188
/**
189189
* Convert a raw type that was loaded (from a YAML file, for example)

worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/FlagContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import javax.annotation.Nullable;
2828
import java.util.Map;
2929

30-
public final class FlagContext extends CommandInputContext<InvalidFlagFormat> {
30+
public final class FlagContext extends CommandInputContext<InvalidFlagFormatException> {
3131

3232
private FlagContext(Actor sender, String input, Map<String, Object> values) {
3333
super(sender, input, values);
@@ -59,8 +59,8 @@ public FlagContext copyWith(@Nullable Actor commandSender, @Nullable String s, @
5959
}
6060

6161
@Override
62-
protected InvalidFlagFormat createException(String str) {
63-
return new InvalidFlagFormat(str);
62+
protected InvalidFlagFormatException createException(String str) {
63+
return new InvalidFlagFormatException(str);
6464
}
6565

6666
public static class FlagContextBuilder {

0 commit comments

Comments
 (0)