Cleanup - .equals("") -> .isEmpty()

This commit is contained in:
Jetz
2024-08-10 12:28:18 -04:00
parent 9bbe4805a3
commit 0ee46ff6ef
35 changed files with 51 additions and 51 deletions

View File

@@ -185,14 +185,14 @@ public class ImageCache {
}
if (altState)
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.BACKFACE_POSTFIX.length());
if (!specColor.equals(""))
if (!specColor.isEmpty())
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.SPECFACE_W.length());
if (imageKey.startsWith(ImageKeys.CARD_PREFIX)) {
ipc = ImageUtil.getPaperCardFromImageKey(imageKey);
if (ipc != null) {
if (altState) {
imageKey = ipc.getCardAltImageKey();
} else if (!specColor.equals("")) {
} else if (!specColor.isEmpty()) {
switch (specColor) {
case "white":
imageKey = ipc.getCardWSpecImageKey();

View File

@@ -518,7 +518,7 @@ public class DeckImport<TModel extends DeckBase> extends FDialog {
// we set it to the current one (if any) or set a new one.
// In this way, if this deck will replace the current one, the name will be kept the same!
if (!deck.hasName()){
if (currentDeckName.equals(""))
if (currentDeckName.isEmpty())
deck.setName(Localizer.getInstance().getMessage("lblNewDeckName"));
else
deck.setName(currentDeckName);

View File

@@ -102,7 +102,7 @@ public class DeckController<T extends DeckBase> {
newModel();
isStored = false;
} else
isStored = !this.modelPath.equals("");
isStored = !this.modelPath.isEmpty();
} else {
CardPool catalogClone = new CardPool(view.getInitialCatalog());
deck = pickFromCatalog(deck, catalogClone);

View File

@@ -94,7 +94,7 @@ public final class FImageUtil {
PaperCard card = ImageUtil.getPaperCardFromImageKey(key);
if (altState) {
imageKey = card.getCardAltImageKey();
} else if (!specColor.equals("")) {
} else if (!specColor.isEmpty()) {
switch (specColor) {
case "white":
imageKey = card.getCardWSpecImageKey();
@@ -119,7 +119,7 @@ public final class FImageUtil {
if(altState) {
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.BACKFACE_POSTFIX.length());
imageKey += "full.jpg";
} else if (!specColor.equals("")) {
} else if (!specColor.isEmpty()) {
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.SPECFACE_W.length());
imageKey += "full.jpg";
}