The SonarLint detects a false positive on the item() method for code under here:
@Deprecated(forRemoval = false) @Override
/**
* @deprecated This method returns the same item, because it pertains to a single item
* @apiNote This method is used for compatibility with {@link SingleItem}
* @return this item
*/
default ItemEntry item() {
return this;
}
In your code snippet the annotations come before the Javadoc. This is not valid, and even if you try to run the javadoc tool the comment will be ignored.
So this comment is considered a regular comment and not a JavaDoc one, that’s why SonarLint raises an issue about not finding the @deprecated tag.
If you swap the annotations and the comment, then SonarLint will stop reporting (and if you generate the Javadoc the comment will correctly be included).
I don’t reproduce the FP on my end with the code you sent. Does it raise the same issue as in your original message (java:S1123 Deprecated elements should have both the annotation and the Javadoc tag) ? I can see another issue raised (java:S1133 Deprecated code should be removed) but this is a true positive.
Don’t hesitate to send us a more complete example, or a pointer to a file. Thanks