You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/09/11 00:31:34 UTC
[commons-vfs] 04/04: Use varargs.
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
commit 9ec6f59ceb282371405d16cb1da76f64162b9e30
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Sep 10 20:31:22 2020 -0400
Use varargs.
---
.../java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java | 2 +-
.../java/org/apache/commons/vfs2/provider/AbstractFileSystem.java | 3 +--
.../apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java | 4 ++--
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
index 28ed9f4..a93d7c9 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
@@ -345,7 +345,7 @@ public class DefaultFileSystemManager implements FileSystemManager {
}
try {
- fileObjectDecoratorConst = fileObjectDecorator.getConstructor(new Class[] { FileObject.class });
+ fileObjectDecoratorConst = fileObjectDecorator.getConstructor(FileObject.class);
} catch (final NoSuchMethodException e) {
throw new FileSystemException("vfs.impl/invalid-decorator.error", fileObjectDecorator.getName(), e);
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java
index 65dbd31..3762523 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java
@@ -347,8 +347,7 @@ public abstract class AbstractFileSystem extends AbstractVfsComponent implements
if (getFileSystemManager().getFileObjectDecoratorConst() != null) {
try {
- file = (FileObject) getFileSystemManager().getFileObjectDecoratorConst()
- .newInstance(new Object[] { file });
+ file = (FileObject) getFileSystemManager().getFileObjectDecoratorConst().newInstance(file);
} catch (final InstantiationException e) {
throw new FileSystemException("vfs.impl/invalid-decorator.error",
getFileSystemManager().getFileObjectDecorator().getName(), e);
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java
index e716c09..5d04b4d 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java
@@ -263,7 +263,7 @@ public class DelegatingFileSystemOptionsBuilder {
for (int iterValues = 0; iterValues < ctx.values.length; iterValues++) {
try {
Array.set(convertedValues, iterValues,
- valueConstructor.newInstance(new Object[] { ctx.values[iterValues] }));
+ valueConstructor.newInstance(ctx.values[iterValues]));
} catch (final InstantiationException e) {
throw new FileSystemException(e);
} catch (final IllegalAccessException e) {
@@ -292,7 +292,7 @@ public class DelegatingFileSystemOptionsBuilder {
for (int iterValues = 0; iterValues < ctx.values.length; iterValues++) {
try {
Array.set(convertedValues, iterValues,
- valueFactory.invoke(null, new Object[] { ctx.values[iterValues] }));
+ valueFactory.invoke(null, ctx.values[iterValues]));
} catch (final IllegalAccessException e) {
throw new FileSystemException(e);
} catch (final InvocationTargetException e) {