diff --git a/build-logic/verification/src/main/kotlin/build-logic.errorprone.gradle.kts b/build-logic/verification/src/main/kotlin/build-logic.errorprone.gradle.kts index afd29e2c22d..294627b31d9 100644 --- a/build-logic/verification/src/main/kotlin/build-logic.errorprone.gradle.kts +++ b/build-logic/verification/src/main/kotlin/build-logic.errorprone.gradle.kts @@ -58,6 +58,7 @@ if (buildParameters.enableErrorprone) { // "FieldCanBeFinal", "ForEachIterable", "FieldCanBeFinal", + "FieldCanBeStatic", "MethodCanBeStatic", ) disable( diff --git a/src/components/src/main/java/org/apache/jmeter/modifiers/gui/UserParametersGui.java b/src/components/src/main/java/org/apache/jmeter/modifiers/gui/UserParametersGui.java index b5ee9680099..63a535e03c6 100644 --- a/src/components/src/main/java/org/apache/jmeter/modifiers/gui/UserParametersGui.java +++ b/src/components/src/main/java/org/apache/jmeter/modifiers/gui/UserParametersGui.java @@ -71,7 +71,7 @@ public class UserParametersGui extends AbstractPreProcessorGui { private PowerTableModel tableModel; - private final int numUserColumns = 1; + private static final int numUserColumns = 1; private JButton addParameterButton; private JButton addUserButton; diff --git a/src/components/src/main/java/org/apache/jmeter/visualizers/StatGraphVisualizer.java b/src/components/src/main/java/org/apache/jmeter/visualizers/StatGraphVisualizer.java index c4efaa66dd5..1d909eba6b9 100644 --- a/src/components/src/main/java/org/apache/jmeter/visualizers/StatGraphVisualizer.java +++ b/src/components/src/main/java/org/apache/jmeter/visualizers/StatGraphVisualizer.java @@ -206,9 +206,9 @@ public class StatGraphVisualizer extends AbstractVisualizer implements Clearable private boolean saveGraphToFile = false; - private final int defaultWidth = 400; + private static final int defaultWidth = 400; - private final int defaultHeight = 300; + private static final int defaultHeight = 300; private final JComboBox columnsList = new JComboBox<>(getLabels(GRAPH_COLUMNS, getGraphColumnsMsgParameters())); @@ -253,7 +253,7 @@ public class StatGraphVisualizer extends AbstractVisualizer implements Clearable // Default checked private final JCheckBox valueLabelsVertical = new JCheckBox(JMeterUtils.getResString("aggregate_graph_value_labels_vertical"), true); // $NON-NLS-1$ - private final Color colorBarGraph = Color.YELLOW; + private final static Color colorBarGraph = Color.YELLOW; private Color colorForeGraph = Color.BLACK; diff --git a/src/core/src/main/java/org/apache/jmeter/samplers/SampleSaveConfiguration.java b/src/core/src/main/java/org/apache/jmeter/samplers/SampleSaveConfiguration.java index 66f5ba613f9..b43278448fd 100644 --- a/src/core/src/main/java/org/apache/jmeter/samplers/SampleSaveConfiguration.java +++ b/src/core/src/main/java/org/apache/jmeter/samplers/SampleSaveConfiguration.java @@ -464,6 +464,8 @@ public class SampleSaveConfiguration implements Cloneable, Serializable { private boolean idleTime = IDLE_TIME; // Does not appear to be used (yet) + // it is + @SuppressWarnings("FieldCanBeStatic") private final int assertionsResultsToSave = ASSERTIONS_RESULT_TO_SAVE; // Don't save this, as it is derived from the time format diff --git a/src/functions/src/main/java/org/apache/jmeter/functions/RandomDate.java b/src/functions/src/main/java/org/apache/jmeter/functions/RandomDate.java index ea35ea83bd9..83243d76f4e 100644 --- a/src/functions/src/main/java/org/apache/jmeter/functions/RandomDate.java +++ b/src/functions/src/main/java/org/apache/jmeter/functions/RandomDate.java @@ -75,7 +75,7 @@ public class RandomDate extends AbstractFunction { // Ensure that these are set, even if no parameters are provided private Locale locale = JMeterUtils.getLocale(); // $NON-NLS-1$ - private final ZoneId systemDefaultZoneID = ZoneId.systemDefault(); // $NON-NLS-1$ + private static final ZoneId systemDefaultZoneID = ZoneId.systemDefault(); // $NON-NLS-1$ private CompoundVariable[] values; private static final class LocaleFormatObject { diff --git a/src/functions/src/main/java/org/apache/jmeter/functions/TimeShift.java b/src/functions/src/main/java/org/apache/jmeter/functions/TimeShift.java index 5b79ba5115e..131d360daea 100644 --- a/src/functions/src/main/java/org/apache/jmeter/functions/TimeShift.java +++ b/src/functions/src/main/java/org/apache/jmeter/functions/TimeShift.java @@ -80,7 +80,7 @@ public class TimeShift extends AbstractFunction { private CompoundVariable amountToShiftCompound; // $NON-NLS-1$ private Locale locale = JMeterUtils.getLocale(); // $NON-NLS-1$ private String variableName = ""; //$NON-NLS-1$ - private final ZoneId systemDefaultZoneID = ZoneId.systemDefault(); + private static final ZoneId systemDefaultZoneID = ZoneId.systemDefault(); private static final class LocaleFormatObject {