Bug 84770

Summary: Formatter fails in specific case (.class in code)
Product: [Eclipse Project] JDT Reporter: Jakub Gwozdz <gwozdziu>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sakai
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jakub Gwozdz CLA 2005-02-09 06:46:07 EST
Steps to reproduce:

1. Make a new class in default package:
-----BEGIN-----
public class FormatterTest {
  void doTest(
      ) {
     System.out.println("(" + 
         Object.class + ")");
  }
}
-----END-----

2. Try to format it by Ctrl+Shift+F  - nothing happens

3. Now change the 'Object.class' to 'Object.class.toString()'
(You can also delete the last ' + ")"'

4. Try to format it by Ctrl+Shift+F  - everything is ok



It seems that formatter crashes, when it has some string operatation (like + ) 
after the keyword class
Comment 1 Dani Megert CLA 2005-02-09 08:28:06 EST
NotE: there's a separate PR that the editor should not fail silenty (bug 70037).
Comment 2 Olivier Thomann CLA 2005-02-09 11:52:59 EST
Reproduced.
I am investigating.
Comment 3 Olivier Thomann CLA 2005-02-09 15:44:31 EST
Fixed and released in HEAD.
Regression test added in FormatterRegressionTests.test543.
Comment 4 Olivier Thomann CLA 2005-02-09 15:46:11 EST
Thanks for the nice test case.
Comment 5 Frederic Fusier CLA 2005-02-16 12:28:57 EST
Verified with 3.1 M5 candidate (I20040215-2300)
Comment 6 Olivier Thomann CLA 2005-03-29 15:45:59 EST
*** Bug 66452 has been marked as a duplicate of this bug. ***