Skip to content

Commit dd01555

Browse files
deepsource-autofix[bot]jshiell
authored andcommitted
refactor: use the declaring class to access fields in child class
Non-private static members of the parent class are accessible by child classes. However, it is a bad practice to do so, because it obscures where a value was actually declared. Always use only the declaring class to access static members.
1 parent f66df8b commit dd01555

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/org/infernus/idea/checkstyle/toolwindow/CheckStyleToolWindowPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ private JPanel createToolPanel() {
162162
resultsTree.setCellRenderer(new ResultTreeRenderer());
163163

164164
progressLabel = new JLabel(" ");
165-
progressBar = new JProgressBar(JProgressBar.HORIZONTAL);
165+
progressBar = new JProgressBar(SwingConstants.HORIZONTAL);
166166
progressBar.setMinimum(0);
167167
final Dimension progressBarSize = new Dimension(100, progressBar.getPreferredSize().height);
168168
progressBar.setMinimumSize(progressBarSize);
169169
progressBar.setPreferredSize(progressBarSize);
170170
progressBar.setMaximumSize(progressBarSize);
171171

172-
progressPanel = new JToolBar(JToolBar.HORIZONTAL);
172+
progressPanel = new JToolBar(SwingConstants.HORIZONTAL);
173173
progressPanel.add(Box.createHorizontalStrut(4));
174174
progressPanel.add(new JLabel(message("plugin.toolwindow.override")));
175175
progressPanel.add(Box.createHorizontalStrut(4));

src/main/java/org/infernus/idea/checkstyle/ui/PropertiesPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private void initialise() {
6060
propertiesTable.getTableHeader().setReorderingAllowed(false);
6161

6262
final JScrollPane propertiesScrollPane = new JBScrollPane(propertiesTable,
63-
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
63+
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
6464
add(propertiesScrollPane, BorderLayout.CENTER);
6565
}
6666

0 commit comments

Comments
 (0)