I commited another way, tell me if it's OK for you otherwise I will revert.
Regards Philippe On Sun, Dec 4, 2011 at 6:47 PM, Philippe Mouawad <[email protected] > wrote: > > > On Sun, Dec 4, 2011 at 6:40 PM, sebb <[email protected]> wrote: > >> On 4 December 2011 17:22, Philippe Mouawad <[email protected]> >> wrote: >> > Hello Sebb, >> > I don't agree with you on this, Introspector caches the result, so next >> > call will be efficient. >> >> It still has to do a fair amount of work before it can even access the >> cache, and the cache requires synchronisation. >> >> > Regarding the fix, as mentionned in comment, it wasn't the top >> satisfactory >> > fix but I think it is OK until we find a better solution. >> >> I'd rather find the a solution based on using the Language Change event. >> It's going to be easier to do so from the original code - and easier >> to understand the changes later - so please revert in the meantime. >> >> Sometimes it's OK to add work-rounds, but this one is quite >> far-reaching and does not agree with how the other GUI classes handle >> language change. >> > > Can you explain how other GUI classes handle it ? Is it through > LocaleChangeListener or something else ? > > Thanks > >> >> > Regards >> > Philippe >> > On Sun, Dec 4, 2011 at 6:08 PM, sebb <[email protected]> wrote: >> > >> >> On 4 December 2011 00:22, <[email protected]> wrote: >> >> > Author: pmouawad >> >> > Date: Sun Dec 4 00:22:27 2011 >> >> > New Revision: 1210034 >> >> > >> >> > URL: http://svn.apache.org/viewvc?rev=1210034&view=rev >> >> > Log: >> >> > Bug 52280 - The menu item Options / Choose Language does not change >> all >> >> the displayed text to the new language >> >> > Fix the menu categories labels >> >> >> >> -1 >> >> >> >> I think it's wrong to refetch the beanInfo every time getStaticLabel() >> >> is used, which is very frequent. >> >> >> >> Need somehow to use the language change event (as is done by other GUI >> >> classes that don't extend TestBean). >> >> >> >> > Modified: >> >> > >> jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java >> >> > jmeter/trunk/xdocs/changes.xml >> >> > >> >> > Modified: >> >> jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java >> >> > URL: >> >> >> http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java?rev=1210034&r1=1210033&r2=1210034&view=diff >> >> > >> >> >> ============================================================================== >> >> > --- >> >> jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java >> >> (original) >> >> > +++ >> >> jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java >> Sun >> >> Dec 4 00:22:27 2011 >> >> > @@ -199,7 +199,13 @@ public class TestBeanGUI extends Abstrac >> >> > if (beanInfo == null){ >> >> > return "null";// $NON-NLS-1$ >> >> > } >> >> > - return beanInfo.getBeanDescriptor().getDisplayName(); >> >> > + try { >> >> > + // We get new BeanInfo instead of cached one >> >> > + // TODO Find a better way to reinitialize the >> beanInfo >> >> instance >> >> > + return >> >> >> Introspector.getBeanInfo(testBeanClass).getBeanDescriptor().getDisplayName(); >> >> > + } catch (IntrospectionException e) { >> >> > + return >> >> beanInfo.getBeanDescriptor().getDisplayName(); >> >> > + } >> >> > } >> >> > >> >> > /** >> >> > @@ -357,7 +363,7 @@ public class TestBeanGUI extends Abstrac >> >> > } >> >> > return menuCategories; >> >> > } >> >> > - >> >> > + >> >> > /** >> >> > * Setup GUI class >> >> > * @return number of matches >> >> > >> >> > Modified: jmeter/trunk/xdocs/changes.xml >> >> > URL: >> >> >> http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1210034&r1=1210033&r2=1210034&view=diff >> >> > >> >> >> ============================================================================== >> >> > --- jmeter/trunk/xdocs/changes.xml (original) >> >> > +++ jmeter/trunk/xdocs/changes.xml Sun Dec 4 00:22:27 2011 >> >> > @@ -58,12 +58,6 @@ For example a Test Action sampler with 0 >> >> > or a Debug Sampler with all fields set to False (to reduce the >> sample >> >> size). >> >> > </p> >> >> > >> >> > -<p> >> >> > -The menu item Options / Choose Language does not change all the >> >> displayed text to the new language. >> >> > -[The behaviour has improved, but language change is still not fully >> >> working, see BUG 52280] >> >> > -To override the default local language fully, set the JMeter >> property >> >> "language" before starting JMeter. >> >> > -</p> >> >> > - >> >> > <!-- =================== Incompatible changes =================== >> --> >> >> > >> >> > <h2>Incompatible changes</h2> >> >> > >> >> > >> >> >> > >> > >> > >> > -- >> > Cordialement. >> > Philippe Mouawad. >> > > > > -- > Cordialement. > Philippe Mouawad. > > > > -- Cordialement. Philippe Mouawad.
