RFC - Reduce loading of PropertiesFile

Thomas Meyer thomas at m3y3r.de
Fri Apr 20 06:01:01 PDT 2012


Zitat von Jiri Vanek <jvanek at redhat.com>:

> On 04/19/2012 09:14 PM, Thomas Meyer wrote:
>
>>
>> patch1.diff
>>
>>
>> # HG changeset patch
>> # User Thomas Meyer<thomas at m3y3r.de>
>> # Date 1334859522 -7200
>> # Node ID e750944c8d66bbab0801e7490303eef26b689df3
>> # Parent  4a35862de3fc26a9e1cdfb66fd7b6c750f18371b
>> Enable JNLPRuntime class to run in headless mode
>>
>> diff -r 4a35862de3fc -r e750944c8d66  
>> netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
>> --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java	Thu Apr 19  
>> 20:02:40 2012 +0200
>> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java	Thu Apr 19  
>> 20:18:42 2012 +0200
>> @@ -199,12 +199,14 @@
>>          ServiceManager.setServiceManagerStub(new  
>> XServiceManagerStub()); // ignored if we're running under Web Start
>>
>>          policy = new JNLPPolicy();
>> -        security = new JNLPSecurityManager(); // side effect:  
>> create JWindow
>> -
>> -        try {
>> -             
>> UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
>> -        } catch (Exception e) {
>> -            // ignore it
>> +        if (!headless) {
>> +            security = new JNLPSecurityManager(); // side effect:  
>> create JWindow
>> +
>> +            try {
>> +                 
>> UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
>> +            } catch (Exception e) {
>> +                // ignore it
>> +            }
>>          }
>>
>>          doMainAppContextHacks();
>>
>>
> hmhm. This looks un-relevant to original issue. What is motivation?  
> Can you poist it in new patch?

without this path the unit test fails in/after a call to  
JNLPRuntime.initialize() with a StackOverflowException.

my solution was to disable the SecurityManager for headless mode. this  
made my unit test work.
I'm not sure if this is the correct thing to do here! Help appriciated!

thomas





More information about the distro-pkg-dev mailing list