Big refactoring

I used Intellij IDEA to automatically refactor code to achive 3 goals.
1) get rid of anonymouse classes, and replace the with lamba to get more readeable and clean code (like in TableWaitingDialog).
2) make effectively final  variables actually final to avoid inadvertent changes on it in further releases and keep objects as immutable, as possible.
3)  Get rid of unused imports (most of the changes) in whole project classes.
This commit is contained in:
vraskulin 2017-01-09 19:16:47 +03:00
parent a9f2c8c407
commit 076840df53
247 changed files with 1919 additions and 3682 deletions

View file

@ -28,7 +28,6 @@
package mage.client.dialog;
import mage.client.MageFrame;
import mage.client.SessionHandler;
import org.apache.log4j.Logger;
@ -43,7 +42,7 @@ public class FeedbackDialog extends javax.swing.JDialog {
private static final Logger log = Logger.getLogger(PreferencesDialog.class);
private String[] feedbackTypes = {"", "Bug or \"something doesn't work\"",
private final String[] feedbackTypes = {"", "Bug or \"something doesn't work\"",
"Feature or \"I need that function\"",
"Thank you or \"Devs, you are so cool!\"",
"Question or \"I'm so curious about\""};
@ -186,18 +185,10 @@ public class FeedbackDialog extends javax.swing.JDialog {
jTabbedPane1.addTab("Give feedback", jPanel6);
sendButton.setText("Send");
sendButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
sendButtonActionPerformed(evt);
}
});
sendButton.addActionListener(evt -> sendButtonActionPerformed(evt));
cancelButton.setText("Cancel");
cancelButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelButtonActionPerformed(evt);
}
});
cancelButton.addActionListener(evt -> cancelButtonActionPerformed(evt));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
@ -294,14 +285,12 @@ public class FeedbackDialog extends javax.swing.JDialog {
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
if (!dialog.isVisible()) {
dialog.setLocation(300, 200);
dialog.setVisible(true);
} else {
dialog.requestFocus();
}
java.awt.EventQueue.invokeLater(() -> {
if (!dialog.isVisible()) {
dialog.setLocation(300, 200);
dialog.setVisible(true);
} else {
dialog.requestFocus();
}
});
}