Skip to content

Commit 98ed36c

Browse files
committed
Remove unused
org.apache.commons.beanutils2.MethodUtils.getPrimitiveType(Class) in favor of org.apache.commons.lang3.ClassUtils.wrapperToPrimitive(Class)
1 parent 1a79f46 commit 98ed36c

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeStaticMethod(Class, String, Object[]) in favor of Apache Commons Lang's org.apache.commons.lang3.reflect.MethodUtils.</action>
4949
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeStaticMethod(Class, String, Object[], Class[]) in favor of Apache Commons Lang's org.apache.commons.lang3.reflect.MethodUtils.</action>
5050
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.toNonPrimitiveClass(Class) in favor of org.apache.commons.lang3.ClassUtils.primitiveToWrapper(Class).</action>
51+
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.getPrimitiveType(Class) in favor of org.apache.commons.lang3.ClassUtils.wrapperToPrimitive(Class).</action>
5152
</release>
5253
<release version="2.0.0-M2" date="2025-05-25" description="This is a major release and requires Java 8.">
5354
<!-- FIX -->

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

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -521,45 +521,6 @@ private static float getObjectTransformationCost(Class<?> srcClass, final Class<
521521
return cost;
522522
}
523523

524-
/**
525-
* Gets the class for the primitive type corresponding to the primitive wrapper class given. For example, an instance of
526-
* {@code Boolean.class</code> returns a <code>boolean.class}.
527-
*
528-
* @param wrapperType the
529-
* @return the primitive type class corresponding to the given wrapper class, null if no match is found
530-
*/
531-
public static Class<?> getPrimitiveType(final Class<?> wrapperType) {
532-
// does anyone know a better strategy than comparing names?
533-
if (Boolean.class.equals(wrapperType)) {
534-
return boolean.class;
535-
}
536-
if (Float.class.equals(wrapperType)) {
537-
return float.class;
538-
}
539-
if (Long.class.equals(wrapperType)) {
540-
return long.class;
541-
}
542-
if (Integer.class.equals(wrapperType)) {
543-
return int.class;
544-
}
545-
if (Short.class.equals(wrapperType)) {
546-
return short.class;
547-
}
548-
if (Byte.class.equals(wrapperType)) {
549-
return byte.class;
550-
}
551-
if (Double.class.equals(wrapperType)) {
552-
return double.class;
553-
}
554-
if (Character.class.equals(wrapperType)) {
555-
return char.class;
556-
}
557-
if (LOG.isDebugEnabled()) {
558-
LOG.debug("Not a known primitive wrapper class: " + wrapperType);
559-
}
560-
return null;
561-
}
562-
563524
/**
564525
* Gets the wrapper object class for the given primitive type class. For example, passing {@code boolean.class</code> returns <code>Boolean.class}
565526
*

0 commit comments

Comments
 (0)