Source:
<code>public void prepareQuery(ExpressionBuilder queryBuilder, Options options) { if (options.containsKey(COMPONENT_STATUS)) { final Boolean isActive = options.get(COMPONENT_STATUS, Boolean.class); queryBuilder.filter(Expressions.match(COMPONENT_STATUS, isActive)); } if (options.containsKey(COMPONENT_MODULE_ID)) { final Collection<String> moduleIds = options.getCollection(COMPONENT_MODULE_ID, String.class); queryBuilder.filter(Expressions.matchAny(COMPONENT_MODULE_ID, moduleIds)); } if (options.containsKey(CONCEPT_STATUS)) { final Boolean isConceptActive = options.get(CONCEPT_STATUS, Boolean.class); queryBuilder.filter(Expressions.match(CONCEPT_STATUS, isConceptActive)); } if (options.containsKey(CONTENT_TYPE)) { final Boolean contentTypeFilter = options.get(CONTENT_TYPE, Boolean.class); if (contentTypeFilter != null && contentTypeFilter) { if (options.containsKey(COMPONENT_EFFECTIVE_TIME_START) || options.containsKey(COMPONENT_EFFECTIVE_TIME_END)) { final Long start = options.get(COMPONENT_EFFECTIVE_TIME_START, Long.class); final Long end = options.get(COMPONENT_EFFECTIVE_TIME_END, Long.class); final Expression effectiveTimeExpression = Expressions.matchRange(SnomedDocument.Fields.EFFECTIVE_TIME, start == null ? 0L : start, end == null ? Long.MAX_VALUE : end ); queryBuilder.filter(effectiveTimeExpression); } else { <START> queryBuilder.filter(SnomedDocument.Expressions.effectiveTime(0L, Long.MAX_VALUE)); <END> } } else if (contentTypeFilter != null && !contentTypeFilter) { queryBuilder.filter(SnomedDocument.Expressions.effectiveTime(EffectiveTimes.UNSET_EFFECTIVE_TIME)); } } }</code><technical_language>Unnecessary filter? If values in effectiveTime field populated range of [0,LONG_MAX), this filter do filtering all. Consider removing this else branch entirely</technical_language>

Target:
public void prepareQuery(ExpressionBuilder queryBuilder, Options options) { if (options.containsKey(COMPONENT_STATUS)) { final Boolean isActive = options.get(COMPONENT_STATUS, Boolean.class); queryBuilder.filter(Expressions.match(COMPONENT_STATUS, isActive)); } if (options.containsKey(COMPONENT_MODULE_ID)) { final Collection<String> moduleIds = options.getCollection(COMPONENT_MODULE_ID, String.class); queryBuilder.filter(Expressions.matchAny(COMPONENT_MODULE_ID, moduleIds)); } if (options.containsKey(CONCEPT_STATUS)) { final Boolean isConceptActive = options.get(CONCEPT_STATUS, Boolean.class); queryBuilder.filter(Expressions.match(CONCEPT_STATUS, isConceptActive)); } if (options.containsKey(CONTENT_TYPE)) { final Boolean contentTypeFilter = options.get(CONTENT_TYPE, Boolean.class); if (contentTypeFilter != null && contentTypeFilter) { if (options.containsKey(COMPONENT_EFFECTIVE_TIME_START) || options.containsKey(COMPONENT_EFFECTIVE_TIME_END)) { final Long start = options.get(COMPONENT_EFFECTIVE_TIME_START, Long.class); final Long end = options.get(COMPONENT_EFFECTIVE_TIME_END, Long.class); final Expression effectiveTimeExpression = Expressions.matchRange(SnomedDocument.Fields.EFFECTIVE_TIME, start == null ? 0L : start, end == null ? Long.MAX_VALUE : end ); queryBuilder.filter(effectiveTimeExpression); } } else if (contentTypeFilter != null && !contentTypeFilter) { queryBuilder.filter(SnomedDocument.Expressions.effectiveTime(EffectiveTimes.UNSET_EFFECTIVE_TIME)); } } }