mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +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<>();
|
List<RowFilter<Object, Object>> ignoreListFilterList = new ArrayList<>();
|
||||||
String serverAddress = SessionHandler.getSession().getServerHostname().orElseGet(() -> "");
|
String serverAddress = SessionHandler.getSession().getServerHostname().orElseGet(() -> "");
|
||||||
final Set<String> ignoreListCopy = IgnoreList.ignoreList(serverAddress);
|
final Set<String> ignoreListCopy = IgnoreList.ignoreList(serverAddress);
|
||||||
if (ignoreListCopy.size() > 0) {
|
if (!ignoreListCopy.isEmpty()) {
|
||||||
ignoreListFilterList.add(new RowFilter<Object, Object>() {
|
ignoreListFilterList.add(new RowFilter<Object, Object>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean include(Entry<? extends Object, ? extends Object> entry) {
|
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) {
|
public static String ignore(String serverAddress, String user) {
|
||||||
if (user == null || user.length() == 0) {
|
if (user == null || user.isEmpty()) {
|
||||||
return ignoreListString(serverAddress);
|
return ignoreListString(serverAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public final class IgnoreList {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String unignore(String serverAddress, String user) {
|
public static String unignore(String serverAddress, String user) {
|
||||||
if (user == null || user.length() == 0) {
|
if (user == null || user.isEmpty()) {
|
||||||
return usage();
|
return usage();
|
||||||
}
|
}
|
||||||
if (MagePreferences.removeIgnoredUser(serverAddress, user)) {
|
if (MagePreferences.removeIgnoredUser(serverAddress, user)) {
|
||||||
|
|
|
@ -143,7 +143,7 @@ public class ArrowBuilder {
|
||||||
if (map.containsKey(gameId)) {
|
if (map.containsKey(gameId)) {
|
||||||
Map<Type, List<Arrow>> innerMap = map.get(gameId);
|
Map<Type, List<Arrow>> innerMap = map.get(gameId);
|
||||||
java.util.List<Arrow> arrows = innerMap.get(type);
|
java.util.List<Arrow> arrows = innerMap.get(type);
|
||||||
if (arrows != null && arrows.size() > 0) {
|
if (arrows != null && !arrows.isEmpty()) {
|
||||||
JPanel p = getArrowsPanel(gameId);
|
JPanel p = getArrowsPanel(gameId);
|
||||||
synchronized (map) {
|
synchronized (map) {
|
||||||
for (Arrow arrow : arrows) {
|
for (Arrow arrow : arrows) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class CanadianHighlander extends Constructed {
|
||||||
valid = false;
|
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");
|
invalid.put("Deck", "Sideboard can't contain any cards: has " + (deck.getSideboard().size()) + " cards");
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue