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-vfs.git
The following commit(s) were added to refs/heads/master by this push:
new d1c8e7e68 Undeprecate util method and reuse
d1c8e7e68 is described below
commit d1c8e7e6811ae870d3398c058362bbbd125b99e7
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Mar 6 07:19:12 2026 -0500
Undeprecate util method and reuse
---
.../commons/vfs2/util/UserAuthenticatorUtils.java | 22 ++++++++--------------
src/changes/changes.xml | 2 --
2 files changed, 8 insertions(+), 16 deletions(-)
diff --git
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/UserAuthenticatorUtils.java
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/UserAuthenticatorUtils.java
index 5fa6add99..e3a261d4b 100644
---
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/UserAuthenticatorUtils.java
+++
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/UserAuthenticatorUtils.java
@@ -107,8 +107,7 @@ public final class UserAuthenticatorUtils {
* @since 2.11.0
*/
public static char[] getPasswordChars(final GenericFileName rootName,
final UserAuthenticationData authData) {
- final String password = getPassword(rootName, authData);
- return password != null ? password.toCharArray() : null;
+ return toChar(getPassword(rootName, authData));
}
/**
@@ -132,32 +131,27 @@ public final class UserAuthenticatorUtils {
* @since 2.11.0
*/
public static char[] getUserNameChars(final GenericFileName rootName,
final UserAuthenticationData authData) {
- final String userName = getUserName(rootName, authData);
- return userName != null ? userName.toCharArray() : null;
+ return toChar(getUserName(rootName, authData));
}
/**
* Converts a string to a char array (null-safe).
*
* @param string The String to convert.
- * @return A new character array.
- * @deprecated Use {@link CharSequenceUtils#toCharArray(CharSequence)}.
+ * @return The character array.
*/
- @Deprecated
public static char[] toChar(final String string) {
- return CharSequenceUtils.toCharArray(string);
+ return string != null ? string.toCharArray() : null;
}
/**
* Converts the given data to a string (null-safe).
*
- * @param data A character array containing the data to convert to a
String.
- * @return A new String.
- * @deprecated Use {@link StringUtils#valueOf(char[])}.
+ * @param value A character array containing the data to convert to a
String.
+ * @return The String.
*/
- @Deprecated
- public static String toString(final char[] data) {
- return StringUtils.valueOf(data);
+ public static String toString(final char[] value) {
+ return value != null ? new String(value) : null;
}
private UserAuthenticatorUtils() {
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 25082af56..718b9d38a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -61,8 +61,6 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="Gary
Gregory">DefaultFileMonitor now restores the current thread's interrupt flag
when catching InterruptedException.</action>
<action type="fix" dev="ggregory" due-to="Gary
Gregory">SftpFileSystem.executeCommand(String, StringBuilder) now restores the
current thread's interrupt flag when catching InterruptedException.</action>
<action type="fix" dev="ggregory" due-to="Vaishnavi Kumbhar, Gary
Gregory" issue="VFS-861">Http5FileProvider Basic authentication fails:
UserAuthenticationData.setData(Type, char[]) should clone its array
input.</action>
- <action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate
UserAuthenticatorUtils.toChar(String).</action>
- <action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate
UserAuthenticatorUtils.toString(String).</action>
<action type="fix" dev="ggregory" due-to="Vaishnavi Kumbhar, Gary
Gregory" issue="VFS-861">Http5FileProvider Basic authentication fails:
UserAuthenticationData.setData(Type, char[]) should clone its array
input.</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory">Add
org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.sendOptions(String,
String).</action>