From d86d81ef21f8fc5a80ad00ca3217da227e8b62df Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 28 Jun 2014 19:13:46 -0700 Subject: [PATCH] Switch Style to Preconditions. --- .../java/com/sk89q/worldedit/util/formatting/Style.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/util/formatting/Style.java b/src/main/java/com/sk89q/worldedit/util/formatting/Style.java index 80774b743..3eafd3c8d 100644 --- a/src/main/java/com/sk89q/worldedit/util/formatting/Style.java +++ b/src/main/java/com/sk89q/worldedit/util/formatting/Style.java @@ -20,11 +20,13 @@ package com.sk89q.worldedit.util.formatting; import com.google.common.collect.Maps; -import org.apache.commons.lang.Validate; import java.util.Map; import java.util.regex.Pattern; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + /** * All supported color values for chat. * @@ -194,8 +196,8 @@ public enum Style { * @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist */ public static Style getByChar(String code) { - Validate.notNull(code, "Code cannot be null"); - Validate.isTrue(code.length() > 0, "Code must have at least one char"); + checkNotNull(code); + checkArgument(!code.isEmpty(), "Code must have at least one character"); return BY_CHAR.get(code.charAt(0)); }