Author: sebb
Date: Mon Nov 8 01:26:35 2010
New Revision: 1032437
URL: http://svn.apache.org/viewvc?rev=1032437&view=rev
Log:
Fix up generics
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/DelegatingFileSystemOptionsBuilder.java
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/DelegatingFileSystemOptionsBuilder.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/DelegatingFileSystemOptionsBuilder.java?rev=1032437&r1=1032436&r2=1032437&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/DelegatingFileSystemOptionsBuilder.java
(original)
+++
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/util/DelegatingFileSystemOptionsBuilder.java
Mon Nov 8 01:26:35 2010
@@ -51,7 +51,8 @@ import java.util.TreeMap;
*/
public class DelegatingFileSystemOptionsBuilder
{
- private static final Class[] STRING_PARAM = new Class[]{String.class};
+ @SuppressWarnings("unchecked") // OK, it is a String
+ private static final Class<String>[] STRING_PARAM = new
Class[]{String.class};
private static final Map<String, Class<?>> PRIMATIVE_TO_OBJECT = new
TreeMap<String, Class<?>>();
@@ -232,7 +233,7 @@ public class DelegatingFileSystemOptions
*/
private boolean convertValuesAndInvoke(final Method configSetter, final
Context ctx) throws FileSystemException
{
- Class[] parameters = configSetter.getParameterTypes();
+ Class<?>[] parameters = configSetter.getParameterTypes();
if (parameters.length < 2)
{
return false;
@@ -242,8 +243,8 @@ public class DelegatingFileSystemOptions
return false;
}
- Class valueParameter = parameters[1];
- Class type;
+ Class<?> valueParameter = parameters[1];
+ Class<?> type;
if (valueParameter.isArray())
{
type = valueParameter.getComponentType();
@@ -260,7 +261,7 @@ public class DelegatingFileSystemOptions
if (type.isPrimitive())
{
- Class objectType = PRIMATIVE_TO_OBJECT.get(type.getName());
+ Class<?> objectType = PRIMATIVE_TO_OBJECT.get(type.getName());
if (objectType == null)
{
log.warn(Messages.getString("vfs.provider/config-unexpected-primitive.error",
type.getName()));
@@ -269,7 +270,7 @@ public class DelegatingFileSystemOptions
type = objectType;
}
- Class valueClass = ctx.values[0].getClass();
+ Class<? extends Object> valueClass = ctx.values[0].getClass();
if (type.isAssignableFrom(valueClass))
{
// can set value directly
@@ -370,7 +371,7 @@ public class DelegatingFileSystemOptions
/**
* invokes the method with the converted values
*/
- private void invokeSetter(Class valueParameter, final Context ctx, final
Method configSetter, final Object values)
+ private void invokeSetter(Class<?> valueParameter, final Context ctx,
final Method configSetter, final Object values)
throws FileSystemException
{
Object[] args;