Bug 84770 - Formatter fails in specific case (.class in code)
Summary: Formatter fails in specific case (.class in code)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 66452 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-09 06:46 EST by Jakub Gwozdz CLA
Modified: 2005-03-29 15:45 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***