Community
Participate
Working Groups
Build: 20020214 I have found what appears to be a problem in the code formatter. The problem appears in formatting "else if" statements. It seems to occur when an expression is used in the statements. In cases where there is not expression in the "if," the formatting works fine. For example, the following two pieces of code are in the same class file: ========================================================= Case 1 ========================================================= if (obj == null) { return null; } else if (obj instanceof String) { return (String) obj; } ========================================================= Case 2 ========================================================= if (value == null || value.equals("null")) { return null; } else if (type.equals(String.class.getName())) { return new String(value); } ========================================================= As you can see there is a problem with the opening brace after the "else if." The following are the options I have set in the formater dialog tabs: New Lines: Checked Insert new line before an opening brace Insert new lines in control statements Unchecked Clear all blank lines Insert new line between 'else if' Insert a new line inside an empty block Line splitting: Maximum line length: 100 Style Unchecked Compact assignment Indentation is represented by a tab Number of spaces representing a tab: 4 Thanks. Eclipse is a great tool!
This is fixed with my latest changes. The guilty piece of code is the class literal (.class). In fact this is a duplicate of 9969. *** This bug has been marked as a duplicate of 9969 ***