[
https://issues.apache.org/jira/browse/LUCENENET-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774775#action_12774775
]
George Aroush commented on LUCENENET-207:
-----------------------------------------
A question and few comments.
In Lucene.Net/Index/NormsWriter.cs:
- for (int i = 0; i < fieldsToRemove.Count; i++)
+ if (fields is System.Collections.Hashtable) //{{DIGY}}
{
- // fields.Remove(fieldsToRemove[i]); // {{Aroush-2.9}}
+ System.Collections.Hashtable fieldsHT =
(System.Collections.Hashtable)fields;
+ for (int i = 0; i < fieldsToRemove.Count; i++)
+ {
+ fieldsHT.Remove(fieldsToRemove[i]);
+ }
+ }
+ else
+ {
System.Diagnostics.Debug.Fail("Port issue:", "workout the
fields.Remove() call"); // {{Aroush-2.9}}
}
+
}
There is no need for object type check here. Please discard this check and its
corresponding "else" block.
Other small cleanup comments:
finally
{
//compressor.End(); // {{Aroush-2.9}} should
this be compressor.Finish()?
- System.Diagnostics.Debug.Fail("Port issue:", "What's the
equivalent to 'java.util.zip.Inflater.end()'?");
+ //System.Diagnostics.Debug.Fail("Port issue:", "What's the
equivalent to 'java.util.zip.Inflater.end()'?");
}
There is no point to keep the commented diagnostics code (there are couple of
them in this patch).
Leave "finally" block in place. This will help with the delta for the next
port.
Also, if you no longer question a port / fix, do nolt leave a "{{DIGY}}"
comments behind. I.e.:
- for (int i = 0; i < fieldsToRemove.Count; i++)
+ if (fields is System.Collections.Hashtable) //{{DIGY}}
I.e.: remove "{{DIGY}}" or "{{Aroush}} as you address a port issue.
If you agree, please commit away with those changes.
Thanks!
> Test Documents (2.9.0)
> ----------------------
>
> Key: LUCENENET-207
> URL: https://issues.apache.org/jira/browse/LUCENENET-207
> Project: Lucene.Net
> Issue Type: Bug
> Environment: 2.9.0
> Reporter: Digy
> Priority: Minor
> Attachments: Documents.patch
>
>
> Hi George,
> 1- I commented "System.Diagnostics.Debug.Fail" in Comression Tools since I
> think it is correct.
> 2- Bug in DirectoryReader (corrected as --> System.String fileName =
> (string)((System.Collections.DictionaryEntry) it.Current).Value;)
> 3- added fields.Remove() to NormsWriter
> DIGY
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.