Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 .github/actions/prepare-for-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Creates a shared setup for other workflows
inputs:
java-version:
required: false
default: "23"
default: "24"
description: "The default JDK version to set up."

java-distribution:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-checks-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
java: [ '23' ]
java: [ '24' ]

runs-on: ${{ matrix.os }}

Expand All @@ -53,7 +53,7 @@ jobs:
matrix:
# Operating systems to run on.
os: [ ubuntu-latest, windows-latest, macos-latest ]
java: [ '23' ]
java: [ '24' ]

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-checks-gradle-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
java-version: [ '23-ea' ]
java-version: [ '24' ]
uses-alt-java: [ true, false ]

runs-on: ${{ matrix.os }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-nightly-smoketester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
java-version: [ '23', '24' ]
java-version: [ '24' ]

runs-on: ${{ matrix.os }}

Expand All @@ -37,7 +37,7 @@ jobs:
# This intentionally lists two versions, the last one is used as the system default (for running gradle).
java-version: |
${{ matrix.java-version }}
23
24

- name: Echo diagnostic paths and locations
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public static void main(String[] args) {

public static void checkVersion() {
int major = Runtime.version().feature();
if (major != 23) {
throw new IllegalStateException("java version must be 23, your version: " + major);
if (major != 24) {
throw new IllegalStateException("java version must be 24, your version: " + major);
}
}

Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ asm = "9.6"
assertj = "3.27.3"
commons-codec = "1.17.2"
commons-compress = "1.19"
ecj = "3.40.0"
# @keep This version refers to ECJ batch compiler from p2 repositories ("drops").
ecjP2Drop = "ecj-4.36M1"
errorprone = "2.36.0"
flexmark = "0.64.8"
# @keep This is GJF version for spotless/ tidy.
googleJavaFormat = "1.23.0"
groovy = "4.0.22"
groovy = "4.0.26"
hamcrest = "2.2"
icu4j = "77.1"
javacc = "7.0.12"
Expand All @@ -20,9 +21,9 @@ jmh = "1.37"
jts = "1.17.0"
junit = "4.13.1"
# @keep Minimum gradle version to run the build
minGradle = "8.10"
minGradle = "8.14"
# @keep This is the minimum required Java version.
minJava = "23"
minJava = "24"
morfologik = "2.1.9"
morfologik-ukrainian = "4.9.1"
nekohtml = "1.9.17"
Expand All @@ -43,7 +44,6 @@ asm-core = { module = "org.ow2.asm:asm", version.ref = "asm" }
assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
commons-codec = { module = "commons-codec:commons-codec", version.ref = "commons-codec" }
commons-compress = { module = "org.apache.commons:commons-compress", version.ref = "commons-compress" }
ecj = { module = "org.eclipse.jdt:ecj", version.ref = "ecj" }
errorprone = { module = "com.google.errorprone:error_prone_core", version.ref = "errorprone" }
flexmark-core = { module = "com.vladsch.flexmark:flexmark", version.ref = "flexmark" }
flexmark-ext-abbreviation = { module = "com.vladsch.flexmark:flexmark-ext-abbreviation", version.ref = "flexmark" }
Expand Down
46 changes: 36 additions & 10 deletions gradle/validation/ecj-lint.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,58 @@
// This adds 'ecjLint' task.

configure(rootProject) {
apply plugin: deps.plugins.undercouch.download.get().pluginId

def ecjVersion = deps.versions.ecjP2Drop.get()
def ecjDropJar = project.layout.buildDirectory.file("ecj-drop/${ecjVersion}.jar")
def downloadEcjDrop = tasks.register("downloadEcjDrop", Download, {
src "https://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops4/S-4.36M1-202504031800/${ecjVersion}.jar"
dest project.layout.buildDirectory.dir("ecj-drop")
overwrite false
onlyIf {
!ecjDropJar.get().asFile.exists()
}
})

configurations {
ecjDeps
ecjDropDeps
}

dependencies {
ecjDeps deps.ecj
artifacts {
add("ecjDropDeps", ecjDropJar, {
builtBy downloadEcjDrop
})
}
}

def resources = scriptResources(buildscript)

allprojects {
plugins.withType(JavaPlugin) {
plugins.withType(JavaPlugin).configureEach {
configurations {
ecjDeps
}

dependencies {
ecjDeps project(path: ":", configuration: "ecjDropDeps")
}

def ecjConfiguration = configurations.ecjDeps

// Create a [sourceSetName]EcjLint task for each source set
// with a non-empty java.srcDirs. These tasks are then
// attached to project's "ecjLint" task.
def lintTasks = sourceSets.collect { sourceSet ->
def lintTasks = sourceSets.collect { SourceSet sourceSet ->
def srcDirs = sourceSet.java.sourceDirectories
.filter { dir -> dir.exists() }

tasks.create(sourceSet.getTaskName("ecjLint", null), JavaExec, { JavaExec task ->
tasks.register(sourceSet.getTaskName("ecjLint", null), JavaExec, { JavaExec task ->
// This dependency is on a configuration; technically it causes
// all dependencies to be resolved before this task executes
// (this includes scheduling tasks that compile the
// sources from other projects for example).
dependsOn sourceSet.compileClasspath
dependsOn ecjConfiguration

// The inputs are all source files from the sourceSet.
inputs.files sourceSet.allSource.asFileTree
Expand All @@ -56,8 +82,8 @@ allprojects {
if (sourceSet.name ==~ /main\d+/) {
enabled = false
}
classpath = rootProject.configurations.ecjDeps

classpath = ecjConfiguration
mainClass = "org.eclipse.jdt.internal.compiler.batch.Main"

// Don't emit any .class files.
Expand Down Expand Up @@ -133,12 +159,12 @@ allprojects {
})
}

task ecjLint() {
def ecjLint = tasks.register("ecjLint", {
description "Lint Java sources using ECJ."
group "Verification"

dependsOn lintTasks
}
})

// Attach ecjLint to check.
check.dependsOn ecjLint
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.jar.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046
7d3a4ac4de1c32b59bc6a4eb8ecb8e612ccd0cf1ae1e99f66902da64df296172
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.jar.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.10.0
8.14.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/ASCIITLD.jflex": "eddfb929c5664b2081a20314ac1a8363c462f27c",
"lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TLDs.txt": "7c5785fda5692269e4a8022d2d08119ace54b54e",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/ASCIITLD.jflex": "796548e0fbf0688225824e65473167dbb478adc4",
"lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TLDs.txt": "84ccf9a61fb66f1f882fbbeb56efe8e21ba74b41",
"property:tldZones": "https://data.iana.org/TLD/tlds-alpha-by-domain.txt"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"gradle/generation/jflex/skeleton.disable.buffer.expansion.txt": "6e43a3a64a9b5eb82ec5b4bc21f95aff5a2a061e",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/ASCIITLD.jflex": "eddfb929c5664b2081a20314ac1a8363c462f27c",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/ASCIITLD.jflex": "796548e0fbf0688225824e65473167dbb478adc4",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizerImpl.java": "ad17a3b0bc254749685ac34c3071bb0881f7b185",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizerImpl.jflex": "8d7cd1a935443deda6cad73b91f1a45c1c714535"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/
// Generated from IANA TLD Database <https://data.iana.org/TLD/tlds-alpha-by-domain.txt>
// file version from 2024 Mar 28, Thu 07:07:01 Coordinated Universal Time
// file version from 2025 Apr 22, Tue 07:07:01 GMT
// generated by org.apache.lucene.analysis.standard.GenerateJflexTLDMacros

// LUCENE-8278: None of the TLDs in {ASCIITLD} is a 1-character-shorter prefix of another TLD
Expand Down Expand Up @@ -285,7 +285,6 @@ ASCIITLD = "." (
| [cC][yY][mM][rR][uU]
| [cC][yY][oO][uU]
| [cC][zZ]
| [dD][aA][bB][uU][rR]
| [dD][aA][dD]
| [dD][aA][nN][cC][eE]
| [dD][aA][tT][aA]
Expand Down Expand Up @@ -590,7 +589,6 @@ ASCIITLD = "." (
| [kK][dD][dD][iI]
| [kK][eE]
| [kK][eE][rR][rR][yY][hH][oO][tT][eE][lL][sS]
| [kK][eE][rR][rR][yY][lL][oO][gG][iI][sS][tT][iI][cC][sS]
| [kK][eE][rR][rR][yY][pP][rR][oO][pP][eE][rR][tT][iI][eE][sS]
| [kK][fF][hH]
| [kK][gG]
Expand Down Expand Up @@ -650,7 +648,6 @@ ASCIITLD = "." (
| [lL][iI][mM][oO]
| [lL][iI][nN][cC][oO][lL][nN]
| [lL][iI][nN][kK]
| [lL][iI][pP][sS][yY]
| [lL][iI][vV][eE]
| [lL][iI][vV][iI][nN][gG]
| [lL][kK]
Expand Down Expand Up @@ -747,7 +744,6 @@ ASCIITLD = "." (
| [nN][aA][bB]
| [nN][aA][gG][oO][yY][aA]
| [nN][aA][mM][eE]
| [nN][aA][tT][uU][rR][aA]
| [nN][aA][vV][yY]
| [nN][bB][aA]
| [nN][cC]
Expand Down Expand Up @@ -958,7 +954,6 @@ ASCIITLD = "." (
| [sS][hH]
| [sS][hH][aA][nN][gG][rR][iI][lL][aA]
| [sS][hH][aA][rR][pP]
| [sS][hH][aA][wW]
| [sS][hH][eE][lL][lL]
| [sS][hH][iI][aA]
| [sS][hH][iI][kK][sS][hH][aA]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ cy
cymru
cyou
cz
dabur
dad
dance
data
Expand Down Expand Up @@ -627,7 +626,6 @@ kaufen
kddi
ke
kerryhotels
kerrylogistics
kerryproperties
kfh
kg
Expand Down Expand Up @@ -691,7 +689,6 @@ limited
limo
lincoln
link
lipsy
live
living
lk
Expand Down Expand Up @@ -801,7 +798,6 @@ na
nab
nagoya
name
natura
navy
nba
nc
Expand Down Expand Up @@ -1038,7 +1034,6 @@ sg
sh
shangrila
sharp
shaw
shell
shia
shiksha
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ private static <A> MMapIndexInputProvider<A> lookupProvider() {
// access through the lookup:
final var constr = lookup.findConstructor(cls, MethodType.methodType(void.class, int.class));
try {
return (MMapIndexInputProvider<A>) constr.invoke(maxPermits);
@SuppressWarnings("unchecked")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL, whats the reason for this?

We should anways get rid on the whole code here in main branch and merge all files to the main compilation unit (except vectors, of course).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler complains about it. Try reverting and see for yourself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does look odd, I agree.

Execution failed for task ':lucene:core:compileJava'.
> Compilation failed; see the compiler output below.
  Note: Recompile with -Xlint:deprecation for details.
  error: warnings found and -Werror specified
  /home/.../lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java:368: warning: [unchecked] unchecked cast
          return (MMapIndexInputProvider<A>) constr.invoke(maxPermits);
                                                          ^
    required: MMapIndexInputProvider<A>
    found:    MMapIndexInputProvider
    where A is a type-variable:
      A extends Object declared in method <A>lookupProvider()
  Note: Some input files use or override a deprecated API.
  1 error
  1 warning

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #14564 to get rid of all this shit.

At moment the other PR is based on Java 23, but it is easy to update to 24. At moment we forgot to change the code, so Java 21 was still in business in Main!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In future, when we update Java version we also need the updates in build system and sourcesets for vectors. So we need to change the mrJarVersions property in Gradle build, too and rename the sourceset folder java23 -> java24

var res = (MMapIndexInputProvider<A>) constr.invoke(maxPermits);
return res;
} catch (RuntimeException | Error e) {
throw e;
} catch (Throwable th) {
Expand Down