Bug 203060 - [codeassist] assert keyword should not be proposed when compliance level is set to 1.3
Summary: [codeassist] assert keyword should not be proposed when compliance level is s...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-12 08:30 EDT by Maxime Daniel CLA
Modified: 2009-04-27 09:36 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix and tests (4.26 KB, patch)
2009-03-16 07:16 EDT, Srikanth Sankaran CLA
no flags Details | Diff
Revised patch (8.24 KB, patch)
2009-03-17 02:47 EDT, Srikanth Sankaran CLA
david_audel: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2007-09-12 08:30:41 EDT
Build id: I20070904-0800

Scenario:
- create a new Java project;
- set its compiler compliance level to 1.3;
- within a method, type asse, then Ctrl-Space.
The assert keyword is proposed, whereas it should not.
Comment 1 Srikanth Sankaran CLA 2009-03-16 07:16:51 EDT
Created attachment 128899 [details]
Proposed fix and tests

David, appreciate your review. Let me know if something is amiss. Thanks.
Comment 2 David Audel CLA 2009-03-16 08:59:43 EDT
The fix is good but you should improve the regression test.

The 1.3 and 1.4 behavior should be tested in two different methods. Currently if the test fails in 1.3, it is not possible to know if it fails also in 1.4.

You should restore the options in a finally block to restore options even if an exception occurs.
Comment 3 Srikanth Sankaran CLA 2009-03-17 02:47:19 EDT
Created attachment 129035 [details]
Revised patch

Split test cases. Added more tests to cover all changed code blocks.
Comment 4 David Audel CLA 2009-03-20 06:15:00 EDT
Comment on attachment 129035 [details]
Revised patch

The patch is good.
Comment 5 David Audel CLA 2009-03-20 06:40:45 EDT
Released for 3.5M7.

I released the revised patch.
I found another bug in the same area but this is a separate problem: bug 269493.
Comment 6 David Audel CLA 2009-04-27 09:36:09 EDT
Verified for 3.5M7 using I20090426-2000