Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public static Object unwrapOptional(@Nullable Object obj) {
* @return whether the element has been found in the given array
*/
public static boolean containsElement(@Nullable Object[] array, Object element) {
if (array == null) {
if (isEmpty(array)) {
return false;
}
for (Object arrayEle : array) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,11 @@ public static boolean hasLength(@Nullable String str) {
*/
@Contract("null -> false")
public static boolean hasText(@Nullable CharSequence str) {
if (str == null) {
return false;
}

int strLen = str.length();
if (strLen == 0) {
if (isEmpty(str)) {
return false;
}

for (int i = 0; i < strLen; i++) {
for (int i = 0; i < str.length(); i++) {
if (!Character.isWhitespace(str.charAt(i))) {
return true;
}
Expand Down
Loading