You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Digy (JIRA)" <ji...@apache.org> on 2007/10/11 18:04:50 UTC

[jira] Updated: (LUCENENET-100) Problem with remoting of IComparable[] in FieldDoc.cs

     [ https://issues.apache.org/jira/browse/LUCENENET-100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy updated LUCENENET-100:
---------------------------

    Attachment: Program.cs

I am sending  the code with apache Licence.

I don't know much about Licensing but, is this statement  "Grant license to ASF for inclusion in ASF works"  while attaching files to Jira not enough?

DIGY

> Problem with remoting of IComparable[] in FieldDoc.cs
> -----------------------------------------------------
>
>                 Key: LUCENENET-100
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-100
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Digy
>            Assignee: George Aroush
>            Priority: Minor
>         Attachments: FieldDoc.patch, Program.cs, RemotingTest.rar
>
>
> Hi George,
> There are two problems related with remoting of IComparable[] in FieldDoc.cs
> 	1- IComparable[] can not be remoted with BinaryFormatter.
> When trying,the follwing error occurs:
> "Binary stream '99' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and  deserialization."
> [See "Hongwei Shen" bug report in 
> http://mail-archives.apache.org/mod_mbox/incubator-lucene-net-dev/200709.mbox/ajax/%3c547A9F771909EA48A8E06238B6DD94E702C59100@MAIL1.corp.geosign.com%3e
> ]
> 	Sample Code
>         ============
> 	    MemoryStream m = new MemoryStream();
>             System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
>             IComparable[] arr = new IComparable[1];
>             arr[0] = 123.45;
>             formatter.Serialize(m, arr);
>             m.Seek(0, SeekOrigin.Begin);
>             IComparable[] arr2 = (IComparable[])formatter.Deserialize(m);
>             Console.WriteLine(arr2[0].ToString() + " " + arr2[0].GetType().ToString());
>             Console.ReadLine();
> 	2-When it is remoted with SoapFormatter, all items in it are converted to string-type (like 123.45f -> "123.45") Therefore 
> FieldDocSortedHitQueue.LessThan method fails with "specified cast is no valid" when evaluating SortField.SCORE, SortField.DOC, SortField.INT and 
> SortField.FLOAT.(At least in my and Michael Garski's case (I know you don't get this error) http://mail-archives.apache.org/mod_mbox/incubator-lucene-net-dev/200709.mbox/ajax/%3c46F062BC.4090707@mac.com%3e)
> [See  LUCENENET-86 and LUCENENET-94]
> 	Sample Code
>         ============
> 	    MemoryStream m = new MemoryStream();
>             System.Runtime.Serialization.Formatters.Soap.SoapFormatter formatter = new System.Runtime.Serialization.Formatters.Soap.SoapFormatter();
>             IComparable[] arr = new IComparable[1];
>             arr[0] = 123.45;
>             formatter.Serialize(m, arr);
>             m.Seek(0, SeekOrigin.Begin);
>             IComparable[] arr2 = (IComparable[])formatter.Deserialize(m);
>             Console.WriteLine(arr2[0].ToString() + " " + arr2[0].GetType().ToString());
>             Console.ReadLine();
> To Test this Patch I used TestSort in NUnite test where TestNormalizedScores and TestRemoteSort fail
> DIGY

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.