Community
Participate
Working Groups
HEAD (and 3.4.2) after bug 243712 The 'Restore Defaults' button on the Java > Compiler preference page does not see a changed or added default JRE (i.e. change it on the 'Installed JREs' page and then go to Compiler and click the restore button without leaving the dialog). The problem is that there's no "working copy" for VM installs, see bug 121057.
If the fix for bug 121057 is to update JavaRuntime.getDefaultVMInstall() immediately, then the fix for this bug could be to override performDefaults() in ComplianceConfigurationBlock to: public void performDefaults() { setDefaultCompilerComplianceValues(); super.performDefaults(); } (and remove setDefaultCompilerComplianceValues(); in the constructor).
> (and remove setDefaultCompilerComplianceValues(); in the constructor). Should actually leave it there as well, since the default is also used to initialize the page in case there are no existing settings.
This works if one hits 'Apply' when leaving the 'Installed JREs' page.