Skip to content

Commit 2124ea9

Browse files
authored
Use default project ID singleton in more places (#128881)
We can use the singleton when parsing JSON and persisted cluster state as well.
1 parent 526522f commit 2124ea9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/cluster/metadata/ProjectId.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
9090
}
9191

9292
public static ProjectId fromXContent(XContentParser parser) throws IOException {
93-
return new ProjectId(parser.text());
93+
return fromId(parser.text());
9494
}
9595

9696
public static ProjectId ofNullable(@Nullable String id, @Nullable ProjectId fallback) {
97-
return id == null ? fallback : new ProjectId(id);
97+
return id == null ? fallback : fromId(id);
9898
}
9999

100100
@Override

0 commit comments

Comments
 (0)