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 243561 - [server_split] Binary compatibility patch support
Summary: [server_split] Binary compatibility patch support
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 8.0.1
Hardware: PC Linux
: P1 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 247159 243683
  Show dependency tree
 
Reported: 2014-04-04 11:37 UTC by Svata Dedic
Modified: 2014-11-13 13:02 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed changes (77.20 KB, patch)
2014-04-09 12:35 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2014-04-04 11:37:39 UTC
Some time ago, NetBeans was able to bytecode-patch classes during loading and inject some things to preserve binary compatibility. The ability was removed as of issue #155796.

In order to better comply with Java 8 Compact profiles, we should make some changes and obsolete code cleanups in NetBeans core APIs, but still it would be highly desirable to preserve binary compatibility for an extended period of time. 

The compatibility can be achieved by providing support for patch modules (aka module framgents, similar to OSGi bundle fragments) together with bytecode instrumentation which injects implementation classes into the loaded class hierarchy.
Comment 1 Svata Dedic 2014-04-08 14:54:27 UTC
Also see http://wiki.netbeans.org/Main_Page/BackwardCompatibilityPatches
Comment 2 Svata Dedic 2014-04-09 12:34:46 UTC
Summary of changes (patch will follow shortly):

1/ API in openide.modules: @PatchFor, @ConstructorDelegate, manifest entry defined in @PatchFor. Annotation Processor enhanced to work with @PatchFor

2/ Changes in o.n.bootstrap:
* Processing of @PatchFor and @ConstructorDelegate (no API)
* Reading of manifest entries, processing OpenIDE-Module-Fragment-Host
* Ability to merge into other module's classloader, fragments use the host classloader

3/ Visible API changes

Possible serialization incompatbility - ModuleData serializes the fragmentHostCodeName.

Friend API change:
public void refineClassLoader(Module m, List parents);
changed to 
public ClassLoader refineClassLoader(Module m, List parents);

4/ Inclusion of OW2 ASM 5.0 library
Comment 3 Svata Dedic 2014-04-09 12:35:52 UTC
Created attachment 146649 [details]
Proposed changes

Proposed changes to openide.modules, o.n.bootstrap
Comment 4 Svata Dedic 2014-04-09 12:39:20 UTC
Note: the target for the patch is the server_split branch
Comment 5 Svata Dedic 2014-04-09 13:52:13 UTC
committed to branch server_split as jet-main#30cc839f4091
Comment 6 Jaroslav Tulach 2014-04-17 11:55:24 UTC
Y01 Serialization is not a problem
Y02 description of functionality should not be in apichanges.xml. Rather put it into Javadoc of @PatchFor & co. and just link to it from apichanges.xml
Comment 7 Svata Dedic 2014-09-16 09:07:19 UTC
Y02 addressed in jet-main#0afbfa1021d6 (server_split branch)


Note: After successful review, I am going to merge the changes into trunk.
Comment 8 Quality Engineering 2014-10-18 05:11:03 UTC
Integrated into 'main-silver', will be available in build *201410180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/30cc839f4091
User: Svata Dedic <sdedic@netbeans.org>
Log: #243561: support for runtime bytecode patching of superclass and constructor generation, support for fragment modules (see OSGi)
Comment 9 Jaroslav Tulach 2014-11-05 09:22:29 UTC
done?