X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2Fimpl%2FAbstractPostReplyBuilder.java;h=8dffdcd8b9ea8b0a86afd4112abcd11427ce84c4;hp=10bdf766a5a86fe610b7d58e991a75c8340687a3;hb=438378deab1514f0f608d975ef65f5b7aea44ccb;hpb=3d6cffe82270a1faacf1f0d39c34b11ab316e0db diff --git a/src/main/java/net/pterodactylus/sone/data/impl/AbstractPostReplyBuilder.java b/src/main/java/net/pterodactylus/sone/data/impl/AbstractPostReplyBuilder.java index 10bdf76..8dffdcd 100644 --- a/src/main/java/net/pterodactylus/sone/data/impl/AbstractPostReplyBuilder.java +++ b/src/main/java/net/pterodactylus/sone/data/impl/AbstractPostReplyBuilder.java @@ -1,5 +1,5 @@ /* - * Sone - AbstractPostReplyBuilder.java - Copyright © 2013–2016 David Roden + * Sone - AbstractPostReplyBuilder.java - Copyright © 2013–2020 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,16 +19,12 @@ package net.pterodactylus.sone.data.impl; import static com.google.common.base.Preconditions.checkState; -import org.apache.commons.lang.StringUtils; - import net.pterodactylus.sone.database.PostReplyBuilder; /** * Abstract {@link PostReplyBuilder} implementation. It stores the state of the * new post and performs validation, implementations only need to implement * {@link #build()}. - * - * @author David ‘Bombe’ Roden */ public abstract class AbstractPostReplyBuilder extends AbstractReplyBuilder implements PostReplyBuilder { @@ -58,7 +54,7 @@ public abstract class AbstractPostReplyBuilder extends AbstractReplyBuilder= 0)), "either current time or custom time must be set"); - checkState(!StringUtils.isBlank(text), "text must not be empty"); + checkState((text != null) && !text.trim().isEmpty(), "text must not be empty"); checkState(postId != null, "post must not be null"); }