[BUG] o.o.a.s.m.AcknowledgedResponse is deprecated without an alternative class #14665
Labels
backwards-compatibility
bug
Something isn't working
Cluster Manager
deprecate
Libraries
Lucene Upgrades and Libraries, Any 3rd party library that Core depends on, ex: nebula; team is respo
Describe the bug
The o.o.a.s.m.AcknowledgedResponse class, returned as an
ActionListener
response from many OpenSearch APIs, produces deprecated warnings (required by JLS 9.6.3.6). Nothing in the class itself indicates any alternative, as strongly recommended by Java documentation:The class itself isn't deprecated, the entire package in which it resides is, to support inclusive language.
This creates an annoyance to developers who find themselves with a compiler warning that they have no alternative to, and often choose to use
@SuppressWarnings("deprecation")
to avoid the warnings (and yellow lines/icons in IDEs); sometimes suppressing an entire class if there are many uses of this type. This has a bad side-effect of potentially missing other deprecated classes.Related component
Libraries
To Reproduce
IndicesAdminClient.delete()
that returns anAcknowledgedResponse
.Expected behavior
Deprecated classes use the
@deprecated
annotation to tell developers what alternative they should use, as strongly recommended by Java documentation.While many classes in the deprecated package have alternatives,
AcknowledgedResponse
does not.The
AcknowledgedRequest
andShardsAcknowledgedResponse
classes have similar issues but are not nearly as ubiquitous.Additional Details
Screenshots
Suggested Fix
I'm happy to submit a PR to fix this if other maintainers agree on the best approach.
I think it's reasonably easy to make a copy of the existing classes in the new inclusively-named package, and then change the existing classes to be subclasses of the non-deprecated ones. That would maintain compatibility for existing code, while providing a migration package for developers who, even after suppressing warnings, still have non-inclusive language in their import statements.
Alternative
The package-level deprecation could be removed in favor of individual class-level deprecation, if there is no actual intent to ever migrate the
AcknowledgedResponse
to another package.The text was updated successfully, but these errors were encountered: