Bug 380890

Summary: Code formatter nested function call change
Product: [Eclipse Project] JDT Reporter: Edward Turnock <c.edward.turnock>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert
Version: 3.8Keywords: needinfo
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.