-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2030 : all new from createComponents() #3040
Conversation
Tried the test from #2030 (comment) , seems to do the trick. |
In general this looks good. Could you rebase after #3041 goes in to see if the tests are clean ? |
What about |
1a954ee
to
e0f9475
Compare
No harmful reuse there |
Oh I need to make a slight improvement |
e0f9475
to
c916001
Compare
interesting ... @vladak will you retest? |
@tarzanek sure, TaaS :-) I think a test case should be added. |
For the record, what was the improvement ? |
I see, using method reference: <<<<<<< HEAD
this.symbolTokenizerFactory = createPlainSymbolTokenizerFactory();
=======
this.symbolTokenizerFactory = this::createPlainSymbolTokenizer;
>>>>>>> c9160011b169e04969ce098c2253c452aef6b200 however I fail to see how this can work. |
so the fix seems to be the use of functional supplier to provide symbol factory: Supplier<JFlexTokenizer> symbolTokenizerFactory; how exactly does it work in detail, I'd love to know too |
Anyway, the updated fix works so merging. |
To clarify, it's a functional supplier of new tokenizers.
@tarzanek , it's thread safe because there is no sharing of data until the output of the supplier is passed along to Lucene after the function returns. No locking required. The object is not immutable but we rely on Lucene also not sharing the object among threads. |
Hello,
Harmful re-use from
createComponents()
seems to be the actual problem. Let's see if this fixes that issue.—CF