You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Prescott Nasser (Updated) (JIRA)" <ji...@apache.org> on 2011/10/31 03:38:32 UTC
[Lucene.Net] [jira] [Updated] (LUCENENET-450) Incorrect use of StreamReader in
MoreLikeThis
[ https://issues.apache.org/jira/browse/LUCENENET-450?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Prescott Nasser updated LUCENENET-450:
--------------------------------------
Attachment: Lucenenet-450.patch
Attached patch; also merged to the trunk
> Incorrect use of StreamReader in MoreLikeThis
> ---------------------------------------------
>
> Key: LUCENENET-450
> URL: https://issues.apache.org/jira/browse/LUCENENET-450
> Project: Lucene.Net
> Issue Type: Bug
> Components: Lucene.Net Contrib
> Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.x, Lucene.Net 2.9.4g
> Reporter: Itamar Syn-Hershko
> Attachments: Lucenenet-450.patch
>
>
> In the MoreLike this implementation (looking at the trunk), line 772 incorrectly creates a new StreamReader instead of using StringReader. This causes the following exception to be thrown, since the ctor expects a file path and not an input string:
> System.ArgumentException: Illegal characters in path.
> at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str)
> at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
> at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, AccessControlActions control, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
> at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
> at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
> at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
> at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
> at System.IO.StreamReader..ctor(String path, Boolean detectEncodingFromByteOrderMarks)
> at Similarity.Net.MoreLikeThis.RetrieveTerms(Int32 docNum) in MoreLikeThis.cs:line 773
> at Similarity.Net.MoreLikeThis.Like(Int32 docNum) in MoreLikeThis.cs:line 507
> Simply replacing StreamReader with StringReader will do the job
--
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