Skip to content

Commit

Permalink
Don't use compact constructor syntax for Manifest.
Browse files Browse the repository at this point in the history
There's a JDK bug where it doesn't work.
  • Loading branch information
prdoyle committed Feb 18, 2024
1 parent 1ec93bd commit de89423
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ public record Manifest(
Optional<EmptyNode> sequoia,
Optional<PandoFormat> pando
) implements StateTreeNode {
public Manifest {
public Manifest(Integer version, Optional<EmptyNode> sequoia, Optional<PandoFormat> pando) {
// Note: this could be a compact constructor, but then it won't work:
// https://github.com/adoptium/adoptium-support/issues/1025
if (sequoia.isPresent() == pando.isPresent()) {
throw new IllegalArgumentException("Exactly one format (sequoia or pando) must be specified in manifest");
}
this.version = version;
this.sequoia = sequoia;
this.pando = pando;
}

public record EmptyNode() implements StateTreeNode { }
Expand Down

0 comments on commit de89423

Please sign in to comment.