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 2cfa0ca Use isEmpty().
2cfa0ca is described below
commit 2cfa0ca3eeed34eb066bfc9446e0cc630d931bf0
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Jan 17 09:21:55 2021 -0500
Use isEmpty().
---
.../src/main/java/org/apache/commons/vfs2/util/URIUtils.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIUtils.java
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIUtils.java
index 9eba68a..14e4ff7 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIUtils.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIUtils.java
@@ -66,24 +66,24 @@ public class URIUtils {
* default system charset is used.
*
* @param data the string to be encoded
- * @param charset the desired character encoding
+ * @param charsetName the desired character encoding
* @return The resulting byte array.
*/
- static byte[] getBytes(final String data, final String charset) {
+ static byte[] getBytes(final String data, final String charsetName) {
if (data == null) {
throw new IllegalArgumentException("data may not be null");
}
- if (charset == null || charset.length() == 0) {
+ if (charsetName == null || charsetName.isEmpty()) {
throw new IllegalArgumentException("charset may not be null or
empty");
}
try {
- return data.getBytes(charset);
+ return data.getBytes(charsetName);
} catch (final UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
- LOG.warn("Unsupported encoding: " + charset + ". System
encoding used.");
+ LOG.warn("Unsupported encoding: " + charsetName + ".
System encoding used.");
}
return data.getBytes(Charset.defaultCharset());