[java] IDEA-377548 Support JEP 502 Stable Values

(cherry picked from commit 34378ba9f59f9c9f8c09420e45d3c24441d68a09)

IJ-CR-172542

GitOrigin-RevId: 864940fcc5acc879fb58463a9c39bee1c640f59d
This commit is contained in:
Bartek Pacia
2025-08-14 15:27:58 +02:00
committed by intellij-monorepo-bot
parent f46b643527
commit 8bc09c3428
3 changed files with 4 additions and 0 deletions

View File

@@ -109,6 +109,7 @@ internal object DefaultJavaSyntaxResources {
"feature.sealed.classes" to "Sealed classes",
"feature.sequenced.collections" to "Sequenced Collections",
"feature.serial.annotation" to "@Serial annotation",
"feature.stable.values" to "Stable Values",
"feature.statements.before.super" to "Flexible Constructor Bodies",
"feature.static.imports" to "Static imports",
"feature.static.interface.calls" to "Static interface method calls",

View File

@@ -67,6 +67,7 @@ feature.implicit.class.name.out.of.scope=The name of an implicitly declared clas
feature.instance.main.method=Instance main method
feature.inherited.static.main.method=Inherited static main method
feature.scoped.values=Scoped Values
feature.stable.values=Stable Values
feature.structured.concurrency=Structured Concurrency
feature.structured.concurrency.constructors=Structured Concurrency (StructuredTaskScope with constructors)
feature.structured.concurrency.static.factory.methods=Structured Concurrency (StructuredTaskScope with static factory methods)

View File

@@ -136,6 +136,7 @@ enum class JavaFeature {
},
SCOPED_VALUES(LanguageLevel.JDK_21_PREVIEW, "feature.scoped.values"),
STABLE_VALUES(LanguageLevel.JDK_25_PREVIEW, "feature.stable.values"),
STRUCTURED_CONCURRENCY(LanguageLevel.JDK_21_PREVIEW, "feature.structured.concurrency"),
STRUCTURED_CONCURRENCY_TASK_SCOPE_CONSTRUCTORS(LanguageLevel.JDK_21_PREVIEW, "feature.structured.concurrency.constructors") {
override fun isSufficient(useSiteLevel: LanguageLevel): Boolean {
@@ -366,6 +367,7 @@ enum class JavaFeature {
"STRING_TEMPLATES" -> STRING_TEMPLATES
"UNNAMED_CLASSES", "IMPLICIT_CLASSES" -> IMPLICIT_CLASSES
"SCOPED_VALUES" -> SCOPED_VALUES
"STABLE_VALUES" -> STABLE_VALUES
"STRUCTURED_CONCURRENCY" -> STRUCTURED_CONCURRENCY
"CLASSFILE_API" -> CLASSFILE_API
"STREAM_GATHERERS" -> STREAM_GATHERERS