Skip to content

Commit c0d16f2

Browse files
committed
Deprecate ConstructorUtils in favor of Apache Commons Lang's
ConstructorUtils. ConstructorUtils is unused in this component.
1 parent 3dfbbe0 commit c0d16f2

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 84 to 85.</action>
3737
<!-- REMOVE -->
3838
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove pre-Java 1.4 code that will never run since we are on Java 8 or greater.</action>
39+
<action dev="ggregory" type="remove" due-to="Gary Gregory">Deprecate ConstructorUtils in favor of Apache Commons Lang's ConstructorUtils. ConstructorUtils is unused in this component.</action>
3940
</release>
4041
<release version="1.11.0" date="2025-05-25" description="This is a maintenance release and requires Java 8.">
4142
<!-- FIX -->

src/main/java/org/apache/commons/beanutils/ConstructorUtils.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,24 @@
2222
import java.lang.reflect.Modifier;
2323

2424
/**
25-
* <p>Utility reflection methods focused on constructors, modeled after {@link MethodUtils}.</p>
25+
* <p>
26+
* Utility reflection methods focused on constructors, modeled after {@link MethodUtils}.
27+
* </p>
2628
*
2729
* <strong>Known Limitations: Accessing Public Constructors In A Default Access Superclass</strong>
28-
* <p>There is an issue when invoking public constructors contained in a default access superclass.
29-
* Reflection locates these constructors fine and correctly assigns them as public.
30-
* However, an {@code IllegalAccessException} is thrown if the constructors is invoked.</p>
30+
* <p>
31+
* There is an issue when invoking public constructors contained in a default access superclass. Reflection locates these constructors fine and correctly
32+
* assigns them as public. However, an {@code IllegalAccessException} is thrown if the constructors is invoked.
33+
* </p>
3134
*
32-
* <p>{@code ConstructorUtils} contains a workaround for this situation.
33-
* It will attempt to call {@code setAccessible} on this constructor.
34-
* If this call succeeds, then the method can be invoked as normal.
35-
* This call will only succeed when the application has sufficient security privileges.
36-
* If this call fails then a warning will be logged and the method may fail.</p>
35+
* <p>
36+
* {@code ConstructorUtils} contains a workaround for this situation. It will attempt to call {@code setAccessible} on this constructor. If this call succeeds,
37+
* then the method can be invoked as normal. This call will only succeed when the application has sufficient security privileges. If this call fails then a
38+
* warning will be logged and the method may fail.
39+
* </p>
40+
*
41+
* @deprecated Use <a href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/reflect/ConstructorUtils.html">ConstructorUtils from
42+
* Apache Commons Lang</a>. ConstructorUtils is unused in this component.
3743
*/
3844
public class ConstructorUtils {
3945

src/test/java/org/apache/commons/beanutils/ConstructorUtilsTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import junit.framework.TestSuite;
2626

2727
/**
28-
* <p> Test case for {@code ConstructorUtils} </p>
29-
*
28+
* Tests {@link ConstructorUtils} </p>
3029
*/
30+
@SuppressWarnings("deprecation")
3131
public class ConstructorUtilsTestCase extends TestCase {
3232

3333
/**

0 commit comments

Comments
 (0)