[Mono-bugs] [Bug 671029] New: TypesWithDisposableFieldsShouldBeDisposableRule should reduce confidence level if the offending field is not constructed in the class but passed in the constructor

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 10 13:26:00 EST 2011


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

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


           Summary: TypesWithDisposableFieldsShouldBeDisposableRule should
                    reduce confidence level if the offending field is not
                    constructed in the class but passed in the constructor
    Classification: Mono
           Product: Mono: Tools
           Version: 2.10.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Gendarme
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: knocte at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US)
AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.94 Safari/534.13

Example:
class SomeRepository {
  ISession session;
  public SomeRepository(ISession session){
    this.session = session;
  }
  public void DoSomeQuery(){
    session.Query("whatever");
  }
}

If ISession is IDisposable, this rule complains.

But the object was not actually constructed in the class, but outside, so there
may be other class who is responsible of disposing it.

Reproducible: Always

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


More information about the mono-bugs mailing list