| Summary: | Code formatter incorrectly wraps empty return Javadoc tag | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Albert Lin <albertl_1998> |
| Component: | Text | Assignee: | Mateusz Matela <mateusz.matela> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mateusz.matela |
| Version: | 3.0 | ||
| Target Milestone: | 4.8 M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | To be verified for 4.8 M6 | ||
Eclipse 3.0M7 Build id: 200402122000 If a method has a Javadoc comment that contains an @return tag that is empty, the code formatter incorrectly wraps the following Javadoc tag so that it is on the same line as the @return tag. To duplicate: In Preferences > Java > Code Formatter, choose the "Java Conventions [built- in]" code formatting set. (Actually, to duplicate this bug, you can probably use any code formatter setting that has the "Format Comments" setting turned on.) Format the following code snippet: public class TestClass { /** * @return * @throws NullPointerException */ public int testMethod() throws NullPointerException { return 0; } } The code formatter produces the following reformatted code: public class TestClass { /** * @return @throws * NullPointerException */ public int testMethod() throws NullPointerException { return 0; } } Note that the @return tag and the @throws tag are now on the same line. Instead, the code formatter should keep the @return tag on its own line.