Bug 203060

Summary: [codeassist] assert keyword should not be proposed when compliance level is set to 1.3
Product: [Eclipse Project] JDT Reporter: Maxime Daniel <maxime_daniel>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: david_audel
Version: 3.4   
Target Milestone: 3.5 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix and tests
none
Revised patch david_audel: review+

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