Community
Participate
Working Groups
It should be possible to place each right brace and parenthesis on a single line if the max line width is exceeded. For example: public List<String> sort(List<String> list) { Collections.sort( list, new Comparator<String>() { @Override public int compare(final String e1, final String e2) { return e1.compareTo(e2) * -1; } } ); return list; } Instead of: public List<String> sort(List<String> list) { Collections.sort(list, new Comparator<String>() { @Override public int compare(final String e1, final String e2) { return e1.compareTo(e2) * -1; } }); // each of this should be placed on a single line as above! return list; } This would make the assignment of the corresponding right and left brace/parenthesis pairs much easier and therefore the readability of the code.
It should be possible to place each right brace and parenthesis on a single line if the max line width is exceeded. For example: public List<String> sort(List<String> list) { Collections.sort( list, new Comparator<String>() { @Override public int compare(final String e1, final String e2) { return e1.compareTo(e2) * -1; } } ); return list; } Instead of: public List<String> sort(List<String> list) { Collections.sort(list, new Comparator<String>() { @Override public int compare(final String e1, final String e2) { return e1.compareTo(e2) * -1; } }); // each of this should be placed on a single line as above! return list; } This would make the assignment of the corresponding right and left brace/parenthesis pairs much easier and therefore enhance the readability of the code.
The comment above is a slight typo correction of the description. Can be deleted.