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.
Summary: | Reliable layer overrides without artificial module dependencies | ||
---|---|---|---|
Product: | platform | Reporter: | Jesse Glick <jglick> |
Component: | Filesystems | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | anebuzelsky, apireviews, jtulach, rmichalsky, saubrecht |
Priority: | P2 | Keywords: | API, API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 181460, 195827 | ||
Bug Blocks: | 71439, 187991, 199823 | ||
Attachments: |
Possible patch
Revised patch |
Description
Jesse Glick
2008-07-28 17:50:08 UTC
You could override findResource in ModuleLayeredFileSystem to make it affect just XML layers. This might be inefficient, however (the default impl uses private infrastructure in MFS/MFO), and also would not work from unit tests that do not load core.jar. Would probably be better to implement directly in MultiFileSystem. One catch is that customizations, in $userdir/config/, should always override layer entries even if they specify a weight. I suggest the code always pick the resource from layers[0] (the writable layer) if it exists, regardless of weight in other layers. This ensures that after setting the content on a MFO, the observed content is what you just set. Could also use createWritableOn to find the priority FS more accurately, taking care to ignore IOException's which are meaningless in this context. Created attachment 65843 [details]
Possible patch
I attached a patch which might work. (Only unit tested, not tried on a real example.) A full patch would also need API changes & documentation, change of VLCT, fixup of nb.org modules to use the new attribute, and perhaps a change to o.n.m.apisupport.project.layers to generate the weight attribute on new layer overrides (to e.g. 100 more than any previous weight). Relates to apisupport. Ok, I'll add weight generation once this feature is done. Jirko, any possibility to get this into 6.8? It is probably better if I take over the base (non-apisupport) patch. I can work on VLCT and use that as a way to find layers in nb.org that need to be changed. Please review. Created attachment 94399 [details]
Revised patch
Includes filesystems changes to recognize the new 'weight' attr; API change documentation; rewritten VLCT test; and fixes to a few modules to make them pass the test (cluster.config=bloated) - to use weight in the few cases where overriding was actually intended, otherwise to not override.
core-main #860290e5753e Integrated into 'main-golden', will be available in build *201003020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/860290e5753e User: Jesse Glick <jglick@netbeans.org> Log: Issue #141925: provide a simpler way to declare which layer entries override others. http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/overview-summary.html the dtd specified attr and not attributed as reported in the documentation page above: <filesystem> <folder name="my-snippets"> <file name="common.xml" url="special-snippet.xml"> <attribute name="weight" intvalue="100"/> </file> </folder> </filesystem> Integrated into 'main-golden', will be available in build *201011030000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/b5d7c37dae43 User: Jesse Glick <jglick@netbeans.org> Log: #141925 apichanges tweak: <attr> not <attribute>. |