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 213906

Summary: RunLevel broken in "Run in Felix" mode
Product: platform Reporter: maxnitribitt <maxnitribitt>
Component: NetigsoAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 7.1.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Suite to test 213906

Description maxnitribitt 2012-06-10 13:59:45 UTC
If you want to replace the Swing UI with an alternative one (e.g. in project eFX) using RunLevel, it works when you use the NetBeans Module System. When you try to "Run in Felix" the registered RunLevel's will be ignored.

Background:

core.osgi.Activator is responsible for running the RunLevel services in netigso mode, but only launches them when a module with bundle id "org.netbeans.core.windows" is present (via showWindowSystem flag).

It would be better to have consistent behaviour in netigso and normal mode.
Comment 1 Jaroslav Tulach 2012-06-10 18:36:09 UTC
Can you provide patch or at least a sample demo that I can use to test the fix?
Comment 2 maxnitribitt 2012-06-11 05:40:28 UTC
Created attachment 120631 [details]
Suite to test 213906
Comment 3 maxnitribitt 2012-06-11 05:50:01 UTC
    I created a small demo that has one module with a RunLevel. It's supposed to
    print to System.out when the project is run:

    ############## TestRunlevel started

    When you use "OSGi->Run in Felix" it doesn't.

    In "core.osgi" Activator the relevant code is in Line 251 onwards:

     if (showWindowSystem) {
                // XXX set ${jdk.home}?
                List<String> bisp = new
    ArrayList<String>(Arrays.asList(Introspector.getBeanInfoSearchPath()));
                bisp.add("org.netbeans.beaninfo"); // NOI18N
                Introspector.setBeanInfoSearchPath(bisp.toArray(new
    String[bisp.size()]));
                CoreBridge.getDefault().registerPropertyEditors();
                for (RunLevel rl : Lookup.getDefault().lookupAll(RunLevel.class)) {
                    rl.run();
                }
                Splash.getInstance().setRunning(false);
            }
Comment 4 Jaroslav Tulach 2014-05-23 08:38:55 UTC
ergonomics#3103395f5adb
Comment 5 Quality Engineering 2014-05-26 01:11:46 UTC
Integrated into 'main-silver', will be available in build *201405260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3103395f5adb
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #213906: It should be safe to execute registered RunLevel all the times