X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2Fimpl%2FAbstractPostReplyBuilder.java;h=8dffdcd8b9ea8b0a86afd4112abcd11427ce84c4;hb=refs%2Ftags%2Fv81;hp=be054249aaf971fe2e28aecf97a6f170dae1b199;hpb=1e9a08c2b73b16dc178437eb8c8025aaa083fcca;p=Sone.git
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..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â2015 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");
}