[ https://issues.apache.org/jira/browse/LUCENENET-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524206
]
Digy commented on LUCENENET-96:
-------------------------------
Hi George,
When I looked at the java code, i saw that NativeFSLockFactory and SimpleFSLockFactory have
parameterless
constructors and setLockDir methods, only for the use of FSDirector.
These methods are not available in the Lucene.net.
-------------------------------------
/**
* Create a SimpleFSLockFactory instance, with null (unset)
* lock directory. This is package-private and is only
* used by FSDirectory when creating this LockFactory via
* the System property
* org.apache.lucene.store.FSDirectoryLockFactoryClass.
*/
SimpleFSLockFactory() throws IOException {
this((File) null);
}
/**
* Set the lock directory. This is package-private and is
* only used externally by FSDirectory when creating this
* LockFactory via the System property
* org.apache.lucene.store.FSDirectoryLockFactoryClass.
*/
void setLockDir(File lockDir) throws IOException {
this.lockDir = lockDir;
}
-------------------------------------
To be able to pass the Nunit test of "Store.TestLockFactory.TestLockClassProperty":
As in Java Version,
a) These methods can be added to NativeFSLockFactory and SimpleFSLockFactory
b) FSDirectory.Init can be modified by inserting the translated java-codes (which are also
not available in
Lucene.Net)
if (lockFactory instanceof NativeFSLockFactory) {
((NativeFSLockFactory) lockFactory).setLockDir(path);
} else if (lockFactory instanceof SimpleFSLockFactory) {
((SimpleFSLockFactory) lockFactory).setLockDir(path);
}
after the creation of the XXXXFSLockFactory class ( c.newInstance() ).
But I think, patches I posted previously are more generic and this also doesn't mean divergence
from
java, since the existing codes already differ from it.
DIGY
> NUnit test for Lucene.Net.Store.TestLockFactory.TestLockClassProperty
> ---------------------------------------------------------------------
>
> Key: LUCENENET-96
> URL: https://issues.apache.org/jira/browse/LUCENENET-96
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Digy
> Priority: Minor
> Attachments: FSDirectory.patch, SupportClass.patch, TestLockFactory.patch
>
>
> After java2C# translation, i added "Set" method to SupportClass.AppSettings and modified
the "get" methods.
> Since NativeFSLockFactory does not have parameterless constructor, i modified FSDirectory
to be able to create an instance of NativeFSLockFactory
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
|