mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Checking String for emptiness with .lenght() is preferable since 1.6
This commit is contained in:
parent
ad7d3c8078
commit
04973ea5aa
4 changed files with 5 additions and 5 deletions
|
@ -636,7 +636,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
List<RowFilter<Object, Object>> ignoreListFilterList = new ArrayList<>();
|
||||
String serverAddress = SessionHandler.getSession().getServerHostname().orElseGet(() -> "");
|
||||
final Set<String> ignoreListCopy = IgnoreList.ignoreList(serverAddress);
|
||||
if (ignoreListCopy.size() > 0) {
|
||||
if (!ignoreListCopy.isEmpty()) {
|
||||
ignoreListFilterList.add(new RowFilter<Object, Object>() {
|
||||
@Override
|
||||
public boolean include(Entry<? extends Object, ? extends Object> entry) {
|
||||
|
|
|
@ -36,7 +36,7 @@ public final class IgnoreList {
|
|||
}
|
||||
|
||||
public static String ignore(String serverAddress, String user) {
|
||||
if (user == null || user.length() == 0) {
|
||||
if (user == null || user.isEmpty()) {
|
||||
return ignoreListString(serverAddress);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ public final class IgnoreList {
|
|||
}
|
||||
|
||||
public static String unignore(String serverAddress, String user) {
|
||||
if (user == null || user.length() == 0) {
|
||||
if (user == null || user.isEmpty()) {
|
||||
return usage();
|
||||
}
|
||||
if (MagePreferences.removeIgnoredUser(serverAddress, user)) {
|
||||
|
|
|
@ -143,7 +143,7 @@ public class ArrowBuilder {
|
|||
if (map.containsKey(gameId)) {
|
||||
Map<Type, List<Arrow>> innerMap = map.get(gameId);
|
||||
java.util.List<Arrow> arrows = innerMap.get(type);
|
||||
if (arrows != null && arrows.size() > 0) {
|
||||
if (arrows != null && !arrows.isEmpty()) {
|
||||
JPanel p = getArrowsPanel(gameId);
|
||||
synchronized (map) {
|
||||
for (Arrow arrow : arrows) {
|
||||
|
|
|
@ -67,7 +67,7 @@ public class CanadianHighlander extends Constructed {
|
|||
valid = false;
|
||||
}
|
||||
|
||||
if (deck.getSideboard().size() > 0) {
|
||||
if (!deck.getSideboard().isEmpty()) {
|
||||
invalid.put("Deck", "Sideboard can't contain any cards: has " + (deck.getSideboard().size()) + " cards");
|
||||
valid = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue