Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 94A73B722 for ; Sat, 7 Jan 2012 02:07:04 +0000 (UTC) Received: (qmail 45796 invoked by uid 500); 7 Jan 2012 02:07:03 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 45555 invoked by uid 500); 7 Jan 2012 02:07:03 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 45542 invoked by uid 99); 7 Jan 2012 02:07:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2012 02:07:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2012 02:06:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 77FAA2388980 for ; Sat, 7 Jan 2012 02:06:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1228550 - /commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java Date: Sat, 07 Jan 2012 02:06:38 -0000 To: commits@commons.apache.org From: niallp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120107020638.77FAA2388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: niallp Date: Sat Jan 7 02:06:38 2012 New Revision: 1228550 URL: http://svn.apache.org/viewvc?rev=1228550&view=rev Log: Checkstyle fixes Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java?rev=1228550&r1=1228549&r2=1228550&view=diff ============================================================================== --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java Sat Jan 7 02:06:38 2012 @@ -53,7 +53,7 @@ public class ReversedLinesFileReader imp * * @param file * the file to be read - * @throws IOException + * @throws IOException if an I/O error occurs */ public ReversedLinesFileReader(final File file) throws IOException { this(file, 4096, Charset.defaultCharset().toString()); @@ -69,7 +69,7 @@ public class ReversedLinesFileReader imp * match with the block size of the underlying file system). * @param encoding * the encoding of the file - * @throws IOException + * @throws IOException if an I/O error occurs */ public ReversedLinesFileReader(final File file, final int blockSize, final String encoding) throws IOException { this.blockSize = blockSize; @@ -104,12 +104,15 @@ public class ReversedLinesFileReader imp // http://www.herongyang.com/Unicode/JIS-Shift-JIS-Encoding.html byteDecrement = 1; } else if(charset == Charset.forName("UTF-16BE") || charset == Charset.forName("UTF-16LE")) { - // UTF-16 new line sequences are not allowed as second tuple of four byte sequences, however byte order has to be specified + // UTF-16 new line sequences are not allowed as second tuple of four byte sequences, + // however byte order has to be specified byteDecrement = 2; } else if(charset == Charset.forName("UTF-16")) { - throw new UnsupportedEncodingException("For UTF-16, you need to specify the byte order (use UTF-16BE or UTF-16LE)"); + throw new UnsupportedEncodingException( + "For UTF-16, you need to specify the byte order (use UTF-16BE or UTF-16LE)"); } else { - throw new UnsupportedEncodingException("Encoding "+encoding+" is not supported yet (feel free to submit a patch)"); + throw new UnsupportedEncodingException( + "Encoding "+encoding+" is not supported yet (feel free to submit a patch)"); } // NOTE: The new line sequences are matched in the order given, so it is important that \r\n is BEFORE \n newLineSequences = new byte[][] { "\r\n".getBytes(encoding), "\n".getBytes(encoding), "\r".getBytes(encoding) }; @@ -122,7 +125,7 @@ public class ReversedLinesFileReader imp * Returns the lines of the file from bottom to top. * * @return the next line or null if the start of the file is reached - * @throws IOException + * @throws IOException if an I/O error occurs */ public String readLine() throws IOException { @@ -148,6 +151,8 @@ public class ReversedLinesFileReader imp /** * Closes underlying resources. + * + * @throws IOException if an I/O error occurs */ public void close() throws IOException { randomAccessFile.close();