diff --git a/core/src/main/java/com/github/starnowski/posjsonhelper/core/Context.java b/core/src/main/java/com/github/starnowski/posjsonhelper/core/Context.java index f1a32cff..8369d414 100644 --- a/core/src/main/java/com/github/starnowski/posjsonhelper/core/Context.java +++ b/core/src/main/java/com/github/starnowski/posjsonhelper/core/Context.java @@ -67,12 +67,11 @@ public static ContextBuilder builder() { /** * Returns copy of value of property {@link #functionsThatShouldBeExecutedWithSchemaReference}. - * If {@link #functionsThatShouldBeExecutedWithSchemaReference} is null then the empty set is being returned. * * @return copy of value of property {@link #functionsThatShouldBeExecutedWithSchemaReference} */ public Set getFunctionsThatShouldBeExecutedWithSchemaReference() { - return functionsThatShouldBeExecutedWithSchemaReference == null ? new HashSet<>() : new HashSet<>(functionsThatShouldBeExecutedWithSchemaReference); + return functionsThatShouldBeExecutedWithSchemaReference == null ? null : new HashSet<>(functionsThatShouldBeExecutedWithSchemaReference); } /** @@ -116,7 +115,8 @@ public ContextBuilder withFunctionsThatShouldBeExecutedWithSchemaReference(Set sqlAstArg super.render(sqlAppender, sqlAstArguments, filter, respectNulls, fromFirst, returnType, walker); } - protected void renderOptionalSchemaReference(SqlAppender sqlAppender){ - if (context.getFunctionsThatShouldBeExecutedWithSchemaReference().contains(getName())) { + protected void renderOptionalSchemaReference(SqlAppender sqlAppender) { + if (context.getFunctionsThatShouldBeExecutedWithSchemaReference() != null && context.getFunctionsThatShouldBeExecutedWithSchemaReference().contains(getName())) { sqlAppender.appendSql(context.getSchema()); sqlAppender.appendSql("."); }