Replace magic constant occurrences with proper constants. #1555

Fixes MagicConstant violations.

 Description:
> Report occurrences where usages of "magic" constants only are allowed but other expressions are used instead. E.g. new Font("Arial", 2 ) // not allowed instead of new Font("Arial", Font. ITALIC ) // OK   Please see org.intellij.lang.annotations.MagicConstant annotation description for details.
This commit is contained in:
Michal Kordas 2015-08-07 01:03:22 +02:00 committed by Roman Ivanov
parent 70c83141b4
commit e5ec819a74
1 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import java.awt.EventQueue;
import java.io.File;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
@ -47,7 +48,7 @@ public class Main {
final File file = new File(args[0]);
panel.openFile(file, frame);
}
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
final Runnable runner = new FrameShower(frame);
EventQueue.invokeLater(runner);
@ -63,7 +64,7 @@ public class Main {
frame.getContentPane().add(panel);
panel.openAst(ast, frame);
frame.setSize(1500, 800);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setVisible(true);
}