Community
Participate
Working Groups
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.
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>(); } } --------
Closing as WORKSFORME. In 3.3, you can set a line wrapping for assignment in: Preferences>Java>Code Style>Formatter>Line Wrapping>Expressions>Àssigments