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 229426 - Netigso.createLoader is expensive and switching off FIND_COVERED_PKGS breaks Matisse
Summary: Netigso.createLoader is expensive and switching off FIND_COVERED_PKGS breaks ...
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Netigso (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks: 229946 231223
  Show dependency tree
 
Reported: 2013-05-06 21:07 UTC by stoto79
Modified: 2013-06-14 01:59 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Two ways to export packages under META-INF (3.38 KB, patch)
2013-05-10 11:17 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description stoto79 2013-05-06 21:07:33 UTC
By default, Netigso.createLoader() makes an expensive bundle.findEntries call that does a scan of the entire OSGi bundle. This is an expensive call. There is a mechanism currently in place, setting the branding property FIND_COVERED_PKGS=findByExportPackage, which disables this behavior with no impact on the OSGi bundles, but with impact on some of the NB's OSGi-aware modules. For example, running JDev, and trying to create a Matisse form blows up, because Matisse export an service, under, META-INF/services which is no longer visible when bundle.findEntries is not called.
Comment 1 Jaroslav Tulach 2013-05-10 11:17:01 UTC
Created attachment 134285 [details]
Two ways to export packages under META-INF

Modules can either enumerate their content under META-INF directory with "/"-prefixed entries, or they can use classical META-INF.some.pckg notation (which is less effective).

I managed to start JDev and use form editor with my patch and with following branding file:
$ cat branding/modules/org-netbeans-core-netigso.jar/org/netbeans/core/netigso/Bundle.properties
FIND_COVERED_PKGS=

If the direction outlined with this patch is found promising, I am ready to turn that into official change and backport it to some 7.3-based branch.
Comment 2 Jaroslav Tulach 2013-05-13 16:45:25 UTC
Comment from Tomáš Pávek:
> I've tried the patch and it seems working well....
Comment 3 Jaroslav Tulach 2013-05-13 16:53:00 UTC
Please verify the final patch:
http://hg.netbeans.org/ergonomics/rev/f22c7660c05f

If it seems good, let me know and I'll backport it to jdev_abrams branch.
Comment 4 stoto79 2013-05-13 21:21:52 UTC
Okay, I tested the patch on my end, and it looks good.
Comment 5 Quality Engineering 2013-05-16 02:27:57 UTC
Integrated into 'main-golden', will be available in build *201305152300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f22c7660c05f
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #229426: MetaInfService entries can be enumerated via current, effective method, or by publishing/exporting META-INF.services package. Most of the modules use the effective method only. OSGi bundles are allowed to use the simple Export-Package: META-INF.services.
Comment 6 Jaroslav Tulach 2013-05-17 07:12:00 UTC
changeset:   2c4627357851
branch:      jdev_abrams
tag:         tip
parent:      256960:0505c074dc75
parent:      260752:f22c7660c05f
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Fri May 17 09:11:12 2013 +0200
summary:     Merging #229426 for consumption by JDev
Comment 7 Quality Engineering 2013-05-28 14:13:15 UTC
Integrated into 'main-golden', will be available in build *201305281155* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/22a462730ae5
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: Fix for #229426 may cause exception from the OSGi framework. Be more robust against IllegalStateException
Comment 8 David Konecny 2013-05-30 01:43:03 UTC
This fix caused regression: issue 229946.
Comment 9 Quality Engineering 2013-06-14 01:59:37 UTC
Integrated into 'main-golden', will be available in build *201306132301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3c770e3ddb4d
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: Additional fix to #229426 discovered as bug #229946: Use the same logic as in getResources also for getResource