diff options
author | chill <chill.gtnh@outlook.com> | 2023-05-28 11:22:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-28 11:22:18 +0200 |
commit | fecc8533c5d52cf9bee137687fdda280dab2e39a (patch) | |
tree | f52544f5ef7196c4b4230d53ccd8eb7eac1b9597 /src/main/java/gregtech/api/util | |
parent | 0f97af86a57831c358089b361ce9fc9c6ece12f7 (diff) | |
download | GT5-Unofficial-fecc8533c5d52cf9bee137687fdda280dab2e39a.tar.gz GT5-Unofficial-fecc8533c5d52cf9bee137687fdda280dab2e39a.tar.bz2 GT5-Unofficial-fecc8533c5d52cf9bee137687fdda280dab2e39a.zip |
make private fields final where possible (#2028)
Diffstat (limited to 'src/main/java/gregtech/api/util')
4 files changed, 10 insertions, 6 deletions
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<GT_ItemStack, GT_Recipe_AssemblyLine> sRecipeCacheByOutput = new HashMap<>(); + private static final HashMap<GT_ItemStack, GT_Recipe_AssemblyLine> sRecipeCacheByOutput = new HashMap<>(); /** * A cache of Recipes using the Recipe Hash String as Key. */ - private static HashMap<String, GT_Recipe_AssemblyLine> sRecipeCacheByRecipeHash = new HashMap<>(); + private static final HashMap<String, GT_Recipe_AssemblyLine> 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<GT_Recipe> { 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<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> recipeEmitter = this::defaultBuildRecipe; private Function<? super GT_Recipe, ? extends GT_Recipe> specialHandler; |