lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Turcotte" <>
Subject Re: [jira] Created: (LUCENE-682) QueryParser with Locale Based Operators (French included)
Date Sun, 29 Oct 2006 15:04:09 GMT
> : I'll make it using a semi column (;) as a separator in the property
> file,
> : shouldn't be used too often. Please tell me if I should use something
> else.
> As i said, i don't really have a lot of experience with ResourceBundles,
> but from what i can tell, i think you should just use getStringArray and
> trust whatever list comes back (you get a 0 or 1 item list when using a
> Properties file right?)

Unfortunately, no. If  Iuse getStringArray while using a
PropertyResourceBundle to backup the ResourceBundle, getStringArray(key)
give a classCastException, as it is just a Wrapper for : (String[])

Worse, I tried implementing a ListResourceBundle and I also get a
classCastException on getStringArray()

the level of abstraction you have is with the ResourceBundle API -- not
> the Properties API, so you shouldn't assume that your users are providing
> a PropertiesResourfceBundle in which you can/need-to split the strings you
> get -- trust that the getStringAttary method does the right thing, most
> people wll use properties files that return single values, and if anyone
> wants multiple values they can write their own class implimenting
> ResourceBundle which returns multiplevalues.

Knowing what I said previously, should I still call getStringArray, catch
the exception and there use getString. Seems costly to me, as most will
probably a PropertiesResourceBundle to store values. What do you think?

if you *really* want to support multiple values in Properties fields ...
> have a key which if set denotes the string value that all other values
> should be split on, if not set, then no splitting is done (that way you
> don't have to worry that you might pick a "split character" which winds up
> being important to someone.

That's right, even if there aren't many character left that don't have a


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message