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.

Bug 199320 - Different --branding does not take effect unless userdir caches are cleared
Summary: Different --branding does not take effect unless userdir caches are cleared
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 201793 204467 (view as bug list)
Depends on:
Blocks: 156330
  Show dependency tree
 
Reported: 2011-06-09 18:58 UTC by Jesse Glick
Modified: 2011-11-01 19:35 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-06-09 18:58:04 UTC
As in http://blogs.oracle.com/geertjan/entry/the_case_for_profiles_part1 create an app with multiple branding variants of some resource, e.g. o-n-c-windows.jar. Start in one branding on a fresh userdir; the branded resources are available as expected. Now start in another branding on the same userdir; the base(r) resources are used, not the branded resources. Putting a debug println into LocaleVariants.findLocaleVariantsOf confirms that the list of JARs from the initial branding is being used.

The current code uses the mapLocale field to produce the right results when using --locale is changed between runs, but this does not extend to --branding. Introducing a new field in the serial form sounds too dangerous, but other possible fixes are:

1. Prepend NbBundle.getBranding + '_' to mapLocale; i.e. replace all usages of Locale.getDefault() in the class with some method which prepends the current branding (if not null). (Including in getLocalizingSuffixesFast, meaning the lastBranding field could be removed.)

2. Get rid of mapLocale, and instead append branding and locale to the cache key name "localeVariants". This has the minor advantage of making startup faster when switching back and forth between locales and/or brandings.
Comment 1 Geertjan Wielenga 2011-07-10 13:58:44 UTC
It would be great if this were fixed. 

Another use case is, for example, where the "Next" button in a wizard needs to have different texts on different panels. Here, if NbBundle.setBranding were to work correctly, multiple branding bundles could be available and when the user switches to a new panel in the wizard, a new branding bundle could be loaded via NbBundle.setBranding, with the result that the text in the "Next" button would be changed to the value set in the new branding bundle. (I.e., in one case "Next" would be branded to "Advance", while in another case the text should be "Send".)
Comment 2 Jesse Glick 2011-07-11 14:00:35 UTC
(In reply to comment #1)
> Another use case [...]

Very different from this bug, and will not be implemented; we do not support changing branding or locale at runtime.
Comment 3 Jaroslav Tulach 2011-08-27 15:36:04 UTC
ergonomics#708491051468

branding & locale is now checked. Still I don't think it is possible to change branding while the application is running.
Comment 4 Jaroslav Tulach 2011-08-27 17:30:51 UTC
*** Bug 200730 has been marked as a duplicate of this bug. ***
Comment 5 Quality Engineering 2011-08-28 14:01:54 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/708491051468
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #199320: Including branding and locale into the cache time stamp
Comment 6 Jesse Glick 2011-08-29 14:45:25 UTC
mapLocale is now obsolete and ought to be deleted, right?
Comment 7 Masaki Katakai 2011-09-08 22:45:04 UTC
*** Bug 201793 has been marked as a duplicate of this bug. ***
Comment 8 Jaroslav Tulach 2011-11-01 15:41:33 UTC
*** Bug 204467 has been marked as a duplicate of this bug. ***
Comment 9 Vladimir Voskresensky 2011-11-01 19:35:24 UTC
possible candidate for the 7.0.1 patch (7.0.1 is used as Studio platform)