diff options
| author | Draknyte1 <Draknyte1@hotmail.com> | 2017-03-04 12:58:47 +1000 |
|---|---|---|
| committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-03-04 12:58:47 +1000 |
| commit | ae21012d216df71f31aed6fbc9d76215fc24ceed (patch) | |
| tree | cc89accbe6ce5c04b72ed3c5e46b2a185f88be6a /src/Java/gtPlusPlus/core/util | |
| parent | ba89972a22a316030f8c3bd99974f915b1d7aefc (diff) | |
| download | GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.gz GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.bz2 GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.zip | |
+ New texture for the slow builders ring.
+ Added the Alkalus Disk.
$ Fixed Frame Box Assembler Recipes.
$ Fixed Missing 7Li material.
$ Fixed Tiered Tanks not showing their capacity in the tooltip.
$ Fixed tooltips for alloys containing Bronze or Steel.
$ Fixed Clay Pipe Extruder Recipes.
- Removed a handful of Plasma cells for misc. materials.
% Changed the Industrial Coke Oven's tooltip, to better describe the input/output requirements.
% Cleaned up The Entire Project.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
37 files changed, 2556 insertions, 2406 deletions
diff --git a/src/Java/gtPlusPlus/core/util/BaseHandler.java b/src/Java/gtPlusPlus/core/util/BaseHandler.java index 63f22f3763..9457dc363f 100644 --- a/src/Java/gtPlusPlus/core/util/BaseHandler.java +++ b/src/Java/gtPlusPlus/core/util/BaseHandler.java @@ -3,9 +3,9 @@ package gtPlusPlus.core.util; public abstract class BaseHandler { public abstract void preInit(); - + public abstract void init(); - + public abstract void postInit(); - + } diff --git a/src/Java/gtPlusPlus/core/util/ClassUtils.java b/src/Java/gtPlusPlus/core/util/ClassUtils.java index dfd8ec898b..20ca894211 100644 --- a/src/Java/gtPlusPlus/core/util/ClassUtils.java +++ b/src/Java/gtPlusPlus/core/util/ClassUtils.java @@ -10,31 +10,31 @@ public class ClassUtils { // There is therefore no more risk of code throwing NoClassDefFoundException. executeCodeLinkingToDependency(); }*/ - public static boolean isPresent(String className) { + public static boolean isPresent(final String className) { try { Class.forName(className); return true; - } catch (Throwable ex) { + } catch (final Throwable ex) { // Class or one of its dependencies is not present... return false; } } - public static Method getMethodViaReflection(Class<?> lookupClass, String methodName, boolean invoke) throws Exception{ - Class<? extends Class> lookup = lookupClass.getClass(); - Method m = lookup.getDeclaredMethod(methodName); - m.setAccessible(true);// Abracadabra + public static Method getMethodViaReflection(final Class<?> lookupClass, final String methodName, final boolean invoke) throws Exception{ + final Class<? extends Class> lookup = lookupClass.getClass(); + final Method m = lookup.getDeclaredMethod(methodName); + m.setAccessible(true);// Abracadabra if (invoke){ m.invoke(lookup);// now its OK } return m; } - public static Class getNonPublicClass(String className){ + public static Class getNonPublicClass(final String className){ Class<?> c = null; try { c = Class.forName(className); - } catch (ClassNotFoundException e) { + } catch (final ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -59,7 +59,7 @@ public class ClassUtils { constructor.setAccessible(true);//ABRACADABRA! try { - Object o = constructor.newInstance(); + final Object o = constructor.newInstance(); return (Class) o; } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { diff --git a/src/Java/gtPlusPlus/core/util/Log.java b/src/Java/gtPlusPlus/core/util/Log.java index ea7076e453..aa0231b954 100644 --- a/src/Java/gtPlusPlus/core/util/Log.java +++ b/src/Java/gtPlusPlus/core/util/Log.java @@ -5,25 +5,25 @@ import org.apache.logging.log4j.Logger; public final class Log { - public static final Logger LOGGER = LogManager.getLogger("MiscUtils"); - - public static void warn(String msg) - { - LOGGER.warn(msg); - } - - public static void error(String msg) - { - LOGGER.error(msg); - } - - public static void info(String msg) - { - LOGGER.info(msg); - } - - public static void debug(String msg) - { - LOGGER.debug(msg); - } + public static final Logger LOGGER = LogManager.getLogger("MiscUtils"); + + public static void warn(final String msg) + { + LOGGER.warn(msg); + } + + public static void error(final String msg) + { + LOGGER.error(msg); + } + + public static void info(final String msg) + { + LOGGER.info(msg); + } + + public static void debug(final String msg) + { + LOGGER.debug(msg); + } } diff --git a/src/Java/gtPlusPlus/core/util/LoggingUtils.java b/src/Java/gtPlusPlus/core/util/LoggingUtils.java index 607771bc8e..3e8219d53a 100644 --- a/src/Java/gtPlusPlus/core/util/LoggingUtils.java +++ b/src/Java/gtPlusPlus/core/util/LoggingUtils.java @@ -5,47 +5,47 @@ import java.util.Date; public class LoggingUtils { - public static void profileLog(Object o){ - try { + public static void profileLog(final Object o){ + try { String content; - File file = new File("GregtechTimingsTC.txt"); + final File file = new File("GregtechTimingsTC.txt"); // if file doesnt exists, then create it if (!file.exists()) { file.createNewFile(); - FileWriter fw = new FileWriter(file.getAbsoluteFile(), true); - BufferedWriter bw = new BufferedWriter(fw); + final FileWriter fw = new FileWriter(file.getAbsoluteFile(), true); + final BufferedWriter bw = new BufferedWriter(fw); bw.write("============================================================"); bw.write(System.lineSeparator()); bw.close(); - } + } if (o instanceof String){ content = (String) o; - } - else { - content = o.toString(); - } - FileWriter fw = new FileWriter(file.getAbsoluteFile(), true); - BufferedWriter bw = new BufferedWriter(fw); + } + else { + content = o.toString(); + } + final FileWriter fw = new FileWriter(file.getAbsoluteFile(), true); + final BufferedWriter bw = new BufferedWriter(fw); bw.write(content); bw.write(System.lineSeparator()); bw.close(); System.out.println("Data Logged."); - } catch (IOException e) { + } catch (final IOException e) { System.out.println("Data logging failed."); } - } - - public static boolean logCurrentSystemTime(String message){ - Date date = new Date(System.currentTimeMillis()); - try { - profileLog(message+" | "+date.toString()); - return true; - } - catch (Throwable r) { - return false; - } - } - + + public static boolean logCurrentSystemTime(final String message){ + final Date date = new Date(System.currentTimeMillis()); + try { + profileLog(message+" | "+date.toString()); + return true; + } + catch (final Throwable r) { + return false; + } + + } + } diff --git a/src/Java/gtPlusPlus/core/util/Quality.java b/src/Java/gtPlusPlus/core/util/Quality.java index 1ce29c7a58..b866b2e28b 100644 --- a/src/Java/gtPlusPlus/core/util/Quality.java +++ b/src/Java/gtPlusPlus/core/util/Quality.java @@ -4,13 +4,13 @@ import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.util.EnumChatFormatting; public enum Quality { - + // Magic Blue // Rare Yellow // Set Green // Unique Gold/Purple // Trade-off Brown - + POOR("Poor", EnumChatFormatting.GRAY), COMMON("Common", EnumChatFormatting.WHITE), UNCOMMON("Uncommon", EnumChatFormatting.DARK_GREEN), @@ -31,27 +31,28 @@ public enum Quality { } public String getQuality() { - return LOOT; + return this.LOOT; } - + protected EnumChatFormatting getColour(){ - return COLOUR; + return this.COLOUR; } - + public String formatted(){ return this.COLOUR+this.LOOT; } - + public static Quality getRandomQuality(){ - int lootChance = MathUtils.randInt(0, 100); + final int lootChance = MathUtils.randInt(0, 100); if (lootChance <= 10){return Quality.POOR;} else if (lootChance <= 45){return Quality.COMMON;} else if (lootChance <= 65){return Quality.UNCOMMON;} else if (lootChance <= 82){return Quality.MAGIC;} else if (lootChance <= 92){return Quality.EPIC;} else if (lootChance <= 97){return Quality.RARE;} - else if (lootChance <= 99){return Quality.ARTIFACT;} - else return null; + else if (lootChance <= 99){return Quality.ARTIFACT;} else { + return null; + } } } diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java index db8ed87231..72441660d2 100644 --- a/src/Java/gtPlusPlus/core/util/Utils.java +++ b/src/Java/gtPlusPlus/core/util/Utils.java @@ -1,6 +1,16 @@ package gtPlusPlus.core.util; -import gregtech.api.enums.*; +import java.awt.Color; +import java.awt.Graphics; +import java.lang.reflect.Method; +import java.util.*; + +import org.apache.commons.lang3.EnumUtils; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import gregtech.api.enums.Materials; +import gregtech.api.enums.TC_Aspects; import gregtech.api.enums.TC_Aspects.TC_AspectStack; import gtPlusPlus.GTplusplus; import gtPlusPlus.core.lib.CORE; @@ -12,14 +22,7 @@ import gtPlusPlus.core.util.math.MathUtils; import ic2.core.Ic2Items; import ic2.core.init.InternalName; import ic2.core.item.resources.ItemCell; - -import java.awt.Color; -import java.awt.Graphics; -import java.lang.reflect.Method; -import java.util.*; - import net.minecraft.block.Block; -import net.minecraft.block.Block.SoundType; import net.minecraft.entity.Entity; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemStack; @@ -31,11 +34,6 @@ import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fluids.*; import net.minecraftforge.oredict.OreDictionary; -import org.apache.commons.lang3.EnumUtils; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.FMLLog; - public class Utils { public static final int WILDCARD_VALUE = Short.MAX_VALUE; @@ -55,27 +53,27 @@ public class Utils { if (CORE.MASTER_VERSION.toLowerCase().equals("offline")){ return false; - } + } if (CORE.MASTER_VERSION.equals(CORE.VERSION.toLowerCase())){ return true; - } + } return false; } - public static TC_AspectStack getTcAspectStack (TC_Aspects aspect, long size){ + public static TC_AspectStack getTcAspectStack (final TC_Aspects aspect, final long size){ return getTcAspectStack(aspect.name(), (int) size); } - public static TC_AspectStack getTcAspectStack (String aspect, long size){ + public static TC_AspectStack getTcAspectStack (final String aspect, final long size){ return getTcAspectStack(aspect, (int) size); } - public static TC_AspectStack getTcAspectStack (TC_Aspects aspect, int size){ + public static TC_AspectStack getTcAspectStack (final TC_Aspects aspect, final int size){ return getTcAspectStack(aspect.name(), size); } - public static TC_AspectStack getTcAspectStack (String aspect, int size){ + public static TC_AspectStack getTcAspectStack (final String aspect, final int size){ TC_AspectStack returnValue = null; @@ -89,13 +87,13 @@ public class Utils { else { Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITO"), size); - } - } catch (NoSuchFieldError r){ + } + } catch (final NoSuchFieldError r){ Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus"); } } else if (aspect.toUpperCase().equals("EXANIMUS")){ - //Adds in Compat for older GT Versions which Misspell aspects. + //Adds in Compat for older GT Versions which Misspell aspects. try { if (EnumUtils.isValidEnum(TC_Aspects.class, "EXANIMUS")){ Utils.LOG_WARNING("TC Aspect found - "+aspect); @@ -104,15 +102,15 @@ public class Utils { else { Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXAMINIS"), size); - } - } catch (NoSuchFieldError r){ + } + } catch (final NoSuchFieldError r){ Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus"); } } else if (aspect.toUpperCase().equals("PRAECANTATIO")){ - //Adds in Compat for older GT Versions which Misspell aspects. + //Adds in Compat for older GT Versions which Misspell aspects. try { if (EnumUtils.isValidEnum(TC_Aspects.class, "PRAECANTATIO")){ Utils.LOG_WARNING("TC Aspect found - "+aspect); @@ -121,10 +119,10 @@ public class Utils { else { Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTIO"), size); - } - } catch (NoSuchFieldError r){ + } + } catch (final NoSuchFieldError r){ Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus"); - } + } } else { Utils.LOG_WARNING("TC Aspect found - "+aspect); @@ -134,11 +132,11 @@ public class Utils { return returnValue; } - public static boolean containsMatch(boolean strict, ItemStack[] inputs, ItemStack... targets) + public static boolean containsMatch(final boolean strict, final ItemStack[] inputs, final ItemStack... targets) { - for (ItemStack input : inputs) + for (final ItemStack input : inputs) { - for (ItemStack target : targets) + for (final ItemStack target : targets) { if (itemMatches(target, input, strict)) { @@ -149,67 +147,67 @@ public class Utils { return false; } - public static boolean itemMatches(ItemStack target, ItemStack input, boolean strict) + public static boolean itemMatches(final ItemStack target, final ItemStack input, final boolean strict) { - if (input == null || target == null) + if ((input == null) || (target == null)) { return false; } - return (target.getItem() == input.getItem() && ((target.getItemDamage() == WILDCARD_VALUE && !strict) || target.getItemDamage() == input.getItemDamage())); + return ((target.getItem() == input.getItem()) && (((target.getItemDamage() == WILDCARD_VALUE) && !strict) || (target.getItemDamage() == input.getItemDamage()))); } - //Non-Dev Comments - public static void LOG_INFO(String s){ + //Non-Dev Comments + public static void LOG_INFO(final String s){ //if (CORE.DEBUG){ FMLLog.info("GT++: "+s); //} } - //Non-Dev Comments - public static void LOG_MACHINE_INFO(String s){ + //Non-Dev Comments + public static void LOG_MACHINE_INFO(final String s){ if (CORE.configSwitches.MACHINE_INFO || ClientProxy.playerName.toLowerCase().contains("draknyte1")){ - FMLLog.info("GT++: Machine Info: "+s); + FMLLog.info("GT++: Machine Info: "+s); } } //Developer Comments - public static void LOG_WARNING(String s){ + public static void LOG_WARNING(final String s){ if (CORE.DEBUG){ FMLLog.warning("GT++: "+s); } } //Errors - public static void LOG_ERROR(String s){ + public static void LOG_ERROR(final String s){ if (CORE.DEBUG){ FMLLog.severe("GT++: "+s); } } //Developer Logger - public static void LOG_SPECIFIC_WARNING(String whatToLog, String msg, int line){ - //if (!CORE.DEBUG){ + public static void LOG_SPECIFIC_WARNING(final String whatToLog, final String msg, final int line){ + //if (!CORE.DEBUG){ FMLLog.warning("GT++ |"+line+"| "+whatToLog+" | "+msg); - //} + //} } - public static void paintBox(Graphics g, int MinA, int MinB, int MaxA, int MaxB){ - g.drawRect (MinA, MinB, MaxA, MaxB); + public static void paintBox(final Graphics g, final int MinA, final int MinB, final int MaxA, final int MaxB){ + g.drawRect (MinA, MinB, MaxA, MaxB); } // Send a message to all players on the server - public static void sendServerMessage(String translationKey) { + public static void sendServerMessage(final String translationKey) { sendServerMessage(new ChatComponentText(translationKey)); } // Send a message to all players on the server - public static void sendServerMessage(IChatComponent chatComponent) { + public static void sendServerMessage(final IChatComponent chatComponent) { MinecraftServer.getServer().getConfigurationManager().sendChatMsg(chatComponent); } /** * Returns if that Liquid is IC2Steam. */ - public static boolean isIC2Steam(FluidStack aFluid) { + public static boolean isIC2Steam(final FluidStack aFluid) { if (aFluid == null) { return false; } @@ -219,7 +217,7 @@ public class Utils { /** * Returns a Liquid Stack with given amount of IC2Steam. */ - public static FluidStack getIC2Steam(long aAmount) { + public static FluidStack getIC2Steam(final long aAmount) { return FluidRegistry.getFluidStack("ic2steam", (int)aAmount); } @@ -231,17 +229,17 @@ public class Utils { 'A',slot_1,'B',slot_2,'C',slot_3, 'D',slot_4,'E',slot_5,'F',slot_6, 'G',slot_7,'H',slot_8,'I',slot_9 - }); + }); }*/ - public static String checkCorrectMiningToolForBlock(Block currentBlock, World currentWorld){ + public static String checkCorrectMiningToolForBlock(final Block currentBlock, final World currentWorld){ String correctTool = ""; - if (!currentWorld.isRemote){ + if (!currentWorld.isRemote){ try { correctTool = currentBlock.getHarvestTool(0); Utils.LOG_WARNING(correctTool); - } catch (NullPointerException e){ + } catch (final NullPointerException e){ } } @@ -250,17 +248,17 @@ public class Utils { } /** - * + * * @param colourStr e.g. "#FFFFFF" * @return String - formatted "rgb(0,0,0)" */ - public static String hex2RgbFormatted(String hexString) { - Color c = new Color( - Integer.valueOf(hexString.substring(1, 3), 16), - Integer.valueOf(hexString.substring(3, 5), 16), + public static String hex2RgbFormatted(final String hexString) { + final Color c = new Color( + Integer.valueOf(hexString.substring(1, 3), 16), + Integer.valueOf(hexString.substring(3, 5), 16), Integer.valueOf(hexString.substring(5, 7), 16)); - StringBuffer sb = new StringBuffer(); + final StringBuffer sb = new StringBuffer(); sb.append("rgb("); sb.append(c.getRed()); sb.append(","); @@ -272,11 +270,11 @@ public class Utils { } /** - * + * * @param colourStr e.g. "#FFFFFF" - * @return + * @return */ - public static Color hex2Rgb(String colorStr) { + public static Color hex2Rgb(final String colorStr) { return new Color( Integer.valueOf( colorStr.substring( 1, 3 ), 16 ), Integer.valueOf( colorStr.substring( 3, 5 ), 16 ), @@ -284,72 +282,72 @@ public class Utils { } /** - * + * * @param colourInt e.g. 0XFFFFFF * @return Colour */ - public static Color hex2Rgb(int colourInt) { + public static Color hex2Rgb(final int colourInt) { return Color.decode(String.valueOf(colourInt)); } /** - * + * * @param colourInt e.g. 0XFFFFFF * @return short[] */ - public static short[] hex2RgbShort(int colourInt) { - Color rgb = Color.decode(String.valueOf(colourInt)); - short[] rgba = {(short) rgb.getRed(), (short) rgb.getGreen(), (short) rgb.getBlue(), (short) rgb.getAlpha()}; + public static short[] hex2RgbShort(final int colourInt) { + final Color rgb = Color.decode(String.valueOf(colourInt)); + final short[] rgba = {(short) rgb.getRed(), (short) rgb.getGreen(), (short) rgb.getBlue(), (short) rgb.getAlpha()}; return rgba; } - public static Timer ShortTimer(int seconds) { + public static Timer ShortTimer(final int seconds) { Timer timer; timer = new Timer(); timer.schedule(new ShortTimerTask(), seconds * 1000); return timer; } - public static String byteToHex(byte b) { - int i = b & 0xFF; + public static String byteToHex(final byte b) { + final int i = b & 0xFF; return Integer.toHexString(i); } - public static Object[] convertListToArray(List<Object> sourceList) { - Object[] targetArray = sourceList.toArray(new Object[sourceList.size()]); + public static Object[] convertListToArray(final List<Object> sourceList) { + final Object[] targetArray = sourceList.toArray(new Object[sourceList.size()]); return targetArray; } - public static List<Object> convertArrayToFixedSizeList(Object[] sourceArray) { - List<Object> targetList = Arrays.asList(sourceArray); + public static List<Object> convertArrayToFixedSizeList(final Object[] sourceArray) { + final List<Object> targetList = Arrays.asList(sourceArray); return targetList; } - public static List<Object> convertArrayToList(Object[] sourceArray) { - List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray)); + public static List<Object> convertArrayToList(final Object[] sourceArray) { + final List<Object> targetList = new ArrayList<>(Arrays.asList(sourceArray)); return targetList; } - public static List<Object> convertArrayListToList(ArrayList sourceArray) { - List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray)); + public static List<Object> convertArrayListToList(final ArrayList sourceArray) { + final List<Object> targetList = new ArrayList<>(Arrays.asList(sourceArray)); return targetList; } - public static void spawnCustomParticle(Entity entity){ + public static void spawnCustomParticle(final Entity entity){ GTplusplus.proxy.generateMysteriousParticles(entity); - } + } - public static void spawnFX(World world, int x, int y, int z, String particleName, Object particleName2){ + public static void spawnFX(final World world, final int x, final int y, final int z, final String particleName, Object particleName2){ if (!world.isRemote){ - if (particleName2 == null || particleName2.equals("")){ + if ((particleName2 == null) || particleName2.equals("")){ particleName2 = particleName; } - int l = MathUtils.randInt(0, 4); - double d0 = (double)((float)x + 0.5F); - double d1 = (double)((float)y + 0.7F); - double d2 = (double)((float)z + 0.5F); - double d3 = 0.2199999988079071D; - double d4 = 0.27000001072883606D; + final int l = MathUtils.randInt(0, 4); + final double d0 = x + 0.5F; + final double d1 = y + 0.7F; + final double d2 = z + 0.5F; + final double d3 = 0.2199999988079071D; + final double d4 = 0.27000001072883606D; if (l == 1) { @@ -377,14 +375,14 @@ public class Utils { } } - public static int rgbtoHexValue(int r, int g, int b){ - if (r > 255 || g > 255 || b > 255 || r < 0 || g < 0 || b < 0){ + public static int rgbtoHexValue(final int r, final int g, final int b){ + if ((r > 255) || (g > 255) || (b > 255) || (r < 0) || (g < 0) || (b < 0)){ return 0; } - Color c = new Color(r,g,b); - String temp = Integer.toHexString( c.getRGB() & 0xFFFFFF ).toUpperCase(); + final Color c = new Color(r,g,b); + String temp = Integer.toHexString( c.getRGB() & 0xFFFFFF ).toUpperCase(); - //System.out.println( "hex: " + Integer.toHexString( c.getRGB() & 0xFFFFFF ) + " hex value:"+temp); + //System.out.println( "hex: " + Integer.toHexString( c.getRGB() & 0xFFFFFF ) + " hex value:"+temp); temp = Utils.appenedHexNotationToString(String.valueOf(temp)); Utils.LOG_WARNING("Made "+temp+" - Hopefully it's not a mess."); Utils.LOG_WARNING("It will decode into "+Integer.decode(temp)+"."); @@ -394,26 +392,26 @@ public class Utils { /* * http://javadevnotes.com/java-left-pad-string-with-zeros-examples */ - public static String leftPadWithZeroes(String originalString, int length) { - StringBuilder sb = new StringBuilder(); - while (sb.length() + originalString.length() < length) { + public static String leftPadWithZeroes(final String originalString, final int length) { + final StringBuilder sb = new StringBuilder(); + while ((sb.length() + originalString.length()) < length) { sb.append('0'); } < |
