naren2605 opened a new issue, #7640:
URL: https://github.com/apache/netbeans/issues/7640
### Apache NetBeans version
Apache NetBeans 22
### What happened
formatting source file is not formatting content with inline javadoc tags
like `@return` correctly
### Language / Project Type / NetBeans Component
_No response_
### How to reproduce
reformat source file with below sample
### issue details
The formatter messes up Javadoc like {@return foo}.
For example formatting this:
```java
/**
* {@return foo}
*/
String bar() {
return null;
}
```
Actual:
```java
/**
*
* {
*
* @return foo}
*/
String bar() {
return null;
}
```
Expected:
```java
/**
* {@return foo}
*/
String bar() {
return null;
}
```
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
macOS
### JDK
openjdk 22.0.1
### Apache NetBeans packaging
Apache NetBeans platform
### Anything else
### root cause analysis
- `@return` is always treated as block tag , since java 16 return can be
both inline and block tag as mentioned in the the
[spec](https://docs.oracle.com/en/java/javase/22/docs/specs/javadoc/doc-comment-spec.html#Where%20Tags%20Can%20Be%20Used)
- this also happens with any inline tag which is not present in list
mentioned
[here](https://github.com/apache/netbeans/blob/master/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java#L4825)
Fixing this will also close [issue in oracle java vscode
#194](https://github.com/oracle/javavscode/issues/194) , will be raising pr for
this issue
### Are you willing to submit a pull request?
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists