How to embedd access to internal API in a library via XaddExports

wzberger javadevlist at javasoft.de
Thu May 12 17:07:22 UTC 2016


Am 12.05.2016 um 15:17 schrieb Alan Bateman:
>
> On 12/05/2016 09:49, wzberger wrote:
>>
>> We provide libs for Swing and JavaFX. For most of the issues bug 
>> reports have been filed. But it's not only about known bugs we also 
>> have to handle unknown bugs - the release cycles until things get 
>> fixed are way too long while customers need solutions. So will it be 
>> possible to fork specific JDK modules and deploy such modified 
>> modules to users in a simple manner - webstart included?
> With OpenJDK then you can of course do your own builds. The 
> java.desktop module is not an upgradeable module (not like the EE 
> modules) so you can't deploy an upgraded version of java.desktop on 
> the upgrade module path, at least not with Oracle JDK builds. You can 
> patch it via -Xpatch for testing or debugging purposes but I assume 
> you don't want your users doing that. This reminds to ask - when you 
> patch the code today then you are using -Xbootclasspath/p or does 
> patching mean using core reflection to access/change private fields.
>
> Java Web Start is not in OpenJDK so I can't comment on patching that 
> (or maybe you mean having web start download patches?).
>
> Finally, and I understand it can frustrating to hit a bug that isn't 
> fixed in a timely manner, but have you considered contributing fixes 
> for the bugs that you are running into?
>
> -Alan
>
>
Workarounds are mostly implemented via reflection - some features are 
provided by extending internal classes. A widely spread example is 
customization of a JTable header renderer by extending 
sun.swing.table.DefaultTableCellHeaderRenderer - it's a pretty common 
approach which is often used in the wild. We also extend 
sun.swing.DefaultLookup and require access to 
sun.swing.plaf.synth.DefaultSynthStyle - of course this is more 
specific. So what's the recommendation, should we file a bug report to 
provide a public API for these kind of classes and if so will these 
classes find their way into the public API?

Because of contributing fixes, if things are simple and clear enough we 
propose fixes. More complex fixes or extensions would require extra 
resources which is currently not an option.

- Wolfgang





More information about the jigsaw-dev mailing list