Bug 380890 - Code formatter nested function call change
Summary: Code formatter nested function call change
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2012-05-29 08:34 EDT by Edward Turnock CLA
Modified: 2013-01-11 05:17 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 Edward Turnock CLA 2012-05-29 08:34:16 EDT
Build Identifier: 20120524-0130

The formatter settings I am using where imported. but I get the broken behaviour when using any of the built in formatters as well.

The behaviour of the code formatter seems to have changed in that it is no longer matching the trailing parenthesis to the start of the matching function call.

an example would be the following.

Formatter behaviour in Indigo (NOTE THE MATCHING PARENTHESIS in the nested function calls)

    Pattern pattern;
    try {
      pattern = Pattern.compile(patternString);
    } catch(PatternSyntaxException e) {
      throw new IllegalArgumentException(
          formatMessage(
              "addProductPattern(): found product[{0}] with an invalid pattern[{1}]: {2}",
              pfs,
              patternString
          ),
          e
      );
    }

Formatter Behaviour in JUNO, This is the breaking change


    Pattern pattern;
    try {
      pattern = Pattern.compile(patternString);
    } catch(PatternSyntaxException e) {
      throw new IllegalArgumentException(
          formatMessage(
              "addProductPattern(): found product[{0}] with an invalid pattern[{1}]: {2}",
              pfs,
              patternString
              ),
              e
          );
    }


more complex nesting is broken even more

Reproducible: Always

Steps to Reproduce:
1. Without formatting enter the java code with nested function calls where the closing parentheses are a new lines indented to the same level as the function call
2. The indent or format
Comment 1 Dani Megert CLA 2012-05-29 09:20:07 EDT
> I get the broken behaviour when using any of the built in formatters as well.
The built-in ones don't align the brackets.

Please attach the formatter profile.
Comment 2 Dani Megert CLA 2013-01-11 05:17:57 EST
Closing due to lack of information and because the built-in profiles work for ne using N20130110-2000.