| Summary: | Code cleanup deletes comments | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Klaus Christiansen <klaus.edwin.christiansen> | ||||
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | gautier.desaintmartinlacaze, loskutov | ||||
| Version: | 4.6 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Created attachment 265503 [details] The code cleanup settings I used. Java Code cleanup sometimes removes comments. It seams that comments on the same line as an IF (maybe other block statements to?) is removed during code cleanup. Other times the result is just poorly formatted. Before: @Override public String getTypeName() { if (type == null) // No type means that we are the type. return NameUtils.upperCaseFirstChar(NameUtils.setVariableCase(getName())); return type.getTypeName(); } After: @Override public String getTypeName() { if (type == null) { return NameUtils.upperCaseFirstChar(NameUtils.setVariableCase(getName())); } return type.getTypeName(); } This is an example of poorly formatted code cleanup. Before: public void addImport(String imp) { if (imp.contains("FormGroup2")) System.err.println("addToImport "); String imppac = imp.substring(0, imp.lastIndexOf(".")); if (imppac.equals(getPackageName())) return; // No need to add classes in same package if (getImports().get(imppac + ".*") != null) return; // Whole package already imported imports.put(imp, imp); } After: public void addImport(String imp) { if (imp.contains("FormGroup2")) { System.err.println("addToImport "); } String imppac = imp.substring(0, imp.lastIndexOf(".")); if (imppac.equals(getPackageName())) { return; // No need to add classes in same package } if (getImports().get(imppac + ".*") != null) { return; // Whole package already imported } imports.put(imp, imp); } Another example of poorly formatted code cleanup. before: protected void define(FunctionSymbol sym, boolean doSetScope) { if (doSetScope) sym.scope = this; // track the scope in each symbol ... } After: protected void define(FunctionSymbol sym, boolean doSetScope) { if (doSetScope) { sym.scope = this; // track the scope in each symbol } ... }