Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade forbiddenapis to 3.4 #11834

Merged
merged 3 commits into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins {
id "base"
id "com.palantir.consistent-versions" version "2.11.0"
id "org.owasp.dependencycheck" version "7.2.0"
id 'de.thetaphi.forbiddenapis' version '3.3' apply false
id 'de.thetaphi.forbiddenapis' version '3.4' apply false
id "de.undercouch.download" version "5.2.0" apply false
id "net.ltgt.errorprone" version "2.0.2" apply false
id 'com.diffplug.spotless' version "6.5.2" apply false
Expand Down
20 changes: 15 additions & 5 deletions gradle/validation/forbidden-apis.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ allprojects { prj ->
doFirst dynamicSignatures.curry(configurations.compileClasspath, "lucene")
}

// Configure defaults for the MR-JAR feature sourceSets
// TODO: Get hold of warning messages!
tasks.matching { it.name == "forbiddenApisMain19" }.all {
failOnMissingClasses = false
targetCompatibility = 19

bundledSignatures += forbiddenApisMain.bundledSignatures

suppressAnnotations += [
"**.SuppressForbidden"
]

doFirst dynamicSignatures.curry(configurations.compileClasspath, "lucene")
}

// Configure defaults for sourceSets.test
tasks.matching { it.name in ["forbiddenApisTest", "forbiddenApisTestFixtures"] }.all {
bundledSignatures += [
Expand Down Expand Up @@ -115,11 +130,6 @@ allprojects { prj ->
inputs.dir(file(resources))
}

// TODO: Remove this when forbiddenapis supports Java 19 class files
tasks.matching { it.name == "forbiddenApisMain19" }.all {
enabled = false
}

// We rely on resolved configurations to compute the relevant set of rule
// files for forbiddenApis. Since we don't want to resolve these configurations until
// the task is executed, we can't really use them as task inputs properly. This is a
Expand Down
4 changes: 3 additions & 1 deletion lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ Other
---------------------
* LUCENE-10423: Remove usages of System.currentTimeMillis() from tests. (Marios Trivyzas)

* GITHUB#11811: upgrade google java format to 1.15.0 (Dawid Weiss)
* GITHUB#11811: Upgrade google java format to 1.15.0 (Dawid Weiss)

* GITHUB#11834: Upgrade forbiddenapis to version 3.4. (Uwe Schindler)

======================== Lucene 9.4.0 =======================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.nio.ByteOrder;
import java.util.Arrays;
import java.util.Objects;
import org.apache.lucene.util.ArrayUtil;

/**
* Base IndexInput implementation that uses an array of MemorySegments to represent a file.
Expand Down Expand Up @@ -408,7 +409,7 @@ MemorySegmentIndexInput buildSlice(String sliceDescription, long offset, long le

// we always allocate one more slice, the last one may be a 0 byte one after truncating with
// asSlice():
final MemorySegment slices[] = Arrays.copyOfRange(segments, startIndex, endIndex + 1);
final MemorySegment slices[] = ArrayUtil.copyOfSubArray(segments, startIndex, endIndex + 1);

// set the last segment's limit for the sliced view.
slices[slices.length - 1] = slices[slices.length - 1].asSlice(0L, sliceEnd & chunkSizeMask);
Expand Down