Skip to content

Commit

Permalink
CalibrationIO
Browse files Browse the repository at this point in the history
- Increased code point limit for SnakeYaml
- Upgrading SnakeYaml was causing a crash
  • Loading branch information
lessthanoptimal committed May 22, 2023
1 parent e36cc36 commit 0da6139
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,15 @@ public static <T extends CameraModel> void save( T parameters, File filePath ) {
}

public static Yaml createYmlObject() {
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
return new Yaml(options);
var dumperOptions = new DumperOptions();
dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);

// Configure to get around point limit (as of SnakeYaml 1.32) causing a crash in a regression test
var loaderOptions = new LoaderOptions();
loaderOptions.setCodePointLimit(30_145_728);

return new Yaml(new Constructor(new LoaderOptions()), new Representer(dumperOptions),
dumperOptions, loaderOptions);
}

/**
Expand Down

0 comments on commit 0da6139

Please sign in to comment.