Author: sebb
Date: Sun Nov 7 20:17:50 2010
New Revision: 1032378
URL: http://svn.apache.org/viewvc?rev=1032378&view=rev
Log:
Fix up generics
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileContent.java
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileObject.java
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/UserAuthenticationData.java
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/VFS.java
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileContent.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileContent.java?rev=1032378&r1=1032377&r2=1032378&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileContent.java
(original)
+++
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileContent.java
Sun Nov 7 20:17:50 2010
@@ -92,7 +92,7 @@ public interface FileContent
* @return The attribute Map.
* @throws FileSystemException If the file does not exist, or does not
support attributes.
*/
- Map getAttributes() throws FileSystemException;
+ Map<String, Object> getAttributes() throws FileSystemException;
/**
* Lists the attributes of the file's content.
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileObject.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileObject.java?rev=1032378&r1=1032377&r2=1032378&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileObject.java
(original)
+++
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileObject.java
Sun Nov 7 20:17:50 2010
@@ -205,7 +205,7 @@ public interface FileObject
* @param selected container for selected files. list needs not to be
empty.
* @throws FileSystemException if an error occurs.
*/
- void findFiles(FileSelector selector, boolean depthwise, List selected)
throws FileSystemException;
+ void findFiles(FileSelector selector, boolean depthwise, List<FileObject>
selected) throws FileSystemException;
/**
* Deletes this file. Does nothing if this file does not exist of if it
is a
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java?rev=1032378&r1=1032377&r2=1032378&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
(original)
+++
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
Sun Nov 7 20:17:50 2010
@@ -32,39 +32,36 @@ import java.util.TreeMap;
public final class FileSystemOptions implements Cloneable
{
/** The options */
- private Map options = new TreeMap();
+ private Map<FileSystemOptionKey, Object> options = new
TreeMap<FileSystemOptionKey, Object>();
/**
* Keys in the options Map.
*/
- private static final class FileSystemOptionKey implements Comparable
+ private static final class FileSystemOptionKey implements
Comparable<FileSystemOptionKey>
{
/** Constant used to create hashcode */
private static final int HASH = 29;
/** The FileSystem class */
- private final Class fileSystemClass;
+ private final Class<FileSystem> fileSystemClass;
/** The option name */
private final String name;
- private FileSystemOptionKey(Class fileSystemClass, String name)
+ private FileSystemOptionKey(Class<FileSystem> fileSystemClass, String
name)
{
this.fileSystemClass = fileSystemClass;
this.name = name;
}
- public int compareTo(Object o)
+ public int compareTo(FileSystemOptionKey o)
{
- FileSystemOptionKey k = (FileSystemOptionKey) o;
-
- int ret =
fileSystemClass.getName().compareTo(k.fileSystemClass.getName());
+ int ret =
fileSystemClass.getName().compareTo(o.fileSystemClass.getName());
if (ret != 0)
{
return ret;
}
-
- return name.compareTo(k.name);
+ return name.compareTo(o.name);
}
@Override
@@ -107,18 +104,18 @@ public final class FileSystemOptions imp
{
}
- void setOption(Class fileSystemClass, String name, Object value)
+ void setOption(Class<FileSystem> fileSystemClass, String name, Object
value)
{
options.put(new FileSystemOptionKey(fileSystemClass, name), value);
}
- Object getOption(Class fileSystemClass, String name)
+ Object getOption(Class<FileSystem> fileSystemClass, String name)
{
FileSystemOptionKey key = new FileSystemOptionKey(fileSystemClass,
name);
return options.get(key);
}
- boolean hasOption(Class fileSystemClass, String name)
+ boolean hasOption(Class<FileSystem> fileSystemClass, String name)
{
FileSystemOptionKey key = new FileSystemOptionKey(fileSystemClass,
name);
return options.containsKey(key);
@@ -171,7 +168,7 @@ public final class FileSystemOptions imp
public Object clone()
{
FileSystemOptions clone = new FileSystemOptions();
- clone.options = new TreeMap(options);
+ clone.options = new TreeMap<FileSystemOptionKey, Object>(options);
return clone;
}
}
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/UserAuthenticationData.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/UserAuthenticationData.java?rev=1032378&r1=1032377&r2=1032378&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/UserAuthenticationData.java
(original)
+++
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/UserAuthenticationData.java
Sun Nov 7 20:17:50 2010
@@ -29,7 +29,7 @@ public class UserAuthenticationData
/**
* Inner class to represent portions of the user authentication data.
*/
- public static class Type implements Comparable
+ public static class Type implements Comparable<Type>
{
/** The type name */
private final String type;
@@ -61,11 +61,9 @@ public class UserAuthenticationData
return true;
}
- public int compareTo(Object o)
+ public int compareTo(Type o)
{
- Type t = (Type) o;
-
- return type.compareTo(t.type);
+ return type.compareTo(o.type);
}
@Override
@@ -91,7 +89,7 @@ public class UserAuthenticationData
public static final Type DOMAIN = new Type("domain");
/** The authentication data. */
- private final Map authenticationData = new TreeMap();
+ private final Map<Type, char[]> authenticationData = new TreeMap<Type,
char[]>();
public UserAuthenticationData()
{
@@ -114,7 +112,7 @@ public class UserAuthenticationData
*/
public char[] getData(Type type)
{
- return (char[]) authenticationData.get(type);
+ return authenticationData.get(type);
}
/**
@@ -123,10 +121,10 @@ public class UserAuthenticationData
public void cleanup()
{
// step 1: nullify character buffers
- Iterator iterAuthenticationData =
authenticationData.values().iterator();
+ Iterator<char[]> iterAuthenticationData =
authenticationData.values().iterator();
while (iterAuthenticationData.hasNext())
{
- char[] data = (char[]) iterAuthenticationData.next();
+ char[] data = iterAuthenticationData.next();
if (data == null || data.length < 0)
{
continue;
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/VFS.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/VFS.java?rev=1032378&r1=1032377&r2=1032378&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/VFS.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/VFS.java
Sun Nov 7 20:17:50 2010
@@ -65,7 +65,7 @@ public final class VFS
try
{
// Create instance
- final Class mgrClass = Class.forName(managerClassName);
+ final Class<?> mgrClass = Class.forName(managerClassName);
final FileSystemManager mgr = (FileSystemManager)
mgrClass.newInstance();
/*