@@ -1230,6 +1230,7 @@ public static Metadata readFrom(StreamInput in) throws IOException {
12301230 }
12311231
12321232 private static void readBwcCustoms (StreamInput in , Builder builder ) throws IOException {
1233+ final ProjectMetadata .Builder projectBuilder = builder .getProject (ProjectId .DEFAULT );
12331234 final Set <String > clusterScopedNames = in .namedWriteableRegistry ().getReaders (ClusterCustom .class ).keySet ();
12341235 final Set <String > projectScopedNames = in .namedWriteableRegistry ().getReaders (ProjectCustom .class ).keySet ();
12351236 final int count = in .readVInt ();
@@ -1245,9 +1246,9 @@ private static void readBwcCustoms(StreamInput in, Builder builder) throws IOExc
12451246 if (custom instanceof PersistentTasksCustomMetadata persistentTasksCustomMetadata ) {
12461247 final var tuple = persistentTasksCustomMetadata .split ();
12471248 builder .putCustom (tuple .v1 ().getWriteableName (), tuple .v1 ());
1248- builder . putProjectCustom (tuple .v2 ().getWriteableName (), tuple .v2 ());
1249+ projectBuilder . putCustom (tuple .v2 ().getWriteableName (), tuple .v2 ());
12491250 } else {
1250- builder . putProjectCustom (custom .getWriteableName (), custom );
1251+ projectBuilder . putCustom (custom .getWriteableName (), custom );
12511252 }
12521253 } else {
12531254 throw new IllegalArgumentException ("Unknown custom name [" + name + "]" );
@@ -1552,7 +1553,8 @@ public Builder putCustom(String type, ClusterCustom custom) {
15521553
15531554 @ Deprecated (forRemoval = true )
15541555 public Builder putCustom (String type , ProjectCustom custom ) {
1555- return putProjectCustom (type , custom );
1556+ getSingleProject ().putCustom (type , Objects .requireNonNull (custom , type ));
1557+ return this ;
15561558 }
15571559
15581560 public ClusterCustom getCustom (String type ) {
@@ -1575,12 +1577,6 @@ public Builder customs(Map<String, ClusterCustom> clusterCustoms) {
15751577 return this ;
15761578 }
15771579
1578- @ Deprecated (forRemoval = true )
1579- public Builder putProjectCustom (String type , ProjectCustom custom ) {
1580- getSingleProject ().putCustom (type , Objects .requireNonNull (custom , type ));
1581- return this ;
1582- }
1583-
15841580 @ Deprecated (forRemoval = true )
15851581 public Builder projectCustoms (Map <String , ProjectCustom > projectCustoms ) {
15861582 projectCustoms .forEach ((key , value ) -> Objects .requireNonNull (value , key ));
0 commit comments