Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ public class SchemaSettings {
public SchemaSettings(Config config, SchemaGenerationStrategy schemaGenerationStrategy) {
this.config = config;
this.schemaGenerationStrategy = schemaGenerationStrategy;

/* Issue 502
*
* We set these two values early because (a) they're entirely driven by settings in the HOCON config and
* (b) they're exposed via accessor methods below (isAllowExtraFields and isAllowMissingFields). To avoid
* any order-of-operations issues in which a SchemaSettings instance may have been created (but not yet
* initialized) and these values are accessed we set them as early as possible here.
*/
allowExtraFields = config.getBoolean(ALLOW_EXTRA_FIELDS);
allowMissingFields = config.getBoolean(ALLOW_MISSING_FIELDS);
}

public void init(
Expand Down Expand Up @@ -470,8 +480,6 @@ public void init(
// Misc

nullToUnset = config.getBoolean(NULL_TO_UNSET);
allowExtraFields = config.getBoolean(ALLOW_EXTRA_FIELDS);
allowMissingFields = config.getBoolean(ALLOW_MISSING_FIELDS);
splits = ConfigUtils.getThreads(config, SPLITS);

// Final checks related to graph operations
Expand Down