From: <cr...@us...> - 2008-12-17 13:47:12
|
Revision: 4792 http://jnode.svn.sourceforge.net/jnode/?rev=4792&view=rev Author: crawley Date: 2008-12-17 13:47:07 +0000 (Wed, 17 Dec 2008) Log Message: ----------- Minor fix to prevent wrapping of IOException with another one. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java 2008-12-17 13:40:06 UTC (rev 4791) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java 2008-12-17 13:47:07 UTC (rev 4792) @@ -290,10 +290,8 @@ long copyLength = Math.min(len - bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the - // block - //and update its contents with the data in src. If the - // whole block - //is overwritten, then skip reading it. + //block and update its contents with the data in src. If the + //whole block is overwritten, then skip reading it. byte[] dest; if (!((blockOffset == 0) && (copyLength == blockSize)) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); @@ -323,6 +321,9 @@ iNode.setMtime(System.currentTimeMillis() / 1000); } + } catch (IOException ex) { + // ... this avoids wrapping an IOException inside another one. + throw ex; } catch (Throwable ex) { final IOException ioe = new IOException(); ioe.initCause(ex); @@ -342,8 +343,7 @@ log.debug("Ext2File.flush()"); iNode.update(); //update the group descriptors and superblock: needed if blocks have - // been - //allocated or deallocated + //been allocated or deallocated iNode.getExt2FileSystem().updateFS(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |