Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion codestyle/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<Class name="org.apache.druid.query.scan.ScanQuery$ScanRowsLimitJsonIncludeFilter"/>
<Class name="org.apache.druid.query.scan.ScanQuery$ScanTimeOrderJsonIncludeFilter"/>
<Class name="org.apache.druid.query.scan.ScanQuery$BatchSizeJsonIncludeFilter"/>
<Class name="org.apache.druid.query.scan.ScanQuery$IsLegacyJsonIncludeFilter"/>
<Class name="org.apache.druid.query.groupby.orderby.DefaultLimitSpec$LimitJsonIncludeFilter"/>
<Class name="org.apache.druid.segment.VirtualColumns$JsonIncludeFilter"/>
</Or>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,14 @@ public List<String> getColumns()

/**
* Compatibility mode with the legacy scan-query extension.
*
* True, false, and null have different meanings: true/false mean "legacy" and "not legacy"; null means use the
* default set by {@link ScanQueryConfig#isLegacy()}. The method {@link #withNonNullLegacy} is provided to help
* with this.
*/
@Nullable
@JsonProperty
@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = IsLegacyJsonIncludeFilter.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
public Boolean isLegacy()
{
return legacy;
Expand Down Expand Up @@ -663,21 +667,4 @@ public boolean equals(Object obj)
return obj instanceof Integer && (int) obj == DEFAULT_BATCH_SIZE;
}
}

/**
* {@link JsonInclude} filter for {@link #isLegacy()}.
*
* This API works by "creative" use of equals. It requires warnings to be suppressed and also requires spotbugs
* exclusions (see spotbugs-exclude.xml).
*/
@SuppressWarnings({"EqualsAndHashcode", "EqualsHashCode"})
static class IsLegacyJsonIncludeFilter // lgtm [java/inconsistent-equals-and-hashcode]
{
@Override
public boolean equals(Object obj)
{
return obj == null ||
obj instanceof Boolean && !(Boolean) obj;
}
}
}
Loading