You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@solr.apache.org by Uwe Schindler <uw...@thetaphi.de> on 2021/03/11 22:26:17 UTC

RE: [lucene] branch main updated: Always include errorprone dependency, even if we're not checking. This ensures consistent use patterns across JVMs.

Hi Dawid,

 

I simply tried it out to merge/cherrypick something  to another checkout. I did it with TortoiseGit, but this just made it simple to setup (GUI, no crazy cmdline).

 

I cherrypicked the lucene commit and applied it to solr. How I have my local setup:

*	I have three checkouts and git repos: lucene-solr.git, lucene.git and solr.git. I don’t want to mix them together, so keep them separate. All are in same top level folder.
*	On each repo I added the 2 other ones as local remote (add a remote, named “local-solr” with URL “../solr”, same for the other ones)
*	I pulled all repos, to be sure to be uptodate
*	On the solr repo, I used the “show log” tortoisegit functionality, switched to “remotes/local-solr main”, right clicked your commit and selected “cherr-pick this commit”. Voila done! Just pushing repo and all was fine.

 

With command line it might be more complicated, but I’m happy!

 

Uwe

 

-----

Uwe Schindler

Achterdiek 19, D-28357 Bremen

https://www.thetaphi.de

eMail: uwe@thetaphi.de

 

From: Uwe Schindler <uw...@thetaphi.de> 
Sent: Thursday, March 11, 2021 10:53 PM
To: dev@lucene.apache.org
Subject: Re: [lucene] branch main updated: Always include errorprone dependency, even if we're not checking. This ensures consistent use patterns across JVMs.

 

Should we maybe merge this also to Solr?

I know it's not needed, but "if" statements around dependencies look strange to me!

I can try to merge it as a proof of concept. 😜

Uwe

Am March 11, 2021 9:27:41 PM UTC schrieb dweiss@apache.org <ma...@apache.org> :

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 8bbcc39  Always include errorprone dependency, even if we're not checking. This ensures consistent use patterns across JVMs.
8bbcc39 is described below

commit 8bbcc395832ccd109794f4b85a71a59a0af2d4f4
Author: Dawid Weiss <dawid.weiss@carrotsearch.com <ma...@carrotsearch.com> >
AuthorDate: Thu Mar 11 22:27:25 2021 +0100

    Always include errorprone dependency, even if we're not checking. This ensures consistent use patterns across JVMs.


  _____  

 gradle/validation/error-prone.gradle | 248 ++++++++++++++++++-----------------
 1 file changed, 125 insertions(+), 123 deletions(-)

diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle
index 2cec644..edcbaed 100644
--- a/gradle/validation/error-prone.gradle
+++ b/gradle/validation/error-prone.gradle
@@ -15,10 +15,9 @@
  * limitations under the License.
  */
 
-// LUCENE-9650: Errorprone on master/gradle no longer works with JDK-16
-if (rootProject.runtimeJavaVersion > JavaVersion.VERSION_15) {
+def includeErrorProne = rootProject.runtimeJavaVersion <= JavaVersion.VERSION_15;
+if (!includeErrorProne) {
   logger.warn("WARNING: errorprone disabled (won't work with JDK ${rootProject.runtimeJavaVersion})")
-  return
 }
 
 allprojects { prj ->
@@ -29,127 +28,130 @@ allprojects { prj ->
       errorprone("com.google.errorprone:error_prone_core")
     }
 
-    tasks.withType(JavaCompile) { task ->
-      options.errorprone.disableWarningsInGeneratedCode = true
-      options.errorprone.errorproneArgs = [
-          // test
-          '-Xep:ExtendingJUnitAssert:OFF',
-          '-Xep:UseCorrectAssertInTests:OFF',
-          '-Xep:DefaultPackage:OFF',
-          '-Xep:FloatingPointLiteralPrecision:OFF',
-          '-Xep:CatchFail:OFF',
-          '-Xep:TryFailThrowable:OFF',
-          '-Xep:MathAbsoluteRandom:OFF',
-          '-Xep:AssertionFailureIgnored:OFF',
-          '-Xep:JUnit4TestNotRun:OFF',
-          '-Xep:FallThrough:OFF',
-          '-Xep:CatchAndPrintStackTrace:OFF',
-          '-Xep:ToStringReturnsNull:OFF',
-          '-Xep:ArrayAsKeyOfSetOrMap:OFF',
-          '-Xep:StaticAssignmentInConstructor:OFF',
-          '-Xep:SelfAssignment:OFF',
-          '-Xep:InvalidPatternSyntax:OFF',
-          '-Xep:MissingFail:OFF',
-          '-Xep:LossyPrimitiveCompare:OFF',
-          '-Xep:ComparableType:OFF',
-          '-Xep:InfiniteRecursion:OFF',
-          '-Xep:MisusedDayOfYear:OFF',
-          '-Xep:FloatingPointAssertionWithinEpsilon:OFF',
+    // LUCENE-9650: Errorprone on master/gradle no longer works with JDK-16
+    if (includeErrorProne) {
+      tasks.withType(JavaCompile) { task ->
+        options.errorprone.disableWarningsInGeneratedCode = true
+        options.errorprone.errorproneArgs = [
+            // test
+            '-Xep:ExtendingJUnitAssert:OFF',
+            '-Xep:UseCorrectAssertInTests:OFF',
+            '-Xep:DefaultPackage:OFF',
+            '-Xep:FloatingPointLiteralPrecision:OFF',
+            '-Xep:CatchFail:OFF',
+            '-Xep:TryFailThrowable:OFF',
+            '-Xep:MathAbsoluteRandom:OFF',
+            '-Xep:AssertionFailureIgnored:OFF',
+            '-Xep:JUnit4TestNotRun:OFF',
+            '-Xep:FallThrough:OFF',
+            '-Xep:CatchAndPrintStackTrace:OFF',
+            '-Xep:ToStringReturnsNull:OFF',
+            '-Xep:ArrayAsKeyOfSetOrMap:OFF',
+            '-Xep:StaticAssignmentInConstructor:OFF',
+            '-Xep:SelfAssignment:OFF',
+            '-Xep:InvalidPatternSyntax:OFF',
+            '-Xep:MissingFail:OFF',
+            '-Xep:LossyPrimitiveCompare:OFF',
+            '-Xep:ComparableType:OFF',
+            '-Xep:InfiniteRecursion:OFF',
+            '-Xep:MisusedDayOfYear:OFF',
+            '-Xep:FloatingPointAssertionWithinEpsilon:OFF',
 
-          '-Xep:ThrowNull:OFF',
-          '-Xep:StaticGuardedByInstance:OFF',
-          '-Xep:ArrayHashCode:OFF',
-          '-Xep:ArrayEquals:OFF',
-          '-Xep:IdentityBinaryExpression:OFF',
-          '-Xep:ComplexBooleanConstant:OFF',
-          '-Xep:ComplexBooleanConstant:OFF',
-          '-Xep:StreamResourceLeak:OFF',
-          '-Xep:UnnecessaryLambda:OFF',
-          '-Xep:ObjectToString:OFF',
-          '-Xep:URLEqualsHashCode:OFF',
-          '-Xep:DoubleBraceInitialization:OFF',
-          '-Xep:ShortCircuitBoolean:OFF',
-          '-Xep:InputStreamSlowMultibyteRead:OFF',
-          '-Xep:NonCanonicalType:OFF',
-          '-Xep:CollectionIncompatibleType:OFF',
-          '-Xep:TypeParameterShadowing:OFF',
-          '-Xep:ThreadJoinLoop:OFF',
-          '-Xep:MutableConstantField:OFF',
-          '-Xep:ReturnValueIgnored:OFF',
-          '-Xep:CollectionIncompatibleType:OFF',
-          '-Xep:SameNameButDifferent:OFF',
-          '-Xep:InvalidParam:OFF',
-          '-Xep:CompareToZero:OFF',
-          '-Xep:DoubleCheckedLocking:OFF',
-          '-Xep:BadShiftAmount:OFF',
-          '-Xep:CollectionUndefinedEquality:OFF',
-          '-Xep:UnescapedEntity:OFF',
-          '-Xep:BoxedPrimitiveEquality:OFF',
-          '-Xep:LogicalAssignment:OFF',
-          '-Xep:DoubleCheckedLocking:OFF',
-          '-Xep:AmbiguousMethodReference:OFF',
-          '-Xep:FormatString:OFF',
-          '-Xep:InstanceOfAndCastMatchWrongType:OFF',
-          '-Xep:ModifyCollectionInEnhancedForLoop:OFF',
-          '-Xep:JavaLangClash:OFF',
-          '-Xep:TypeParameterUnusedInFormals:OFF',
-          '-Xep:UnusedNestedClass:OFF',
-          '-Xep:OverrideThrowableToString:OFF',
-          '-Xep:FutureReturnValueIgnored:OFF',
-          '-Xep:BadInstanceof:OFF',
-          '-Xep:UnusedNestedClass:OFF',
-          '-Xep:OverrideThrowableToString:OFF',
-          '-Xep:EqualsIncompatibleType:OFF',
-          '-Xep:ByteBufferBackingArray:OFF',
-          '-Xep:ByteBufferBackingArray:OFF',
-          '-Xep:UnusedMethod:OFF',
-          '-Xep:ObjectsHashCodePrimitive:OFF',
-          '-Xep:ObjectsHashCodePrimitive:OFF',
-          '-Xep:UnnecessaryAnonymousClass:OFF',
-          '-Xep:BoxedPrimitiveConstructor:OFF',
-          '-Xep:ArgumentSelectionDefectChecker:OFF',
-          '-Xep:StringSplitter:OFF',
-          '-Xep:MixedMutabilityReturnType:OFF',
-          '-Xep:EqualsUnsafeCast:OFF',
-          '-Xep:OperatorPrecedence:OFF',
-          '-Xep:HidingField:OFF',
-          '-Xep:ThreadPriorityCheck:OFF',
-          '-Xep:InlineFormatString:OFF',
-          '-Xep:EqualsUnsafeCast:OFF',
-          '-Xep:UnsynchronizedOverridesSynchronized:OFF',
-          '-Xep:OperatorPrecedence:OFF',
-          '-Xep:ArrayToString:OFF',
-          '-Xep:ClassCanBeStatic:OFF',
-          '-Xep:InvalidInlineTag:OFF',
-          '-Xep:EmptyCatch:OFF',
-          '-Xep:UnnecessaryParentheses:OFF',
-          '-Xep:AlmostJavadoc:OFF',
-          '-Xep:Finally:OFF',
-          '-Xep:ImmutableEnumChecker:OFF',
-          '-Xep:NonAtomicVolatileUpdate:OFF',
-          '-Xep:MutablePublicArray:OFF',
-          '-Xep:LockNotBeforeTry:OFF',
-          '-Xep:WaitNotInLoop:OFF',
-          '-Xep:UndefinedEquals:OFF',
-          '-Xep:JdkObsolete:OFF',
-          '-Xep:NarrowingCompoundAssignment:OFF',
-          '-Xep:InconsistentCapitalization:OFF',
-          '-Xep:IntLongMath:OFF',
-          '-Xep:SynchronizeOnNonFinalField:OFF',
-          '-Xep:ThreadLocalUsage:OFF',
-          '-Xep:ProtectedMembersInFinalClass:OFF',
-          '-Xep:BadImport:OFF',
-          '-Xep:InconsistentHashCode:OFF',
-          '-Xep:MissingOverride:OFF',
-          '-Xep:EqualsGetClass:OFF',
-          '-Xep:PublicConstructorForAbstractClass:OFF',
-          '-Xep:EscapedEntity:OFF',
-          '-Xep:ModifiedButNotUsed:OFF',
-          '-Xep:ReferenceEquality:OFF',
-          '-Xep:InvalidBlockTag:OFF',
-          '-Xep:MissingSummary:OFF',
-          '-Xep:UnusedVariable:OFF'
-      ]
+            '-Xep:ThrowNull:OFF',
+            '-Xep:StaticGuardedByInstance:OFF',
+            '-Xep:ArrayHashCode:OFF',
+            '-Xep:ArrayEquals:OFF',
+            '-Xep:IdentityBinaryExpression:OFF',
+            '-Xep:ComplexBooleanConstant:OFF',
+            '-Xep:ComplexBooleanConstant:OFF',
+            '-Xep:StreamResourceLeak:OFF',
+            '-Xep:UnnecessaryLambda:OFF',
+            '-Xep:ObjectToString:OFF',
+            '-Xep:URLEqualsHashCode:OFF',
+            '-Xep:DoubleBraceInitialization:OFF',
+            '-Xep:ShortCircuitBoolean:OFF',
+            '-Xep:InputStreamSlowMultibyteRead:OFF',
+            '-Xep:NonCanonicalType:OFF',
+            '-Xep:CollectionIncompatibleType:OFF',
+            '-Xep:TypeParameterShadowing:OFF',
+            '-Xep:ThreadJoinLoop:OFF',
+            '-Xep:MutableConstantField:OFF',
+            '-Xep:ReturnValueIgnored:OFF',
+            '-Xep:CollectionIncompatibleType:OFF',
+            '-Xep:SameNameButDifferent:OFF',
+            '-Xep:InvalidParam:OFF',
+            '-Xep:CompareToZero:OFF',
+            '-Xep:DoubleCheckedLocking:OFF',
+            '-Xep:BadShiftAmount:OFF',
+            '-Xep:CollectionUndefinedEquality:OFF',
+            '-Xep:UnescapedEntity:OFF',
+            '-Xep:BoxedPrimitiveEquality:OFF',
+            '-Xep:LogicalAssignment:OFF',
+            '-Xep:DoubleCheckedLocking:OFF',
+            '-Xep:AmbiguousMethodReference:OFF',
+            '-Xep:FormatString:OFF',
+            '-Xep:InstanceOfAndCastMatchWrongType:OFF',
+            '-Xep:ModifyCollectionInEnhancedForLoop:OFF',
+            '-Xep:JavaLangClash:OFF',
+            '-Xep:TypeParameterUnusedInFormals:OFF',
+            '-Xep:UnusedNestedClass:OFF',
+            '-Xep:OverrideThrowableToString:OFF',
+            '-Xep:FutureReturnValueIgnored:OFF',
+            '-Xep:BadInstanceof:OFF',
+            '-Xep:UnusedNestedClass:OFF',
+            '-Xep:OverrideThrowableToString:OFF',
+            '-Xep:EqualsIncompatibleType:OFF',
+            '-Xep:ByteBufferBackingArray:OFF',
+            '-Xep:ByteBufferBackingArray:OFF',
+            '-Xep:UnusedMethod:OFF',
+            '-Xep:ObjectsHashCodePrimitive:OFF',
+            '-Xep:ObjectsHashCodePrimitive:OFF',
+            '-Xep:UnnecessaryAnonymousClass:OFF',
+            '-Xep:BoxedPrimitiveConstructor:OFF',
+            '-Xep:ArgumentSelectionDefectChecker:OFF',
+            '-Xep:StringSplitter:OFF',
+            '-Xep:MixedMutabilityReturnType:OFF',
+            '-Xep:EqualsUnsafeCast:OFF',
+            '-Xep:OperatorPrecedence:OFF',
+            '-Xep:HidingField:OFF',
+            '-Xep:ThreadPriorityCheck:OFF',
+            '-Xep:InlineFormatString:OFF',
+            '-Xep:EqualsUnsafeCast:OFF',
+            '-Xep:UnsynchronizedOverridesSynchronized:OFF',
+            '-Xep:OperatorPrecedence:OFF',
+            '-Xep:ArrayToString:OFF',
+            '-Xep:ClassCanBeStatic:OFF',
+            '-Xep:InvalidInlineTag:OFF',
+            '-Xep:EmptyCatch:OFF',
+            '-Xep:UnnecessaryParentheses:OFF',
+            '-Xep:AlmostJavadoc:OFF',
+            '-Xep:Finally:OFF',
+            '-Xep:ImmutableEnumChecker:OFF',
+            '-Xep:NonAtomicVolatileUpdate:OFF',
+            '-Xep:MutablePublicArray:OFF',
+            '-Xep:LockNotBeforeTry:OFF',
+            '-Xep:WaitNotInLoop:OFF',
+            '-Xep:UndefinedEquals:OFF',
+            '-Xep:JdkObsolete:OFF',
+            '-Xep:NarrowingCompoundAssignment:OFF',
+            '-Xep:InconsistentCapitalization:OFF',
+            '-Xep:IntLongMath:OFF',
+            '-Xep:SynchronizeOnNonFinalField:OFF',
+            '-Xep:ThreadLocalUsage:OFF',
+            '-Xep:ProtectedMembersInFinalClass:OFF',
+            '-Xep:BadImport:OFF',
+            '-Xep:InconsistentHashCode:OFF',
+            '-Xep:MissingOverride:OFF',
+            '-Xep:EqualsGetClass:OFF',
+            '-Xep:PublicConstructorForAbstractClass:OFF',
+            '-Xep:EscapedEntity:OFF',
+            '-Xep:ModifiedButNotUsed:OFF',
+            '-Xep:ReferenceEquality:OFF',
+            '-Xep:InvalidBlockTag:OFF',
+            '-Xep:MissingSummary:OFF',
+            '-Xep:UnusedVariable:OFF'
+        ]
+      }
     }
   }
 }


--
Uwe Schindler
Achterdiek 19, 28357 Bremen
https://www.thetaphi.de