You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/05/14 13:13:11 UTC
(commons-lang) branch master updated (5e36226a0 -> 88ab71b19)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
from 5e36226a0 Add test
new 74a9bea58 Better implementation of org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle.spacer(int)
new 416a35430 Indentation
new 88ab71b19 Comment empty blocks
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../commons/lang3/builder/MultilineRecursiveToStringStyle.java | 9 +++------
.../java/org/apache/commons/lang3/time/DurationFormatUtils.java | 6 +++---
.../java/org/apache/commons/lang3/reflect/TypeUtilsTest.java | 8 ++++++++
3 files changed, 14 insertions(+), 9 deletions(-)
(commons-lang) 03/03: Comment empty blocks
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 88ab71b19491efe351dd7caa554ee99911c6d9cf
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 14 09:13:06 2024 -0400
Comment empty blocks
---
src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
index dca2096b5..541cc02c7 100644
--- a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
@@ -163,6 +163,7 @@ abstract class Test1<G> {
public class TypeUtilsTest<B> extends AbstractLangTest {
public interface And<K, V> extends This<Number, Number> {
+ // empty
}
public static class ClassWithSuperClassWithGenericType extends ArrayList<Object> {
@@ -175,24 +176,31 @@ public class TypeUtilsTest<B> extends AbstractLangTest {
/** This non-static inner class is parameterized. */
private class MyInnerClass<T> {
+ // empty
}
public class Other<T> implements This<String, T> {
+ // empty
}
public class Tester implements This<String, B> {
+ // empty
}
public class That<K, V> implements This<K, V> {
+ // empty
}
public class The<K, V> extends That<Number, Number> implements And<String, String> {
+ // empty
}
public class Thing<Q> extends Other<B> {
+ // empty
}
public interface This<K, V> {
+ // empty
}
public static Comparable<String> stringComparable;
(commons-lang) 02/03: Indentation
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 416a354308bbea30466639d141c81b0580d6cd01
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 12 18:42:55 2024 -0400
Indentation
---
.../java/org/apache/commons/lang3/time/DurationFormatUtils.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
index 5e0fbccc8..417d2a592 100644
--- a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
+++ b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
@@ -257,9 +257,9 @@ public class DurationFormatUtils {
}
}
if (isLiteral) {
- if (!inOptional || !lastOutputZero) {
- buffer.append(value.toString());
- }
+ if (!inOptional || !lastOutputZero) {
+ buffer.append(value.toString());
+ }
} else if (value.equals(y)) {
lastOutputSeconds = false;
lastOutputZero = years == 0;
(commons-lang) 01/03: Better implementation of org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle.spacer(int)
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 74a9bea58feb0a15b906623dff06721b07fec6a7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 12 18:13:45 2024 -0400
Better implementation of
org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle.spacer(int)
---
.../commons/lang3/builder/MultilineRecursiveToStringStyle.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
index 861a55fe2..54cb160c7 100644
--- a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
+++ b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
@@ -18,6 +18,7 @@
package org.apache.commons.lang3.builder;
import org.apache.commons.lang3.ClassUtils;
+import org.apache.commons.lang3.StringUtils;
/**
* Works with {@link ToStringBuilder} to create a "deep" {@code toString}.
@@ -206,12 +207,8 @@ public class MultilineRecursiveToStringStyle extends RecursiveToStringStyle {
* @param spaces how far to indent
* @return a StringBuilder with {spaces} leading space characters.
*/
- private StringBuilder spacer(final int spaces) {
- final StringBuilder sb = new StringBuilder();
- for (int i = 0; i < spaces; i++) {
- sb.append(" ");
- }
- return sb;
+ private String spacer(final int spaces) {
+ return StringUtils.repeat(' ', spaces);
}
}