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=0fe124ed0ad9abc36b8a7abfc7f86bd950f8f249;hp=be054249aaf971fe2e28aecf97a6f170dae1b199;hb=179e7da4d8d8a474d0b622d60b5f5d32d6ab4052;hpb=76ed638264e531a26e35647d13702db865a52321 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 be05424..0fe124e 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–2015 David Roden + * Sone - AbstractPostReplyBuilder.java - Copyright © 2013–2019 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"); }