mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
replace [list].size() == 0 and [string].length() == 0 to use .isEmpty() instead
This commit is contained in:
parent
3612332607
commit
3128bd2b4b
48 changed files with 90 additions and 109 deletions
|
|
@ -85,7 +85,7 @@ public class DraftGrid extends javax.swing.JPanel implements MouseListener {
|
|||
}
|
||||
|
||||
public void loadBooster(CardsView booster, BigCard bigCard) {
|
||||
if (booster instanceof CardsView && booster.size() == 0) {
|
||||
if (booster instanceof CardsView && booster.isEmpty()) {
|
||||
emptyGrid = true;
|
||||
} else {
|
||||
if (!emptyGrid) {
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public class ChoiceDialog extends IDialogPanel {
|
|||
}
|
||||
|
||||
private void displayCards(CardsView cards, UUID gameId, BigCard bigCard) {
|
||||
if (cards.size() == 0) {
|
||||
if (cards.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public class StackDialog extends IDialogPanel {
|
|||
|
||||
private void displayStack(CardsView cards, UUID gameId, BigCard bigCard) {
|
||||
|
||||
if (cards == null || cards.size() == 0) {
|
||||
if (cards == null || cards.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ public class ResetPasswordDialog extends MageDialog {
|
|||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void btnGetAuthTokenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGetAuthTokenActionPerformed
|
||||
if (this.txtEmail.getText().length() == 0) {
|
||||
if (this.txtEmail.getText().isEmpty()) {
|
||||
MageFrame.getInstance().showError("Please enter an email address.");
|
||||
return;
|
||||
}
|
||||
|
|
@ -275,15 +275,15 @@ public class ResetPasswordDialog extends MageDialog {
|
|||
}//GEN-LAST:event_btnGetAuthTokenActionPerformed
|
||||
|
||||
private void btnSubmitNewPasswordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSubmitNewPasswordActionPerformed
|
||||
if (this.txtEmail.getText().length() == 0) {
|
||||
if (this.txtEmail.getText().isEmpty()) {
|
||||
MageFrame.getInstance().showError("Please enter an email address.");
|
||||
return;
|
||||
}
|
||||
if (this.txtAuthToken.getText().length() == 0) {
|
||||
if (this.txtAuthToken.getText().isEmpty()) {
|
||||
MageFrame.getInstance().showError("Please enter an auth token.");
|
||||
return;
|
||||
}
|
||||
if (this.txtPassword.getText().length() == 0) {
|
||||
if (this.txtPassword.getText().isEmpty()) {
|
||||
MageFrame.getInstance().showError("Please enter a new password.");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public class TournamentPlayerPanel extends javax.swing.JPanel {
|
|||
private void cbPlayerTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbPlayerTypeActionPerformed
|
||||
if (!this.cbPlayerType.getSelectedItem().equals("Human")) {
|
||||
this.pnlPlayerName.setVisible(true);
|
||||
if (this.txtPlayerName.getText().length() == 0) {
|
||||
if (this.txtPlayerName.getText().isEmpty()) {
|
||||
this.txtPlayerName.setText("Computer " + this.lblPlayerNum.getText());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ public class GlowText extends JLabel {
|
|||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
if (getText().length() == 0) {
|
||||
if (getText().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ public class ManaSymbols {
|
|||
loadSymbolsImages(symbolWidth);
|
||||
}
|
||||
Map<String, BufferedImage> sizedSymbols = manaImages.get(symbolWidth);
|
||||
if (manaCost.length() == 0) {
|
||||
if (manaCost.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
manaCost = manaCost.replace("\\", "");
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
ArrayList<CardDownloadData> cards = getNeededCards(allCards);
|
||||
|
||||
/*
|
||||
* if (cards == null || cards.size() == 0) {
|
||||
* if (cards == null || cards.isEmpty()) {
|
||||
* JOptionPane.showMessageDialog(null,
|
||||
* "All card pictures have been downloaded."); return; }
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue