[java] IDEA-372997 JavaFeature: create two versions of the Structured Concurrency to reflect reality in JEPs

see discussion in IJ-MR-167068

(cherry picked from commit 6d36cb4375f8f6a6d7d7b603de037c2c7a5255a8)


(cherry picked from commit bc222c301dfe54624b54c05431dadf0a5c0523dc)

IJ-MR-169535

GitOrigin-RevId: 05d36387c2949811727a8191dd8cf9a4bb70ee8e
This commit is contained in:
Bartek Pacia
2025-06-26 15:10:00 +02:00
committed by intellij-monorepo-bot
parent ba9ef159a8
commit 5cba7b1050
5 changed files with 22 additions and 18 deletions

View File

@@ -67,7 +67,8 @@ feature.implicit.class.name.out.of.scope=Names of implicitly declared classes ar
feature.instance.main.method=Instance main method
feature.inherited.static.main.method=Inherited static main method
feature.scoped.values=Scoped 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)
feature.sequenced.collections=Sequenced Collections
feature.classfile.api=ClassFile API
feature.stream.gatherers=Stream Gatherers

View File

@@ -99,7 +99,13 @@ enum class JavaFeature {
INSTANCE_MAIN_METHOD(LanguageLevel.JDK_21_PREVIEW, "feature.instance.main.method"),
SCOPED_VALUES(LanguageLevel.JDK_21_PREVIEW, "feature.scoped.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 {
return super.isSufficient(useSiteLevel) && !useSiteLevel.isAtLeast(LanguageLevel.JDK_25)
}
},
STRUCTURED_CONCURRENCY_TASK_SCOPE_STATIC_FACTORY_METHODS(LanguageLevel.JDK_25_PREVIEW, "feature.structured.concurrency.static.factory.methods"),
IMPLICIT_CLASS_NAME_OUT_OF_SCOPE(LanguageLevel.JDK_22_PREVIEW, "feature.implicit.class.name.out.of.scope"),
CLASSFILE_API(LanguageLevel.JDK_22_PREVIEW, "feature.classfile.api"),
@@ -216,7 +222,7 @@ enum class JavaFeature {
"STRING_TEMPLATES" -> STRING_TEMPLATES
"UNNAMED_CLASSES", "IMPLICIT_CLASSES" -> IMPLICIT_CLASSES
"SCOPED_VALUES" -> SCOPED_VALUES
"STRUCTURED_CONCURRENCY" -> STRUCTURED_CONCURRENCY
"STRUCTURED_CONCURRENCY" -> STRUCTURED_CONCURRENCY_TASK_SCOPE_CONSTRUCTORS
"CLASSFILE_API" -> CLASSFILE_API
"STREAM_GATHERERS" -> STREAM_GATHERERS
"FOREIGN" -> FOREIGN_FUNCTIONS