From ff733d9d9bb03ce840200aa213b7bdfc5755777d Mon Sep 17 00:00:00 2001 From: Arturo Bernal Date: Sat, 8 Oct 2022 22:40:36 +0200 Subject: [PATCH] Make a non-access modifier local variables. (#966) --- src/main/java/org/apache/commons/lang3/Functions.java | 2 +- src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 4 ++-- .../java/org/apache/commons/lang3/time/FastDateParser.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/Functions.java b/src/main/java/org/apache/commons/lang3/Functions.java index 93fdf10e7..e5e4e106c 100644 --- a/src/main/java/org/apache/commons/lang3/Functions.java +++ b/src/main/java/org/apache/commons/lang3/Functions.java @@ -631,7 +631,7 @@ public class Functions { public static void tryWithResources(final FailableRunnable action, final FailableConsumer errorHandler, final FailableRunnable... resources) { - org.apache.commons.lang3.function.FailableRunnable[] fr = new org.apache.commons.lang3.function.FailableRunnable[resources.length]; + final org.apache.commons.lang3.function.FailableRunnable[] fr = new org.apache.commons.lang3.function.FailableRunnable[resources.length]; Arrays.setAll(fr, i -> () -> resources[i].run()); Failable.tryWithResources(action::run, errorHandler != null ? errorHandler::accept : null, fr); } diff --git a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java index 0396d427d..bff3fef53 100644 --- a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java +++ b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java @@ -2456,7 +2456,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build * @param startIndex the index to start at, invalid index rounded to edge * @return the first index of the string, or -1 if not found */ - public int indexOf(final String str, int startIndex) { + public int indexOf(final String str, final int startIndex) { return StringUtils.indexOf(this, str, startIndex); } @@ -2557,7 +2557,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build * @param startIndex the index to start at, invalid index rounded to edge * @return the last index of the string, or -1 if not found */ - public int lastIndexOf(final String str, int startIndex) { + public int lastIndexOf(final String str, final int startIndex) { return StringUtils.lastIndexOf(this, str, startIndex); } diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java index b4506e704..979bf6028 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java @@ -485,7 +485,7 @@ public class FastDateParser implements DateParser, Serializable { * @param regex The regular expression to build * @return The map of string display names to field values */ - private static Map appendDisplayNames(final Calendar calendar, Locale locale, final int field, + private static Map appendDisplayNames(final Calendar calendar, final Locale locale, final int field, final StringBuilder regex) { final Map values = new HashMap<>(); final Locale actualLocale = LocaleUtils.toLocale(locale);