From e5ec819a74d1cb02e36559c50e8c8bcbbef012fc Mon Sep 17 00:00:00 2001 From: Michal Kordas Date: Fri, 7 Aug 2015 01:03:22 +0200 Subject: [PATCH] Replace magic constant occurrences with proper constants. #1555 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/main/java/com/puppycrawl/tools/checkstyle/gui/Main.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/gui/Main.java b/src/main/java/com/puppycrawl/tools/checkstyle/gui/Main.java index 5d2cc923c..6e960de58 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/gui/Main.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/gui/Main.java @@ -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); }