[Mono-bugs] [Bug 635552] New: Types implementing Java.IO.Closeable should also implement System.IDisposable

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Aug 30 10:44:10 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=635552

https://bugzilla.novell.com/show_bug.cgi?id=635552#c0


           Summary: Types implementing Java.IO.Closeable should also
                    implement System.IDisposable
    Classification: Mono
           Product: MonoDroid
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mkestner at novell.com
        ReportedBy: jpryor at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


The java.io.Closeable interface was added in Java 6, and is the moral
equivalent of System.IDisposable.  Java 7 will supposedly add "native" support
for this interface, allowing Java code such as:

    do (Closeable c = ...) {
    }
    // at end of block, c.close() is implicitly invoked.

This is basically C#'s 'using' block.

Thus, to permit better use of C# functionality, every type that implements
Java.IO.ICloseable should ALSO implement System.IDisposable (possibly
explicitly), where IDisposable.Dispose() would simply call Close():

    namespace Java.IO {
        public abstract partial class Reader : Java.Lang.Object,
                Java.IO.ICloseable, Java.Lang.IReadable, System.IDisposable
        {
            void IDisposable.Dispose() {Close();}

            // other generated methods...
        }
    }

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list