[Japi-cvs] SF.net SVN: japi: [578] libs/io/trunk
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2007-08-15 15:41:55
|
Revision: 578 http://japi.svn.sourceforge.net/japi/?rev=578&view=rev Author: christianhujer Date: 2007-08-15 08:41:53 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Added missing @NotNull / @Nullable annotations. Modified Paths: -------------- libs/io/trunk/libs-io.iml libs/io/trunk/src/net/sf/japi/io/Copier.java Modified: libs/io/trunk/libs-io.iml =================================================================== --- libs/io/trunk/libs-io.iml 2007-08-15 13:10:25 UTC (rev 577) +++ libs/io/trunk/libs-io.iml 2007-08-15 15:41:53 UTC (rev 578) @@ -8,6 +8,15 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/io/trunk/src/net/sf/japi/io/Copier.java =================================================================== --- libs/io/trunk/src/net/sf/japi/io/Copier.java 2007-08-15 13:10:25 UTC (rev 577) +++ libs/io/trunk/src/net/sf/japi/io/Copier.java 2007-08-15 15:41:53 UTC (rev 578) @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import org.jetbrains.annotations.NotNull; /** A Runnable that copies from an InputStream to an OutputStream. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -40,10 +41,10 @@ public static final boolean DEFAULT_AUTO_CLOSE = true; /** The InputStream to read from. */ - private final InputStream in; + @NotNull private final InputStream in; /** The OutputStream to write to. */ - private final OutputStream out; + @NotNull private final OutputStream out; /** The buffer size to use. */ private final int bufSize; @@ -58,7 +59,7 @@ * @param in the InputStream to read from * @param out the OutputStream to write to */ - public Copier(final InputStream in, final OutputStream out) { + public Copier(@NotNull final InputStream in, @NotNull final OutputStream out) { this(in, out, DEFAULT_BUF_SIZE, DEFAULT_AUTO_FLUSH, DEFAULT_AUTO_CLOSE); } @@ -67,7 +68,7 @@ * @param out the OutputStream to write to * @param bufSize buffer size to use while copying */ - public Copier(final InputStream in, final OutputStream out, final int bufSize) { + public Copier(@NotNull final InputStream in, @NotNull final OutputStream out, final int bufSize) { this(in, out, bufSize, DEFAULT_AUTO_FLUSH, DEFAULT_AUTO_CLOSE); } @@ -78,7 +79,7 @@ * @param autoFlush whether to flush automatically (true for automatic flush, false for flush on close) * @param autoClose whether to close the streams automatically (true for automatic close, false for no close) */ - public Copier(final InputStream in, final OutputStream out, final int bufSize, final boolean autoFlush, final boolean autoClose) { + public Copier(@NotNull final InputStream in, @NotNull final OutputStream out, final int bufSize, final boolean autoFlush, final boolean autoClose) { this.in = in; this.out = out; this.bufSize = bufSize; @@ -89,7 +90,7 @@ /** Start the copier in a new thread. * @return the newly created thread */ - public Thread start() { + @NotNull public Thread start() { final Thread thread = new Thread(this); thread.start(); return thread; @@ -108,13 +109,10 @@ } catch (final IOException e) { System.err.println(e); } finally { - //noinspection CatchGenericClass,OverlyBroadCatchBlock - try { out.flush(); } catch (final Exception ignore) { /* ignore */ } + try { out.flush(); } catch (final IOException ignore) { /* ignore */ } if (autoClose) { - //noinspection CatchGenericClass,OverlyBroadCatchBlock - try { out.close(); } catch (final Exception ignore) { /* ignore */ } - //noinspection CatchGenericClass,OverlyBroadCatchBlock - try { in.close(); } catch (final Exception ignore) { /* ignore */ } + try { out.close(); } catch (final IOException ignore) { /* ignore */ } + try { in.close(); } catch (final IOException ignore) { /* ignore */ } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |