Skip to content
Permalink
Browse files
Remove unnecessary array creation for varargs.
  • Loading branch information
garydgregory committed Dec 19, 2019
1 parent 2da0353 commit a62149bf5bd4f304abab90b90a46d41d07cd32ec
Showing 16 changed files with 41 additions and 47 deletions.
@@ -51,10 +51,10 @@ public class WebdavFileProvider extends HttpFileProvider {

/** The capabilities of the WebDAV provider */
protected static final Collection<Capability> capabilities = Collections
.unmodifiableCollection(Arrays.asList(new Capability[] { Capability.CREATE, Capability.DELETE,
Capability.RENAME, Capability.GET_TYPE, Capability.LIST_CHILDREN, Capability.READ_CONTENT,
Capability.URI, Capability.WRITE_CONTENT, Capability.GET_LAST_MODIFIED, Capability.ATTRIBUTES,
Capability.RANDOM_ACCESS_READ, Capability.DIRECTORY_READ_CONTENT, }));
.unmodifiableCollection(Arrays.asList(Capability.CREATE, Capability.DELETE, Capability.RENAME, Capability.GET_TYPE,
Capability.LIST_CHILDREN, Capability.READ_CONTENT, Capability.URI, Capability.WRITE_CONTENT,
Capability.GET_LAST_MODIFIED, Capability.ATTRIBUTES, Capability.RANDOM_ACCESS_READ,
Capability.DIRECTORY_READ_CONTENT));

public WebdavFileProvider() {
super();
@@ -36,8 +36,8 @@
*/
public class MimeFileProvider extends AbstractLayeredFileProvider implements FileProvider {
static final Collection<Capability> capabilities = Collections
.unmodifiableCollection(Arrays.asList(new Capability[] { Capability.GET_TYPE, Capability.GET_LAST_MODIFIED,
Capability.LIST_CHILDREN, Capability.READ_CONTENT, Capability.URI, Capability.ATTRIBUTES }));
.unmodifiableCollection(Arrays.asList(Capability.GET_TYPE, Capability.GET_LAST_MODIFIED, Capability.LIST_CHILDREN,
Capability.READ_CONTENT, Capability.URI, Capability.ATTRIBUTES));

public MimeFileProvider() {
super();
@@ -38,11 +38,11 @@ public class SmbFileProvider extends AbstractOriginatingFileProvider implements
UserAuthenticationData.USERNAME, UserAuthenticationData.PASSWORD, UserAuthenticationData.DOMAIN };

static final Collection<Capability> capabilities = Collections
.unmodifiableCollection(Arrays.asList(new Capability[] { Capability.CREATE, Capability.DELETE,
Capability.RENAME, Capability.GET_TYPE, Capability.GET_LAST_MODIFIED,
Capability.SET_LAST_MODIFIED_FILE, Capability.SET_LAST_MODIFIED_FOLDER, Capability.LIST_CHILDREN,
Capability.READ_CONTENT, Capability.URI, Capability.WRITE_CONTENT, Capability.APPEND_CONTENT,
Capability.RANDOM_ACCESS_READ, Capability.RANDOM_ACCESS_WRITE }));
.unmodifiableCollection(Arrays.asList(Capability.CREATE, Capability.DELETE, Capability.RENAME, Capability.GET_TYPE,
Capability.GET_LAST_MODIFIED, Capability.SET_LAST_MODIFIED_FILE,
Capability.SET_LAST_MODIFIED_FOLDER, Capability.LIST_CHILDREN, Capability.READ_CONTENT,
Capability.URI, Capability.WRITE_CONTENT, Capability.APPEND_CONTENT, Capability.RANDOM_ACCESS_READ,
Capability.RANDOM_ACCESS_WRITE));

public SmbFileProvider() {
super();
@@ -34,9 +34,8 @@
public class Bzip2FileProvider extends CompressedFileFileProvider {

/** The provider's capabilities */
protected static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays
.asList(new Capability[] { Capability.GET_LAST_MODIFIED, Capability.GET_TYPE, Capability.LIST_CHILDREN,
Capability.READ_CONTENT, Capability.WRITE_CONTENT, Capability.URI, Capability.COMPRESS }));
protected static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays.asList(Capability.GET_LAST_MODIFIED, Capability.GET_TYPE, Capability.LIST_CHILDREN, Capability.READ_CONTENT,
Capability.WRITE_CONTENT, Capability.URI, Capability.COMPRESS));

public Bzip2FileProvider() {
super();
@@ -46,10 +46,9 @@ public class FtpFileProvider extends AbstractOriginatingFileProvider {
public static final UserAuthenticationData.Type[] AUTHENTICATOR_TYPES = new UserAuthenticationData.Type[] {
UserAuthenticationData.USERNAME, UserAuthenticationData.PASSWORD };

static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays
.asList(new Capability[] { Capability.CREATE, Capability.DELETE, Capability.RENAME, Capability.GET_TYPE,
Capability.LIST_CHILDREN, Capability.READ_CONTENT, Capability.GET_LAST_MODIFIED, Capability.URI,
Capability.WRITE_CONTENT, Capability.APPEND_CONTENT, Capability.RANDOM_ACCESS_READ, }));
static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays.asList(Capability.CREATE, Capability.DELETE, Capability.RENAME, Capability.GET_TYPE,
Capability.LIST_CHILDREN, Capability.READ_CONTENT, Capability.GET_LAST_MODIFIED, Capability.URI,
Capability.WRITE_CONTENT, Capability.APPEND_CONTENT, Capability.RANDOM_ACCESS_READ));

/**
* Constructs a new provider.
@@ -36,9 +36,8 @@ public class GzipFileProvider extends CompressedFileFileProvider {
/**
* Capabilities.
*/
protected static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays
.asList(new Capability[] { Capability.GET_LAST_MODIFIED, Capability.GET_TYPE, Capability.LIST_CHILDREN,
Capability.WRITE_CONTENT, Capability.READ_CONTENT, Capability.URI, Capability.COMPRESS }));
protected static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays.asList(Capability.GET_LAST_MODIFIED, Capability.GET_TYPE, Capability.LIST_CHILDREN, Capability.WRITE_CONTENT,
Capability.READ_CONTENT, Capability.URI, Capability.COMPRESS));

public GzipFileProvider() {
super();
@@ -37,9 +37,9 @@
public class HdfsFileProvider extends AbstractOriginatingFileProvider {

static final Collection<Capability> CAPABILITIES = Collections
.unmodifiableCollection(Arrays.asList(new Capability[] { Capability.GET_TYPE, Capability.READ_CONTENT,
Capability.URI, Capability.GET_LAST_MODIFIED, Capability.ATTRIBUTES, Capability.RANDOM_ACCESS_READ,
Capability.DIRECTORY_READ_CONTENT, Capability.LIST_CHILDREN }));
.unmodifiableCollection(Arrays.asList(Capability.GET_TYPE, Capability.READ_CONTENT, Capability.URI, Capability.GET_LAST_MODIFIED,
Capability.ATTRIBUTES, Capability.RANDOM_ACCESS_READ, Capability.DIRECTORY_READ_CONTENT,
Capability.LIST_CHILDREN));

/**
* Constructs a new HdfsFileProvider.
@@ -42,9 +42,8 @@ public class HttpFileProvider extends AbstractOriginatingFileProvider {
UserAuthenticationData.USERNAME, UserAuthenticationData.PASSWORD };

static final Collection<Capability> capabilities = Collections
.unmodifiableCollection(Arrays.asList(new Capability[] { Capability.GET_TYPE, Capability.READ_CONTENT,
Capability.URI, Capability.GET_LAST_MODIFIED, Capability.ATTRIBUTES, Capability.RANDOM_ACCESS_READ,
Capability.DIRECTORY_READ_CONTENT, }));
.unmodifiableCollection(Arrays.asList(Capability.GET_TYPE, Capability.READ_CONTENT, Capability.URI, Capability.GET_LAST_MODIFIED,
Capability.ATTRIBUTES, Capability.RANDOM_ACCESS_READ, Capability.DIRECTORY_READ_CONTENT));

/**
* Constructs a new provider.
@@ -43,8 +43,8 @@ public class JarFileProvider extends ZipFileProvider {
static {
final Collection<Capability> combined = new ArrayList<>();
combined.addAll(ZipFileProvider.capabilities);
combined.addAll(Arrays.asList(new Capability[] { Capability.ATTRIBUTES, Capability.FS_ATTRIBUTES,
Capability.SIGNING, Capability.MANIFEST_ATTRIBUTES, Capability.VIRTUAL }));
combined.addAll(Arrays.asList(Capability.ATTRIBUTES, Capability.FS_ATTRIBUTES, Capability.SIGNING,
Capability.MANIFEST_ATTRIBUTES, Capability.VIRTUAL));
capabilities = Collections.unmodifiableCollection(combined);
}

@@ -39,11 +39,11 @@ public class DefaultLocalFileProvider extends AbstractOriginatingFileProvider im

/** The provider's capabilities. */
public static final Collection<Capability> capabilities = Collections.unmodifiableCollection(
Arrays.asList(new Capability[] { Capability.CREATE, Capability.DELETE, Capability.RENAME,
Capability.GET_TYPE, Capability.GET_LAST_MODIFIED, Capability.SET_LAST_MODIFIED_FILE,
Arrays.asList(Capability.CREATE, Capability.DELETE, Capability.RENAME, Capability.GET_TYPE,
Capability.GET_LAST_MODIFIED, Capability.SET_LAST_MODIFIED_FILE,
Capability.SET_LAST_MODIFIED_FOLDER, Capability.LIST_CHILDREN, Capability.READ_CONTENT,
Capability.URI, Capability.WRITE_CONTENT, Capability.APPEND_CONTENT, Capability.RANDOM_ACCESS_READ,
Capability.RANDOM_ACCESS_SET_LENGTH, Capability.RANDOM_ACCESS_WRITE }));
Capability.RANDOM_ACCESS_SET_LENGTH, Capability.RANDOM_ACCESS_WRITE));

/**
* Constructs a new provider.
@@ -34,11 +34,11 @@ public class RamFileProvider extends AbstractOriginatingFileProvider {

/** The provider's capabilities. */
public static final Collection<Capability> capabilities = Collections.unmodifiableCollection(
Arrays.asList(new Capability[] { Capability.CREATE, Capability.DELETE, Capability.RENAME,
Capability.GET_TYPE, Capability.GET_LAST_MODIFIED, Capability.SET_LAST_MODIFIED_FILE,
Arrays.asList(Capability.CREATE, Capability.DELETE, Capability.RENAME, Capability.GET_TYPE,
Capability.GET_LAST_MODIFIED, Capability.SET_LAST_MODIFIED_FILE,
Capability.SET_LAST_MODIFIED_FOLDER, Capability.LIST_CHILDREN, Capability.READ_CONTENT,
Capability.URI, Capability.WRITE_CONTENT, Capability.APPEND_CONTENT, Capability.RANDOM_ACCESS_READ,
Capability.RANDOM_ACCESS_SET_LENGTH, Capability.RANDOM_ACCESS_WRITE }));
Capability.RANDOM_ACCESS_SET_LENGTH, Capability.RANDOM_ACCESS_WRITE));

/**
* Constructs a new provider.
@@ -37,7 +37,7 @@ public class ResourceFileProvider extends AbstractFileProvider {

/** The provider's capabilities */
protected static final Collection<Capability> capabilities = Collections
.unmodifiableCollection(Arrays.asList(new Capability[] { Capability.DISPATCHER }));
.unmodifiableCollection(Arrays.asList(Capability.DISPATCHER));

private static final int BUFFER_SIZE = 80;

@@ -46,11 +46,10 @@ public class SftpFileProvider extends AbstractOriginatingFileProvider {
UserAuthenticationData.USERNAME, UserAuthenticationData.PASSWORD };

/** The provider's capabilities. */
protected static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays
.asList(new Capability[] { Capability.CREATE, Capability.DELETE, Capability.RENAME, Capability.GET_TYPE,
Capability.LIST_CHILDREN, Capability.READ_CONTENT, Capability.URI, Capability.WRITE_CONTENT,
Capability.GET_LAST_MODIFIED, Capability.SET_LAST_MODIFIED_FILE, Capability.RANDOM_ACCESS_READ,
Capability.APPEND_CONTENT }));
protected static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays.asList(Capability.CREATE, Capability.DELETE, Capability.RENAME, Capability.GET_TYPE,
Capability.LIST_CHILDREN, Capability.READ_CONTENT, Capability.URI, Capability.WRITE_CONTENT,
Capability.GET_LAST_MODIFIED, Capability.SET_LAST_MODIFIED_FILE, Capability.RANDOM_ACCESS_READ,
Capability.APPEND_CONTENT));

/**
* Creates a new Session.
@@ -38,8 +38,8 @@ public class TarFileProvider extends AbstractLayeredFileProvider {

/** The provider's capabilities */
protected static final Collection<Capability> capabilities = Collections
.unmodifiableCollection(Arrays.asList(new Capability[] { Capability.GET_LAST_MODIFIED, Capability.GET_TYPE,
Capability.LIST_CHILDREN, Capability.READ_CONTENT, Capability.URI, Capability.VIRTUAL }));
.unmodifiableCollection(Arrays.asList(Capability.GET_LAST_MODIFIED, Capability.GET_TYPE, Capability.LIST_CHILDREN,
Capability.READ_CONTENT, Capability.URI, Capability.VIRTUAL));

public TarFileProvider() {
super();
@@ -37,7 +37,7 @@ public class UrlFileProvider extends AbstractFileProvider {

/** The provider's capabilities */
protected static final Collection<Capability> capabilities = Collections.unmodifiableCollection(
Arrays.asList(new Capability[] { Capability.READ_CONTENT, Capability.URI, Capability.GET_LAST_MODIFIED }));
Arrays.asList(Capability.READ_CONTENT, Capability.URI, Capability.GET_LAST_MODIFIED));

public UrlFileProvider() {
super();
@@ -38,9 +38,8 @@
public class ZipFileProvider extends AbstractLayeredFileProvider {

/** The list of capabilities this provider supports */
protected static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays
.asList(new Capability[] { Capability.GET_LAST_MODIFIED, Capability.GET_TYPE, Capability.LIST_CHILDREN,
Capability.READ_CONTENT, Capability.URI, Capability.COMPRESS, Capability.VIRTUAL }));
protected static final Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays.asList(Capability.GET_LAST_MODIFIED, Capability.GET_TYPE, Capability.LIST_CHILDREN, Capability.READ_CONTENT,
Capability.URI, Capability.COMPRESS, Capability.VIRTUAL));

public ZipFileProvider() {
super();

0 comments on commit a62149b

Please sign in to comment.