From d4e1c02bd8fa57a62110d8e6dfedda2a9512c988 Mon Sep 17 00:00:00 2001 From: Sebastian Reddig Date: Thu, 31 Oct 2024 19:23:32 +0100 Subject: [PATCH] refactor: Making inner classes static --- .../core/specialevents/SpecialEventsPredictionManager.java | 2 +- src/main/java/module/ifa/FlagLabel.java | 2 +- src/main/java/module/ifa/IfaOverviewDialog.java | 6 +++--- src/main/java/module/ifa/table/SummaryTableSorter.java | 2 +- .../java/module/lineup/penalties/PenaltyTakersView.java | 2 +- .../module/lineup/substitution/SubstitutionOverview.java | 2 +- src/main/java/module/lineup/substitution/WhenTextField.java | 4 ++-- src/main/java/module/specialEvents/FilterPanel.java | 2 +- src/main/java/module/teamAnalyzer/ui/RecapTableSorter.java | 2 +- src/main/java/module/training/ui/TrainingPanel.java | 2 +- src/main/java/module/tsforecast/Curve.java | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/core/specialevents/SpecialEventsPredictionManager.java b/src/main/java/core/specialevents/SpecialEventsPredictionManager.java index d1a5f79c8..4fa8ddc8d 100644 --- a/src/main/java/core/specialevents/SpecialEventsPredictionManager.java +++ b/src/main/java/core/specialevents/SpecialEventsPredictionManager.java @@ -27,7 +27,7 @@ public class SpecialEventsPredictionManager { private final HashMap playerInLineup = new HashMap<>(); private final HashMap opponentPlayerInLineup = new HashMap<>(); - public class Analyse { + public static class Analyse { private List specialEventsPredictions; private Lineup lineup; private Lineup opponentLineup; diff --git a/src/main/java/module/ifa/FlagLabel.java b/src/main/java/module/ifa/FlagLabel.java index a0bfbb2d8..205aa494e 100644 --- a/src/main/java/module/ifa/FlagLabel.java +++ b/src/main/java/module/ifa/FlagLabel.java @@ -73,7 +73,7 @@ protected void paintComponent(Graphics g) { super.paintComponent(g); } - private class TransparentFilter extends RGBImageFilter { + private static class TransparentFilter extends RGBImageFilter { private int percent; public TransparentFilter(int percent) { diff --git a/src/main/java/module/ifa/IfaOverviewDialog.java b/src/main/java/module/ifa/IfaOverviewDialog.java index 4c506aba8..cdf30d9a2 100644 --- a/src/main/java/module/ifa/IfaOverviewDialog.java +++ b/src/main/java/module/ifa/IfaOverviewDialog.java @@ -191,13 +191,13 @@ public Object getValueAt(int rowIndex, int columnIndex) { } } - private class Entry { + private static class Entry { Country country; WorldDetailLeague league; double coolness; } - private class CountryTableCellRenderer extends DefaultTableCellRenderer { + private static class CountryTableCellRenderer extends DefaultTableCellRenderer { private static final long serialVersionUID = -5212837673330509051L; @@ -213,7 +213,7 @@ public Component getTableCellRendererComponent(JTable table, Object value, } } - private class BooleanTableCellRenderer extends DefaultTableCellRenderer { + private static class BooleanTableCellRenderer extends DefaultTableCellRenderer { private static final long serialVersionUID = -5648974651813645856L; diff --git a/src/main/java/module/ifa/table/SummaryTableSorter.java b/src/main/java/module/ifa/table/SummaryTableSorter.java index 678dac9dc..8b5c70b3f 100644 --- a/src/main/java/module/ifa/table/SummaryTableSorter.java +++ b/src/main/java/module/ifa/table/SummaryTableSorter.java @@ -74,7 +74,7 @@ public Integer getIdentifier(int row) { } } - class TableCellValue { + static class TableCellValue { public int row; public int column; public Object value; diff --git a/src/main/java/module/lineup/penalties/PenaltyTakersView.java b/src/main/java/module/lineup/penalties/PenaltyTakersView.java index 2f89aeb03..a0cf45702 100644 --- a/src/main/java/module/lineup/penalties/PenaltyTakersView.java +++ b/src/main/java/module/lineup/penalties/PenaltyTakersView.java @@ -656,7 +656,7 @@ public Component getTableCellRendererComponent(JTable table, Object value, } } - private class SkillRenderer extends DoubleRenderer { + private static class SkillRenderer extends DoubleRenderer { @Serial private static final long serialVersionUID = 3943598594307257068L; diff --git a/src/main/java/module/lineup/substitution/SubstitutionOverview.java b/src/main/java/module/lineup/substitution/SubstitutionOverview.java index e6a1d3bd5..689a735a2 100644 --- a/src/main/java/module/lineup/substitution/SubstitutionOverview.java +++ b/src/main/java/module/lineup/substitution/SubstitutionOverview.java @@ -510,7 +510,7 @@ public TableRow getRow(int rowIndex) { /* * This class is a simple container for row data. */ - private class TableRow { + private static class TableRow { private Substitution sub; private Problem problem; diff --git a/src/main/java/module/lineup/substitution/WhenTextField.java b/src/main/java/module/lineup/substitution/WhenTextField.java index dc6044c91..d4a3e8c3e 100644 --- a/src/main/java/module/lineup/substitution/WhenTextField.java +++ b/src/main/java/module/lineup/substitution/WhenTextField.java @@ -103,7 +103,7 @@ public String valueToString(Object obj) throws ParseException { } - private class EditFormatter extends JFormattedTextField.AbstractFormatter { + private static class EditFormatter extends JFormattedTextField.AbstractFormatter { private static final long serialVersionUID = 4814824765566252119L; private DocumentFilter filter = new Filter(); @@ -123,7 +123,7 @@ protected DocumentFilter getDocumentFilter() { return this.filter; } - private class Filter extends DocumentFilter { + private static class Filter extends DocumentFilter { @Override public void replace(FilterBypass fb, int offset, int length, String text, AttributeSet attrs) diff --git a/src/main/java/module/specialEvents/FilterPanel.java b/src/main/java/module/specialEvents/FilterPanel.java index 5b0371dee..0fa496239 100644 --- a/src/main/java/module/specialEvents/FilterPanel.java +++ b/src/main/java/module/specialEvents/FilterPanel.java @@ -527,7 +527,7 @@ public Component getListCellRendererComponent(JList list, Object value, int inde } } - private class PlayerCBItem extends CBItem { + private static class PlayerCBItem extends CBItem { private int speciality = -1; diff --git a/src/main/java/module/teamAnalyzer/ui/RecapTableSorter.java b/src/main/java/module/teamAnalyzer/ui/RecapTableSorter.java index d1295da0a..29aff8d64 100644 --- a/src/main/java/module/teamAnalyzer/ui/RecapTableSorter.java +++ b/src/main/java/module/teamAnalyzer/ui/RecapTableSorter.java @@ -17,7 +17,7 @@ public class RecapTableSorter extends AbstractTableSorter { //~ Instance fields ---------------------------------------------------------------------------- - protected final class NaturalNumericComparator implements + protected static final class NaturalNumericComparator implements Comparator { @Override public int compare(String o1, String o2) { diff --git a/src/main/java/module/training/ui/TrainingPanel.java b/src/main/java/module/training/ui/TrainingPanel.java index c893423e3..4d7213cea 100644 --- a/src/main/java/module/training/ui/TrainingPanel.java +++ b/src/main/java/module/training/ui/TrainingPanel.java @@ -292,7 +292,7 @@ public String getToolTipText(MouseEvent e) { /** * JTable class for past and future trainings table */ - private class TrainingTable extends JTable { + private static class TrainingTable extends JTable { public TrainingTable(TableModel arg0) { super(arg0); diff --git a/src/main/java/module/tsforecast/Curve.java b/src/main/java/module/tsforecast/Curve.java index 098bf8dbe..66eca98d5 100644 --- a/src/main/java/module/tsforecast/Curve.java +++ b/src/main/java/module/tsforecast/Curve.java @@ -55,7 +55,7 @@ class Curve { private Point m_currentPoint = null; private Color m_Color = null; - class Point implements Comparable { + static class Point implements Comparable { double m_dSpirit; int m_iAttitude;