[Japi-cvs] SF.net SVN: japi:[1060] libs/argparser/trunk/src/doc/examples
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2009-02-22 16:25:10
|
Revision: 1060 http://japi.svn.sourceforge.net/japi/?rev=1060&view=rev Author: christianhujer Date: 2009-02-22 16:25:06 +0000 (Sun, 22 Feb 2009) Log Message: ----------- Fixed some IntelliJ IDEA warnings. Modified Paths: -------------- libs/argparser/trunk/src/doc/examples/Cat.java libs/argparser/trunk/src/doc/examples/Head.java libs/argparser/trunk/src/doc/examples/Recode.java libs/argparser/trunk/src/doc/examples/Tail.java libs/argparser/trunk/src/doc/examples/Uniq.java Modified: libs/argparser/trunk/src/doc/examples/Cat.java =================================================================== --- libs/argparser/trunk/src/doc/examples/Cat.java 2009-02-22 15:25:18 UTC (rev 1059) +++ libs/argparser/trunk/src/doc/examples/Cat.java 2009-02-22 16:25:06 UTC (rev 1060) @@ -36,7 +36,7 @@ private static final int BUF_SIZE = 4096; /** {@inheritDoc} */ - @SuppressWarnings({ "InstanceMethodNamingConvention" }) + @SuppressWarnings({"InstanceMethodNamingConvention", "ProhibitedExceptionDeclared"}) public int run(@NotNull final List<String> args) throws Exception { int returnCode = 0; if (args.size() == 0) { @@ -66,6 +66,7 @@ */ private void copy(@NotNull final InputStream in, @NotNull final OutputStream out) throws IOException { final byte[] buf = new byte[BUF_SIZE]; + //noinspection NestedAssignment for (int bytesRead; (bytesRead = in.read(buf)) != -1;) { out.write(buf, 0, bytesRead); } Modified: libs/argparser/trunk/src/doc/examples/Head.java =================================================================== --- libs/argparser/trunk/src/doc/examples/Head.java 2009-02-22 15:25:18 UTC (rev 1059) +++ libs/argparser/trunk/src/doc/examples/Head.java 2009-02-22 16:25:06 UTC (rev 1060) @@ -145,6 +145,7 @@ @SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"}) final BufferedReader lin = new BufferedReader(new InputStreamReader(in)); String line; + //noinspection NestedAssignment for (int i = 0; i < numItems && (line = lin.readLine()) != null; i++) { System.out.println(line); } Modified: libs/argparser/trunk/src/doc/examples/Recode.java =================================================================== --- libs/argparser/trunk/src/doc/examples/Recode.java 2009-02-22 15:25:18 UTC (rev 1059) +++ libs/argparser/trunk/src/doc/examples/Recode.java 2009-02-22 16:25:06 UTC (rev 1060) @@ -39,7 +39,7 @@ /** * Recode is a Java program that recodes files from one encoding to another. - * Warning: This file changes permissions and eventually ownership. + * Warning: Unlike its UNIX pendants, this program changes permissions and eventually ownership of the processed files. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class Recode extends BasicCommand { @@ -74,7 +74,7 @@ } /** {@inheritDoc} */ - @SuppressWarnings({"InstanceMethodNamingConvention"}) + @SuppressWarnings({"InstanceMethodNamingConvention", "ProhibitedExceptionDeclared"}) public int run(@NotNull final List<String> args) throws Exception { int returnCode = 0; if (args.size() == 0) { @@ -132,7 +132,7 @@ @SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"}) final Writer cout = new OutputStreamWriter(out, outputEncoding); final char[] buf = new char[BUF_SIZE]; - //noinspection StatementWithEmptyBody + //noinspection NestedAssignment for (int charsRead; (charsRead = cin.read(buf)) != -1;) { cout.write(buf, 0, charsRead); } Modified: libs/argparser/trunk/src/doc/examples/Tail.java =================================================================== --- libs/argparser/trunk/src/doc/examples/Tail.java 2009-02-22 15:25:18 UTC (rev 1059) +++ libs/argparser/trunk/src/doc/examples/Tail.java 2009-02-22 16:25:06 UTC (rev 1060) @@ -135,6 +135,7 @@ final byte[] buf = new byte[numItems]; int bytesRead; int loop = 0; + //noinspection NestedAssignment while ((bytesRead = lin.read(buf)) != -1) { loop++; } @@ -153,7 +154,7 @@ @SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"}) final BufferedReader lin = new BufferedReader(new InputStreamReader(in)); int num = 0; - //noinspection StatementWithEmptyBody + //noinspection NestedAssignment,ValueOfIncrementOrDecrementUsed while ((buf[num++ % numItems] = lin.readLine()) != null) { // nothing to do, it's all in the condition. } Modified: libs/argparser/trunk/src/doc/examples/Uniq.java =================================================================== --- libs/argparser/trunk/src/doc/examples/Uniq.java 2009-02-22 15:25:18 UTC (rev 1059) +++ libs/argparser/trunk/src/doc/examples/Uniq.java 2009-02-22 16:25:06 UTC (rev 1060) @@ -64,7 +64,7 @@ } /** {@inheritDoc} */ - @SuppressWarnings({"InstanceMethodNamingConvention"}) + @SuppressWarnings({"InstanceMethodNamingConvention", "ProhibitedExceptionDeclared"}) public int run(@NotNull final List<String> args) throws Exception { int returnCode = 0; for (final String arg : args) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |