[ https://issues.apache.org/jira/browse/LUCENENET-468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211301#comment-13211301 ]
Christopher Currens commented on LUCENENET-468: ----------------------------------------------- Pretty much all classes with Close now have a public Dispose(); non-sealed have a protected Dispose(bool) as well. The code compiles and tests pass, but code analysis still needs to be run to make sure Dispose is being called everywhere internally in the code. > Implement the Dispose pattern properly in classes with Close > ------------------------------------------------------------ > > Key: LUCENENET-468 > URL: https://issues.apache.org/jira/browse/LUCENENET-468 > Project: Lucene.Net > Issue Type: Sub-task > Components: Lucene.Net Contrib, Lucene.Net Core, Lucene.Net Demo, > Lucene.Net Test > Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.0.3, > Lucene.Net 2.9.4g > Environment: all > Reporter: Christopher Currens > Fix For: Lucene.Net 3.0.3 > > Time Spent: 1m > Remaining Estimate: 0h > > Implement the dispose pattern as [suggested > here|http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx] on any class that > implements Close(). Be sure to implement the IDisposable.Dispose() only in > the base class, and have all sub-class behavior overridden in a protected > method. > This change will involve making sure that everywhere the classes are used in > contrib, core, demo and test, that dispose is called on them. We don't want > to neglect calling dispose in our own code. For those with Visual Studio > 2010 Premium or higher, turning on Code Analysis in the project settings will > flag a warning that Dispose needs to be called on a class, so you don't have > to manually go searching for it. > These changes do not have to be breaking. Instead, also make {{Close}} a > public method in the base class and have it call {{Dispose}}. Mark it with > the Obsolete attribute, so we can remove it in later releases. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira