You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/09/01 23:02:25 UTC

[GitHub] [lucene-solr] vthacker opened a new pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

vthacker opened a new pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686292245


   bq. While some warnings are disputable, most of these point to genuine errors or deficiencies - this looks very useful!
   
   Right. This is always my problem with static analysis tools - if you can't somehow mark or suppress warnings in places where the code is valid (comparing references, for example) then the tool becomes a burden to maintain - the list of warnings will just pile up without anyone looking. 
   
   bq. To get this plugin integrated ( without fixing all the warnings/errors ) we'd need to set this options.errorprone.allErrorsAsWarnings = true and remove "-Werror", from the defaults-java.gradle file
   
   I'm against removing -Werror from compiler options. We can make this plugin run as an option but -Werror should be the default for anyone else.
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#discussion_r483402784



##########
File path: gradle/validation/error-prone.gradle
##########
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+allprojects { prj ->
+    plugins.withId("java", {
+        prj.apply plugin: 'net.ltgt.errorprone'
+        plugins.withType(JavaPlugin) {

Review comment:
       you only need one - plugins.withId or plugins.withType. It's the same thing here.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] vthacker commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
vthacker commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-685924654


   Looks like this is  duplicate of LUCENE-9411?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-685957523


   I don't think so. That issue only added dependencies, it has nothing to do with running static analysis using that tool.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#discussion_r483402573



##########
File path: build.gradle
##########
@@ -127,6 +128,9 @@ apply from: file('gradle/ide/intellij-idea.gradle')
 apply from: file('gradle/ide/eclipse.gradle')
 
 // Validation tasks
+apply from: file('gradle/hacks/findbugs.gradle')

Review comment:
       I think the problem may be in clashing JARs - errorprone annotations are imported in a different place of the build (Erick worked on this), without any static analysis. I can take a look but later.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] vthacker commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
vthacker commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686220411


   Here is the complete list of warnings/errors that this tool gives us for lucene-core
   
   ```
   ~/apache-work/lucene-solr (solr_core_errorprone) $ gradlew -p lucene/core/ compileJava
   
   > Task :lucene:core:compileJava
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/Sort.java:180: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
         if (fields[i] != rewrittenSortFields[i]) {
                       ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (!Objects.equals(fields[i], rewrittenSortFields[i])) {' or 'if (!fields[i].equals(rewrittenSortFields[i])) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/Sort.java:185: warning: [UnnecessaryParentheses] These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
       return (changed) ? new Sort(rewrittenSortFields) : this;
              ^
       (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
     Did you mean 'return changed ? new Sort(rewrittenSortFields) : this;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java:690: warning: [ModifiedButNotUsed] A collection or proto builder was created, but its values were never accessed.
         final List<C> collectedCollectors = new ArrayList<>();
                                             ^
       (see https://errorprone.info/bugpattern/ModifiedButNotUsed)
     Did you mean to remove this line or to remove this line?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java:756: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       for (Query rewrittenQuery = query.rewrite(reader); rewrittenQuery != query;
                                                                         ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'for (Query rewrittenQuery = query.rewrite(reader); !Objects.equals(rewrittenQuery, query);' or 'for (Query rewrittenQuery = query.rewrite(reader); !rewrittenQuery.equals(query);'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java:98: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
     public Similarity() {}
            ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected Similarity() {}'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java:111: warning: [EscapedEntity] HTML entities in @code/@literal tags will appear literally in the rendered javadoc.
      * {@code Long.compareUnsigned(n1, n2) &gt; 0} then
        ^
       (see https://errorprone.info/bugpattern/EscapedEntity)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java:112: warning: [EscapedEntity] HTML entities in @code/@literal tags will appear literally in the rendered javadoc.
      * {@code SimScorer.score(freq, n1) &lt;= SimScorer.score(freq, n2)}
        ^
       (see https://errorprone.info/bugpattern/EscapedEntity)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java:157: warning: [EscapedEntity] HTML entities in @code/@literal tags will appear literally in the rendered javadoc.
        * {@code freq1 &gt; freq2}, then {@code score(freq1, norm) &gt;=
          ^
       (see https://errorprone.info/bugpattern/EscapedEntity)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java:157: warning: [EscapedEntity] HTML entities in @code/@literal tags will appear literally in the rendered javadoc.
        * {@code freq1 &gt; freq2}, then {@code score(freq1, norm) &gt;=
                                         ^
       (see https://errorprone.info/bugpattern/EscapedEntity)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java:162: warning: [EscapedEntity] HTML entities in @code/@literal tags will appear literally in the rendered javadoc.
        * {@code Long.compareUnsigned(norm1, norm2) &gt; 0} then
          ^
       (see https://errorprone.info/bugpattern/EscapedEntity)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java:163: warning: [EscapedEntity] HTML entities in @code/@literal tags will appear literally in the rendered javadoc.
        * {@code score(freq, norm1) &lt;= score(freq, norm2)} for any legal
          ^
       (see https://errorprone.info/bugpattern/EscapedEntity)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java:206: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
     public boolean equals(Object obj) {
                    ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java:502: warning: [InconsistentHashCode] hashCode includes the fields [numWords], which equals does not. Two instances of this class could compare equal, but have different hashCodes, which violates the hashCode contract.
     public int hashCode() {
                ^
       (see https://errorprone.info/bugpattern/InconsistentHashCode)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java:189: warning: [MissingOverride] set implements method in BitSet; expected @Override
     public void set(int index) {
                 ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override public void set(int index) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/FieldInvertState.java:94: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       if (this.attributeSource != attributeSource) {
                                ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (!Objects.equals(this.attributeSource, attributeSource)) {' or 'if (!this.attributeSource.equals(attributeSource)) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java:437: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.
         for (Entry<Class<? extends Attribute>, AttributeImpl> entry : this.attributes.entrySet()) {
              ^
       (see https://errorprone.info/bugpattern/BadImport)
     Did you mean 'for (Map.Entry<Class<? extends Attribute>, AttributeImpl> entry : this.attributes.entrySet()) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/AttributeFactory.java:104: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
       public StaticImplementationAttributeFactory(AttributeFactory delegate, Class<A> clazz) {
              ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected StaticImplementationAttributeFactory(AttributeFactory delegate, Class<A> clazz) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/AttributeFactory.java:118: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
       public boolean equals(Object other) {
                      ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean 'if (!(other instanceof StaticImplementationAttributeFactory))'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java:148: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
       public NumericComparator(String field, T missingValue) {
              ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected NumericComparator(String field, T missingValue) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/automaton/CompiledAutomaton.java:478: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
     public boolean equals(Object obj) {
                    ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/analysis/Analyzer.java:97: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
     public Analyzer() {
            ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected Analyzer() {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/analysis/Analyzer.java:109: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
     public Analyzer(ReuseStrategy reuseStrategy) {
            ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected Analyzer(ReuseStrategy reuseStrategy) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/analysis/Analyzer.java:370: warning: [ProtectedMembersInFinalClass] Make members of final classes package-private: source, sink
       protected final Consumer<Reader> source;
                                        ^
       (see https://errorprone.info/bugpattern/ProtectedMembersInFinalClass)
     Did you mean 'final Consumer<Reader> source;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/analysis/Analyzer.java:445: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
       public ReuseStrategy() {}
              ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected ReuseStrategy() {}'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/CloseableThreadLocal.java:58: warning: [ThreadLocalUsage] ThreadLocals should be stored in static fields
     private ThreadLocal<WeakReference<T>> t = new ThreadLocal<>();
                                               ^
       (see https://errorprone.info/bugpattern/ThreadLocalUsage)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/CloseableThreadLocal.java:97: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized(hardRefs) {
                   ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/CloseableThreadLocal.java:111: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized(hardRefs) {
                   ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/store/IOContext.java:113: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
     public boolean equals(Object obj) {
                    ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java:199: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
             * 2; // hash tables need to be oversized to avoid collisions, assume 2x capacity
             ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean '2L * NUM_BYTES_OBJECT_REF'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java:362: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
         if (query != root) {
                   ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (!Objects.equals(query, root)) {' or 'if (!query.equals(root)) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java:376: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
         if (query == root) {
                   ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (Objects.equals(query, root)) {' or 'if (query.equals(root)) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java:102: warning: [InconsistentCapitalization] Found the field 'docIDUpto' with the same name as the parameter 'docIDUpTo' but with different capitalization.
       private BinaryDocValuesUpdate(Term term, String field, BytesRef value, int docIDUpTo) {
                                                                                  ^
       (see https://errorprone.info/bugpattern/InconsistentCapitalization)
     Did you mean 'private BinaryDocValuesUpdate(Term term, String field, BytesRef value, int docIDUpto) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java:159: warning: [InconsistentCapitalization] Found the field 'docIDUpto' with the same name as the parameter 'docIDUpTo' but with different capitalization.
       private NumericDocValuesUpdate(Term term, String field, long value, int docIDUpTo, boolean hasValue) {
                                                                               ^
       (see https://errorprone.info/bugpattern/InconsistentCapitalization)
     Did you mean 'private NumericDocValuesUpdate(Term term, String field, long value, int docIDUpto, boolean hasValue) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java:73: warning: [NarrowingCompoundAssignment] Compound assignments from long to int hide lossy casts
       sizeInBytes += valueSizeInBytes();
                   ^
       (see https://errorprone.info/bugpattern/NarrowingCompoundAssignment)
     Did you mean 'sizeInBytes = (int) (sizeInBytes + valueSizeInBytes());'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java:96: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
       private static final long RAW_VALUE_SIZE_IN_BYTES = NUM_BYTES_ARRAY_HEADER + 2*Integer.BYTES + NUM_BYTES_OBJECT_REF;
                                                                                                    ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'private static final long RAW_VALUE_SIZE_IN_BYTES = (long) NUM_BYTES_ARRAY_HEADER + 2*Integer.BYTES + NUM_BYTES_OBJECT_REF;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:401: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
     private final LinkedList<MergePolicy.OneMerge> pendingMerges = new LinkedList<>();
                                                                    ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:2206: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
               if (pendingMerges.contains(merge) || runningMerges.contains(merge)) {
                                         ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:2337: warning: [MissingOverride] getMergingSegments implements method in MergeContext; expected @Override
     public synchronized Set<SegmentCommitInfo> getMergingSegments() {
                                                ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override public synchronized Set<SegmentCommitInfo> getMergingSegments() {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:2348: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
       if (pendingMerges.size() == 0) {
                             ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:2352: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         MergePolicy.OneMerge merge = pendingMerges.removeFirst();
                                                               ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:2364: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
       return pendingMerges.size() != 0;
                                ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:2632: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
       pendingMerges.clear();
                          ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:2679: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         while (pendingMerges.size() > 0 || runningMerges.size() > 0) {
                                  ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:3237: warning: [UndefinedEquals] Collection does not have well-defined equals behavior.
       assert copiedFiles.equals(newInfoPerCommit.files()): "copiedFiles=" + copiedFiles + " vs " + newInfoPerCommit.files();
                                ^
       (see https://errorprone.info/bugpattern/UndefinedEquals)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:3587: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
               boolean removed = pendingMerges.remove(merge);
                                                     ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:4437: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
       pendingMerges.add(merge);
                        ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:4440: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         infoStream.message("IW", "add merge to pendingMerges: " + segString(merge.segments) + " [total " + pendingMerges.size() + " pending]");
                                                                                                                              ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:4476: warning: [NarrowingCompoundAssignment] Compound assignments from double to long hide lossy casts
           merge.estimatedMergeBytes += info.sizeInBytes() * (1.0 - delRatio);
                                     ^
       (see https://errorprone.info/bugpattern/NarrowingCompoundAssignment)
     Did you mean 'merge.estimatedMergeBytes = (long) (merge.estimatedMergeBytes + info.sizeInBytes() * (1.0 - delRatio));'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:4581: warning: [JdkObsolete] Date has a bad API that leads to bugs; prefer java.time.Instant or LocalDate.
       diagnostics.put("timestamp", Long.toString(new Date().getTime()));
                                                                    ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:4581: warning: [JdkObsolete] Date has a bad API that leads to bugs; prefer java.time.Instant or LocalDate.
       diagnostics.put("timestamp", Long.toString(new Date().getTime()));
                                                  ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:4699: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
             if (reader != wrappedReader) { // if we don't have a wrapped reader we won't preserve any soft-deletes
                        ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (!Objects.equals(reader, wrappedReader)) {' or 'if (!reader.equals(wrappedReader)) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:4746: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
         assert mergeState.segmentInfo == merge.info.info;
                                       ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'assert Objects.equals(mergeState.segmentInfo, merge.info.info);' or 'assert mergeState.segmentInfo.equals(merge.info.info);'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:4969: warning: [WaitNotInLoop] Because of spurious wakeups, wait(long) must always be called in a loop
         wait(1000);
             ^
       (see https://errorprone.info/bugpattern/WaitNotInLoop)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:5900: warning: [MissingOverride] toString overrides method in Object; expected @Override
       public String toString() {
                     ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override public String toString() {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/MergeState.java:245: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
       public DocMap() {
              ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected DocMap() {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java:185: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.
         Set<Entry<PauseReason,AtomicLong>> entries = pauseTimesNS.entrySet();
             ^
       (see https://errorprone.info/bugpattern/BadImport)
     Did you mean 'Set<Map.Entry<PauseReason,AtomicLong>> entries = pauseTimesNS.entrySet();'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java:561: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
     public MergePolicy() {
            ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected MergePolicy() {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java:513: warning: [LockNotBeforeTry] Prefer locking *immediately* before the try block which releases the lock to avoid the possibility of any intermediate statements throwing.
       globalBufferLock.lock();
                            ^
       (see https://errorprone.info/bugpattern/LockNotBeforeTry)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java:56: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
       public Allocator(int blockSize) {
              ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected Allocator(int blockSize) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java:235: warning: [MutablePublicArray] Non-empty arrays are mutable, so this `public static final` array is not a constant and can be modified by clients of this class.  Prefer an ImmutableList, or provide an accessor method that returns a defensive copy.
     public final static int[] NEXT_LEVEL_ARRAY = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9};
                               ^
       (see https://errorprone.info/bugpattern/MutablePublicArray)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java:240: warning: [MutablePublicArray] Non-empty arrays are mutable, so this `public static final` array is not a constant and can be modified by clients of this class.  Prefer an ImmutableList, or provide an accessor method that returns a defensive copy.
     public final static int[] LEVEL_SIZE_ARRAY = {5, 14, 20, 30, 40, 40, 80, 80, 120, 200};
                               ^
       (see https://errorprone.info/bugpattern/MutablePublicArray)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java:336: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       assert flushPending.get() == Boolean.TRUE;
                                 ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'assert Objects.equals(flushPending.get(), Boolean.TRUE);' or 'assert flushPending.get().equals(Boolean.TRUE);'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java:596: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       return flushPending.get() == Boolean.TRUE;
                                 ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'return Objects.equals(flushPending.get(), Boolean.TRUE);' or 'return flushPending.get().equals(Boolean.TRUE);'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java:623: warning: [NonAtomicVolatileUpdate] This update of a volatile variable is non-atomic
       lastCommittedBytesUsed += delta;
                              ^
       (see https://errorprone.info/bugpattern/NonAtomicVolatileUpdate)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java:665: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       return hasFlushed.get() == Boolean.TRUE;
                               ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'return Objects.equals(hasFlushed.get(), Boolean.TRUE);' or 'return hasFlushed.get().equals(Boolean.TRUE);'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java:148: warning: [ImmutableEnumChecker] enums should be immutable: 'Format' has non-final field 'id'
       public int id;
                  ^
       (see https://errorprone.info/bugpattern/ImmutableEnumChecker)
     Did you mean 'public final int id;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/LongsRef.java:75: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
       final long end = offset + length;
                               ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'final long end = (long) offset + length;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/LongsRef.java:109: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
       final long end = offset + length;
                               ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'final long end = (long) offset + length;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/SegmentCommitInfo.java:392: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.
       for (Entry<Integer,Set<String>> e : dvUpdatesFiles.entrySet()) {
            ^
       (see https://errorprone.info/bugpattern/BadImport)
     Did you mean 'for (Map.Entry<Integer,Set<String>> e : dvUpdatesFiles.entrySet()) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java:583: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.
         for (Entry<Integer,Set<String>> e : dvUpdatesFiles.entrySet()) {
              ^
       (see https://errorprone.info/bugpattern/BadImport)
     Did you mean 'for (Map.Entry<Integer,Set<String>> e : dvUpdatesFiles.entrySet()) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java:443: warning: [Finally] If you return or throw from a finally, then values returned or thrown from the try-catch block will be ignored. Consider using try-with-resources instead.
           throw IOUtils.rethrowAlways(priorE);
           ^
       (see https://errorprone.info/bugpattern/Finally)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java:672: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
       public FindSegmentsFile(Directory directory) {
              ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected FindSegmentsFile(Directory directory) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java:80: warning: [AlmostJavadoc] This comment contains Javadoc or HTML tags, but isn't started with a double asterisk (/**); is it meant to be Javadoc?
   final class IndexFileDeleter implements Closeable {
         ^
       (see https://errorprone.info/bugpattern/AlmostJavadoc)
     Did you mean '/**'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/store/Lock.java:48: warning: [MissingOverride] close implements method in Closeable; expected @Override
     public abstract void close() throws IOException;
                          ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override public abstract void close() throws IOException;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java:141: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       assert newReader != oldReader;
                        ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'assert !Objects.equals(newReader, oldReader);' or 'assert !newReader.equals(oldReader);'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java:154: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       assert newReader != oldReader;
                        ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'assert !Objects.equals(newReader, oldReader);' or 'assert !newReader.equals(oldReader);'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java:236: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       assert newReader != oldReader;
                        ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'assert !Objects.equals(newReader, oldReader);' or 'assert !newReader.equals(oldReader);'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java:280: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.
       for (Entry<String,List<DocValuesFieldUpdates>> ent : pendingDVUpdates.entrySet()) {
            ^
       (see https://errorprone.info/bugpattern/BadImport)
     Did you mean 'for (Map.Entry<String,List<DocValuesFieldUpdates>> ent : pendingDVUpdates.entrySet()) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java:429: warning: [ProtectedMembersInFinalClass] Make members of final classes package-private: <init>
       protected MergedDocValues(DocValuesInstance onDiskDocValues, DocValuesInstance updateDocValues, DocValuesFieldUpdates.Iterator updateIterator) {
                 ^
       (see https://errorprone.info/bugpattern/ProtectedMembersInFinalClass)
     Did you mean 'MergedDocValues(DocValuesInstance onDiskDocValues, DocValuesInstance updateDocValues, DocValuesFieldUpdates.Iterator updateIterator) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java:495: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
       final long estInfosSize = 40 + 90 * fieldInfos.size();
                                    ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'final long estInfosSize = 40L + 90 * fieldInfos.size();'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java:583: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
           if (reader != this.reader) {
                      ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (!reader.equals(this.reader)) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java:131: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
         if (field != fields[0]) { // that's an easy win of not accounting if there is an outlier
                   ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (!Objects.equals(field, fields[0])) {' or 'if (!field.equals(fields[0])) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/BytesRefArray.java:247: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
         return RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + indices.length * Integer.BYTES;
                                                         ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'return (long) RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + indices.length * Integer.BYTES;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java:105: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
           + 3 * Integer.BYTES;
           ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'return (long) RamUsageEstimator.NUM_BYTES_OBJECT_HEADER'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/PrefixCodedTerms.java:193: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
     public boolean equals(Object obj) {
                    ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean 'if (!(obj instanceof PrefixCodedTerms)) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java:184: warning: [UnnecessaryParentheses] These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
         return ((readByte(pos    )       ) << 24 |
                 ^
       (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
     Did you mean 'return (readByte(pos    ) << 24 |'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/store/MergeInfo.java:64: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
     public boolean equals(Object obj) {
                    ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/codecs/CompoundFormat.java:34: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
     public CompoundFormat() {
            ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected CompoundFormat() {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushQueue.java:32: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
     private final Queue<FlushTicket> queue = new LinkedList<>();
                                              ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
     Did you mean 'private final Queue<FlushTicket> queue = new ArrayDeque<>();'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java:60: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
     private final Queue<DocumentsWriterPerThread> flushQueue = new LinkedList<>();
                                                                ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
     Did you mean 'private final Queue<DocumentsWriterPerThread> flushQueue = new ArrayDeque<>();'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java:62: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
     private final Queue<DocumentsWriterPerThread> blockedFlushes = new LinkedList<>();
                                                                    ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
     Did you mean 'private final Queue<DocumentsWriterPerThread> blockedFlushes = new ArrayDeque<>();'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java:88: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
       this.hardMaxBytesPerDWPT = config.getRAMPerThreadHardLimitMB() * 1024 * 1024;
                                                                             ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'this.hardMaxBytesPerDWPT = config.getRAMPerThreadHardLimitMB() * 1024L * 1024;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java:336: warning: [NonAtomicVolatileUpdate] This update of a volatile variable is non-atomic
       numPending--; // write access synced
                 ^
       (see https://errorprone.info/bugpattern/NonAtomicVolatileUpdate)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterStallControl.java:77: warning: [WaitNotInLoop] Because of spurious wakeups, wait(long) must always be called in a loop
               wait(1000);
                   ^
       (see https://errorprone.info/bugpattern/WaitNotInLoop)
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/util/IntBlockPool.java:36: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
       public Allocator(int blockSize) {
              ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected Allocator(int blockSize) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/store/FlushInfo.java:56: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
     public boolean equals(Object obj) {
                    ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/index/DocIDMerger.java:42: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
       public Sub(MergeState.DocMap docMap) {
              ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected Sub(MergeState.DocMap docMap) {'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/codecs/lucene84/Lucene84PostingsWriter.java:284: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
       posDeltaBuffer[posBufferUpto] = position - lastPosition;
                                                ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'posDeltaBuffer[posBufferUpto] = (long) position - lastPosition;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/codecs/lucene84/Lucene84PostingsWriter.java:302: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
         offsetStartDeltaBuffer[posBufferUpto] = startOffset - lastStartOffset;
                                                             ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'offsetStartDeltaBuffer[posBufferUpto] = (long) startOffset - lastStartOffset;'?
   /Users/vthacker/apache-work/lucene-solr/lucene/core/src/java/org/apache/lucene/codecs/lucene84/Lucene84PostingsWriter.java:303: warning: [IntLongMath] Expression of type int may overflow before being assigned to a long
         offsetLengthBuffer[posBufferUpto] = endOffset - startOffset;
                                                       ^
       (see https://errorprone.info/bugpattern/IntLongMath)
     Did you mean 'offsetLengthBuffer[posBufferUpto] = (long) endOffset - startOffset;'?
   100 warnings
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-685972773


   Why is there this strange dependency? Listing it under plugins should be enough.
   
   Especially, build tools should not be listed in versions.props and instead just added to plugin declaration.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#discussion_r482745406



##########
File path: gradle/validation/error-prone.gradle
##########
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+configure([project(":lucene:core")]) {
+    apply plugin: 'net.ltgt.errorprone'
+
+    plugins.withType(JavaPlugin) {
+        dependencies {
+            errorprone("com.google.errorprone:error_prone_core:2.4.0")
+        }
+
+        tasks.withType(JavaCompile) {
+            options.errorprone.errorproneArgs = ['-Xep:InvalidBlockTag:OFF', '-Xep:MissingSummary:OFF', '-Xep:UnusedVariable:OFF']

Review comment:
       The gradle plugin has a nice DSL for setting options, see here?
   https://github.com/tbroyer/gradle-errorprone-plugin#migration-from-versions-00x




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] vthacker commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
vthacker commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686719941


   > but I'd like to see how to mark valid code with suppressions first so that we can correct the errors, exclude false-positives somehow and then enable this plugin to run by default.
   
   Instead of marking code with supressions, what if we excluded all the warning types that are there in our codebase explicitly 
   ```
    options.errorprone.errorproneArgs = ['-Xep:ClassCanBeStatic:OFF', '-Xep:InvalidInlineTag:OFF',  ....
   ```
   
   That would ensure 
   1. No new warnings creep in
   1. We don't need to remove `-Werror` and the compile output doesn't throw a bunch of warnings that no one looks at
   
   Then in subsequent PRs we can remove one warning type and fix the code usage by either addressing them or suppressing them in code?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] vthacker commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
vthacker commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686220105


   > Why is there this strange dependency? Listing it under plugins should be enough.
   
   Ah okay! Just getting starter with gradle so I'll be making some mistakes like that :)
   
   The error prone [docs](https://errorprone.info/docs/installation) point to this plugin for gradle integration.
   
   Hopefully this change is more in tune with how to add error-prone
   
   To get this plugin integrated ( without fixing all the warnings/errors ) we'd need to set this `options.errorprone.allErrorsAsWarnings = true` and remove `"-Werror",` from the `defaults-java.gradle` file 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686302137


   Is there a way to enable/disable checks using a config file?
   
   Things like ReferenceEquality in Lucene Code is annoying. It should be disabled there.
   
   I love the LinkedList comment. 😁


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] vthacker commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
vthacker commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686774814


   Latest change applies errorprone to all modules ( thanks `forbidden-apis.gradle` for the example )
   
   Also explicitly disable all warnings


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686969828


   I made a few changes to consolidate the version used across compilations. Still don't know what the original problem was, let's see if this passes though.
   https://github.com/apache/lucene-solr/pull/1828


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] vthacker commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
vthacker commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686222263


   This is the set of warnings/errors for `solr/core` 
   
   ```
   ~/apache-work/lucene-solr (solr_core_errorprone) $ gradlew -p solr/core/ compileJava
   
   > Task :solr:solrj:compileJava
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   
   > Task :lucene:spatial-extras:compileJava
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   
   > Task :lucene:analysis:common:compileJava
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   
   > Task :lucene:suggest:compileJava
   Note: /Users/vthacker/apache-work/lucene-solr/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java uses or overrides a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   
   > Task :solr:core:compileJava
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/ConfigOverlay.java:93: warning: [UnnecessaryParentheses] These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
           if (obj.get(s) == null || (!(obj.get(s) instanceof Map))) {
                                     ^
       (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
     Did you mean 'if (obj.get(s) == null || !(obj.get(s) instanceof Map)) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/ConfigOverlay.java:112: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
       LinkedList<String> hierarchy = new LinkedList<>();
                                      ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/ConfigOverlay.java:130: warning: [UnnecessaryParentheses] These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
           if (obj.get(s) == null || (!(obj.get(s) instanceof Map))) {
                                     ^
       (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
     Did you mean 'if (obj.get(s) == null || !(obj.get(s) instanceof Map)) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/schema/FieldType.java:1265: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
         if (analyzer.getVersion() != Version.LATEST) {
                                   ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (!Objects.equals(analyzer.getVersion(), Version.LATEST)) {' or 'if (!analyzer.getVersion().equals(Version.LATEST)) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/PluginInfo.java:187: warning: [MissingOverride] toMap implements method in MapSerializable; expected @Override
     public Map<String, Object> toMap(Map<String, Object> map) {
                                ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override @SuppressWarnings({"unchecked", "rawtypes"})'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrConfig.java:319: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       if (version == Version.LATEST && !versionWarningAlreadyLogged.getAndSet(true)) {
                   ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (Objects.equals(version, Version.LATEST) && !versionWarningAlreadyLogged.getAndSet(true)) {' or 'if (version.equals(Version.LATEST) && !versionWarningAlreadyLogged.getAndSet(true)) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java:88: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
     public RequestHandlerBase() {
            ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected RequestHandlerBase() {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/security/PermissionNameProvider.java:60: warning: [ImmutableEnumChecker] enums should be immutable: 'Name' has field 'collName' of type 'java.util.Set<java.lang.String>', 'Set' is mutable
       final Set<String> collName;
                         ^
       (see https://errorprone.info/bugpattern/ImmutableEnumChecker)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java:340: warning: [JdkObsolete] SortedMap was replaced by NavigableMap in Java 6.
           SortedSet<String> allUnknownAttributes = problems.get(elementName);
                                                                ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java:343: warning: [JdkObsolete] SortedMap was replaced by NavigableMap in Java 6.
             problems.put(elementName, allUnknownAttributes);
                         ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java:345: warning: [JdkObsolete] SortedSet was replaced by NavigableSet in Java 6.
           allUnknownAttributes.addAll(unknownAttributes);
                                      ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java:348: warning: [JdkObsolete] SortedMap was replaced by NavigableMap in Java 6.
       if (problems.size() > 0) {
                        ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java:350: warning: [JdkObsolete] SortedMap was replaced by NavigableMap in Java 6.
         for (Map.Entry<String,SortedSet<String>> entry : problems.entrySet()) {
                                                                           ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java:68: warning: [MissingOverride] close implements method in AutoCloseable; expected @Override
     void close();
          ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override void close();'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java:361: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.
     public Iterator<Entry<String, String>> httpHeaders() {
                     ^
       (see https://errorprone.info/bugpattern/BadImport)
     Did you mean 'public Iterator<Map.Entry<String, String>> httpHeaders() {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java:205: warning: [EmptyCatch] Caught exceptions should not be ignored
       } catch (FileNotFoundException | NoSuchFileException e) {
         ^
       (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/snapshots/SolrSnapshotMetaDataManager.java:327: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.
         for(Entry<String,SnapshotMetaData> ent : nameToDetailsMapping.entrySet()) {
             ^
       (see https://errorprone.info/bugpattern/BadImport)
     Did you mean 'for(Map.Entry<String,SnapshotMetaData> ent : nameToDetailsMapping.entrySet()) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java:127: warning: [EmptyCatch] Caught exceptions should not be ignored
           } catch (java.security.AccessControlException ace) {}
             ^
       (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java:172: warning: [UnnecessaryParentheses] These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
         return (new File(storageDir, storedResourceId)).exists();
                ^
       (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
     Did you mean 'return new File(storageDir, storedResourceId).exists();'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java:446: warning: [EmptyCatch] Caught exceptions should not be ignored
             } catch (Exception ignore){}
               ^
       (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java:297: warning: [MixedMutabilityReturnType] This method returns both mutable and immutable collections or maps from different paths. This may be confusing for users of the method.
     static List<UpdateRequestProcessorFactory> getReqProcessors(String processor, SolrCore core) {
                                                ^
       (see https://errorprone.info/bugpattern/MixedMutabilityReturnType)
     Did you mean 'static ImmutableList<UpdateRequestProcessorFactory> getReqProcessors(String processor, SolrCore core) {' or 'static ImmutableList<UpdateRequestProcessorFactory> getReqProcessors(String processor, SolrCore core) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java:262: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
       LinkedList<UpdateRequestProcessorFactory> urps = new LinkedList<>(defaultUrp.chain);
                                                        ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java:268: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
       insertBefore(urps, post, RunUpdateProcessorFactory.class, urps.size() - 1);
                                                                          ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java:271: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         ArrayList<String> names = new ArrayList<>(urps.size());
                                                            ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java:283: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
       for (int i = 0; i < urps.size(); i++) {
                                    ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java:284: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         if (klas.isInstance(urps.get(i))) {
                                     ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
     Did you mean 'if (klas.isInstance(ArrayList)) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java:287: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
             if (i > 0 && urps.get(i - 1) instanceof LogUpdateProcessorFactory) {
                                  ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java:294: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
       for (int i = newFactories.size() - 1; 0 <= i; i--) urps.add(idx, newFactories.get(i));
                                                                  ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2878: warning: [MixedMutabilityReturnType] This method returns both mutable and immutable collections or maps from different paths. This may be confusing for users of the method.
     public <T> List<T> initPlugins(List<PluginInfo> pluginInfos, Class<T> type, String defClassName) {
                        ^
       (see https://errorprone.info/bugpattern/MixedMutabilityReturnType)
     Did you mean 'public <T> ImmutableList<T> initPlugins(List<PluginInfo> pluginInfos, Class<T> type, String defClassName) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2904: warning: [ProtectedMembersInFinalClass] Make members of final classes package-private: initRestManager
     protected RestManager initRestManager() throws SolrException {
                           ^
       (see https://errorprone.info/bugpattern/ProtectedMembersInFinalClass)
     Did you mean 'RestManager initRestManager() throws SolrException {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:214: warning: [JdkObsolete] Date has a bad API that leads to bugs; prefer java.time.Instant or LocalDate.
     private final Date startTime = new Date();
                                    ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:380: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized (searcherLock) {
                    ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1016: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
         searcherExecutor.submit(() -> {
                                ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1157: warning: [BadInstanceof] `newUpdateHandler` is an instance of UpdateHandler which is a subtype of SolrMetricProducer, so this is equivalent to a null check.
       if (newUpdateHandler instanceof SolrMetricProducer) {
                            ^
       (see https://errorprone.info/bugpattern/BadInstanceof)
     Did you mean 'if (newUpdateHandler != null) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1856: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
     private final LinkedList<RefCounted<SolrIndexSearcher>> _searchers = new LinkedList<>();
                                                                          ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1857: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
     private final LinkedList<RefCounted<SolrIndexSearcher>> _realtimeSearchers = new LinkedList<>();
                                                                                  ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1874: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized (searcherLock) {
                    ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1875: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         isEmpty = _searchers.isEmpty();
                                     ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1876: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         isEmpty = isEmpty && _realtimeSearchers.isEmpty();
                                                        ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1976: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized (searcherLock) {
                    ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1991: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized (searcherLock) {
                    ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1992: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         if (!_searchers.isEmpty()) {
                                ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:1993: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
           RefCounted<SolrIndexSearcher> newest = _searchers.getLast();
                                                                    ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2007: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized (searcherLock) {
                    ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2019: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
         synchronized (searcherLock) {
                      ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2071: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
         synchronized (searcherLock) {
                      ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2162: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
         synchronized (searcherLock) {
                      ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2235: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized (searcherLock) {
                    ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2318: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
         synchronized (searcherLock) {
                      ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2442: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
           synchronized (searcherLock) {
                        ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2480: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
             synchronized (searcherLock) {
                          ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2513: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized (searcherLock) {
                    ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2564: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized (searcherLock) {
                    ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2613: warning: [UnnecessaryParentheses] These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
           final long qtime = (long) (req.getRequestTimer().getTime());
                                     ^
       (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
     Did you mean 'final long qtime = (long) req.getRequestTimer().getTime();'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:2672: warning: [UnnecessaryParentheses] These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
       final int qtime = (int) (req.getRequestTimer().getTime());
                               ^
       (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
     Did you mean 'final int qtime = (int) req.getRequestTimer().getTime();'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:3130: warning: [BadInstanceof] `solrInfoBean` is an instance of SolrInfoBean which is a subtype of SolrMetricProducer, so this is equivalent to a null check.
       if (solrInfoBean instanceof SolrMetricProducer) {
                        ^
       (see https://errorprone.info/bugpattern/BadInstanceof)
     Did you mean 'if (solrInfoBean != null) {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/SolrCore.java:3249: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
       coreAsyncTaskExecutor.submit(r);
                                   ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/api/ApiBag.java:173: warning: [MissingOverride] call implements method in Api; expected @Override
       public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
                   ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override @SuppressWarnings({"unchecked", "rawtypes"})'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/api/ApiBag.java:290: warning: [MutableConstantField] Constant field declarations should use the immutable type (such as ImmutableList) instead of the general collection interface type (such as List)
     public static final Set<String> KNOWN_TYPES = ImmutableSet.of("string", "boolean", "list", "int", "double", "object");
                            ^
       (see https://errorprone.info/bugpattern/MutableConstantField)
     Did you mean 'public static final ImmutableSet<String> KNOWN_TYPES = ImmutableSet.of("string", "boolean", "list", "int", "double", "object");'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/api/ApiBag.java:354: warning: [OverrideThrowableToString] To return a custom message with a Throwable class, one should override getMessage() instead of toString().
     public static class ExceptionWithErrObject extends SolrException {
                   ^
       (see https://errorprone.info/bugpattern/OverrideThrowableToString)
     Did you mean 'public String getMessage() {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/api/ApiBag.java:368: warning: [MissingOverride] toString overrides method in SolrException; expected @Override
       public String toString() {
                     ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override public String toString() {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/PluginBag.java:362: warning: [MissingOverride] get implements method in Supplier; expected @Override
       public T get() {
                ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override public T get() {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/PluginBag.java:399: warning: [MissingOverride] toString overrides method in Object; expected @Override
       public String toString() {
                     ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override public String toString() {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/core/PluginBag.java:408: warning: [TypeParameterShadowing] Found aliased type parameters: T declared in PluginBag
     public class LazyPluginHolder<T> extends PluginHolder<T> {
            ^
       (see https://errorprone.info/bugpattern/TypeParameterShadowing)
     Did you mean 'public class LazyPluginHolder<T2> extends PluginHolder<T2> {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:1917: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.
           try (HttpSolrClient client = new Builder(leaderBaseUrl)
                                            ^
       (see https://errorprone.info/bugpattern/BadImport)
     Did you mean 'try (HttpSolrClient client = new HttpSolrClient.Builder(leaderBaseUrl)'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:730: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.
               && rep.getType() != Type.PULL
                                   ^
       (see https://errorprone.info/bugpattern/BadImport)
     Did you mean '&& rep.getType() != Replica.Type.PULL'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:187: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
       public boolean equals(Object obj) {
                      ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:267: warning: [MissingOverride] call implements method in Callable; expected @Override
       public Object call() throws Exception {
                     ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override public Object call() throws Exception {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:412: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
                         executorService.submit(new RegisterCoreAsync(descriptor, true, true));
                                               ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:424: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
                 synchronized (reconnectListeners) {
                              ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:431: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
                       executorService.submit(new OnReconnectNotifyAsync(listener));
                                             ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:636: warning: [EmptyCatch] Caught exceptions should not be ignored
       } catch (AlreadyClosedException | SessionExpiredException | KeeperException.ConnectionLossException e) {
         ^
       (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:655: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
           customThreadPool.submit(() -> collectionToTerms.values().parallelStream().forEach(ZkCollectionTerms::close));
                                  ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:658: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
         customThreadPool.submit(() -> replicateFromLeaders.values().parallelStream().forEach(ReplicateFromLeader::stopReplication));
                                ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:667: warning: [MissingOverride] close implements method in Closeable; expected @Override
     public void close() {
                 ^
       (see https://errorprone.info/bugpattern/MissingOverride)
     Did you mean '@Override public void close() {'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:673: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
       customThreadPool.submit(() -> Collections.singleton(overseerElector.getContext()).parallelStream().forEach(IOUtils::closeQuietly));
                              ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:675: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
       customThreadPool.submit(() -> Collections.singleton(overseer).parallelStream().forEach(IOUtils::closeQuietly));
                              ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:678: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
         customThreadPool.submit(() -> electionContexts.values().parallelStream().forEach(IOUtils::closeQuietly));
                                ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:683: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
         customThreadPool.submit(() -> Collections.singleton(cloudSolrClient).parallelStream().forEach(IOUtils::closeQuietly));
                                ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:684: warning: [FutureReturnValueIgnored] Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.
         customThreadPool.submit(() -> Collections.singleton(cloudManager).parallelStream().forEach(IOUtils::closeQuietly));
                                ^
       (see https://errorprone.info/bugpattern/FutureReturnValueIgnored)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:726: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
       if (shard.getReplica(cd.getCloudDescriptor().getCoreNodeName()) != shard.getLeader()) return;
                                                                       ^
       (see https://errorprone.info/bugpattern/ReferenceEquality)
     Did you mean 'if (!Objects.equals(shard.getReplica(cd.getCloudDescriptor().getCoreNodeName()), shard.getLeader())) return;' or 'if (!shard.getReplica(cd.getCloudDescriptor().getCoreNodeName()).equals(shard.getLeader())) return;'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:837: warning: [JdkObsolete] Enumeration is an ancient precursor to Iterator.
             while (netInterfaces.hasMoreElements()) {
                                                 ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:838: warning: [JdkObsolete] Enumeration is an ancient precursor to Iterator.
               NetworkInterface ni = netInterfaces.nextElement();
                                                              ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:840: warning: [JdkObsolete] Enumeration is an ancient precursor to Iterator.
               while (ips.hasMoreElements()) {
                                         ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:841: warning: [JdkObsolete] Enumeration is an ancient precursor to Iterator.
                 InetAddress ip = ips.nextElement();
                                                 ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:1022: warning: [JdkObsolete] SortedSet was replaced by NavigableSet in Java 6.
         oldNodes.removeAll(newNodes);
                           ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:1023: warning: [JdkObsolete] SortedSet was replaced by NavigableSet in Java 6.
         if (oldNodes.isEmpty()) { // only added nodes
                             ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:1143: warning: [EmptyCatch] Caught exceptions should not be ignored
       } catch (NoNodeException e) {
         ^
       (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:2284: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
         synchronized (reconnectListeners) {
                      ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:2297: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
         synchronized (reconnectListeners) {
                      ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:2313: warning: [SynchronizeOnNonFinalField] Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.
       synchronized (reconnectListeners) {
                    ^
       (see https://errorprone.info/bugpattern/SynchronizeOnNonFinalField)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkController.java:2596: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
       public boolean equals(Object o) {
                      ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean 'if (!(o instanceof UnloadCoreOnDeletedWatcher)) return false;'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkDistributedQueue.java:356: warning: [MixedMutabilityReturnType] This method returns both mutable and immutable collections or maps from different paths. This may be confusing for users of the method.
     public Map<String, Object> getStats() {
                                ^
       (see https://errorprone.info/bugpattern/MixedMutabilityReturnType)
     Did you mean 'return ImmutableMap.of();' or 'return ImmutableMap.of();'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkDistributedQueue.java:368: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         final List<Map<String, Object>> failed = new ArrayList<>(stat.failureDetails.size());
                                                                                          ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkDistributedQueue.java:370: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
         stat.failureDetails.forEach(failedOp -> {
                                    ^
       (see https://errorprone.info/bugpattern/JdkObsolete)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ZkDistributedQueue.java:371: warning: [ModifiedButNotUsed] A collection or proto builder was created, but its values were never accessed.
           Map<String, Object> fo = new HashMap<>();
                                    ^
       (see https://errorprone.info/bugpattern/ModifiedButNotUsed)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/OverseerTaskQueue.java:125: warning: [EmptyCatch] Caught exceptions should not be ignored
         } catch (KeeperException.NoNodeException ignored) {
           ^
       (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/OverseerTaskQueue.java:181: warning: [WaitNotInLoop] Because of spurious wakeups, await(long,java.util.concurrent.TimeUnit) must always be called in a loop
           eventReceived.await(timeoutMs, TimeUnit.MILLISECONDS);
                              ^
       (see https://errorprone.info/bugpattern/WaitNotInLoop)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/OverseerTaskQueue.java:325: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
       public boolean equals(Object obj) {
                      ^
       (see https://errorprone.info/bugpattern/EqualsGetClass)
     Did you mean to remove this line?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java:38: warning: [PublicConstructorForAbstractClass] Constructors of on an abstract class can be declared protected as there is never a need for them to be public
     public ElectionContext(final String coreNodeName,
            ^
       (see https://errorprone.info/bugpattern/PublicConstructorForAbstractClass)
     Did you mean 'protected ElectionContext(final String coreNodeName,'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/handler/ClassifyStream.java:73: error: [FormatString] extra format arguments: used 1, provided 2
         throw new IOException(String.format(Locale.ROOT,"Invalid expression %s - field parameter must be specified",expression, streamExpressions.size()));
                                            ^
       (see https://errorprone.info/bugpattern/FormatString)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/util/circuitbreaker/CPUCircuitBreaker.java:94: error: [IdentityBinaryExpression] A binary expression where both operands are the same is usually incorrect; the value of this expression is equivalent to `seenCPUUsage.get() == 0.0`.
       if (seenCPUUsage.get() == 0.0 || seenCPUUsage.get() == 0.0) {
                                     ^
       (see https://errorprone.info/bugpattern/IdentityBinaryExpression)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/search/HashQParserPlugin.java:101: error: [ArrayHashCode] hashcode method on array does not hash array contents
             31 * keys.hashCode() +
                               ^
       (see https://errorprone.info/bugpattern/ArrayHashCode)
     Did you mean '31 * Arrays.hashCode(keys) +'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/search/HashQParserPlugin.java:112: error: [ArrayEquals] Reference equality used to compare arrays
         return keys.equals(other.keys) &&
                           ^
       (see https://errorprone.info/bugpattern/ArrayEquals)
     Did you mean 'return Arrays.equals(keys, other.keys) &&'?
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/search/stats/LRUStatsCache.java:129: error: [IdentityBinaryExpression] A binary expression where both operands are the same is usually incorrect; the value of this expression is equivalent to `!missingColStats.isEmpty()`.
       if (!missingColStats.isEmpty() || !missingColStats.isEmpty()) {
                                      ^
       (see https://errorprone.info/bugpattern/IdentityBinaryExpression)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java:393: error: [IdentityBinaryExpression] A binary expression where both operands are the same is usually incorrect; the value of this expression is equivalent to `Double.isNaN(a)`.
         if (a != a) {  // a==NaN
               ^
       (see https://errorprone.info/bugpattern/IdentityBinaryExpression)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java:394: error: [IdentityBinaryExpression] A binary expression where both operands are the same is usually incorrect; the value of this expression is equivalent to `Double.isNaN(b)`.
           if (b != b) {
                 ^
       (see https://errorprone.info/bugpattern/IdentityBinaryExpression)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java:400: error: [IdentityBinaryExpression] A binary expression where both operands are the same is usually incorrect; the value of this expression is equivalent to `Double.isNaN(b)`.
         if (b != b) { // b is NaN so a is greater
               ^
       (see https://errorprone.info/bugpattern/IdentityBinaryExpression)
   /Users/vthacker/apache-work/lucene-solr/solr/core/src/java/org/apache/solr/schema/RankField.java:73: error: [ThrowNull] Throwing 'null' always results in a NullPointerException being thrown.
       throw null;
       ^
       (see https://errorprone.info/bugpattern/ThrowNull)
     Did you mean 'throw new NullPointerException();'?
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   9 errors
   100 warnings
   ```
   
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] vthacker merged pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
vthacker merged pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-685376959


   Please move all of this plugin's related code to a separate snippet file, much like everything else gradle-related is shaped at the moment.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686928388


   I'll take a look later as to why this doesn't build. The problem with individual suppressions remains though - you can go by category but I think there will be still places where false positives need to be marked as such (so that they don't generate a warning). We will need a mechanism to individually flag such places as "valid use" - this applies to reference comparisons in particular (which may be a bug or may be intentional, depending on the intention of the programmer).


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] vthacker commented on a change in pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
vthacker commented on a change in pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#discussion_r483318383



##########
File path: build.gradle
##########
@@ -127,6 +128,9 @@ apply from: file('gradle/ide/intellij-idea.gradle')
 apply from: file('gradle/ide/eclipse.gradle')
 
 // Validation tasks
+apply from: file('gradle/hacks/findbugs.gradle')

Review comment:
       Hmm! Locally this made precommit happy
   
   But https://github.com/apache/lucene-solr/pull/1816/checks?check_run_id=1069510797 still is running into the same error 🤔 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] tflobbe commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
tflobbe commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686831857


   Hey, just in case you haven't seen it, there is a related email in the dev list about static analysis using a Github App. See http://mail-archives.apache.org/mod_mbox/lucene-dev/202009.mbox/%3CCAF_Lw0dt5jpLqyO3fwevjxbpduY_V6%2BWWyudBjkN4ZS5OHWjDA%40mail.gmail.com%3E 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] sigram commented on pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

Posted by GitBox <gi...@apache.org>.
sigram commented on pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#issuecomment-686274891


   While some warnings are disputable, most of these point to genuine errors or deficiencies - this looks very useful!


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org