Bug 152725 - [1.6][formatter] Code formatter does not format 1.5 code when source level is 1.6
Summary: [1.6][formatter] Code formatter does not format 1.5 code when source level is...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2.1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-03 07:56 EDT by Jesper de Jong CLA
Modified: 2006-09-12 04:39 EDT (History)
2 users (show)

See Also:


Attachments
Proposed patch (10.08 KB, patch)
2006-08-04 11:10 EDT, Frederic Fusier CLA
no flags Details | Diff
Proposed fix for 3.2 maintenance branch (9.96 KB, patch)
2006-08-15 12:15 EDT, Olivier Thomann CLA
no flags Details | Diff
Regression tests for 3.2 maintenance branch (3.06 KB, patch)
2006-08-15 12:16 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper de Jong CLA 2006-08-03 07:56:20 EDT
When you have a project in Eclipse that uses Java SE 6 beta 2, the code formatter does nothing if you try to format an enum automatically. The source code is not formatted, it just doesn't change the source code at all.

It works normally if I change the project to use JDK 1.5.0_07.
Comment 1 Frederic Fusier CLA 2006-08-04 06:44:15 EDT
Problem is more serious than that. When compliance is set to 6.0 (it's not a JRE issue), then formatter is not able to format 1.5 code...
Comment 2 Frederic Fusier CLA 2006-08-04 11:10:57 EDT
Created attachment 47402 [details]
Proposed patch

Add test FormatterRegressionTests#test626
Comment 3 Frederic Fusier CLA 2006-08-04 11:12:18 EDT
Released for 3.3 M1 in HEAD.

Olivier, please review the fix and decide whether if should but put in R3_2_maintenance stream...
Comment 4 Frederic Fusier CLA 2006-08-07 04:39:28 EDT
Verified for 3.3 M1 using build I20060807-0010
Comment 5 Olivier Thomann CLA 2006-08-14 11:05:35 EDT
The fix looks good and should definitely be backported to 3.2 maintenance stream.
Comment 6 Olivier Thomann CLA 2006-08-14 11:22:50 EDT
Backported to 3.2 maintenance branch.
Released for 3.2.1.
Added regression test org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.test622
Comment 7 Olivier Thomann CLA 2006-08-15 12:10:01 EDT
I removed the fix from the 3.2.1 branch since it requires approval from Philippe first.
Philippe, I'll attach the patch to be applied on 3.2 maintenance branch.
Comment 8 Olivier Thomann CLA 2006-08-15 12:15:14 EDT
Created attachment 47926 [details]
Proposed fix for 3.2 maintenance branch
Comment 9 Olivier Thomann CLA 2006-08-15 12:16:44 EDT
Created attachment 47927 [details]
Regression tests for 3.2 maintenance branch
Comment 10 Philipe Mulet CLA 2006-08-30 12:09:30 EDT
+1 for 3.2.1
Comment 11 Olivier Thomann CLA 2006-08-30 12:21:50 EDT
Released for 3.2.1.
Added regression test org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test622.
Comment 12 David Audel CLA 2006-09-12 04:39:43 EDT
Verified for 3.2.1 using build M20060908-1655