Skip to content

Commit a511a16

Browse files
committed
Normalize parameter names
1 parent efab6cb commit a511a16

12 files changed

+36
-36
lines changed

src/main/java/org/apache/commons/lang3/Streams.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -540,13 +540,13 @@ public static <O> FailableStream<O> stream(final Stream<O> stream) {
540540
* Returns a {@link Collector} that accumulates the input elements into a
541541
* new array.
542542
*
543-
* @param pElementType Type of an element in the array.
543+
* @param elementType Type of an element in the array.
544544
* @param <O> the type of the input elements
545545
* @return a {@link Collector} which collects all the input elements into an
546546
* array, in encounter order
547547
*/
548-
public static <O> Collector<O, ?, O[]> toArray(final Class<O> pElementType) {
549-
return new ArrayCollector<>(pElementType);
548+
public static <O> Collector<O, ?, O[]> toArray(final Class<O> elementType) {
549+
return new ArrayCollector<>(elementType);
550550
}
551551

552552
/**

src/test/java/org/apache/commons/lang3/FunctionsTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public void reset() {
6868
closed = false;
6969
}
7070

71-
public void run(final Throwable pTh) throws Throwable {
72-
if (pTh != null) {
73-
throw pTh;
71+
public void run(final Throwable throwable) throws Throwable {
72+
if (throwable != null) {
73+
throw throwable;
7474
}
7575
}
7676
}

src/test/java/org/apache/commons/lang3/StreamsTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@
4545
@Deprecated
4646
public class StreamsTest extends AbstractLangTest {
4747

48-
protected <T extends Throwable> FailableConsumer<String, T> asIntConsumer(final T pThrowable) {
48+
protected <T extends Throwable> FailableConsumer<String, T> asIntConsumer(final T throwable) {
4949
return s -> {
5050
final int i = Integer.parseInt(s);
5151
if (i == 4) {
52-
throw pThrowable;
52+
throw throwable;
5353
}
5454
};
5555
}
5656

57-
protected <T extends Throwable> FailablePredicate<Integer, T> asIntPredicate(final T pThrowable) {
57+
protected <T extends Throwable> FailablePredicate<Integer, T> asIntPredicate(final T phrowable) {
5858
return i -> {
59-
if (i.intValue() == 5 && pThrowable != null) {
60-
throw pThrowable;
59+
if (i.intValue() == 5 && phrowable != null) {
60+
throw phrowable;
6161
}
6262
return i % 2 == 0;
6363
};

src/test/java/org/apache/commons/lang3/builder/DefaultToStringStyleTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public void testPerson() {
147147
p.name = "John Doe";
148148
p.age = 33;
149149
p.smoker = false;
150-
final String pBaseStr = p.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p));
151-
assertEquals(pBaseStr + "[name=John Doe,age=33,smoker=false]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
150+
final String baseStr = p.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p));
151+
assertEquals(baseStr + "[name=John Doe,age=33,smoker=false]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
152152
}
153153

154154
}

src/test/java/org/apache/commons/lang3/builder/MultiLineToStringStyleTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public void testPerson() {
147147
p.name = "Jane Doe";
148148
p.age = 25;
149149
p.smoker = true;
150-
final String pBaseStr = p.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p));
151-
assertEquals(pBaseStr + "[" + System.lineSeparator() + " name=Jane Doe" + System.lineSeparator() + " age=25" + System.lineSeparator() + " smoker=true" + System.lineSeparator() + "]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
150+
final String baseStr = p.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p));
151+
assertEquals(baseStr + "[" + System.lineSeparator() + " name=Jane Doe" + System.lineSeparator() + " age=25" + System.lineSeparator() + " smoker=true" + System.lineSeparator() + "]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
152152
}
153153

154154
}

src/test/java/org/apache/commons/lang3/builder/NoFieldNamesToStringStyleTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public void testPerson() {
147147
p.name = "Ron Paul";
148148
p.age = 72;
149149
p.smoker = false;
150-
final String pBaseStr = p.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p));
151-
assertEquals(pBaseStr + "[Ron Paul,72,false]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
150+
final String baseStr = p.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p));
151+
assertEquals(baseStr + "[Ron Paul,72,false]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
152152
}
153153

154154
}

src/test/java/org/apache/commons/lang3/builder/RecursiveToStringStyleTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ public void testPerson() {
154154
p.smoker = false;
155155
p.job = new Job();
156156
p.job.title = "Manager";
157-
final String pBaseStr = p.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p));
158-
final String pJobStr = p.job.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p.job));
159-
assertEquals(pBaseStr + "[age=33,job=" + pJobStr + "[title=Manager],name=John Doe,smoker=false]",
157+
final String baseStr = p.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p));
158+
final String jobStr = p.job.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p.job));
159+
assertEquals(baseStr + "[age=33,job=" + jobStr + "[title=Manager],name=John Doe,smoker=false]",
160160
new ReflectionToStringBuilder(p, new RecursiveToStringStyle()).toString());
161161
}
162162

src/test/java/org/apache/commons/lang3/builder/ShortPrefixToStringStyleTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public void testPerson() {
147147
p.name = "John Q. Public";
148148
p.age = 45;
149149
p.smoker = true;
150-
final String pBaseStr = "ToStringStyleTest.Person";
151-
assertEquals(pBaseStr + "[name=John Q. Public,age=45,smoker=true]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
150+
final String baseStr = "ToStringStyleTest.Person";
151+
assertEquals(baseStr + "[name=John Q. Public,age=45,smoker=true]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
152152
}
153153

154154
}

src/test/java/org/apache/commons/lang3/builder/StandardToStringStyleTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public void testPerson() {
224224
p.name = "Suzy Queue";
225225
p.age = 19;
226226
p.smoker = false;
227-
final String pBaseStr = "ToStringStyleTest.Person";
228-
assertEquals(pBaseStr + "[name=Suzy Queue,age=19,smoker=false]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
227+
final String baseStr = "ToStringStyleTest.Person";
228+
assertEquals(baseStr + "[name=Suzy Queue,age=19,smoker=false]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
229229
}
230230
}

src/test/java/org/apache/commons/lang3/function/FailableFunctionsTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public void reset() {
6262
closed = false;
6363
}
6464

65-
public void run(final Throwable pTh) throws Throwable {
66-
if (pTh != null) {
67-
throw pTh;
65+
public void run(final Throwable throwable) throws Throwable {
66+
if (throwable != null) {
67+
throw throwable;
6868
}
6969
}
7070
}

src/test/java/org/apache/commons/lang3/function/ObjectsTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public static class TestableFailableSupplier<O, E extends Exception> implements
3434
private final FailableSupplier<O, E> supplier;
3535
private boolean invoked;
3636

37-
TestableFailableSupplier(final FailableSupplier<O, E> pSupplier) {
38-
this.supplier = pSupplier;
37+
TestableFailableSupplier(final FailableSupplier<O, E> supplier) {
38+
this.supplier = supplier;
3939
}
4040

4141
@Override
@@ -53,8 +53,8 @@ public static class TestableSupplier<O> implements Supplier<O> {
5353
private final Supplier<O> supplier;
5454
private boolean invoked;
5555

56-
TestableSupplier(final Supplier<O> pSupplier) {
57-
this.supplier = pSupplier;
56+
TestableSupplier(final Supplier<O> supplier) {
57+
this.supplier = supplier;
5858
}
5959

6060
@Override

src/test/java/org/apache/commons/lang3/stream/StreamsTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@
4747
*/
4848
public class StreamsTest extends AbstractLangTest {
4949

50-
protected <T extends Throwable> FailableConsumer<String, T> asIntConsumer(final T pThrowable) {
50+
protected <T extends Throwable> FailableConsumer<String, T> asIntConsumer(final T throwable) {
5151
return s -> {
5252
final int i = Integer.parseInt(s);
5353
if (i == 4) {
54-
throw pThrowable;
54+
throw throwable;
5555
}
5656
};
5757
}
5858

59-
protected <T extends Throwable> FailablePredicate<Integer, T> asIntPredicate(final T pThrowable) {
59+
protected <T extends Throwable> FailablePredicate<Integer, T> asIntPredicate(final T throwable) {
6060
return i -> {
61-
if (i.intValue() == 5 && pThrowable != null) {
62-
throw pThrowable;
61+
if (i.intValue() == 5 && throwable != null) {
62+
throw throwable;
6363
}
6464
return i % 2 == 0;
6565
};

0 commit comments

Comments
 (0)