Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 416401 - [preferences] Incorrect enablement of 'Inline finally blocks' preference option
Summary: [preferences] Incorrect enablement of 'Inline finally blocks' preference option
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.4 M2   Edit
Assignee: Martin Mathew CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-03 04:32 EDT by Martin Mathew CLA
Modified: 2013-09-10 10:43 EDT (History)
2 users (show)

See Also:
daniel_megert: review+


Attachments
Patch. (1.58 KB, patch)
2013-09-03 09:49 EDT, Martin Mathew CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mathew CLA 2013-09-03 04:32:57 EDT
Found that 'Inline finally blocks' option is enabled incorrectly:
1. In the compiler preference page, select 'Configure Project Specific Settings' and choose a Java 1.4 project. Select the 'Java Build Path' and modify the EE to J2SE-1.5. Use the back button or directly click on the Java Compiler to come back to the previous page where the project specific setting was being modified. See that the 'Inline finally blocks' is enabled for Java-1.5, which is wrong.

2. In the compiler preference page, select 1.4 compliance level. Now uncheck 'Inline finally blocks' option. Now change the compliance level to 1.5 and then change to 1.6 and now change it back to 1.4, the checkbox is now checked. This also looks wrong.
Comment 1 Noopur Gupta CLA 2013-09-03 04:42:39 EDT
It can be reproduced and the exisiting behavior looks incorrect.
Dani, please confirm if it should be fixed.
Comment 2 Dani Megert CLA 2013-09-03 05:11:14 EDT
(In reply to Manju Mathew from comment #0)
> Found that 'Inline finally blocks' option is enabled incorrectly:
> 1. In the compiler preference page, select 'Configure Project Specific
> Settings' and choose a Java 1.4 project. Select the 'Java Build Path' and
> modify the EE to J2SE-1.5. Use the back button or directly click on the Java
> Compiler to come back to the previous page where the project specific
> setting was being modified. See that the 'Inline finally blocks' is enabled
> for Java-1.5, which is wrong.

Yes, the option/widget should be disabled in this case. There's no need to go via preference page, just edit the project settings is enough to surface the bug.


> 2. In the compiler preference page, select 1.4 compliance level. Now uncheck
> 'Inline finally blocks' option. Now change the compliance level to 1.5 and
> then change to 1.6 and now change it back to 1.4, the checkbox is now
> checked. This also looks wrong.

Agreed.


Please fix those issues.
Comment 3 Martin Mathew CLA 2013-09-03 09:49:50 EDT
Created attachment 235108 [details]
Patch.

The first issue occurred as #updateInlineJSREnableState() was not called after compliance setting was modified.

The second issue was because the check box state is stored every time the check box is disabled. So when user change the compliance setting from 1.5 to 1.6, the state of the check box which was already in disabled state is disabled again and the disabled state value is stored.

Dani, please have a look.