You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2022/11/25 16:47:30 UTC

[lucene] branch main updated: fix bad shift amounts and enable check (#11979)

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

rmuir 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 4e93f29318e fix bad shift amounts and enable check (#11979)
4e93f29318e is described below

commit 4e93f29318e5ced23579beff424b2c41db08c415
Author: Robert Muir <rm...@apache.org>
AuthorDate: Fri Nov 25 11:47:25 2022 -0500

    fix bad shift amounts and enable check (#11979)
---
 gradle/validation/error-prone.gradle                                  | 2 +-
 lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java | 2 +-
 lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle
index 44971d7409b..69a38574c4d 100644
--- a/gradle/validation/error-prone.gradle
+++ b/gradle/validation/error-prone.gradle
@@ -88,7 +88,7 @@ allprojects { prj ->
             '-Xep:AutoValueBuilderDefaultsInConstructor:ERROR',
             '-Xep:AutoValueConstructorOrderChecker:ERROR',
             '-Xep:BadAnnotationImplementation:ERROR',
-            // '-Xep:BadShiftAmount:OFF',
+            '-Xep:BadShiftAmount:ERROR',
             '-Xep:BanJNDI:ERROR',
             '-Xep:BoxedPrimitiveEquality:ERROR',
             '-Xep:BundleDeserializationCast:ERROR',
diff --git a/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java b/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java
index 8d8dfaeb978..ddb556822d4 100644
--- a/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java
+++ b/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java
@@ -243,7 +243,7 @@ public abstract class LZ4TestCase extends LuceneTestCase {
   }
 
   public void testIncompressibleRandom() throws IOException {
-    byte[] b = new byte[TestUtil.nextInt(random(), 1, 1 << 32)];
+    byte[] b = new byte[TestUtil.nextInt(random(), 1, 1 << 18)];
     random().nextBytes(b);
     doTest(b, newHashTable());
     doTestWithDictionary(b, newHashTable());
diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java b/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java
index 1567d2df398..7700d96e3b5 100644
--- a/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java
+++ b/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java
@@ -1931,7 +1931,7 @@ public class TestJoinUtil extends LuceneTestCase {
     document.add(new IntPoint(fieldName + "INT", linkInt));
     document.add(new FloatPoint(fieldName + "FLOAT", linkInt));
 
-    final long linkLong = linkInt << 32 | linkInt;
+    final long linkLong = (long) linkInt << 32 | linkInt;
     document.add(new LongPoint(fieldName + "LONG", linkLong));
     document.add(new DoublePoint(fieldName + "DOUBLE", linkLong));