Skip to content

Commit c8ff762

Browse files
Introduce Java NestInFileClass feature in java_features.proto for Edition 2024.
PiperOrigin-RevId: 739187956
1 parent a2d0c68 commit c8ff762

File tree

3 files changed

+503
-33
lines changed

3 files changed

+503
-33
lines changed

java/core/src/main/resources/google/protobuf/java_features.proto

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,36 @@ message JavaFeatures {
8484
edition_defaults = { edition: EDITION_LEGACY, value: "true" },
8585
edition_defaults = { edition: EDITION_2024, value: "false" }
8686
];
87+
88+
message NestInFileClassFeature {
89+
enum NestInFileClass {
90+
// Invalid default, which should never be used.
91+
NEST_IN_FILE_CLASS_UNKNOWN = 0;
92+
// Do not nest the generated class in the file class.
93+
NO = 1;
94+
// Nest the generated class in the file class.
95+
YES = 2;
96+
// Fall back to the `java_multiple_files` option. Users won't be able to
97+
// set this option.
98+
LEGACY = 3 [feature_support = {
99+
edition_introduced: EDITION_2024
100+
edition_removed: EDITION_2024
101+
}];
102+
}
103+
reserved 1 to max;
104+
}
105+
106+
// Whether to nest the generated class in the generated file class. This is
107+
// only applicable to *top-level* messages, enums, and services.
108+
optional NestInFileClassFeature.NestInFileClass nest_in_file_class = 5 [
109+
retention = RETENTION_SOURCE,
110+
targets = TARGET_TYPE_MESSAGE,
111+
targets = TARGET_TYPE_ENUM,
112+
targets = TARGET_TYPE_SERVICE,
113+
feature_support = {
114+
edition_introduced: EDITION_2024,
115+
},
116+
edition_defaults = { edition: EDITION_LEGACY, value: "LEGACY" },
117+
edition_defaults = { edition: EDITION_2024, value: "NO" }
118+
];
87119
}

0 commit comments

Comments
 (0)