@@ -0,0 +1,1420 @@
+package sfBugs;%0D%0A%0D%0Aimport java.io.Closeable;%0D%0Aimport java.io.File;%0D%0Aimport java.io.FileInputStream;%0D%0Aimport java.io.FileOutputStream;%0D%0Aimport java.io.IOException;%0D%0Aimport java.nio.channels.FileChannel;%0D%0A%0D%0Apublic class Bug3160693 %7B%0D%0A    public static void copy(File srcFile, File dstFile) throws IOException %7B%0D%0A        FileChannel srcChannel = null;%0D%0A        FileChannel dstChannel = null;%0D%0A%0D%0A        try %7B%0D%0A            // Create channel on the source%0D%0A            srcChannel = new FileInputStream(srcFile).getChannel();%0D%0A%0D%0A            // Create channel on the destination%0D%0A            dstChannel = new FileOutputStream(dstFile).getChannel();%0D%0A%0D%0A            // Copy file contents from source to destination%0D%0A            dstChannel.transferFrom(srcChannel,%0D%0A                    0,%0D%0A                    srcChannel.size());%0D%0A        %7D finally %7B%0D%0A            //Note only closing src channel, comment this next line of code and run FindBugs it will detect that here both srcChannel%0D%0A            //and dstChannel may failed to close. But enabling this next call will result in no longer detecting that this has%0D%0A            //failed for dstChannel%0D%0A            safeClose(srcChannel);%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    public static void safeClose(Closeable closeable) %7B%0D%0A        if (closeable != null) %7B%0D%0A            try %7B%0D%0A                closeable.close();%0D%0A            %7D catch (IOException ex) %7B%0D%0A            %7D%0D%0A        %7D%0D%0A    %7D%0D%0A%7D%0D%0A

Add bug 3160693