-
Notifications
You must be signed in to change notification settings - Fork 122
jdk21 #3829
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
base: develop
Are you sure you want to change the base?
jdk21 #3829
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,70 +74,66 @@ dependencies { | |
| api("info.picocli:picocli-spring-boot-starter:4.7.7") | ||
|
|
||
| // кэширование | ||
| api("com.github.ben-manes.caffeine", "caffeine", "3.2.3") | ||
| api("com.github.ben-manes.caffeine:caffeine:3.2.3") | ||
| api("org.ehcache:ehcache:3.11.1") | ||
|
|
||
| // lsp4j core | ||
| api("org.eclipse.lsp4j", "org.eclipse.lsp4j", "0.24.0") | ||
| api("org.eclipse.lsp4j", "org.eclipse.lsp4j.websocket.jakarta", "0.24.0") | ||
| api("org.eclipse.lsp4j:org.eclipse.lsp4j:0.24.0") | ||
| api("org.eclipse.lsp4j:org.eclipse.lsp4j.websocket.jakarta:0.24.0") | ||
|
|
||
| // 1c-syntax | ||
| api("io.github.1c-syntax", "bsl-parser", "0.30.0") { | ||
| exclude("com.ibm.icu", "*") | ||
| exclude("org.antlr", "ST4") | ||
| exclude("org.antlr", "antlr-runtime") | ||
| } | ||
| api("io.github.1c-syntax", "utils", "0.6.9") | ||
| api("io.github.1c-syntax", "mdclasses", "0.17.4") | ||
| api("io.github.1c-syntax", "bsl-common-library", "0.9.2") | ||
| api("io.github.1c-syntax", "supportconf", "0.15.0") | ||
| api("io.github.1c-syntax:bsl-parser:0.31.0") | ||
| api("io.github.1c-syntax:utils:0.7.0") | ||
| api("io.github.1c-syntax:mdclasses:0.18.0") | ||
| api("io.github.1c-syntax:bsl-common-library:0.10.0") | ||
| api("io.github.1c-syntax:supportconf:0.16.0") | ||
|
|
||
| // nullability annotations | ||
| api("org.jspecify", "jspecify", "1.0.0") | ||
| api("org.jspecify:jspecify:1.0.0") | ||
|
|
||
| // JLanguageTool | ||
| implementation("org.languagetool", "languagetool-core", languageToolVersion){ | ||
| exclude("commons-logging", "commons-logging") | ||
| exclude("com.sun.xml.bind", "jaxb-core") | ||
| exclude("com.sun.xml.bind", "jaxb-impl") | ||
| implementation("org.languagetool:languagetool-core:$languageToolVersion"){ | ||
| exclude("commons-logging:commons-logging") | ||
| exclude("com.sun.xml.bind:jaxb-core") | ||
| exclude("com.sun.xml.bind:jaxb-impl") | ||
| } | ||
| implementation("org.languagetool", "language-en", languageToolVersion){ | ||
| exclude("commons-logging", "commons-logging") | ||
| exclude("com.sun.xml.bind", "jaxb-core") | ||
| exclude("com.sun.xml.bind", "jaxb-impl") | ||
| implementation("org.languagetool:language-en:$languageToolVersion"){ | ||
| exclude("commons-logging:commons-logging") | ||
| exclude("com.sun.xml.bind:jaxb-core") | ||
| exclude("com.sun.xml.bind:jaxb-impl") | ||
| } | ||
| implementation("org.languagetool", "language-ru", languageToolVersion){ | ||
| exclude("commons-logging", "commons-logging") | ||
| exclude("com.sun.xml.bind", "jaxb-core") | ||
| exclude("com.sun.xml.bind", "jaxb-impl") | ||
| implementation("org.languagetool:language-ru:$languageToolVersion"){ | ||
| exclude("commons-logging:commons-logging") | ||
| exclude("com.sun.xml.bind:jaxb-core") | ||
| exclude("com.sun.xml.bind:jaxb-impl") | ||
| } | ||
|
|
||
| // AOP | ||
| implementation("org.aspectj", "aspectjrt", "1.9.25.1") | ||
| implementation("org.aspectj:aspectjrt:1.9.25.1") | ||
|
|
||
| // commons utils | ||
| implementation("commons-io", "commons-io", "2.21.0") | ||
| implementation("commons-beanutils", "commons-beanutils", "1.11.0"){ | ||
| exclude("commons-logging", "commons-logging") | ||
| implementation("commons-io:commons-io:2.21.0") | ||
| implementation("commons-beanutils:commons-beanutils:1.11.0"){ | ||
| exclude("commons-logging:commons-logging") | ||
| } | ||
| implementation("commons-codec", "commons-codec", "1.20.0") | ||
| implementation("org.apache.commons", "commons-lang3", "3.20.0") | ||
| implementation("org.apache.commons", "commons-collections4", "4.5.0") | ||
| implementation("org.apache.commons", "commons-exec", "1.6.0") | ||
| implementation("commons-codec:commons-codec:1.20.0") | ||
| implementation("org.apache.commons:commons-lang3:3.20.0") | ||
| implementation("org.apache.commons:commons-collections4:4.5.0") | ||
| implementation("org.apache.commons:commons-exec:1.6.0") | ||
|
|
||
| // progress bar | ||
| implementation("me.tongfei", "progressbar", "0.10.1") | ||
| implementation("me.tongfei:progressbar:0.10.1") | ||
|
|
||
| // (de)serialization | ||
| implementation("tools.jackson.core:jackson-databind") | ||
| implementation("tools.jackson.dataformat:jackson-dataformat-xml") | ||
| implementation("io.leangen.geantyref:geantyref:2.0.1") | ||
|
|
||
| // graphs | ||
| implementation("org.jgrapht", "jgrapht-core", "1.5.2") | ||
| implementation("org.jgrapht:jgrapht-core:1.5.2") | ||
|
|
||
| // SARIF serialization | ||
| implementation("com.contrastsecurity", "java-sarif", "2.0") | ||
| implementation("com.contrastsecurity:java-sarif:2.0") | ||
|
|
||
| // CONSTRAINTS | ||
| implementation("com.google.guava:guava") { | ||
|
|
@@ -152,21 +148,21 @@ dependencies { | |
|
|
||
| // spring | ||
| testImplementation("org.springframework.boot:spring-boot-starter-test") { | ||
| exclude("com.vaadin.external.google", "android-json") | ||
| exclude("com.vaadin.external.google:android-json") | ||
| } | ||
|
|
||
| testImplementation("org.junit.jupiter:junit-jupiter") | ||
|
|
||
| // test utils | ||
| testImplementation("org.jmockit", "jmockit", "1.50") | ||
| testImplementation("org.awaitility", "awaitility", "4.3.0") | ||
| testImplementation("org.jmockit:jmockit:1.50") | ||
| testImplementation("org.awaitility:awaitility:4.3.0") | ||
|
Comment on lines
+157
to
+158
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: JMockit 1.50 tends to run into Java 17+ / Java 21 problems for the same underlying reason as many legacy instrumentation/mocking tools: JEP 403 (delivered in Java 17) tightened access to JDK internals so you can’t rely on the old “relaxed” illegal reflective access behavior anymore; you must explicitly open the needed JDK packages (or the tool must be updated to stop depending on them). [1] What it looks like on Java 21Typical failures show up as Why JMockit specifically is risky here
Practical workarounds (tests)Because JEP 403 removed the “single switch” approach ( Common starting point (adjust based on the exact package named in your exception): (You may need additional Bottom lineIf you must stay on JMockit 1.50 with Java 21, expect to maintain a growing list of Sources: 🌐 Web query:
💡 Result: JMockit’s mocking works by bytecode instrumentation via a
Practical takeaways for Java 21
Sources 🏁 Script executed: cd /tmp && git ls-files | grep -E "(build\.gradle|pom\.xml|\.java-version)" | head -20Repository: 1c-syntax/bsl-language-server Length of output: 141 🏁 Script executed: cat -n build.gradle.kts | sed -n '1,50p'Repository: 1c-syntax/bsl-language-server Length of output: 2185 🏁 Script executed: cat -n build.gradle.kts | sed -n '200,250p'Repository: 1c-syntax/bsl-language-server Length of output: 2158 🏁 Script executed: rg -n "java\s*\{|sourceCompatibility|targetCompatibility|jvmArgs|add-opens" build.gradle.ktsRepository: 1c-syntax/bsl-language-server Length of output: 249 🏁 Script executed: rg -n "test|jvmArgs|javaagent" build.gradle.kts | head -30Repository: 1c-syntax/bsl-language-server Length of output: 1308 Add The codebase targets Java 21 (lines 164–165) while using jmockit 1.50 with Adjust the 🤖 Prompt for AI Agents |
||
|
|
||
| testRuntimeOnly("org.junit.platform:junit-platform-launcher") | ||
| } | ||
|
|
||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| sourceCompatibility = JavaVersion.VERSION_21 | ||
| targetCompatibility = JavaVersion.VERSION_21 | ||
| withSourcesJar() | ||
| withJavadocJar() | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.