From fecc8533c5d52cf9bee137687fdda280dab2e39a Mon Sep 17 00:00:00 2001 From: chill Date: Sun, 28 May 2023 11:22:18 +0200 Subject: make private fields final where possible (#2028) --- src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java | 4 ++-- src/main/java/gregtech/api/util/GT_BaseCrop.java | 4 ++-- src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java | 2 +- src/main/java/gregtech/api/util/GT_Recipe.java | 6 +++++- 4 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/api/util') diff --git a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java index a1af512b82..077964cb69 100644 --- a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java +++ b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java @@ -28,11 +28,11 @@ public class GT_AssemblyLineUtils { /** * A cache of Recipes using the Output as Key. */ - private static HashMap sRecipeCacheByOutput = new HashMap<>(); + private static final HashMap sRecipeCacheByOutput = new HashMap<>(); /** * A cache of Recipes using the Recipe Hash String as Key. */ - private static HashMap sRecipeCacheByRecipeHash = new HashMap<>(); + private static final HashMap sRecipeCacheByRecipeHash = new HashMap<>(); /** * Checks the DataStick for deprecated/invalid recipes, updating them as required. diff --git a/src/main/java/gregtech/api/util/GT_BaseCrop.java b/src/main/java/gregtech/api/util/GT_BaseCrop.java index 912a966e35..456ba50ff1 100644 --- a/src/main/java/gregtech/api/util/GT_BaseCrop.java +++ b/src/main/java/gregtech/api/util/GT_BaseCrop.java @@ -36,8 +36,8 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { private int mMaxSize = 0; private int mAfterHarvestSize = 0; private int mHarvestSize = 0; - private int[] mStats = new int[5]; - private int mGrowthSpeed = 0; + private final int[] mStats = new int[5]; + private final int mGrowthSpeed = 0; private ItemStack mDrop = null; private ItemStack[] mSpecialDrops = null; private Materials mBlock = null; diff --git a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java index d6b41e69b0..f47a356d7b 100644 --- a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java +++ b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java @@ -4,7 +4,7 @@ public class GT_ItsNotMyFaultException extends RuntimeException { private static final long serialVersionUID = -8752778866486460495L; - private String mError; + private final String mError; public GT_ItsNotMyFaultException(String aError) { mError = aError; diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 4aa6d68a0a..2b7f0ec5b9 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -3160,7 +3160,11 @@ public class GT_Recipe implements Comparable { private int neiTextColorOverride = -1; private INEISpecialInfoFormatter neiSpecialInfoFormatter; - private boolean checkForCollision = true, allowNoInput, allowNoInputFluid, allowNoOutput, allowNoOutputFluid; + private final boolean checkForCollision = true; + private boolean allowNoInput; + private boolean allowNoInputFluid; + private boolean allowNoOutput; + private boolean allowNoOutputFluid; private boolean disableOptimize = false; private Function> recipeEmitter = this::defaultBuildRecipe; private Function specialHandler; -- cgit