Bug 99882 - No support for "new" assignment statement wrapping
Summary: No support for "new" assignment statement wrapping
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal with 4 votes (vote)
Target Milestone: 3.3 RC4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 23:54 EDT by Hacking Bear CLA
Modified: 2007-06-22 12:50 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hacking Bear CLA 2005-06-13 23:54:30 EDT
I twist around the Code Formatter but find not way to properly wrap an 
assignment statement.

Especially with Java 1.5 generics, assignment statement can become very long 
at the point of the new operator. For example, set the line length to 80, and 
the following statement is not wrapped nicely.

    private HashMap<String, String> m_stringKeyToValueMap = new 
HashMap<String, String>(8);

I can get the wrapping occurs at the parameter but it is already too far away 
and looks ugly.

We need to be able to wrap right before or after the equal sign.
Comment 1 Maxim Romashchenko CLA 2005-08-15 08:26:31 EDT
Another example of code which does not wrap well.
Actually, it does not wrap at all.


--------
import java.util.ArrayList;
import java.util.List;

import net.sf.acegisecurity.GrantedAuthority;
import net.sf.acegisecurity.providers.dao.AuthenticationDao;

public class AuthDao implements AuthenticationDao {
    public UserDetails loadUserByUsername(String username) {

        // the next line does not wrap:
        final List<GrantedAuthority> authorities = new
ArrayList<GrantedAuthority>();
    }
}
--------
Comment 2 Olivier Thomann CLA 2007-06-21 12:11:05 EDT
Closing as WORKSFORME.
In 3.3, you can set a line wrapping for assignment in:
Preferences>Java>Code Style>Formatter>Line Wrapping>Expressions>Àssigments