Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/impl/src/test/org/jicarilla/io
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2537/components/http/impl/src/test/org/jicarilla/io
Modified Files:
FilesystemTestCase.java
Log Message:
Ran some code analysis tools on the code and changed approximately 200 small things based on that. Nothing shocking (I hope!)
Index: FilesystemTestCase.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/impl/src/test/org/jicarilla/io/FilesystemTestCase.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- FilesystemTestCase.java 19 Feb 2004 20:29:26 -0000 1.3
+++ FilesystemTestCase.java 26 Feb 2004 16:51:56 -0000 1.4
@@ -47,10 +47,12 @@
*/
public class FilesystemTestCase extends TestCase
{
+ public final static int BUFFER_SIZE = 1024;
+
// ----------------------------------------------------------------------
// Properties
// ----------------------------------------------------------------------
- FilesystemImpl system;
+ protected FilesystemImpl system;
// ----------------------------------------------------------------------
// Setup
@@ -59,8 +61,8 @@
{
super.setUp();
- String javaHome = System.getProperty( "java.home" );
- String slash = System.getProperty( "file.separator" );
+ final String javaHome = System.getProperty( "java.home" );
+ final String slash = System.getProperty( "file.separator" );
system = new FilesystemImpl( javaHome + slash + "lib" );
}
@@ -75,15 +77,15 @@
// ----------------------------------------------------------------------
public void testGetFile() throws Exception
{
- ReadableByteChannel channel = system.getFile( "rt.jar" );
+ final ReadableByteChannel channel = system.getFile( "rt.jar" );
assertNotNull( channel );
assertTrue( channel.isOpen() );
while(true)
{
- ByteBuffer buf = ByteBuffer.allocate(1024);
- int read = channel.read(buf);
+ final ByteBuffer buf = ByteBuffer.allocate(BUFFER_SIZE);
+ final int read = channel.read(buf);
if( read < 0 )
break;
}
@@ -132,7 +134,7 @@
// ----------------------------------------------------------------------
public void testReturnFile() throws Exception
{
- ReadableByteChannel channel = system.getFile( "rt.jar" );
+ final ReadableByteChannel channel = system.getFile( "rt.jar" );
assertNotNull( channel );
assertTrue( channel.isOpen() );
system.returnFile( channel );
@@ -151,13 +153,13 @@
public void testReturnFileDoesNotModifyChannelsItDidNotCreate() throws Exception
{
- String javaHome = System.getProperty( "java.home" );
- String slash = System.getProperty( "file.separator" );
- String file = javaHome + slash + "lib" + slash + "rt.jar";
+ final String javaHome = System.getProperty( "java.home" );
+ final String slash = System.getProperty( "file.separator" );
+ final String file = javaHome + slash + "lib" + slash + "rt.jar";
- File f = new File( file );
- FileInputStream fs = new FileInputStream( f );
- FileChannel fc = fs.getChannel();
+ final File f = new File( file );
+ final FileInputStream fs = new FileInputStream( f );
+ final FileChannel fc = fs.getChannel();
system.returnFile( fc );
assertTrue( fc.isOpen() );
@@ -175,7 +177,7 @@
{
}
- public int read( ByteBuffer dst ) throws IOException
+ public int read( final ByteBuffer dst ) throws IOException
{
return 0;
}
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.