Skip to content
Merged
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 @@ -3,6 +3,7 @@

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.collections4.CollectionUtils;

/**
Expand Down Expand Up @@ -55,11 +56,12 @@ public Selectable jsonPath(String jsonPath) {

@Override
public String get() {
if (CollectionUtils.isNotEmpty(all())) {
return all().get(0);
} else {
return null;
}
List<String> sourceTexts = all();
if (CollectionUtils.isNotEmpty(sourceTexts)) {
return sourceTexts.get(0);
}
return null;

}

@Override
Expand Down Expand Up @@ -91,8 +93,9 @@ public Selectable replace(String regex, String replacement) {
}

public String getFirstSourceText() {
if (getSourceTexts() != null && getSourceTexts().size() > 0) {
return getSourceTexts().get(0);
List<String> sourceTexts = getSourceTexts();
if (CollectionUtils.isNotEmpty(sourceTexts)) {
return sourceTexts.get(0);
}
return null;
}
Expand All @@ -104,6 +107,6 @@ public String toString() {

@Override
public boolean match() {
return getSourceTexts() != null && getSourceTexts().size() > 0;
return CollectionUtils.isNotEmpty(getSourceTexts());
}
}