Skip to content

Commit 9cbcb9d

Browse files
committed
The class LocaleBeanUtils no longer extends BeanUtils (both classes only
contains static methods) - Make class final - Make constructor private - Remove trailing whitespace
1 parent 6f71fcf commit 9cbcb9d

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
<action type="fix" dev="ggregory" due-to="Gary Gregory">The constructor org.apache.commons.beanutils2.ConvertUtils is now private (the class only contains static methods).</action>
4444
<action type="fix" dev="ggregory" due-to="Gary Gregory">The class org.apache.commons.beanutils2.ConstructorUtils is now final (the class only contains static methods).</action>
4545
<action type="fix" dev="ggregory" due-to="Gary Gregory">The constructor org.apache.commons.beanutils2.ConstructorUtils is now private (the class only contains static methods).</action>
46+
<action type="fix" dev="ggregory" due-to="Gary Gregory">The class LocaleBeanUtils no longer extends BeanUtils (both classes only contains static methods).</action>
47+
<action type="fix" dev="ggregory" due-to="Gary Gregory">The class org.apache.commons.beanutils2.BeanUtils is now final (the class only contains static methods).</action>
48+
<action type="fix" dev="ggregory" due-to="Gary Gregory">The constructor org.apache.commons.beanutils2.BeanUtils is now private (the class only contains static methods).</action>
4649
<!-- ADD -->
4750
<!-- UPDATE -->
4851
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 78 to 81.</action>

src/main/java/org/apache/commons/beanutils2/BeanUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @see BeanUtilsBean
3636
*/
37-
public class BeanUtils {
37+
public final class BeanUtils {
3838

3939
/** An empty class array */
4040
static final Class<?>[] EMPTY_CLASS_ARRAY = {};
@@ -359,4 +359,8 @@ public static void populate(final Object bean, final Map<String, ? extends Objec
359359
public static void setProperty(final Object bean, final String name, final Object value) throws IllegalAccessException, InvocationTargetException {
360360
BeanUtilsBean.getInstance().setProperty(bean, name, value);
361361
}
362+
363+
private BeanUtils() {
364+
// empty
365+
}
362366
}

src/main/java/org/apache/commons/beanutils2/ConvertUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public static <T> Class<T> primitiveToWrapper(final Class<T> type) {
220220
public static <T> void register(final Converter<T> converter, final Class<T> clazz) {
221221
ConvertUtilsBean.getInstance().register(converter, clazz);
222222
}
223-
223+
224224
private ConvertUtils() {
225225
// empty
226226
}

src/main/java/org/apache/commons/beanutils2/MethodUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ public static Object invokeStaticMethod(final Class<?> objectClass, final String
10641064
* @param parameterization the type of parameter being tested
10651065
* @return true if the assignment is compatible.
10661066
*/
1067-
public static final boolean isAssignmentCompatible(final Class<?> parameterType, final Class<?> parameterization) {
1067+
public static boolean isAssignmentCompatible(final Class<?> parameterType, final Class<?> parameterization) {
10681068
// try plain assignment
10691069
if (parameterType.isAssignableFrom(parameterization)) {
10701070
return true;
@@ -1170,7 +1170,7 @@ public static Class<?> toNonPrimitiveClass(final Class<?> clazz) {
11701170
}
11711171
return clazz;
11721172
}
1173-
1173+
11741174
private MethodUtils() {
11751175
// empty
11761176
}

src/main/java/org/apache/commons/beanutils2/locale/LocaleBeanUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import java.lang.reflect.InvocationTargetException;
2121
import java.util.Locale;
2222

23-
import org.apache.commons.beanutils2.BeanUtils;
24-
2523
/**
2624
* <p>
2725
* Utility methods for populating JavaBeans properties via reflection in a locale-dependent manner.
@@ -31,7 +29,7 @@
3129
* The implementations for these methods are provided by {@code LocaleBeanUtilsBean}. For more details see {@link LocaleBeanUtilsBean}.
3230
* </p>
3331
*/
34-
public final class LocaleBeanUtils extends BeanUtils {
32+
public final class LocaleBeanUtils {
3533

3634
/**
3735
* <p>
@@ -546,7 +544,7 @@ public static void setProperty(final Object bean, final String name, final Objec
546544
throws IllegalAccessException, InvocationTargetException {
547545
LocaleBeanUtilsBean.getLocaleBeanUtilsInstance().setProperty(bean, name, value, pattern);
548546
}
549-
547+
550548
private LocaleBeanUtils() {
551549
// empty
552550
}

src/main/java/org/apache/commons/beanutils2/locale/LocaleConvertUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public static void setApplyLocalized(final boolean newApplyLocalized) {
352352
public static void setDefaultLocale(final Locale locale) {
353353
LocaleConvertUtilsBean.getInstance().setDefaultLocale(locale);
354354
}
355-
355+
356356
private LocaleConvertUtils() {
357357
// empty
358358
}

0 commit comments

Comments
 (0)