[
https://issues.apache.org/jira/browse/LUCENE-9394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17130513#comment-17130513
]
Michael Sokolov commented on LUCENE-9394:
-----------------------------------------
I did a round of this, will post a PR soon, but I just want to note what would
be required to get to zero warnings. For the most part, it seems innocuous to
me, but there were some changes I thought would be worth surfacing. Here's a
summary of what needs doing:
# The spatial-extras package is simply riddled with easily-fixed deprecation
warnings. Change the usage there to conform to the new API in spatial4j.
# Update usage of newer version of randomizedtesting API
# Add @Deprecated annotations to tests of deprecated classes
# In a few cases, replace usage of deprecated (internal Lucene) classes or
methods with their more modern equivalents. EG: SynonymGraphFilter for
SynonymFilter in tests where it is possible.
# Replace static imports of constants from deprecated classes with qualified
references, assigning to a locally-defined constant in some cases (eg instead
of importing WordDelimiterFilter.*, import WordDelimiter and refer to constants
as WordDelimiter.XXX).
# Replace usage of junit.framework.Assert with org.junit.Assert. Is this
controversial? I don't know the history here.
# Add SuppressWarnings("deprecation") annotations as needed for the rest of
the deprecation issues. These mostly have to with *our own* deprecations. I
don't think these warnings are providing any value. The process of removing a
deprecated class or method is likely going to be a full-sweep top-down effort
(like this one) - the warnings about usage of deprecated classes/methods
(mostly in tests) are not going to be the thing that prompts us to do that.
Additionally I addressed a number of generics warnings, fixing or suppressing
unchecked casts and/or raw types. One thing I did not address is the use of the
raw Map type in ValueSource, which causes lots of warnings. I wanted to ask
here if people think it is worth switching to use Map<?, ?> in the signature of
ValueSource and its subclasses? I suppose that could have a pretty big ripple
effect? But the alternative is an API that is simply filthy with
SuppressWarnings("rawtypes").
> Fix or suppress compile-time warnings
> -------------------------------------
>
> Key: LUCENE-9394
> URL: https://issues.apache.org/jira/browse/LUCENE-9394
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Michael Sokolov
> Priority: Major
>
> This is a spinoff from [~erickerickson]'s efforts over in SOLR-10778
> The goal is a warning-free compilation, followed by enforcement of build
> failure on warnings, with the idea of suppressing innocuous warnings to the
> extent that the remaining warnings be treated as build failure.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]