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 2012/12/03 14:37:52 UTC
svn commit: r1416507 [6/8] - in /commons/proper/vfs/trunk/core/src:
main/java/org/apache/commons/vfs2/ main/java/org/apache/commons/vfs2/auth/
main/java/org/apache/commons/vfs2/cache/
main/java/org/apache/commons/vfs2/impl/ main/java/org/apache/commons...
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/VfsTask.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/VfsTask.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/VfsTask.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/VfsTask.java Mon Dec 3 13:37:12 2012
@@ -45,7 +45,7 @@ public class VfsTask
{
if (manager == null)
{
- StandardFileSystemManager mngr = new StandardFileSystemManager();
+ final StandardFileSystemManager mngr = new StandardFileSystemManager();
mngr.setLogger(new AntLogger());
mngr.init();
manager = mngr;
@@ -73,49 +73,49 @@ public class VfsTask
implements SubBuildListener
{
@Override
- public void subBuildStarted(BuildEvent buildEvent)
+ public void subBuildStarted(final BuildEvent buildEvent)
{
}
@Override
- public void subBuildFinished(BuildEvent buildEvent)
+ public void subBuildFinished(final BuildEvent buildEvent)
{
closeManager();
}
@Override
- public void buildFinished(BuildEvent event)
+ public void buildFinished(final BuildEvent event)
{
closeManager();
}
@Override
- public void buildStarted(BuildEvent event)
+ public void buildStarted(final BuildEvent event)
{
}
@Override
- public void messageLogged(BuildEvent event)
+ public void messageLogged(final BuildEvent event)
{
}
@Override
- public void targetFinished(BuildEvent event)
+ public void targetFinished(final BuildEvent event)
{
}
@Override
- public void targetStarted(BuildEvent event)
+ public void targetStarted(final BuildEvent event)
{
}
@Override
- public void taskFinished(BuildEvent event)
+ public void taskFinished(final BuildEvent event)
{
}
@Override
- public void taskStarted(BuildEvent event)
+ public void taskStarted(final BuildEvent event)
{
}
}
@@ -133,65 +133,65 @@ public class VfsTask
}
@Override
- public void debug(Object o, Throwable throwable)
+ public void debug(final Object o, final Throwable throwable)
{
debug(o);
}
@Override
- public void error(Object o)
+ public void error(final Object o)
{
log(String.valueOf(o), Project.MSG_ERR);
}
@Override
- public void error(Object o, Throwable throwable)
+ public void error(final Object o, final Throwable throwable)
{
error(o);
}
@Override
- public void fatal(Object o)
+ public void fatal(final Object o)
{
log(String.valueOf(o), Project.MSG_ERR);
}
@Override
- public void fatal(Object o, Throwable throwable)
+ public void fatal(final Object o, final Throwable throwable)
{
fatal(o);
}
@Override
- public void info(Object o)
+ public void info(final Object o)
{
log(String.valueOf(o), Project.MSG_INFO);
}
@Override
- public void info(Object o, Throwable throwable)
+ public void info(final Object o, final Throwable throwable)
{
info(o);
}
@Override
- public void trace(Object o)
+ public void trace(final Object o)
{
}
@Override
- public void trace(Object o, Throwable throwable)
+ public void trace(final Object o, final Throwable throwable)
{
}
@Override
- public void warn(Object o)
+ public void warn(final Object o)
{
log(String.valueOf(o), Project.MSG_WARN);
}
@Override
- public void warn(Object o, Throwable throwable)
+ public void warn(final Object o, final Throwable throwable)
{
warn(o);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java Mon Dec 3 13:37:12 2012
@@ -36,7 +36,7 @@ public class CombinedResources extends R
private boolean inited;
private final Properties properties = new Properties();
- public CombinedResources(String resourceName)
+ public CombinedResources(final String resourceName)
{
this.resourceName = resourceName;
}
@@ -54,14 +54,14 @@ public class CombinedResources extends R
inited = true;
}
- protected void loadResources(Locale locale)
+ protected void loadResources(final Locale locale)
{
if (locale == null)
{
return;
}
- String[] parts = new String[]{locale.getLanguage(), locale.getCountry(), locale.getVariant()};
- StringBuilder sb = new StringBuilder();
+ final String[] parts = new String[]{locale.getLanguage(), locale.getCountry(), locale.getVariant()};
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < 3; i++)
{
sb.append(getResourceName());
@@ -88,21 +88,21 @@ public class CombinedResources extends R
resourceName = resourceName.replace('.', '/') + ".properties";
try
{
- Enumeration<URL> resources = loader.getResources(resourceName);
+ final Enumeration<URL> resources = loader.getResources(resourceName);
while (resources.hasMoreElements())
{
- URL resource = resources.nextElement();
+ final URL resource = resources.nextElement();
try
{
properties.load(resource.openConnection().getInputStream());
}
- catch (IOException e)
+ catch (final IOException e)
{
// ignore
}
}
}
- catch (IOException e)
+ catch (final IOException e)
{
// ignore
}
@@ -138,7 +138,7 @@ public class CombinedResources extends R
}
@Override
- protected Object handleGetObject(String key)
+ protected Object handleGetObject(final String key)
{
if (!inited)
{
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CryptorFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CryptorFactory.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CryptorFactory.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CryptorFactory.java Mon Dec 3 13:37:12 2012
@@ -41,7 +41,7 @@ public final class CryptorFactory
* Allows the Cryptor class to be set programmatically.
* @param cryptor The Cryptor.
*/
- public static synchronized void setCryptor(Cryptor cryptor)
+ public static synchronized void setCryptor(final Cryptor cryptor)
{
instance = cryptor;
}
@@ -59,16 +59,16 @@ public final class CryptorFactory
return instance;
}
- String cryptorClass = System.getProperty(CRYPTOR_CLASS);
+ final String cryptorClass = System.getProperty(CRYPTOR_CLASS);
if (cryptorClass != null)
{
try
{
- Class<?> clazz = Class.forName(cryptorClass);
+ final Class<?> clazz = Class.forName(cryptorClass);
instance = (Cryptor) clazz.newInstance();
return instance;
}
- catch (Exception ex)
+ catch (final Exception ex)
{
throw new RuntimeException("Unable to create Cryptor " + cryptorClass, ex);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java Mon Dec 3 13:37:12 2012
@@ -44,17 +44,17 @@ public class DefaultCryptor implements C
* @throws Exception If an error occurs.
*/
@Override
- public String encrypt(String plainKey) throws Exception
+ public String encrypt(final String plainKey) throws Exception
{
- byte[] input = plainKey.getBytes();
- SecretKeySpec key = new SecretKeySpec(KEY_BYTES, "AES");
+ final byte[] input = plainKey.getBytes();
+ final SecretKeySpec key = new SecretKeySpec(KEY_BYTES, "AES");
- Cipher cipher = Cipher.getInstance("AES");
+ final Cipher cipher = Cipher.getInstance("AES");
// encryption pass
cipher.init(Cipher.ENCRYPT_MODE, key);
- byte[] cipherText = new byte[cipher.getOutputSize(input.length)];
+ final byte[] cipherText = new byte[cipher.getOutputSize(input.length)];
int ctLength = cipher.update(input, 0, input.length, cipherText, 0);
ctLength += cipher.doFinal(cipherText, ctLength);
return encode(cipherText);
@@ -67,23 +67,23 @@ public class DefaultCryptor implements C
* @throws Exception If an error occurs.
*/
@Override
- public String decrypt(String encryptedKey) throws Exception
+ public String decrypt(final String encryptedKey) throws Exception
{
- SecretKeySpec key = new SecretKeySpec(KEY_BYTES, "AES");
- Cipher cipher = Cipher.getInstance("AES");
+ final SecretKeySpec key = new SecretKeySpec(KEY_BYTES, "AES");
+ final Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.DECRYPT_MODE, key);
- byte[] decoded = decode(encryptedKey);
- byte[] plainText = new byte[cipher.getOutputSize(decoded.length)];
+ final byte[] decoded = decode(encryptedKey);
+ final byte[] plainText = new byte[cipher.getOutputSize(decoded.length)];
int ptLength = cipher.update(decoded, 0, decoded.length, plainText, 0);
ptLength += cipher.doFinal(plainText, ptLength);
return new String(plainText).substring(0, ptLength);
}
- private String encode(byte[] bytes)
+ private String encode(final byte[] bytes)
{
- StringBuilder builder = new StringBuilder();
+ final StringBuilder builder = new StringBuilder();
- for (byte b : bytes)
+ for (final byte b : bytes)
{
builder.append(HEX_CHARS[(b >> BITS_IN_HALF_BYTE) & MASK]);
builder.append(HEX_CHARS[b & MASK]);
@@ -91,21 +91,21 @@ public class DefaultCryptor implements C
return builder.toString();
}
- private byte[] decode(String str)
+ private byte[] decode(final String str)
{
- int length = str.length() / 2;
- byte[] decoded = new byte[length];
- char[] chars = str.toCharArray();
+ final int length = str.length() / 2;
+ final byte[] decoded = new byte[length];
+ final char[] chars = str.toCharArray();
int index = 0;
for (int i = 0; i < chars.length; ++i)
{
- int id1 = indexOf(HEX_CHARS, chars[i]);
+ final int id1 = indexOf(HEX_CHARS, chars[i]);
if (id1 == -1)
{
throw new IllegalArgumentException("Character " + chars[i] + " at position " + i
+ " is not a valid hexidecimal character");
}
- int id2 = indexOf(HEX_CHARS, chars[++i]);
+ final int id2 = indexOf(HEX_CHARS, chars[++i]);
if (id2 == -1)
{
throw new IllegalArgumentException("Character " + chars[i] + " at position " + i
@@ -116,7 +116,7 @@ public class DefaultCryptor implements C
return decoded;
}
- private int indexOf(char[] array, char valueToFind)
+ private int indexOf(final char[] array, final char valueToFind)
{
if (array == null)
{
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java Mon Dec 3 13:37:12 2012
@@ -137,7 +137,7 @@ public class DelegatingFileSystemOptions
public void setConfigStrings(final FileSystemOptions fso, final String scheme, final String name,
final String[] values) throws FileSystemException
{
- Context ctx = new Context(fso, scheme, name, values);
+ final Context ctx = new Context(fso, scheme, name, values);
setValues(ctx);
}
@@ -177,13 +177,13 @@ public class DelegatingFileSystemOptions
final Class<?>[] classNames)
throws FileSystemException, IllegalAccessException, InstantiationException
{
- Object[] values = new Object[classNames.length];
+ final Object[] values = new Object[classNames.length];
for (int iterClassNames = 0; iterClassNames < values.length; iterClassNames++)
{
values[iterClassNames] = classNames[iterClassNames].newInstance();
}
- Context ctx = new Context(fso, scheme, name, values);
+ final Context ctx = new Context(fso, scheme, name, values);
setValues(ctx);
}
@@ -191,7 +191,7 @@ public class DelegatingFileSystemOptions
/**
* sets the values using the informations of the given context.<br>
*/
- private void setValues(Context ctx) throws FileSystemException
+ private void setValues(final Context ctx) throws FileSystemException
{
// find all setter methods suitable for the given "name"
if (!fillConfigSetters(ctx))
@@ -205,10 +205,10 @@ public class DelegatingFileSystemOptions
ctx.fileSystemConfigBuilder = getManager().getFileSystemConfigBuilder(ctx.scheme);
// try to find a setter which could accept the value
- Iterator<Method> iterConfigSetters = ctx.configSetters.iterator();
+ final Iterator<Method> iterConfigSetters = ctx.configSetters.iterator();
while (iterConfigSetters.hasNext())
{
- Method configSetter = iterConfigSetters.next();
+ final Method configSetter = iterConfigSetters.next();
if (convertValuesAndInvoke(configSetter, ctx))
{
return;
@@ -226,7 +226,7 @@ public class DelegatingFileSystemOptions
*/
private boolean convertValuesAndInvoke(final Method configSetter, final Context ctx) throws FileSystemException
{
- Class<?>[] parameters = configSetter.getParameterTypes();
+ final Class<?>[] parameters = configSetter.getParameterTypes();
if (parameters.length < 2)
{
return false;
@@ -236,7 +236,7 @@ public class DelegatingFileSystemOptions
return false;
}
- Class<?> valueParameter = parameters[1];
+ final Class<?> valueParameter = parameters[1];
Class<?> type;
if (valueParameter.isArray())
{
@@ -254,7 +254,7 @@ public class DelegatingFileSystemOptions
if (type.isPrimitive())
{
- Class<?> objectType = PRIMATIVE_TO_OBJECT.get(type.getName());
+ final Class<?> objectType = PRIMATIVE_TO_OBJECT.get(type.getName());
if (objectType == null)
{
log.warn(Messages.getString("vfs.provider/config-unexpected-primitive.error", type.getName()));
@@ -263,7 +263,7 @@ public class DelegatingFileSystemOptions
type = objectType;
}
- Class<? extends Object> valueClass = ctx.values[0].getClass();
+ final Class<? extends Object> valueClass = ctx.values[0].getClass();
if (type.isAssignableFrom(valueClass))
{
// can set value directly
@@ -280,14 +280,14 @@ public class DelegatingFileSystemOptions
return false;
}
- Object convertedValues = java.lang.reflect.Array.newInstance(type, ctx.values.length);
+ final Object convertedValues = java.lang.reflect.Array.newInstance(type, ctx.values.length);
Constructor<?> valueConstructor;
try
{
valueConstructor = type.getConstructor(STRING_PARAM);
}
- catch (NoSuchMethodException e)
+ catch (final NoSuchMethodException e)
{
valueConstructor = null;
}
@@ -301,15 +301,15 @@ public class DelegatingFileSystemOptions
Array.set(convertedValues, iterValues,
valueConstructor.newInstance(new Object[]{ctx.values[iterValues]}));
}
- catch (InstantiationException e)
+ catch (final InstantiationException e)
{
throw new FileSystemException(e);
}
- catch (IllegalAccessException e)
+ catch (final IllegalAccessException e)
{
throw new FileSystemException(e);
}
- catch (InvocationTargetException e)
+ catch (final InvocationTargetException e)
{
throw new FileSystemException(e);
}
@@ -328,7 +328,7 @@ public class DelegatingFileSystemOptions
valueFactory = null;
}
}
- catch (NoSuchMethodException e)
+ catch (final NoSuchMethodException e)
{
valueFactory = null;
}
@@ -343,11 +343,11 @@ public class DelegatingFileSystemOptions
Array.set(convertedValues, iterValues,
valueFactory.invoke(null, new Object[]{ctx.values[iterValues]}));
}
- catch (IllegalAccessException e)
+ catch (final IllegalAccessException e)
{
throw new FileSystemException(e);
}
- catch (InvocationTargetException e)
+ catch (final InvocationTargetException e)
{
throw new FileSystemException(e);
}
@@ -363,7 +363,7 @@ public class DelegatingFileSystemOptions
/**
* invokes the method with the converted values
*/
- private void invokeSetter(Class<?> valueParameter, final Context ctx, final Method configSetter,
+ private void invokeSetter(final Class<?> valueParameter, final Context ctx, final Method configSetter,
final Object values)
throws FileSystemException
{
@@ -388,11 +388,11 @@ public class DelegatingFileSystemOptions
{
configSetter.invoke(ctx.fileSystemConfigBuilder, args);
}
- catch (IllegalAccessException e)
+ catch (final IllegalAccessException e)
{
throw new FileSystemException(e);
}
- catch (InvocationTargetException e)
+ catch (final InvocationTargetException e)
{
throw new FileSystemException(e);
}
@@ -404,8 +404,8 @@ public class DelegatingFileSystemOptions
private boolean fillConfigSetters(final Context ctx)
throws FileSystemException
{
- Map<String, List<Method>> schemeMethods = getSchemeMethods(ctx.scheme);
- List<Method> configSetters = schemeMethods.get(ctx.name.toLowerCase());
+ final Map<String, List<Method>> schemeMethods = getSchemeMethods(ctx.scheme);
+ final List<Method> configSetters = schemeMethods.get(ctx.name.toLowerCase());
if (configSetters == null)
{
return false;
@@ -433,7 +433,7 @@ public class DelegatingFileSystemOptions
/**
* create the list of all set*() methods for the given scheme
*/
- private Map<String, List<Method>> createSchemeMethods(String scheme) throws FileSystemException
+ private Map<String, List<Method>> createSchemeMethods(final String scheme) throws FileSystemException
{
final FileSystemConfigBuilder fscb = getManager().getFileSystemConfigBuilder(scheme);
if (fscb == null)
@@ -441,24 +441,24 @@ public class DelegatingFileSystemOptions
throw new FileSystemException("vfs.provider/no-config-builder.error", scheme);
}
- Map<String, List<Method>> schemeMethods = new TreeMap<String, List<Method>>();
+ final Map<String, List<Method>> schemeMethods = new TreeMap<String, List<Method>>();
- Method[] methods = fscb.getClass().getMethods();
- for (Method method : methods)
+ final Method[] methods = fscb.getClass().getMethods();
+ for (final Method method : methods)
{
if (!Modifier.isPublic(method.getModifiers()))
{
continue;
}
- String methodName = method.getName();
+ final String methodName = method.getName();
if (!methodName.startsWith("set"))
{
// not a setter
continue;
}
- String key = methodName.substring(3).toLowerCase();
+ final String key = methodName.substring(3).toLowerCase();
List<Method> configSetter = schemeMethods.get(key);
if (configSetter == null)
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/EncryptUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/EncryptUtil.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/EncryptUtil.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/EncryptUtil.java Mon Dec 3 13:37:12 2012
@@ -36,7 +36,7 @@ public final class EncryptUtil
* @param args The arguments in the form "command" parm1, parm2.
* @throws Exception If an error occurs.
*/
- public static void main(String[] args) throws Exception
+ public static void main(final String[] args) throws Exception
{
if (args.length != 2 || !args[0].equals("encrypt"))
{
@@ -44,7 +44,7 @@ public final class EncryptUtil
System.err.println(" password : The clear text password to encrypt");
System.exit(0);
}
- Cryptor cryptor = CryptorFactory.getCryptor();
+ final Cryptor cryptor = CryptorFactory.getCryptor();
if (args[0].equals("encrypt"))
{
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorInputStream.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorInputStream.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorInputStream.java Mon Dec 3 13:37:12 2012
@@ -116,7 +116,7 @@ public class MonitorInputStream
@Override
public void close() throws IOException
{
- boolean closed = finished.getAndSet(true);
+ final boolean closed = finished.getAndSet(true);
if (closed)
{
return;
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorOutputStream.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorOutputStream.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorOutputStream.java Mon Dec 3 13:37:12 2012
@@ -83,7 +83,7 @@ public class MonitorOutputStream
* @since 2.0
*/
@Override
- public synchronized void write(int b) throws IOException
+ public synchronized void write(final int b) throws IOException
{
assertOpen();
super.write(b);
@@ -97,7 +97,7 @@ public class MonitorOutputStream
* @since 2.0
*/
@Override
- public synchronized void write(byte[] b, int off, int len) throws IOException
+ public synchronized void write(final byte[] b, final int off, final int len) throws IOException
{
assertOpen();
super.write(b, off, len);
@@ -120,7 +120,7 @@ public class MonitorOutputStream
* @since 2.0
*/
@Override
- public void write(byte[] b) throws IOException
+ public void write(final byte[] b) throws IOException
{
assertOpen();
super.write(b);
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorRandomAccessContent.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorRandomAccessContent.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/MonitorRandomAccessContent.java Mon Dec 3 13:37:12 2012
@@ -91,7 +91,7 @@ public class MonitorRandomAccessContent
}
@Override
- public void seek(long pos) throws IOException
+ public void seek(final long pos) throws IOException
{
content.seek(pos);
}
@@ -103,109 +103,109 @@ public class MonitorRandomAccessContent
}
@Override
- public void write(int b) throws IOException
+ public void write(final int b) throws IOException
{
content.write(b);
}
@Override
- public void write(byte[] b) throws IOException
+ public void write(final byte[] b) throws IOException
{
content.write(b);
}
@Override
- public void write(byte[] b, int off, int len) throws IOException
+ public void write(final byte[] b, final int off, final int len) throws IOException
{
content.write(b, off, len);
}
@Override
- public void writeBoolean(boolean v) throws IOException
+ public void writeBoolean(final boolean v) throws IOException
{
content.writeBoolean(v);
}
@Override
- public void writeByte(int v) throws IOException
+ public void writeByte(final int v) throws IOException
{
content.writeByte(v);
}
@Override
- public void writeShort(int v) throws IOException
+ public void writeShort(final int v) throws IOException
{
content.writeShort(v);
}
@Override
- public void writeChar(int v) throws IOException
+ public void writeChar(final int v) throws IOException
{
content.writeChar(v);
}
@Override
- public void writeInt(int v) throws IOException
+ public void writeInt(final int v) throws IOException
{
content.writeInt(v);
}
@Override
- public void writeLong(long v) throws IOException
+ public void writeLong(final long v) throws IOException
{
content.writeLong(v);
}
@Override
- public void writeFloat(float v) throws IOException
+ public void writeFloat(final float v) throws IOException
{
content.writeFloat(v);
}
@Override
- public void writeDouble(double v) throws IOException
+ public void writeDouble(final double v) throws IOException
{
content.writeDouble(v);
}
@Override
- public void writeBytes(String s) throws IOException
+ public void writeBytes(final String s) throws IOException
{
content.writeBytes(s);
}
@Override
- public void writeChars(String s) throws IOException
+ public void writeChars(final String s) throws IOException
{
content.writeChars(s);
}
@Override
- public void writeUTF(String str) throws IOException
+ public void writeUTF(final String str) throws IOException
{
content.writeUTF(str);
}
@Override
- public void readFully(byte[] b) throws IOException
+ public void readFully(final byte[] b) throws IOException
{
content.readFully(b);
}
@Override
- public void readFully(byte[] b, int off, int len) throws IOException
+ public void readFully(final byte[] b, final int off, final int len) throws IOException
{
content.readFully(b, off, len);
}
@Override
- public int skipBytes(int n) throws IOException
+ public int skipBytes(final int n) throws IOException
{
return content.skipBytes(n);
}
@Override
- public void setLength(long newLength) throws IOException
+ public void setLength(final long newLength) throws IOException
{
content.setLength(newLength);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Os.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Os.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Os.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Os.java Mon Dec 3 13:37:12 2012
@@ -286,17 +286,17 @@ public final class Os
private static OsFamily[] determineAllFamilies()
{
// Determine all families the current OS belongs to
- Set<OsFamily> allFamilies = new HashSet<OsFamily>();
+ final Set<OsFamily> allFamilies = new HashSet<OsFamily>();
if (OS_FAMILY != null)
{
- List<OsFamily> queue = new ArrayList<OsFamily>();
+ final List<OsFamily> queue = new ArrayList<OsFamily>();
queue.add(OS_FAMILY);
while (queue.size() > 0)
{
final OsFamily family = queue.remove(0);
allFamilies.add(family);
final OsFamily[] families = family.getFamilies();
- for (OsFamily parent : families)
+ for (final OsFamily parent : families)
{
queue.add(parent);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/UserAuthenticatorUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/UserAuthenticatorUtils.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/UserAuthenticatorUtils.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/UserAuthenticatorUtils.java Mon Dec 3 13:37:12 2012
@@ -39,8 +39,8 @@ public final class UserAuthenticatorUtil
* @param overriddenValue The default value.
* @return The data of the given type as a character array or null if the data is not available.
*/
- public static char[] getData(UserAuthenticationData data, UserAuthenticationData.Type type,
- char[] overriddenValue)
+ public static char[] getData(final UserAuthenticationData data, final UserAuthenticationData.Type type,
+ final char[] overriddenValue)
{
if (overriddenValue != null)
{
@@ -62,10 +62,10 @@ public final class UserAuthenticatorUtil
* @param authenticatorTypes An array of types describing the data to be retrieved.
* @return A UserAuthenticationData object containing the data requested.
*/
- public static UserAuthenticationData authenticate(FileSystemOptions opts,
- UserAuthenticationData.Type[] authenticatorTypes)
+ public static UserAuthenticationData authenticate(final FileSystemOptions opts,
+ final UserAuthenticationData.Type[] authenticatorTypes)
{
- UserAuthenticator auth = DefaultFileSystemConfigBuilder.getInstance().getUserAuthenticator(opts);
+ final UserAuthenticator auth = DefaultFileSystemConfigBuilder.getInstance().getUserAuthenticator(opts);
return authenticate(auth, authenticatorTypes);
}
@@ -76,8 +76,8 @@ public final class UserAuthenticatorUtil
* @param authenticatorTypes An array of types describing the data to be retrieved.
* @return A UserAuthenticationData object containing the data requested.
*/
- public static UserAuthenticationData authenticate(UserAuthenticator auth,
- UserAuthenticationData.Type[] authenticatorTypes)
+ public static UserAuthenticationData authenticate(final UserAuthenticator auth,
+ final UserAuthenticationData.Type[] authenticatorTypes)
{
if (auth == null)
{
@@ -93,7 +93,7 @@ public final class UserAuthenticatorUtil
* @param string The String to convert.
* @return The character array.
*/
- public static char[] toChar(String string)
+ public static char[] toChar(final String string)
{
if (string == null)
{
@@ -108,7 +108,7 @@ public final class UserAuthenticatorUtil
*
* @param authData The UserAuthenticationDAta.
*/
- public static void cleanup(UserAuthenticationData authData)
+ public static void cleanup(final UserAuthenticationData authData)
{
if (authData == null)
{
@@ -124,7 +124,7 @@ public final class UserAuthenticatorUtil
* @param data A character array containing the data to convert to a String.
* @return The String.
*/
- public static String toString(char[] data)
+ public static String toString(final char[] data)
{
if (data == null)
{
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/WeakRefFileListener.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/WeakRefFileListener.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/WeakRefFileListener.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/WeakRefFileListener.java Mon Dec 3 13:37:12 2012
@@ -49,7 +49,7 @@ public class WeakRefFileListener impleme
*/
public static void installListener(final FileObject file, final FileListener listener)
{
- WeakRefFileListener weakListener = new WeakRefFileListener(file, listener);
+ final WeakRefFileListener weakListener = new WeakRefFileListener(file, listener);
file.getFileSystem().addListener(file, new WeakRefFileListener(file, weakListener));
}
@@ -62,10 +62,10 @@ public class WeakRefFileListener impleme
*/
protected FileListener getListener() throws Exception
{
- FileListener listener = this.listener.get();
+ final FileListener listener = this.listener.get();
if (listener == null)
{
- FileObject file = fs.resolveFile(name);
+ final FileObject file = fs.resolveFile(name);
file.getFileSystem().removeListener(file, this);
}
return listener;
@@ -79,7 +79,7 @@ public class WeakRefFileListener impleme
@Override
public void fileCreated(final FileChangeEvent event) throws Exception
{
- FileListener listener = getListener();
+ final FileListener listener = getListener();
if (listener == null)
{
return;
@@ -95,7 +95,7 @@ public class WeakRefFileListener impleme
@Override
public void fileDeleted(final FileChangeEvent event) throws Exception
{
- FileListener listener = getListener();
+ final FileListener listener = getListener();
if (listener == null)
{
return;
@@ -111,9 +111,9 @@ public class WeakRefFileListener impleme
* @throws Exception if an error occurs.
*/
@Override
- public void fileChanged(FileChangeEvent event) throws Exception
+ public void fileChanged(final FileChangeEvent event) throws Exception
{
- FileListener listener = getListener();
+ final FileListener listener = getListener();
if (listener == null)
{
return;
Modified: commons/proper/vfs/trunk/core/src/test/java/code/ClassToLoad.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/code/ClassToLoad.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/code/ClassToLoad.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/code/ClassToLoad.java Mon Dec 3 13:37:12 2012
@@ -21,7 +21,7 @@ package code;
*/
public class ClassToLoad
{
- private String m_message = "**PRIVATE**";
+ private final String m_message = "**PRIVATE**";
@Override
public String toString()
Modified: commons/proper/vfs/trunk/core/src/test/java/com/jcraft/jsch/TestIdentityRepositoryFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/com/jcraft/jsch/TestIdentityRepositoryFactory.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/com/jcraft/jsch/TestIdentityRepositoryFactory.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/com/jcraft/jsch/TestIdentityRepositoryFactory.java Mon Dec 3 13:37:12 2012
@@ -29,7 +29,7 @@ import org.apache.commons.vfs2.provider.
public class TestIdentityRepositoryFactory implements IdentityRepositoryFactory
{
@Override
- public IdentityRepository create(JSch jsch)
+ public IdentityRepository create(final JSch jsch)
{
return new LocalIdentityRepository(jsch);
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/AbstractVfsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/AbstractVfsTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/AbstractVfsTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/AbstractVfsTestCase.java Mon Dec 3 13:37:12 2012
@@ -150,7 +150,7 @@ public abstract class AbstractVfsTestCas
{
return file.getCanonicalFile();
}
- catch (IOException e)
+ catch (final IOException e)
{
return file.getAbsoluteFile();
}
@@ -165,7 +165,7 @@ public abstract class AbstractVfsTestCas
public static void assertSameMessage(final String[] messages, final Throwable throwable)
{
Throwable current = throwable;
- for (String message : messages)
+ for (final String message : messages)
{
assertNotNull(current);
if (message != null)
@@ -181,14 +181,14 @@ public abstract class AbstractVfsTestCas
/**
* Returns the cause of an exception.
*/
- public static Throwable getCause(Throwable throwable)
+ public static Throwable getCause(final Throwable throwable)
{
try
{
- Method method = throwable.getClass().getMethod("getCause", (Class[]) null);
+ final Method method = throwable.getClass().getMethod("getCause", (Class[]) null);
return (Throwable) method.invoke(throwable, (Object[]) null);
}
- catch (Exception e)
+ catch (final Exception e)
{
return null;
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Mon Dec 3 13:37:12 2012
@@ -85,8 +85,8 @@ public class FileExtensionSelectorTest
@Test
public void testEmpty() throws Exception
{
- FileSelector selector = new FileExtensionSelector();
- FileObject[] foList = BaseFolder.findFiles(selector);
+ final FileSelector selector = new FileExtensionSelector();
+ final FileObject[] foList = BaseFolder.findFiles(selector);
Assert.assertEquals(0, foList.length);
}
@@ -102,7 +102,7 @@ public class FileExtensionSelectorTest
Assert.assertTrue(foArray.length > 0);
// gather file extensions.
final Set<String> extensionSet = new HashSet<String>();
- for (FileObject fo : foArray)
+ for (final FileObject fo : foArray)
{
extensionSet.add(fo.getName().getExtension());
}
@@ -124,8 +124,8 @@ public class FileExtensionSelectorTest
@Test
public void testNullCollection() throws Exception
{
- FileSelector selector0 = new FileExtensionSelector((Collection<String>) null);
- FileObject[] foList = BaseFolder.findFiles(selector0);
+ final FileSelector selector0 = new FileExtensionSelector((Collection<String>) null);
+ final FileObject[] foList = BaseFolder.findFiles(selector0);
Assert.assertEquals(0, foList.length);
}
@@ -137,8 +137,8 @@ public class FileExtensionSelectorTest
@Test
public void testNullString() throws Exception
{
- FileSelector selector0 = new FileExtensionSelector((String) null);
- FileObject[] foList = BaseFolder.findFiles(selector0);
+ final FileSelector selector0 = new FileExtensionSelector((String) null);
+ final FileObject[] foList = BaseFolder.findFiles(selector0);
Assert.assertEquals(0, foList.length);
}
@@ -154,7 +154,7 @@ public class FileExtensionSelectorTest
Assert.assertTrue(foArray.length > 0);
// gather file extensions.
final Set<String> extensionSet = new HashSet<String>();
- for (FileObject fo : foArray)
+ for (final FileObject fo : foArray)
{
extensionSet.add(fo.getName().getExtension());
}
@@ -162,14 +162,14 @@ public class FileExtensionSelectorTest
Arrays.asList(foArray).toString());
Assert.assertEquals(message, ExtensionCount, extensionSet.size());
// check each extension
- for (String extension : extensionSet)
+ for (final String extension : extensionSet)
{
final FileSelector selector = new FileExtensionSelector(extension);
final FileObject[] list = BaseFolder.findFiles(selector);
Assert.assertEquals(FilesPerExtensionCount, list.length);
}
// check each file against itself
- for (FileObject fo : foArray)
+ for (final FileObject fo : foArray)
{
final FileSelector selector = new FileExtensionSelector(fo.getName().getExtension());
final FileObject[] list = BaseFolder.findFiles(selector);
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileIteratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileIteratorTest.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileIteratorTest.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileIteratorTest.java Mon Dec 3 13:37:12 2012
@@ -81,17 +81,17 @@ public class FileIteratorTest
final FileObject[] listFiles = BaseFolder.getChildren();
Assert.assertTrue(FileCount > listFiles.length);
int i = 0;
- for (FileObject actualFile : BaseFolder)
+ for (final FileObject actualFile : BaseFolder)
{
- FileObject expectedFile = findFiles[i];
+ final FileObject expectedFile = findFiles[i];
Assert.assertEquals(expectedFile, actualFile);
i++;
}
- Iterator<FileObject> iter = BaseFolder.iterator();
+ final Iterator<FileObject> iter = BaseFolder.iterator();
i = 0;
while (iter.hasNext())
{
- FileObject expectedFile = findFiles[i];
+ final FileObject expectedFile = findFiles[i];
Assert.assertEquals(expectedFile, iter.next());
i++;
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java Mon Dec 3 13:37:12 2012
@@ -66,8 +66,8 @@ public class FileTypeSelectorTest
@Test
public void testFileOrFolders() throws Exception
{
- FileSelector selector = new FileTypeSelector(FileType.FILE_OR_FOLDER);
- FileObject[] foList = BaseFolder.findFiles(selector);
+ final FileSelector selector = new FileTypeSelector(FileType.FILE_OR_FOLDER);
+ final FileObject[] foList = BaseFolder.findFiles(selector);
// Why 0?
Assert.assertEquals(0, foList.length);
}
@@ -75,16 +75,16 @@ public class FileTypeSelectorTest
@Test
public void testFiles() throws Exception
{
- FileSelector selector = new FileTypeSelector(FileType.FILE);
- FileObject[] foList = BaseFolder.findFiles(selector);
+ final FileSelector selector = new FileTypeSelector(FileType.FILE);
+ final FileObject[] foList = BaseFolder.findFiles(selector);
Assert.assertEquals(5, foList.length);
}
@Test
public void testFolders() throws Exception
{
- FileSelector selector = new FileTypeSelector(FileType.FOLDER);
- FileObject[] foList = BaseFolder.findFiles(selector);
+ final FileSelector selector = new FileTypeSelector(FileType.FOLDER);
+ final FileObject[] foList = BaseFolder.findFiles(selector);
Assert.assertEquals(8, foList.length);
}
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/PatternFileSelectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/PatternFileSelectorTest.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/PatternFileSelectorTest.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/PatternFileSelectorTest.java Mon Dec 3 13:37:12 2012
@@ -116,7 +116,7 @@ public class PatternFileSelectorTest
final String regExPrefix = ".*\\.";
// gather file extensions.
final Set<String> extensionSet = new HashSet<String>();
- for (FileObject fo : foArray)
+ for (final FileObject fo : foArray)
{
extensionSet.add(regExPrefix + fo.getName().getExtension());
}
@@ -124,14 +124,14 @@ public class PatternFileSelectorTest
Arrays.asList(foArray).toString());
Assert.assertEquals(message, ExtensionCount, extensionSet.size());
// check each extension
- for (String extension : extensionSet)
+ for (final String extension : extensionSet)
{
final FileSelector selector = new PatternFileSelector(extension);
final FileObject[] list = BaseFolder.findFiles(selector);
Assert.assertEquals(FilesPerExtensionCount, list.length);
}
// check each file against itself
- for (FileObject fo : foArray)
+ for (final FileObject fo : foArray)
{
final FileSelector selector = new PatternFileSelector(regExPrefix + fo.getName().getExtension());
final FileObject[] list = BaseFolder.findFiles(selector);
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/RunTest.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/RunTest.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/RunTest.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/RunTest.java Mon Dec 3 13:37:12 2012
@@ -24,11 +24,11 @@ import junit.framework.TestResult;
public class RunTest
{
- public static void main(String[] args) throws Exception
+ public static void main(final String[] args) throws Exception
{
final String ip = "192.168.0.128";
- Properties props = System.getProperties();
+ final Properties props = System.getProperties();
props.setProperty("test.data.src", "src/test-data");
props.setProperty("test.basedir", "core/target/test-classes/test-data");
props.setProperty("test.basedir.res", "test-data");
@@ -47,7 +47,7 @@ public class RunTest
props.setProperty("test.sftp.uri",
"sftp://vfsusr:vfs%2f%25\\te:st@" + ip + "/vfstest");
- Test tests[] = new Test[]
+ final Test tests[] = new Test[]
{
// LocalProviderTestCase.suite(),
// FtpProviderTestCase.suite(),
@@ -74,31 +74,31 @@ public class RunTest
// WebdavProviderTestCase.suite(),
};
- TestResult result = new TestResult()
+ final TestResult result = new TestResult()
{
@Override
- public void startTest(Test test)
+ public void startTest(final Test test)
{
System.out.println("start " + test);
System.out.flush();
}
@Override
- public void endTest(Test test)
+ public void endTest(final Test test)
{
// System.err.println("end " + test);
}
@Override
- public synchronized void addError(Test test, Throwable throwable)
+ public synchronized void addError(final Test test, final Throwable throwable)
{
// throw new RuntimeException(throwable.getMessage());
throwable.printStackTrace();
}
@Override
- public synchronized void addFailure(Test test,
- AssertionFailedError assertionFailedError)
+ public synchronized void addFailure(final Test test,
+ final AssertionFailedError assertionFailedError)
{
// throw new RuntimeException(assertionFailedError.getMessage());
assertionFailedError.printStackTrace();
@@ -110,7 +110,7 @@ public class RunTest
System.out.println("start test#" + i);
System.out.flush();
- Test test = tests[i];
+ final Test test = tests[i];
test.run(result);
// break;
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/LRUFilesCacheTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/LRUFilesCacheTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/LRUFilesCacheTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/LRUFilesCacheTestCase.java Mon Dec 3 13:37:12 2012
@@ -37,7 +37,7 @@ public class LRUFilesCacheTestCase
{
public static Test suite() throws Exception
{
- CacheTestSuite suite = new CacheTestSuite(new LRUFilesCacheTestCase());
+ final CacheTestSuite suite = new CacheTestSuite(new LRUFilesCacheTestCase());
suite.addTests(LRUFilesCacheTests.class);
return suite;
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/LRUFilesCacheTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/LRUFilesCacheTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/LRUFilesCacheTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/LRUFilesCacheTests.java Mon Dec 3 13:37:12 2012
@@ -26,45 +26,51 @@ public class LRUFilesCacheTests extends
{
public void testFilesCache() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
// releaseable
- FileObject dir1 = scratchFolder.resolveFile("dir1");
+ final FileObject dir1 = scratchFolder.resolveFile("dir1");
// avoid cache removal
- FileObject dir2 = scratchFolder.resolveFile("dir2");
+ final FileObject dir2 = scratchFolder.resolveFile("dir2");
dir2.getContent();
// releaseable
@SuppressWarnings("unused")
+ final
FileObject dir3 = scratchFolder.resolveFile("dir3");
// releaseable
@SuppressWarnings("unused")
+ final
FileObject dir4 = scratchFolder.resolveFile("dir4");
// releaseable
@SuppressWarnings("unused")
+ final
FileObject dir5 = scratchFolder.resolveFile("dir5");
// releaseable
@SuppressWarnings("unused")
+ final
FileObject dir6 = scratchFolder.resolveFile("dir6");
// releaseable
@SuppressWarnings("unused")
+ final
FileObject dir7 = scratchFolder.resolveFile("dir7");
// releaseable
@SuppressWarnings("unused")
+ final
FileObject dir8 = scratchFolder.resolveFile("dir8");
// check if the cache still holds the right instance
- FileObject dir2_2 = scratchFolder.resolveFile("dir2");
+ final FileObject dir2_2 = scratchFolder.resolveFile("dir2");
assertTrue(dir2 == dir2_2);
// check if the cache still holds the right instance
- FileObject dir1_2 = scratchFolder.resolveFile("dir1");
+ final FileObject dir1_2 = scratchFolder.resolveFile("dir1");
assertFalse(dir1 == dir1_2);
}
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/NullFilesCacheTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/NullFilesCacheTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/NullFilesCacheTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/NullFilesCacheTestCase.java Mon Dec 3 13:37:12 2012
@@ -37,7 +37,7 @@ public class NullFilesCacheTestCase
{
public static Test suite() throws Exception
{
- CacheTestSuite suite = new CacheTestSuite(new NullFilesCacheTestCase());
+ final CacheTestSuite suite = new CacheTestSuite(new NullFilesCacheTestCase());
suite.addTests(NullFilesCacheTests.class);
return suite;
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/NullFilesCacheTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/NullFilesCacheTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/NullFilesCacheTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/cache/NullFilesCacheTests.java Mon Dec 3 13:37:12 2012
@@ -27,10 +27,10 @@ public class NullFilesCacheTests extends
{
public void testFilesCache() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
- FileObject dir1 = scratchFolder.resolveFile("dir1");
- FileObject dir1_2 = scratchFolder.resolveFile("dir1");
+ final FileObject dir1 = scratchFolder.resolveFile("dir1");
+ final FileObject dir1_2 = scratchFolder.resolveFile("dir1");
assertFalse(dir1 == dir1_2);
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/impl/test/DefaultFileMonitorTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/impl/test/DefaultFileMonitorTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/impl/test/DefaultFileMonitorTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/impl/test/DefaultFileMonitorTests.java Mon Dec 3 13:37:12 2012
@@ -64,8 +64,8 @@ public class DefaultFileMonitorTests ext
public void testFileCreated() throws Exception
{
- FileObject fileObj = fsManager.resolveFile(testFile.toURI().toURL().toString());
- DefaultFileMonitor monitor = new DefaultFileMonitor(new TestFileListener());
+ final FileObject fileObj = fsManager.resolveFile(testFile.toURI().toURL().toString());
+ final DefaultFileMonitor monitor = new DefaultFileMonitor(new TestFileListener());
monitor.setDelay(100);
monitor.addFile(fileObj);
monitor.start();
@@ -79,8 +79,8 @@ public class DefaultFileMonitorTests ext
public void testFileDeleted() throws Exception
{
writeToFile(testFile);
- FileObject fileObj = fsManager.resolveFile(testFile.toURI().toString());
- DefaultFileMonitor monitor = new DefaultFileMonitor(new TestFileListener());
+ final FileObject fileObj = fsManager.resolveFile(testFile.toURI().toString());
+ final DefaultFileMonitor monitor = new DefaultFileMonitor(new TestFileListener());
monitor.setDelay(100);
monitor.addFile(fileObj);
monitor.start();
@@ -94,16 +94,16 @@ public class DefaultFileMonitorTests ext
public void testFileModified() throws Exception
{
writeToFile(testFile);
- FileObject fileObj = fsManager.resolveFile(testFile.toURI().toURL().toString());
- DefaultFileMonitor monitor = new DefaultFileMonitor(new TestFileListener());
+ final FileObject fileObj = fsManager.resolveFile(testFile.toURI().toURL().toString());
+ final DefaultFileMonitor monitor = new DefaultFileMonitor(new TestFileListener());
monitor.setDelay(100);
monitor.addFile(fileObj);
monitor.start();
// Need a long delay to insure the new timestamp doesn't truncate to be the same as
// the current timestammp. Java only guarantees the timestamp will be to 1 second.
Thread.sleep(1000);
- long value = System.currentTimeMillis();
- boolean rc = testFile.setLastModified(value);
+ final long value = System.currentTimeMillis();
+ final boolean rc = testFile.setLastModified(value);
assertTrue("setLastModified succeeded",rc);
Thread.sleep(300);
assertTrue("No event occurred", changeStatus != 0);
@@ -114,8 +114,8 @@ public class DefaultFileMonitorTests ext
public void testFileRecreated() throws Exception
{
- FileObject fileObj = fsManager.resolveFile(testFile.toURI().toURL().toString());
- DefaultFileMonitor monitor = new DefaultFileMonitor(new TestFileListener());
+ final FileObject fileObj = fsManager.resolveFile(testFile.toURI().toURL().toString());
+ final DefaultFileMonitor monitor = new DefaultFileMonitor(new TestFileListener());
monitor.setDelay(100);
monitor.addFile(fileObj);
monitor.start();
@@ -138,9 +138,9 @@ public class DefaultFileMonitorTests ext
monitor.stop();
}
- private void writeToFile(File file) throws Exception
+ private void writeToFile(final File file) throws Exception
{
- FileWriter out = new FileWriter(file);
+ final FileWriter out = new FileWriter(file);
out.write("string=value1");
out.flush();
out.close();
@@ -150,19 +150,19 @@ public class DefaultFileMonitorTests ext
public class TestFileListener implements FileListener
{
@Override
- public void fileChanged(FileChangeEvent event) throws Exception
+ public void fileChanged(final FileChangeEvent event) throws Exception
{
changeStatus = 1;
}
@Override
- public void fileDeleted(FileChangeEvent event) throws Exception
+ public void fileDeleted(final FileChangeEvent event) throws Exception
{
changeStatus = 2;
}
@Override
- public void fileCreated(FileChangeEvent event) throws Exception
+ public void fileCreated(final FileChangeEvent event) throws Exception
{
changeStatus = 3;
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/impl/test/VfsClassLoaderTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/impl/test/VfsClassLoaderTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/impl/test/VfsClassLoaderTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/impl/test/VfsClassLoaderTests.java Mon Dec 3 13:37:12 2012
@@ -49,7 +49,7 @@ public class VfsClassLoaderTests
*/
private VFSClassLoader createClassLoader() throws FileSystemException
{
- FileObject file = getBaseFolder();
+ final FileObject file = getBaseFolder();
return new VFSClassLoader(file, getManager());
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/perf/FileNamePerformance.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/perf/FileNamePerformance.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/perf/FileNamePerformance.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/perf/FileNamePerformance.java Mon Dec 3 13:37:12 2012
@@ -26,13 +26,13 @@ public class FileNamePerformance
{
private final static int NUOF_RESOLVES = 100000;
- public static void main(String[] args) throws FileSystemException
+ public static void main(final String[] args) throws FileSystemException
{
- FileSystemManager mgr = VFS.getManager();
+ final FileSystemManager mgr = VFS.getManager();
- FileObject root = mgr
+ final FileObject root = mgr
.resolveFile("smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr");
- FileName rootName = root.getName();
+ final FileName rootName = root.getName();
testNames(mgr, rootName);
@@ -41,7 +41,7 @@ public class FileNamePerformance
testFiles(mgr);
}
- private static void testFiles(FileSystemManager mgr) throws FileSystemException
+ private static void testFiles(final FileSystemManager mgr) throws FileSystemException
{
for (int i = 0; i < 10; i++)
{
@@ -49,18 +49,18 @@ public class FileNamePerformance
mgr.resolveFile("smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr/many/path/elements/with%25esc/any%25where/to/file.txt");
}
- long start = System.currentTimeMillis();
+ final long start = System.currentTimeMillis();
for (int i = 0; i < NUOF_RESOLVES; i++)
{
mgr.resolveFile("smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr/many/path/elements/with%25esc/any%25where/to/file.txt");
}
- long end = System.currentTimeMillis();
+ final long end = System.currentTimeMillis();
System.err.println("time to resolve " + NUOF_RESOLVES + " files: "
+ (end - start) + "ms");
}
- private static void testChildren(FileObject root) throws FileSystemException
+ private static void testChildren(final FileObject root) throws FileSystemException
{
for (int i = 0; i < 10; i++)
{
@@ -68,18 +68,18 @@ public class FileNamePerformance
root.resolveFile("/many/path/elements/with%25esc/any%25where/to/file.txt");
}
- long start = System.currentTimeMillis();
+ final long start = System.currentTimeMillis();
for (int i = 0; i < NUOF_RESOLVES; i++)
{
root.resolveFile("/many/path/elements/with%25esc/any%25where/to/file.txt");
}
- long end = System.currentTimeMillis();
+ final long end = System.currentTimeMillis();
System.err.println("time to resolve " + NUOF_RESOLVES + " children: "
+ (end - start) + "ms");
}
- private static void testNames(FileSystemManager mgr, FileName rootName) throws FileSystemException
+ private static void testNames(final FileSystemManager mgr, final FileName rootName) throws FileSystemException
{
for (int i = 0; i < 10; i++)
{
@@ -88,13 +88,13 @@ public class FileNamePerformance
"/many/path/elements/with%25esc/any%25where/to/file.txt");
}
- long start = System.currentTimeMillis();
+ final long start = System.currentTimeMillis();
for (int i = 0; i < NUOF_RESOLVES; i++)
{
mgr.resolveName(rootName,
"/many/path/elements/with%25esc/any%25where/to/file.txt");
}
- long end = System.currentTimeMillis();
+ final long end = System.currentTimeMillis();
System.err.println("time to resolve " + NUOF_RESOLVES + " names: "
+ (end - start) + "ms");
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/FtpProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/FtpProviderTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/FtpProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/FtpProviderTestCase.java Mon Dec 3 13:37:12 2012
@@ -105,7 +105,7 @@ public class FtpProviderTestCase extends
// The user prop file requires the "homedirectory" to be set
user.setHomeDirectory(getTestDirectoryString());
serverFactory.setUserManager(userManager);
- ListenerFactory factory = new ListenerFactory();
+ final ListenerFactory factory = new ListenerFactory();
// set the port of the listener
factory.setPort(SocketPort);
@@ -167,7 +167,7 @@ public class FtpProviderTestCase extends
{
uri = ConnectionUri;
}
- FileSystemOptions opts = new FileSystemOptions();
+ final FileSystemOptions opts = new FileSystemOptions();
final FtpFileSystemConfigBuilder builder = FtpFileSystemConfigBuilder.getInstance();
builder.setPassiveMode(opts, true);
// FtpFileType.BINARY is the default
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/MultipleConnectionTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/MultipleConnectionTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/MultipleConnectionTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/MultipleConnectionTestCase.java Mon Dec 3 13:37:12 2012
@@ -43,8 +43,8 @@ public class MultipleConnectionTestCase
@Test
public void testUnderlyingConnect() throws SocketException, IOException
{
- FTPClient client1 = new FTPClient();
- FTPClient client2 = new FTPClient();
+ final FTPClient client1 = new FTPClient();
+ final FTPClient client2 = new FTPClient();
try
{
final String hostname = "localhost";
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java Mon Dec 3 13:37:12 2012
@@ -114,14 +114,14 @@ public class FtpsProviderTestCase_Disabl
// The user prop file requires the "homedirectory" to be set
user.setHomeDirectory(getTestDirectoryString());
serverFactory.setUserManager(userManager);
- ListenerFactory factory = new ListenerFactory();
+ final ListenerFactory factory = new ListenerFactory();
// set the port of the listener
factory.setPort(SocketPort);
// define SSL configuration
final URL serverJksResource = ClassLoader.getSystemClassLoader().getResource(SERVER_JKS_RES);
Assert.assertNotNull(SERVER_JKS_RES, serverJksResource);
- SslConfigurationFactory ssl = new SslConfigurationFactory();
+ final SslConfigurationFactory ssl = new SslConfigurationFactory();
final File keyStoreFile = new File(serverJksResource.getFile());
Assert.assertTrue(keyStoreFile.toString(), keyStoreFile.exists());
ssl.setKeystoreFile(keyStoreFile);
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/MultipleConnectionTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/MultipleConnectionTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/MultipleConnectionTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/MultipleConnectionTestCase.java Mon Dec 3 13:37:12 2012
@@ -44,7 +44,7 @@ public class MultipleConnectionTestCase
FtpsProviderTestCase_Disabled.tearDownClass();
}
- private FTPSClient init(FTPSClient client)
+ private FTPSClient init(final FTPSClient client)
{
client.enterLocalPassiveMode();
return client;
@@ -66,8 +66,8 @@ public class MultipleConnectionTestCase
@Test
public void testUnderlyingConnect() throws SocketException, IOException
{
- FTPSClient client1 = this.init(new FTPSClient(true));
- FTPSClient client2 = this.init(new FTPSClient(true));
+ final FTPSClient client1 = this.init(new FTPSClient(true));
+ final FTPSClient client2 = this.init(new FTPSClient(true));
try
{
final String hostname = "localhost";
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/HttpProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/HttpProviderTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/HttpProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/HttpProviderTestCase.java Mon Dec 3 13:37:12 2012
@@ -167,7 +167,7 @@ public class HttpProviderTestCase extend
manager.addProvider("http", new HttpFileProvider());
}
- private void testResloveFolderSlash(String uri, boolean followRedirect) throws FileSystemException
+ private void testResloveFolderSlash(final String uri, final boolean followRedirect) throws FileSystemException
{
VFS.getManager().getFilesCache().close();
final FileSystemOptions opts = new FileSystemOptions();
@@ -176,7 +176,7 @@ public class HttpProviderTestCase extend
try
{
checkReadTestsFolder(file);
- } catch (FileNotFolderException e)
+ } catch (final FileNotFolderException e)
{
// Expected: VFS HTTP does not support listing children yet.
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/jar/test/JarProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/jar/test/JarProviderTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/jar/test/JarProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/jar/test/JarProviderTestCase.java Mon Dec 3 13:37:12 2012
@@ -34,7 +34,7 @@ import org.apache.commons.vfs2.test.Prov
*/
public class JarProviderTestCase extends AbstractProviderTestConfig implements ProviderTestConfig
{
- static FileObject getTestJar(final FileSystemManager manager, String name) throws Exception
+ static FileObject getTestJar(final FileSystemManager manager, final String name) throws Exception
{
final File jarFile = AbstractVfsTestCase.getTestResourceFile(name);
final String uri = "jar:file:" + jarFile.getAbsolutePath() + "!/";
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java Mon Dec 3 13:37:12 2012
@@ -33,12 +33,12 @@ public class FileNameTests
public void testAbsoluteFileName() throws Exception
{
// Locate file by absolute file name
- String fileName = new File("testdir").getAbsolutePath();
- FileObject absFile = getManager().resolveFile(fileName);
+ final String fileName = new File("testdir").getAbsolutePath();
+ final FileObject absFile = getManager().resolveFile(fileName);
// Locate file by URI
- String uri = "file://" + fileName.replace(File.separatorChar, '/');
- FileObject uriFile = getManager().resolveFile(uri);
+ final String uri = "file://" + fileName.replace(File.separatorChar, '/');
+ final FileObject uriFile = getManager().resolveFile(uri);
assertSame("file object", absFile, uriFile);
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/local/test/UrlTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/local/test/UrlTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/local/test/UrlTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/local/test/UrlTests.java Mon Dec 3 13:37:12 2012
@@ -36,12 +36,12 @@ public class UrlTests
*/
public void testHashFindFiles() throws Exception
{
- FileSystemManager fsManager = VFS.getManager();
+ final FileSystemManager fsManager = VFS.getManager();
- FileObject[] foList = getBaseFolder().findFiles(Selectors.SELECT_FILES);
+ final FileObject[] foList = getBaseFolder().findFiles(Selectors.SELECT_FILES);
boolean hashFileFound = false;
- for (FileObject fo : foList)
+ for (final FileObject fo : foList)
{
if (fo.getURL().toString().contains("test-hash"))
{
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/CustomRamProviderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/CustomRamProviderTest.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/CustomRamProviderTest.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/CustomRamProviderTest.java Mon Dec 3 13:37:12 2012
@@ -49,7 +49,7 @@ public class CustomRamProviderTest
{
private static final byte[] NON_EMPTY_FILE_CONTENT = new byte[]{ 1, 2, 3 };
- private List<Closeable> closeables = new ArrayList<Closeable>();
+ private final List<Closeable> closeables = new ArrayList<Closeable>();
FileSystemOptions defaultRamFs = new FileSystemOptions();
@@ -62,7 +62,7 @@ public class CustomRamProviderTest
/**
* Closes the given {@link Closeable} during the tearDown phase.
*/
- private <C extends Closeable> C closeOnTearDown(C closeable)
+ private <C extends Closeable> C closeOnTearDown(final C closeable)
{
this.closeables.add(closeable);
return closeable;
@@ -106,7 +106,7 @@ public class CustomRamProviderTest
@After
public void tearDown() throws Exception
{
- for (Closeable closeable : this.closeables)
+ for (final Closeable closeable : this.closeables)
{
try
{
@@ -204,14 +204,14 @@ public class CustomRamProviderTest
@Test
public void testRootFolderExists() throws FileSystemException
{
- FileObject root = manager.resolveFile("ram:///", defaultRamFs);
+ final FileObject root = manager.resolveFile("ram:///", defaultRamFs);
assertTrue(root.getType().hasChildren());
try
{
root.delete();
fail();
- } catch (FileSystemException e)
+ } catch (final FileSystemException e)
{
// Expected
}
@@ -222,34 +222,34 @@ public class CustomRamProviderTest
public void testSmallFS() throws Exception
{
// Default FS
- FileObject fo1 = manager.resolveFile("ram:/");
- FileObject fo2 = manager.resolveFile("ram:/");
+ final FileObject fo1 = manager.resolveFile("ram:/");
+ final FileObject fo2 = manager.resolveFile("ram:/");
assertTrue("Both files should exist in the same fs instance.", fo1.getFileSystem() == fo2.getFileSystem());
// Small FS
- FileObject fo3 = manager.resolveFile("ram:/fo3", smallSized);
- FileObject fo4 = manager.resolveFile("ram:/", smallSized);
+ final FileObject fo3 = manager.resolveFile("ram:/fo3", smallSized);
+ final FileObject fo4 = manager.resolveFile("ram:/", smallSized);
assertTrue("Both files should exist in different fs instances.", fo3.getFileSystem() == fo4.getFileSystem());
assertTrue("These file shouldn't be in the same file system.", fo1.getFileSystem() != fo3.getFileSystem());
fo3.createFile();
try
{
- OutputStream os = fo3.getContent().getOutputStream();
+ final OutputStream os = fo3.getContent().getOutputStream();
os.write(new byte[10]);
os.close();
- } catch (FileSystemException e)
+ } catch (final FileSystemException e)
{
fail("It shouldn't save such a small file");
}
try
{
- OutputStream os = fo3.getContent().getOutputStream();
+ final OutputStream os = fo3.getContent().getOutputStream();
os.write(new byte[11]);
os.close();
fail("It shouldn't save such a big file");
- } catch (FileSystemException e)
+ } catch (final FileSystemException e)
{
// Expected
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/RamProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/RamProviderTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/RamProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/RamProviderTestCase.java Mon Dec 3 13:37:12 2012
@@ -68,7 +68,7 @@ public class RamProviderTestCase extends
manager.addProvider("ram", new RamFileProvider());
manager.addProvider("file", new DefaultLocalFileProvider());
}
- catch (Exception e)
+ catch (final Exception e)
{
log.error(e);
throw e;
@@ -85,8 +85,8 @@ public class RamProviderTestCase extends
if (!inited)
{
// Import the test tree
- FileObject fo = manager.resolveFile("ram:/");
- RamFileSystem fs = (RamFileSystem) fo.getFileSystem();
+ final FileObject fo = manager.resolveFile("ram:/");
+ final RamFileSystem fs = (RamFileSystem) fo.getFileSystem();
fs.importTree(new File(AbstractVfsTestCase.getTestDirectoryString()));
fo.close();
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/res/test/ResourceProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/res/test/ResourceProviderTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/res/test/ResourceProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/res/test/ResourceProviderTestCase.java Mon Dec 3 13:37:12 2012
@@ -43,7 +43,7 @@ public class ResourceProviderTestCase ex
* Prepares the file system manager. This implementation does nothing.
*/
@Override
- public void prepare(DefaultFileSystemManager manager)
+ public void prepare(final DefaultFileSystemManager manager)
throws Exception
{
manager.addProvider("res", new ResourceFileProvider());
@@ -55,10 +55,10 @@ public class ResourceProviderTestCase ex
* Returns the base folder for tests.
*/
@Override
- public FileObject getBaseTestFolder(FileSystemManager manager)
+ public FileObject getBaseTestFolder(final FileSystemManager manager)
throws Exception
{
- String baseDir = AbstractVfsTestCase.getResourceTestDirectoryString();
+ final String baseDir = AbstractVfsTestCase.getResourceTestDirectoryString();
return manager.resolveFile("res:" + baseDir);
}
}