This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
/** * Get localized variants of a resource name. * For the locale and branding search order, see * {@link #getLocalizingSuffixes}. * This method applies those suffixes to a resource * path, before the extension. An "extension" is defined * as the minimal suffix of the resource string beginning * with a period and coming after any slash, or if no such * suffix exists, the empty string. * <p>For example, given the * resource path <samp>foo/bar.gif</samp>, you might get * as results (German locale, branding <samp>mybrand</samp>): * <ol> * <li><samp>foo/bar_mybrand_de.gif</samp> * <li><samp>foo/bar_mybrand.gif</samp> * <li><samp>foo/bar_de.gif</samp> * <li><samp>foo/bar.gif</samp> * </ol> * @param resource a resource path, slash-separated, possibly * including a file extension after a period * @return a list of locale and branding variants of that path * @since 3.XXX */ public Iterator getLocalizedVariants(String resource); This method should be used throughout the code base wherever this basic piece of logic is done. It is not particularly hard to write similar code without the helper method, but it is repeated a number of times, and there is one known bug in some (but not all) implementations of this idiom, which would be avoided by a centralized implementation: the code to check for a dot does not check if it comes after the last slash, so that locale variants of "foo.bar/baz" would incorrectly show e.g. "foo_de.bar/baz" rather than the correct "foo.bar/baz_de".
Later.