Todd - that's a great question.
In DoubleMetaphoneFilterFactoryTest#testDefaults, no inject parameter
is sent, and the old code did this:
- if (args.get(INJECT) != null) {
- inject = Boolean.getBoolean(args.get(INJECT));
- }
So that never hit the bug.
And in #testSettingSizeAndInject, inject=false, so it does end up
calling Boolean.getBoolean, but there is no JVM system property called
inject and thus inject=false.
If the first test had explicitly set inject=true, voila, bug.
Funnily enough, I had a deja vu, and have ranted about the
ridiculousness of Boolean.getBoolean in the past: <http://markmail.org/message/i5wt6sd3nsiahfhy
>. If it hadn't been for Hoss's keen eyes, it would have cost me
another 15 minutes of debugging to figure this one out.
Erik
On Nov 5, 2008, at 5:25 PM, Feak, Todd wrote:
Exactly how didn't it work?
There's a test in the DoubleMetaphoneFilterFactoryTest that tests with
and without inject. Is the test not testing what I thought it was?
-----Original Message-----
From: Erik Hatcher (JIRA) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2008 3:07 PM
To: solr-dev@lucene.apache.org
Subject: [jira] Resolved: (SOLR-837) Fix PhoneticFilterFactory and
DoubleMetaphoneFilterFactory inject parameter
[
https://issues.apache.org/jira/browse/SOLR-837?page=com.atlassian.jira.p
lugin.system.issuetabpanels:all-tabpanel ]
Erik Hatcher resolved SOLR-837.
-------------------------------
Resolution: Fixed
Fix PhoneticFilterFactory and DoubleMetaphoneFilterFactory inject
parameter
------------------------------------------------------------------------
---
Key: SOLR-837
URL: https://issues.apache.org/jira/browse/SOLR-837
Project: Solr
Issue Type: Bug
Components: Analysis
Affects Versions: 1.3
Reporter: Erik Hatcher
Assignee: Erik Hatcher
Fix For: 1.4
Attachments: SOLR-837.patch
At ApacheCon Solr Boot Camp training, an attendee discovered the
inject parameter doesn't work for the PhoneticFilterFactory. I
stared
at it for a while, added some debugging output, scratched my head,
asked
Hoss wtf, and he immediately spotted the Boolean.getBoolean mistake.
Here's the fix. Will commit right away, logging the JIRA for
tracking
purposes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.