lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Tregenna <luc...@rekenys.com>
Subject Re: Lucene.Net 1.9 RC1 Build 4 beta is ready
Date Thu, 15 Jun 2006 22:05:37 GMT
As far as I can tell the StreamWriter in the TestSearch.cs file is not 
really needed - it looks from the '(aroush)' comments that the intention 
was just to wrap the StringWriter in a StreamWriter, but I don't think 
this needs doing. The only methods called on pw in DoTestSearch are 
TextWriter methods that they both implement so using the StreamWriter 
directly appears fine - or at least consistent which is all the test 
actually tests Patch follows...

Ben

Index: TestSearch.cs
===================================================================
--- TestSearch.cs    (revision 414637)
+++ TestSearch.cs    (working copy)
@@ -56,17 +56,12 @@
         public virtual void  TestSearch_Renamed_Method()
         {
             System.IO.StringWriter sw = new System.IO.StringWriter();
-            System.IO.StreamWriter pw = null; // new 
System.IO.StreamWriter(sw);    // {{Aroush}} how do you pass 'sw' to 
StreamWriter()?
-            DoTestSearch(pw, false);
-            pw.Close();
+            DoTestSearch(sw, false);
             sw.Close();
             System.String multiFileOutput = 
sw.GetStringBuilder().ToString();
-            //System.out.println(multiFileOutput);
            
             sw = new System.IO.StringWriter();
-            pw = null; // new System.IO.StreamWriter(sw);   // 
{{Aroush}} how do you pass 'sw' to StreamWriter()?
-            DoTestSearch(pw, true);
-            pw.Close();
+            DoTestSearch(sw, true);
             sw.Close();
             System.String singleFileOutput = 
sw.GetStringBuilder().ToString();
            
@@ -74,7 +69,7 @@
         }
        
        
-        private void  DoTestSearch(System.IO.StreamWriter out_Renamed, 
bool useCompoundFile)
+        private void  DoTestSearch(System.IO.StringWriter out_Renamed, 
bool useCompoundFile)
         {
             Directory directory = new RAMDirectory();
             Analyzer analyzer = new SimpleAnalyzer();


Mime
View raw message