auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean seen(String fingerprint) { TermQuery query = new TermQuery(new Term(F_IDENTITY, fingerprint)); IndexSearcher searcher = null; try { searcher = manager.acquire(); TopDocs results = searcher.search(query, 1); boolean foundIdenticalReport = results.totalHits > 0; return foundIdenticalReport; } catch (Exception e) { log(WARN_HISTORY_NOT_AVAILABLE, e); return false; } finally { try { manager.release(searcher); } catch (IOException e) { log(WARN_HISTORY_NOT_AVAILABLE, e); } } }

Target:
private boolean seen(String fingerprint) { TermQuery query = new TermQuery(new Term(F_IDENTITY, fingerprint)); IndexSearcher searcher = null; try { searcher = manager.acquire(); TopDocs results = searcher.search(query, 1); boolean foundIdenticalReport = results.totalHits > 0; return foundIdenticalReport; } catch (Exception e) { log(WARN_HISTORY_NOT_AVAILABLE, e); return false; } finally { try { if (searcher != null) { manager.release(searcher); searcher = null; } } catch (IOException e) { log(WARN_HISTORY_NOT_AVAILABLE, e); } } }
Source:
public void doTheThing() { int divisor = 15; int dividend = 5; double result = divide(dividend, divisor); }

Target:
public void doTheThing() { Unknown u, A; alpha(u); alpha(A); int divisor = 15; int dividend = 5; double result = divide(dividend, divisor); double result1 = divide(new B().alpha, divisor); double result2 = divide(new B().dividend, divisor); Unknown e; String b =""; beta(e, b); beta(b, e); beta(a,b); alpha(divisor); alpha(e); int a = 2; alpha(a); }
Source:
protected void executeQueryCommand() { if (setVdsForConnectStorage() == null) { return; } storageDomainsWithAttachedStoragePoolId = filterAttachedStorageDomains(); getQueryReturnValue().setReturnValue(storageDomainsWithAttachedStoragePoolId); }

Target:
protected void executeQueryCommand() { List<StorageDomainStatic> storageDomainsWithAttachedStoragePoolId = new ArrayList<>(); if (getVdsForConnectStorage() != null) { storageDomainsWithAttachedStoragePoolId = filterAttachedStorageDomains(); } getQueryReturnValue().setReturnValue(storageDomainsWithAttachedStoragePoolId); }
Source:
private RexNode simplifyMultiply(RexCall e) { int oneIndex = findLiteralIndex(e.operands, 1L); if (oneIndex >= 0) { RexNode other = e.getOperands().get((oneIndex + 1) % 2); return other.getType().equals(e.getType()) ? other : rexBuilder.makeCast(e.getType(), other); } return simplifyGenericNode(e); }

Target:
private RexNode simplifyMultiply(RexCall e) { final int oneIndex = findLiteralIndex(e.operands, BigDecimal.ONE); if (oneIndex >= 0) { RexNode other = e.getOperands().get((oneIndex + 1) % 2); return other.getType().equals(e.getType()) ? other : rexBuilder.makeCast(e.getType(), other); } return simplifyGenericNode(e); }
Source:
private void disableBreakpoints() { for (BreakpointRequest fBreakpointRequest : fBreakpointRequests) { fBreakpointRequest.disable(); } }

Target:
private void disableBreakpoints() { for (BreakpointRequest breakpointRequest : fBreakpointRequests) { breakpointRequest.disable(); } }
Source:
public void visitFileInput(FileInput fileInput) { scopesByRootTree = new HashMap<>(); fileInput.accept(new FirstPhaseVisitor()); fileInput.accept(new SecondPhaseVisitor()); scopesByRootTree.values().stream() .filter(scope -> scope.rootTree instanceof FunctionLike) .forEach(scope -> { FunctionLike funcDef = (FunctionLike) scope.rootTree; for (Symbol symbol : scope.symbols()) { if (funcDef.is(Kind.LAMBDA)) { ((LambdaExpressionImpl) funcDef).addLocalVariableSymbol(symbol); } else { ((FunctionDefImpl) funcDef).addLocalVariableSymbol(symbol); } } }); scopesByRootTree.values().stream() .filter(scope -> scope.rootTree.is(Kind.CLASSDEF)) .forEach(scope -> { ClassDefImpl classDef = (ClassDefImpl) scope.rootTree; scope.symbols.forEach(classDef::addClassField); scope.instanceAttributesByName.values().forEach(classDef::addInstanceField); }); scopesByRootTree.values().stream() .filter(scope -> scope.rootTree.is(Kind.FILE_INPUT)) .forEach(scope -> scope.symbols.forEach(((FileInputImpl) fileInput)::addModuleFields)); }

Target:
public void visitFileInput(FileInput fileInput) { scopesByRootTree = new HashMap<>(); fileInput.accept(new FirstPhaseVisitor()); fileInput.accept(new SecondPhaseVisitor()); for (Scope scope : scopesByRootTree.values()) { if (scope.rootTree instanceof FunctionLike) { FunctionLike funcDef = (FunctionLike) scope.rootTree; for (Symbol symbol : scope.symbols()) { if (funcDef.is(Kind.LAMBDA)) { ((LambdaExpressionImpl) funcDef).addLocalVariableSymbol(symbol); } else { ((FunctionDefImpl) funcDef).addLocalVariableSymbol(symbol); } } } else if (scope.rootTree.is(Kind.CLASSDEF)) { ClassDefImpl classDef = (ClassDefImpl) scope.rootTree; scope.symbols.forEach(classDef::addClassField); scope.instanceAttributesByName.values().forEach(classDef::addInstanceField); } else if (scope.rootTree.is(Kind.FILE_INPUT)) { scope.symbols.forEach(((FileInputImpl) fileInput)::addGlobalVariables); } } }
Source:
public void runTestAsync() { mContext.getPostTarget().postDelayed(() -> { Display display = mContext.getWindowManager().getDefaultDisplay(); boolean passing = checkEqualsAndLog(R.string.tv_hdr_display_is_hdr, false, display.isHdr()); passing &= hasNoHdrCapabilities(display, this); doneWithPassingState(passing); }, Duration.ofSeconds(DISPLAY_DISCONNECT_WAIT_TIME_SECONDS).toMillis()); }

Target:
public void runTestAsync() { mContext.getPostTarget().postDelayed(() -> { Display display = mContext.getWindowManager().getDefaultDisplay(); getAsserter() .withFailureMessage("Display.isHdr()") .that(display.isHdr()) .isTrue(); getAsserter() .withFailureMessage("Display.getHdrCapabilities()") .that(display.getHdrCapabilities().getSupportedHdrTypes()) .isEmpty(); done(); }, Duration.ofSeconds(DISPLAY_DISCONNECT_WAIT_TIME_SECONDS).toMillis()); }
Source:
public void applyStatefulStreamSerializationTest() { final ApplyStatefulOperatorStream statefulOpStream = new ApplyStatefulOperatorStream<>( expectedApplyStatefulFunction, mockDag); final Vertex serializedVertex = statefulOpStream.getSerializedVertex(); Assert.assertEquals(serializedVertex.getVertexType(), VertexTypeEnum.INSTANT_OPERATOR); final InstantOperatorInfo statefulOpInfo = (InstantOperatorInfo) serializedVertex.getAttributes(); final List<ByteBuffer> statefulOpObjects = statefulOpInfo.getObjects(); final ApplyStatefulFunction deserializedOpState = (ApplyStatefulFunction) deserializeObject(statefulOpObjects.get(0)); final Tuple2 firstInput = new Tuple2<>("ABC", 1); final Tuple2 secondInput = new Tuple2<>("BAC", 1); final ApplyStatefulFunction<Tuple2<String, Integer>, Integer> applyStatefulFunction1 = expectedApplyStatefulFunction; final ApplyStatefulFunction<Tuple2<String, Integer>, Integer> applyStatefulFunction2 = deserializedOpState; Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); applyStatefulFunction1.update(firstInput); applyStatefulFunction2.update(firstInput); Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); applyStatefulFunction1.update(secondInput); applyStatefulFunction2.update(secondInput); Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); }

Target:
public void applyStatefulStreamSerializationTest() { final ApplyStatefulOperatorStream statefulOpStream = new ApplyStatefulOperatorStream<>( expectedApplyStatefulFunction, mockDag); final Vertex serializedVertex = statefulOpStream.getSerializedVertex(); Assert.assertEquals(serializedVertex.getVertexType(), VertexTypeEnum.INSTANT_OPERATOR); final InstantOperatorInfo statefulOpInfo = (InstantOperatorInfo) serializedVertex.getAttributes(); final List<ByteBuffer> statefulOpFunctions = statefulOpInfo.getFunctions(); final ApplyStatefulFunction deserializedOpState = (ApplyStatefulFunction) deserializeFunction(statefulOpFunctions.get(0)); final Tuple2 firstInput = new Tuple2<>("ABC", 1); final Tuple2 secondInput = new Tuple2<>("BAC", 1); final ApplyStatefulFunction<Tuple2<String, Integer>, Integer> applyStatefulFunction1 = expectedApplyStatefulFunction; final ApplyStatefulFunction<Tuple2<String, Integer>, Integer> applyStatefulFunction2 = deserializedOpState; Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); applyStatefulFunction1.update(firstInput); applyStatefulFunction2.update(firstInput); Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); applyStatefulFunction1.update(secondInput); applyStatefulFunction2.update(secondInput); Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); }
Source:
public void enqueue(E e) { final Long id = guidGenerator.nextLong(); CorfuQueueRecord<E> queueEntry = new CorfuQueueRecord<E>(0, 0, id, e); class QueueEntryAddressGetter implements TransactionalContext.PreCommitListener { CorfuQueueRecord<E> queueRecord; QueueEntryAddressGetter(CorfuQueueRecord<E> queueRecord) { this.queueRecord = queueRecord; } @Override public void preCommitCallback(TokenResponse tokenResponse) { queueRecord.getRecordId().setEpoch(tokenResponse.getEpoch()); queueRecord.getRecordId().setSequence(tokenResponse.getSequence()); } } if (TransactionalContext.isInTransaction()) { QueueEntryAddressGetter addressGetter = new QueueEntryAddressGetter(queueEntry); TransactionalContext.getRootContext().addPreCommitListener(addressGetter); } corfuTable.put(queueEntry.getRecordId().getEntryId(), queueEntry); }

Target:
public void enqueue(E e) { final Long id = guidGenerator.nextLong(); CorfuQueueRecord<E> queueEntry; if (TransactionalContext.isInTransaction()) { queueEntry = new CorfuQueueRecord<>(Address.NON_ADDRESS, Address.NON_ADDRESS, id, e); class QueueEntryAddressGetter implements PreCommitListener { private CorfuQueueRecord<E> queueRecord; private QueueEntryAddressGetter(CorfuQueueRecord<E> queueRecord) { this.queueRecord = queueRecord; } @Override public void preCommitCallback(TokenResponse tokenResponse) { queueRecord.getRecordId().setEpoch(tokenResponse.getEpoch()); queueRecord.getRecordId().setSequence(tokenResponse.getSequence()); log.trace("preCommitCallback for Queue: " + queueRecord.getRecordId().toString()); } } QueueEntryAddressGetter addressGetter = new QueueEntryAddressGetter(queueEntry); log.trace("enqueue: Adding preCommitListener for Queue: " + queueEntry.getRecordId().toString()); TransactionalContext.getRootContext().addPreCommitListener(addressGetter); } else { queueEntry = new CorfuQueueRecord<>(0, 0, id, e); } corfuTable.put(queueEntry.getRecordId().getEntryId(), queueEntry); }
Source:
private void umountNfs(Connection conn, String remoteDir, String localDir) { if (localDir == null) { localDir = "/var/cloud_mount/" + UUID.nameUUIDFromBytes(remoteDir.getBytes()); } String result = callHostPlugin(conn, "cloud-plugin-storage", "umountNfsSecondaryStorage", "localDir", localDir, "remoteDir", remoteDir); if (org.apache.commons.lang.StringUtils.isBlank(result)) { String errMsg = "Could not umount secondary storage " + remoteDir + " on host " + localDir; s_logger.warn(errMsg); } }

Target:
private void umountNfs(Connection conn, String remoteDir, String localDir) { if (localDir == null) { localDir = BASE_MOUNT_POINT_ON_REMOTE + UUID.nameUUIDFromBytes(remoteDir.getBytes()); } String result = callHostPlugin(conn, "cloud-plugin-storage", "umountNfsSecondaryStorage", "localDir", localDir, "remoteDir", remoteDir); if (org.apache.commons.lang.StringUtils.isBlank(result)) { String errMsg = "Could not umount secondary storage " + remoteDir + " on host " + localDir; s_logger.warn(errMsg); } }
Source:
private LinuxStyle(String label, int red, int green, int blue, int alpha, float heightFactor) { if (red > 255 || red < 0) { throw new IllegalArgumentException("Red needs to be between 0 and 255"); } if (green > 255 || green < 0) { throw new IllegalArgumentException("Green needs to be between 0 and 255"); } if (blue > 255 || blue < 0) { throw new IllegalArgumentException("Blue needs to be between 0 and 255"); } if (alpha > 255 || alpha < 0) { throw new IllegalArgumentException("alpha needs to be between 0 and 255"); } if (heightFactor > 1.0 || heightFactor < 0) { throw new IllegalArgumentException("Height factor needs to be between 0 and 1.0, given hint : " + heightFactor); } fMap = ImmutableMap.of(StyleProperties.STYLE_NAME, label, StyleProperties.BACKGROUND_COLOR, X11ColorUtils.toHexColor(red, green, blue), StyleProperties.HEIGHT, heightFactor, StyleProperties.OPACITY, (float) alpha / 255); }

Target:
private LinuxStyle(String label, int red, int green, int blue, int alpha, float heightFactor) { this(label, red, green, blue, alpha, heightFactor, String.valueOf(Messages.LinuxStyles_ProcessGroup)); }
Source:
public void shouldPlaceTokenWhenUrlHasFragment() { final String docUrl = "<LINK_2>"; assertEquals("<LINK_0>", sendMail.createDocUrlWithToken(docUrl, TOKEN)); }

Target:
public void shouldPlaceTokenWhenUrlHasFragment() { final String docUrl = "<LINK_2>"; assertEquals("<LINK_1>"+TOKEN+"#/server", sendMail.createDocUrlWithToken(docUrl, TOKEN)); }
Source:
public void testResponderSendOk() throws Exception { Responder spy = PowerMockito.spy(responder); Payload payload = new Payload.PayloadBuilder().build(); spy.send(payload, null); PowerMockito.verifyPrivate(spy, times(1)).invoke("send", anyObject(), anyObject()); }

Target:
public void testResponderSendOk() throws Exception { Responder spy = PowerMockito.spy(responder); Payload payload = new Payload.PayloadBuilder().build(); spy.send(payload, null); PowerMockito.verifyPrivate(spy, times(1)).invoke("sendMessage", anyObject(), anyObject()); }
Source:
private HiveCompressionCodec getHiveCompressionCodec(ConnectorSession session, boolean isTemporaryTable, HiveStorageFormat storageFormat) { if (isTemporaryTable) { return getTemporaryTableCompressionCodec(session); } if (storageFormat.equals(ORC) || storageFormat.equals(DWRF)) { return getOrcCompressionCodec(session); } return getCompressionCodec(session); }

Target:
private HiveCompressionCodec getHiveCompressionCodec(ConnectorSession session, boolean isTemporaryTable, HiveStorageFormat storageFormat) { if (isTemporaryTable) { return getTemporaryTableCompressionCodec(session); } if (storageFormat == ORC || storageFormat == DWRF) { return getOrcCompressionCodec(session); } return getCompressionCodec(session); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; State state = (State) o; if (id != state.id) return false; if (count != state.count) return false; return source != null ? source.equals(state.source) : state.source == null; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; State state = (State) o; return id == state.id && count == state.count && (source != null ? source.equals(state.source) : state.source == null); }
Source:
public void run(final Callback callback) { final Stack<Node<View, Edge>> nodes = new Stack<Node<View, Edge>>(); processedConnectors.clear(); childrenTraverseProcessor .setRootUUID(candidate.getUUID()) .traverse(graph, new AbstractChildrenTraverseCallback<Node<View, Edge>, Edge<Child, Node>>() { @Override public void startNodeTraversal(final Node<View, Edge> node) { super.startNodeTraversal(node); nodes.add(node); } @Override public boolean startNodeTraversal(final List<Node<View, Edge>> parents, final Node<View, Edge> node) { super.startNodeTraversal(parents, node); nodes.add(node); return true; } }); int nodesSize = nodes.size(); while (nodesSize > 0) { processNode(nodes.get(nodesSize - 1), callback, false); nodesSize--; } processNode(candidate, callback, true); }

Target:
public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = new ArrayDeque(); processedConnectors.clear(); childrenTraverseProcessor .setRootUUID(candidate.getUUID()) .traverse(graph, new AbstractChildrenTraverseCallback<Node<View, Edge>, Edge<Child, Node>>() { @Override public void startNodeTraversal(final Node<View, Edge> node) { super.startNodeTraversal(node); nodes.add(node); } @Override public boolean startNodeTraversal(final List<Node<View, Edge>> parents, final Node<View, Edge> node) { super.startNodeTraversal(parents, node); nodes.add(node); return true; } }); nodes.descendingIterator().forEachRemaining(node -> processNode(node, callback, false)); processNode(candidate, callback, true); }
Source:
public List<CountDataPoint> topCounts(String metricId, Interval interval, DateTime timestamp, long offset, long size) { final String key = getKey(metricId, interval, timestamp); Collection<TypedTuple<String>> data = zsetOps.reverseRangeWithScores(key, offset, offset + size - 1); List<CountDataPoint> results = new ArrayList<CountDataPoint>(); for (TypedTuple<String> tuple : data) { results.add(new CountDataPoint( nameIdDao.getName(tuple.getValue()), tuple.getScore().longValue())); } return results; }

Target:
public List<CountDataPoint> topCounts(String metricId, Interval interval, DateTime timestamp, long offset, long size) { final String key = getKey(metricId, interval, timestamp); Collection<TypedTuple<String>> data = zsetOps.reverseRangeWithScores(key, offset, offset + size - 1); List<CountDataPoint> results = new ArrayList<CountDataPoint>(); for (TypedTuple<String> tuple : data) { results.add(new CountDataPoint( nameIdDao.getName(tuple.getValue()), tuple.getScore().longValue())); } return Collections.unmodifiableList(results); }
Source:
private void doRequestAndCheckAssertions(Map<String, Duration> flags, List<Map<String, Object>> assertions, HttpAssertionTarget target, final String url) { switch (target) { case body: Supplier<String> getBody = new Supplier<String>() { @Override public String get() { return HttpTool.getContent(url); } }; TestFrameworkAssertions.checkAssertions(flags, assertions, target.toString(), getBody); break; case status: Supplier<Integer> getStatusCode = new Supplier<Integer>() { @Override public Integer get() { try { return HttpTool.getHttpStatusCode(url); } catch (Exception e) { LOG.error("HTTP call to failed due to ... returning Status code [500]", url, e.getMessage()); return HttpStatus.SC_INTERNAL_SERVER_ERROR; } } }; TestFrameworkAssertions.checkAssertions(flags, assertions, target.toString(), getStatusCode); break; default: throw new RuntimeException("Unexpected assertion target (" + target + ")"); } }

Target:
private void doRequestAndCheckAssertions(Map<String, Duration> flags, List<Map<String, Object>> assertions, HttpAssertionTarget target, final String url) { switch (target) { case body: Supplier<String> getBody = new Supplier<String>() { @Override public String get() { return HttpTool.getContent(url); } }; TestFrameworkAssertions.checkAssertions(flags, assertions, target.toString(), getBody); break; case status: Supplier<Integer> getStatusCode = new Supplier<Integer>() { @Override public Integer get() { try { return HttpTool.getHttpStatusCode(url); } catch (Exception e) { LOG.info("HTTP call to failed due to [{}]", url, e.getMessage()); throw Exceptions.propagate(e); } } }; TestFrameworkAssertions.checkAssertions(flags, assertions, target.toString(), getStatusCode); break; default: throw new RuntimeException("Unexpected assertion target (" + target + ")"); } }
Source:
public void registerFeedback(ConjureTimeLockClientFeedback feedback) { trackedFeedbackReports.put(feedback.hashCode(), feedback); }

Target:
public void registerFeedback(ConjureTimeLockClientFeedback feedback) { trackedFeedbackReports.put(UUID.randomUUID(), feedback); }
Source:
public static Object deserializeSQLTypesToJava(String sqltypename, String value ) throws ParseException { Class clazz = String.class; String cleantypename = sqltypename.trim().toUpperCase(); if (mapSQLtypeNameToJavaClass.containsKey(cleantypename)) clazz = mapSQLtypeNameToJavaClass.get(cleantypename); if( Boolean.TYPE == clazz ) return Boolean.parseBoolean( value ); else if (Byte[].class == clazz) return value.getBytes(Charset.forName("UTF-8")); else if( Byte.TYPE == clazz ) return Byte.parseByte( value ); else if( Integer.TYPE == clazz ) return Integer.parseInt( value ); else if( Long.TYPE == clazz ) return Long.parseLong( value ); else if( Float.TYPE == clazz ) return Float.parseFloat( value ); else if( Double.TYPE == clazz ) return Double.parseDouble( value ); else if ( Short.TYPE == clazz) return Short.parseShort(value); else if (Character.TYPE == clazz) return value.charAt(0); else if (java.math.BigDecimal.class == clazz) return new BigDecimal(value.replaceAll(",", "")); else if (java.sql.Date.class == clazz) return java.sql.Date.valueOf(value); else if (java.sql.Time.class == clazz) try { return new java.sql.Time(((java.util.Date)HoursColonMinutesColonSeconds24HourFormat.parse(value)).getTime()); } catch (ParseException e) { throw new ParseException("Could not deserialize " + value +" to time (HH:mm:ss) format: " + e.getLocalizedMessage(), e.getErrorOffset()); } else if (java.sql.Timestamp.class == clazz) return Timestamp.valueOf(value); else return value; }

Target:
public static Object deserializeSQLTypesToJava(String sqltypename, String value ) throws ParseException { Class clazz = String.class; String cleantypename = sqltypename.trim().toUpperCase(); if (mapSQLtypeNameToJavaClass.containsKey(cleantypename)) clazz = mapSQLtypeNameToJavaClass.get(cleantypename); if( Boolean.TYPE == clazz ) return Boolean.parseBoolean( value ); else if (Byte[].class == clazz) return value.getBytes(Charset.forName("UTF-8")); else if( Byte.TYPE == clazz ) return Byte.parseByte( value ); else if( Integer.TYPE == clazz ) return Integer.parseInt( value ); else if( Long.TYPE == clazz ) return Long.parseLong( value ); else if( Float.TYPE == clazz ) return Float.parseFloat( value ); else if( Double.TYPE == clazz ) return Double.parseDouble( value ); else if ( Short.TYPE == clazz) return Short.parseShort(value); else if (Character.TYPE == clazz) return value.charAt(0); else if (java.math.BigDecimal.class == clazz) return new BigDecimal(value.replaceAll(",", "")); else if (java.sql.Date.class == clazz) return java.sql.Date.valueOf(value); else if (java.sql.Time.class == clazz) try { return new java.sql.Time(((java.util.Date)HoursColonMinutesColonSeconds24HourFormat.parse(value)).getTime()); } catch (ParseException e) { throw new ParseException("Could not deserialize " + value +" to time (HH:mm:ss) format: " + e.getLocalizedMessage(), e.getErrorOffset()); } catch (Exception e) { throw new ParseException("Could not deserialize " + value +" to time (HH:mm:ss) format: " + e.getLocalizedMessage(),-1); } else if (java.sql.Timestamp.class == clazz) return Timestamp.valueOf(value); else return value; }
Source:
public QueryBuilder make(EsHint hint, String fieldName, Object value) { String valueString = (String) value; if (valueString.endsWith("*") && valueString.length() > 2) { value = valueString.substring(0, valueString.length() - 1); } MatchPhrasePrefixQueryBuilder matchPhrasePrefixQuery = QueryBuilders.matchPhrasePrefixQuery(fieldName, value); if (hint.analyzer != null) { matchPhrasePrefixQuery.analyzer(hint.analyzer); } return matchPhrasePrefixQuery; }

Target:
public QueryBuilder make(EsHint hint, String fieldName, Object value) { String valueString = (String) value; if (valueString.endsWith("*") && valueString.length() > 2) { value = valueString.substring(0, valueString.length() - 1); } return QueryBuilders.matchPhrasePrefixQuery(fieldName, value).analyzer(hint.analyzer); }
Source:
private static void verifyProductsOutput(Collection<Product> originalProducts, Set<ProductDTO> dtoProducts) { for (Product productSource : originalProducts) { for (ProductDTO productDTO : dtoProducts) { assertNotNull(productDTO); assertNotNull(productDTO.getId()); if (productDTO.getId().equals(productSource.getId())) { assertTrue(productDTO.getName().equals(productSource.getName())); } } } }

Target:
private void verifyProductsOutput(Collection<Product> originalProducts, Set<ProductDTO> dtoProducts) { for (Product productSource : originalProducts) { for (ProductDTO productDTO : dtoProducts) { assertNotNull(productDTO); assertNotNull(productDTO.getId()); if (productDTO.getId().equals(productSource.getId())) { assertTrue(productDTO.getName().equals(productSource.getName())); } } } }
Source:
public PreviewSnapshotModel(VM vm, Guid userSelectedSnapshotId) { this(); this.vm = vm; setVmId(vm.getId()); this.userSelectedSnapshotId = userSelectedSnapshotId; }

Target:
public PreviewSnapshotModel(VM vm, Guid userSelectedSnapshotId) { this(); setVmId(vm.getId()); }
Source:
public boolean validateConcurStandardAccountExtractFile(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) { boolean valid = validateDetailCount(concurStandardAccountingExtractFile); valid = validateAmounts(concurStandardAccountingExtractFile) && valid; valid = validateDate(concurStandardAccountingExtractFile.getBatchDate()) && valid; if (LOG.isDebugEnabled() && valid) { LOG.debug("validateConcurStandardAccountExtractFile, passed file level validation, the record counts, batch date, and journal totals are all correct."); } return valid; }

Target:
public boolean validateConcurStandardAccountExtractFile(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) { boolean valid = validateDetailCount(concurStandardAccountingExtractFile); valid = validateAmountsAndDebitCreditCode(concurStandardAccountingExtractFile) && valid; valid = validateDate(concurStandardAccountingExtractFile.getBatchDate()) && valid; if (LOG.isDebugEnabled() && valid) { LOG.debug("validateConcurStandardAccountExtractFile, passed file level validation, the record counts, batch date, and journal totals are all correct."); } return valid; }
Source:
private void initializeFields() { for (Iterator i = fields().values().iterator(); i.hasNext();) { StructField f = (StructField) i.next(); try { Object o = f.field.get(this); if (o == null) { initializeField(f, f.type); } } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } }

Target:
private void initializeFields() { for (Iterator i = fields().values().iterator(); i.hasNext();) { StructField f = (StructField) i.next(); Object o = this.getField(f); if (o == null) { initializeField(f, f.type); } } }
Source:
private void setCorrelationId(HasCorrelationId params) { params.setCorrelationId(getCurrent().getCorrelationId()); }

Target:
private void setCorrelationId(HasCorrelationId params) { String correlationId = getCurrent().getParameters().get(CORRELATION_ID); if (correlationId != null) { params.setCorrelationId(correlationId); } }
Source:
private static String formatDoubleAsDataSize(double value) { if (isFinite(value)) { return DataSize.succinctDataSize(value, BYTE).toString(); } return "?"; }

Target:
private static String formatDoubleAsDataSize(double value) { if (!isFinite(value)) { return Double.toString(value); } else if (isNaN(value)) { return "?"; } return DataSize.succinctDataSize(value, BYTE).toString(); }
Source:
private void addFacetingRequest(JsonBuilder.Object facets, FacetingRequest facetingRequest) { String facetFieldAbsoluteName = facetingRequest.getFieldName(); FacetMetadata facetMetadata = null; for ( Class<?> entityType : getQueriedEntityTypes() ) { EntityIndexBinding binding = extendedIntegrator.getIndexBinding( entityType ); TypeMetadata typeMetadata = binding.getDocumentBuilder().getTypeMetadata(); facetMetadata = typeMetadata.getFacetMetadataFor( facetFieldAbsoluteName ); if ( facetMetadata != null ) { break; } } if ( facetMetadata == null ) { throw new AssertionFailure( "Unknown facet field name:" + facetFieldAbsoluteName ); } String sourceFieldName = facetMetadata.getSourceField().getAbsoluteName(); String facetSubfieldName = facetMetadata.getRelativeName(); ToElasticsearch.addFacetingRequest( facets, facetingRequest, sourceFieldName, facetSubfieldName ); }

Target:
private void addFacetingRequest(JsonBuilder.Object facets, FacetingRequest facetingRequest) { String facetFieldAbsoluteName = facetingRequest.getFieldName(); FacetMetadata facetMetadata = null; for ( Class<?> entityType : getQueriedEntityTypes() ) { EntityIndexBinding binding = extendedIntegrator.getIndexBinding( entityType ); TypeMetadata typeMetadata = binding.getDocumentBuilder().getTypeMetadata(); facetMetadata = typeMetadata.getFacetMetadataFor( facetFieldAbsoluteName ); if ( facetMetadata != null ) { break; } } if ( facetMetadata == null ) { throw LOG.unknownFieldNameForFaceting( facetingRequest.getFacetingName(), facetingRequest.getFieldName() ); } String sourceFieldAbsoluteName = facetMetadata.getSourceField().getAbsoluteName(); String facetSubfieldName = facetMetadata.getPath().getRelativeName(); ToElasticsearch.addFacetingRequest( facets, facetingRequest, sourceFieldAbsoluteName, facetSubfieldName ); }
Source:
private static boolean objectToString(StringBuilder bld, ObjectNode node, int depth, boolean newLine) { if (newLine) { indent(bld, depth); newLine = false; } if (node.size() > 0 || (node.size() == 0 && node instanceof ObjectNode)) { bld.append("{\n"); newLine = true; } boolean first = true; for (Iterator<Map.Entry<String, JsonNode>> itr = node.fields(); itr.hasNext();) { if (first) { first = false; } else { if (newLine) { indent(bld, depth); } bld.append(','); bld.append('\n'); } Map.Entry<String, JsonNode> entry = itr.next(); indent(bld, depth); bld.append('\"'); bld.append(entry.getKey()); bld.append('\"'); bld.append(':'); newLine = toString(bld, entry.getValue(), depth + 1, false); if (newLine) { indent(bld, depth); newLine = false; } } if (node.size() > 0) { bld.append('\n'); newLine = true; } if (newLine) { indent(bld, depth); } bld.append('}'); return false; }

Target:
private static boolean objectToString(StringBuilder bld, ObjectNode node, int depth, boolean newLine) { if (newLine) { indent(bld, depth); newLine = false; } if (node.size() >= 0){ bld.append("{\n"); newLine = true; } boolean first = true; for (Iterator<Map.Entry<String, JsonNode>> itr = node.fields(); itr.hasNext();) { if (first) { first = false; } else { if (newLine) { indent(bld, depth); } bld.append(','); bld.append('\n'); } Map.Entry<String, JsonNode> entry = itr.next(); indent(bld, depth); bld.append('\"'); bld.append(entry.getKey()); bld.append('\"'); bld.append(':'); newLine = toString(bld, entry.getValue(), depth + 1, false); if (newLine) { indent(bld, depth); newLine = false; } } if (node.size() > 0) { bld.append('\n'); newLine = true; } if (newLine) { indent(bld, depth); } bld.append('}'); return false; }
Source:
public static String getPropertyValue(Property[] properties, String propertyName) { if (ArrayUtils.isEmpty(properties) || StringUtils.isBlank(propertyName)) { return null; } for (Property property : properties) { if (property == null || StringUtils.isBlank(property.getName())) { continue; } if (property.getName().equals(propertyName)) { if (StringUtils.isNotBlank(property.getValue())){ return property.getValue(); } } } return null; }

Target:
public static String getPropertyValue(Property[] properties, String propertyName) { Property property = getProperty(properties, propertyName); if (property != null) { if (StringUtils.isNotBlank(property.getValue())) { return property.getValue(); } } return null; }
Source:
public static Object encodeObject(Object dataToEncode) { Object returnValue = dataToEncode; if (dataToEncode instanceof byte[]) { returnValue = SafeEncoder.encode((byte[]) dataToEncode); } else if (dataToEncode instanceof ArrayList) { ArrayList arrayToDecode = (ArrayList)dataToEncode; ArrayList returnValueArray = new ArrayList(arrayToDecode.size()); for (Object arrayEntry : arrayToDecode) { returnValueArray.add(encodeObject(arrayEntry)); } returnValue = returnValueArray; } return returnValue; }

Target:
public static Object encodeObject(Object dataToEncode) { if (dataToEncode instanceof byte[]) { return SafeEncoder.encode((byte[]) dataToEncode); } if (dataToEncode instanceof List) { List arrayToDecode = (List)dataToEncode; List returnValueArray = new ArrayList(arrayToDecode.size()); for (Object arrayEntry : arrayToDecode) { returnValueArray.add(encodeObject(arrayEntry)); } return returnValueArray; } return dataToEncode; }
Source:
public static Iterable<Object[]> data() { return Arrays.asList(new Object[][] { {"SetVariableBrick", new SetVariableBrick()}, {"ChangeVariableBrick", new ChangeVariableBrick()}, {"AskBrick", new AskBrick()}, {"AskSpeechBrick", new AskSpeechBrick()}, {"HideTextBrick", new HideTextBrick()}, {"ShowTextBrick", new ShowTextBrick()}, {"ShowTextColorSizeAlignmentBrick", new ShowTextColorSizeAlignmentBrick()}, {"ReadVariableFromDeviceBrick", new ReadVariableFromDeviceBrick()}, {"WebRequestBrick", new WebRequestBrick()}, {"WriteVariableOnDeviceBrick", new WriteVariableOnDeviceBrick()}, }); }

Target:
public static Iterable<Object[]> data() { return Arrays.asList(new Object[][] { {"SetVariableBrick", new SetVariableBrick()}, {"ChangeVariableBrick", new ChangeVariableBrick()}, {"AskBrick", new AskBrick()}, {"AskSpeechBrick", new AskSpeechBrick()}, {"HideTextBrick", new HideTextBrick()}, {"ShowTextBrick", new ShowTextBrick()}, {"ShowTextColorSizeAlignmentBrick", new ShowTextColorSizeAlignmentBrick()}, {"WebRequestBrick", new WebRequestBrick()}, {"ReadVariableFromDeviceBrick", new ReadVariableFromDeviceBrick()}, {"WriteVariableOnDeviceBrick", new WriteVariableOnDeviceBrick()}, }); }
Source:
protected void executeQueryCommand() { try { getQueryReturnValue().setReturnValue(getUserRequestForStorageDomainRepoFileList()); } catch (Exception e) { log.error("Failed to retrieve image list: {}", e.getCause().getMessage()); getQueryReturnValue().setExceptionString(e.getCause().getMessage()); getQueryReturnValue().setSucceeded(false); } }

Target:
protected void executeQueryCommand() { try { getQueryReturnValue().setReturnValue(getUserRequestForStorageDomainRepoFileList()); } catch (Exception e) { String message = Optional.of(e.getCause()).map(Throwable::getMessage).orElse(""); log.error("Failed to retrieve image list: {}", message); getQueryReturnValue().setExceptionString(message); getQueryReturnValue().setSucceeded(false); } }
Source:
default Attributes getAttributes() throws RealmUnavailableException { throw log.attributesNotSupportedByRealm(); }

Target:
default Attributes getAttributes() throws RealmUnavailableException { return null; }
Source:
public void destroy() { executor.shutdownNow(); try { executor.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { LOG.warn("Destroying InMemoryRegistrationStore was interrupted.", e); } }

Target:
public void destroy() { executor.shutdownNow(); try { executor.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { LOG.warn("Destroying RequestSender was interrupted.", e); } }
Source:
public double getLatitude() { return mLatitude; }

Target:
public final double getLatitude() { return mLatitude; }
Source:
public String toString() { return value+""; }

Target:
public String toString() { return String.valueOf(value); }
Source:
private void flushRegions() throws ForeignException { if (regions.isEmpty()) { return; } monitor.rethrowException(); if (taskManager.hasTasks()) { throw new IllegalStateException("Attempting to flush " + table + " but we currently have outstanding tasks"); } List<byte[]> families = null; if (family != null) { LOG.debug("Flush regions with specified family:{}", family); families = Arrays.asList(Bytes.toBytes(family)); } for (HRegion region : regions) { taskManager.submitTask(new RegionFlushTask(region, families)); monitor.rethrowException(); } LOG.debug("Flush region tasks submitted for " + regions.size() + " regions"); try { taskManager.waitForOutstandingTasks(); } catch (InterruptedException e) { throw new ForeignException(getMemberName(), e); } }

Target:
private void flushRegions() throws ForeignException { if (regions.isEmpty()) { return; } monitor.rethrowException(); if (taskManager.hasTasks()) { throw new IllegalStateException("Attempting to flush " + table + " but we currently have outstanding tasks"); } List<byte[]> families = null; if (family != null) { LOG.debug("About to flush family on all regions for table {}", family, table); families = Arrays.asList(Bytes.toBytes(family)); } for (HRegion region : regions) { taskManager.submitTask(new RegionFlushTask(region, families)); monitor.rethrowException(); } LOG.debug("Flush region tasks submitted for " + regions.size() + " regions"); try { taskManager.waitForOutstandingTasks(); } catch (InterruptedException e) { throw new ForeignException(getMemberName(), e); } }
Source:
public List<HRegionInfo> getTableRegions(TableName tableName) throws IOException { List<HRegionInfo> regionInfos = Collections.emptyList(); BigtableRegionLocator regionLocator = new BigtableRegionLocator(tableName, options, connection.getSession().getDataClient()); for (HRegionLocation location : regionLocator.getAllRegionLocations()) { regionInfos.add(location.getRegionInfo()); } regionLocator.close(); return regionInfos; }

Target:
public List<HRegionInfo> getTableRegions(TableName tableName) throws IOException { return connection.getAllRegionInfos(tableName); }
Source:
private int getFrameLength(final SendableApnsPushNotification<T> sendableApnsPushNotification) { return ApnsFrameItem.values().length * (FRAME_ITEM_ID_SIZE + FRAME_ITEM_LENGTH_SIZE) + sendableApnsPushNotification.getPushNotification().getToken().length + sendableApnsPushNotification.getPushNotification().getPayload().getBytes(utf8).length + SEQUENCE_NUMBER_SIZE + EXPIRATION_SIZE + PRIORITY_SIZE; }

Target:
private int getFrameLength(final SendableApnsPushNotification<T> sendableApnsPushNotification) { return ApnsFrameItem.values().length * (FRAME_ITEM_ID_SIZE + FRAME_ITEM_LENGTH_SIZE) + sendableApnsPushNotification.getPushNotification().getToken().length + sendableApnsPushNotification.getPushNotification().getPayload().getBytes(utf8).length + SEQUENCE_NUMBER_SIZE + DELIVERY_INVALIDATION_TIME_SIZE + PRIORITY_SIZE; }
Source:
public Response createUser(StaffMemberPayload payload) { DefaultsDAO defaultsDAO = DAOFactory.getInstance().getDefaultsDAO(); Defaults defaults = defaultsDAO.getDefaults(); if (defaults.getUserDefaultContactType() == null) { return Response.status(Status.INTERNAL_SERVER_ERROR).entity("userDefaultContactType not set in Defaults").build(); } if (StringUtils.isAnyBlank(payload.getFirstName(), payload.getLastName(), payload.getEmail(), payload.getRole())) { return Response.status(Status.BAD_REQUEST).entity("Empty fields in payload").build(); } Role role = Role.valueOf(payload.getRole()); if (role != Role.MANAGER && role != Role.TEACHER) { return Response.status(Status.BAD_REQUEST).entity(String.format("Unsupported role %s", payload.getRole())).build(); } String address = StringUtils.trim(StringUtils.lowerCase(payload.getEmail())); Email email = commonController.findEmailByAddress(address); if (email != null) { return Response.status(Status.CONFLICT).entity(getMessage("error.emailInUse")).build(); } User loggedUser = sessionController.getUser(); Person person = personController.createPerson(null, null, null, null, Boolean.FALSE); StaffMember staffMember = userController.createStaffMember(loggedUser.getOrganization(), payload.getFirstName(), payload.getLastName(), role, person); userController.addUserEmail(staffMember, defaults.getUserDefaultContactType(), address, Boolean.TRUE); payload.setIdentifier(staffMember.getId().toString()); return Response.ok(payload).build(); }

Target:
public Response createUser(StaffMemberPayload payload) { DefaultsDAO defaultsDAO = DAOFactory.getInstance().getDefaultsDAO(); Defaults defaults = defaultsDAO.getDefaults(); if (defaults.getUserDefaultContactType() == null) { return Response.status(Status.INTERNAL_SERVER_ERROR).entity("userDefaultContactType not set in Defaults").build(); } if (StringUtils.isAnyBlank(payload.getFirstName(), payload.getLastName(), payload.getEmail(), payload.getRole())) { return Response.status(Status.BAD_REQUEST).entity("Empty fields in payload").build(); } Role role = Role.valueOf(payload.getRole()); if (role != Role.MANAGER && role != Role.TEACHER) { return Response.status(Status.BAD_REQUEST).entity(String.format("Unsupported role %s", payload.getRole())).build(); } String address = StringUtils.trim(StringUtils.lowerCase(payload.getEmail())); Email email = commonController.findEmailByAddress(address); if (email != null) { return Response.status(Status.CONFLICT).entity(getMessage("error.emailInUse")).build(); } User loggedUser = sessionController.getUser(); if (loggedUser.getOrganization() == null) { return Response.status(Status.INTERNAL_SERVER_ERROR).entity("Current user lacks organization").build(); } Person person = personController.createPerson(null, null, null, null, Boolean.FALSE); StaffMember staffMember = userController.createStaffMember(loggedUser.getOrganization(), payload.getFirstName(), payload.getLastName(), role, person); userController.addUserEmail(staffMember, defaults.getUserDefaultContactType(), address, Boolean.TRUE); payload.setIdentifier(staffMember.getId().toString()); return Response.ok(payload).build(); }
Source:
protected void executeCommand() { userProfileDao.remove(getParameters().getUserProfile().getId()); }

Target:
protected void executeCommand() { userProfileDao.remove(getParameters().getUserProfile().getId()); setSucceeded(true); }
Source:
public void loadRecord(ObjectNode record) { String uri = directory+UUID.randomUUID().toString()+".json"; count++; record.set("instance", this.recordDef); record.set("metadata", this.recordMetadata); JacksonHandle handle = new JacksonHandle(record); JSONWriteOperation operation = new JSONWriteOperation(uri, documentMetadata, handle); batcher.add(operation); }

Target:
public void loadRecord(ObjectNode record) { String uri = directory+UUID.randomUUID().toString()+".json"; count++; ObjectNode recordData = JsonNodeFactory.instance.objectNode(); recordData.set("metadata", this.recordMetadata); recordData.set("instance", record); JacksonHandle handle = new JacksonHandle(recordData); JSONWriteOperation operation = new JSONWriteOperation(uri, documentMetadata, handle); batcher.add(operation); }
Source:
public String getQueryId() { List<String> content = new ArrayList<>(); if (this.entrezGeneId != null) { content.add(Integer.toString(this.entrezGeneId)); } else { if (this.hugoSymbol != null) { content.add(this.hugoSymbol); } else { content.add(""); } } if (this.alteration != null) { content.add(this.alteration); } else { content.add(""); } if (this.alteration != null) { content.add(this.alteration); } else { content.add(""); } if (this.alterationType != null) { content.add(this.alterationType); } else { content.add(""); } if (this.type != null) { content.add(this.type); } else { content.add(""); } if (this.tumorType != null) { content.add(this.tumorType); } else { content.add(""); } if (consequence != null) { content.add(this.consequence); } else { content.add(""); } if (this.proteinStart != null) { content.add(Integer.toString(this.proteinStart)); } else { content.add(""); } if (this.proteinEnd != null) { content.add(Integer.toString(this.proteinEnd)); } else { content.add(""); } return StringUtils.join(content.toArray(), "&"); }

Target:
public String getQueryId() { List<String> content = new ArrayList<>(); if (this.entrezGeneId != null) { content.add(Integer.toString(this.entrezGeneId)); } else { if (this.hugoSymbol != null) { content.add(this.hugoSymbol); } else { content.add(""); } } if (this.alteration != null) { content.add(this.alteration); } else { content.add(""); } if (this.alterationType != null) { content.add(this.alterationType); } else { content.add(""); } if (this.type != null) { content.add(this.type); } else { content.add(""); } if (this.tumorType != null) { content.add(this.tumorType); } else { content.add(""); } if (consequence != null) { content.add(this.consequence); } else { content.add(""); } if (this.proteinStart != null) { content.add(Integer.toString(this.proteinStart)); } else { content.add(""); } if (this.proteinEnd != null) { content.add(Integer.toString(this.proteinEnd)); } else { content.add(""); } return StringUtils.join(content.toArray(), "&"); }
Source:
public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); Document document = MessageUtil.getDocumentBody(in); try { String actionType = document.getRootElement().getChild("title", ATOM_NS).getTextTrim(); in.setHeader(CdrSolrUpdateAction, actionType); in.setBody(document); } catch (NullPointerException e) { in.setHeader(CdrSolrUpdateAction, "none"); } }

Target:
public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); Document document = MessageUtil.getDocumentBody(in); if (document == null) { return; } String actionType = document.getRootElement().getChildTextTrim("title", ATOM_NS); if (actionType == null) { in.setHeader(CdrSolrUpdateAction, null); return; } in.setHeader(CdrSolrUpdateAction, actionType); in.setBody(document); }
Source:
private List<String> selectColumnValuesMatchingFilterUsingPostFiltering( final DimFilter filter, final String selectColumn ) { final Filter theFilter = makeFilter(filter); final Filter postFilteringFilter = new Filter() { @Override public <T> T getBitmapResult(BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory) { throw new UnsupportedOperationException(); } @Override public ValueMatcher makeMatcher(ColumnSelectorFactory factory) { return theFilter.makeMatcher(factory); } @Override public boolean supportsBitmapIndex(BitmapIndexSelector selector) { return false; } @Override public boolean supportsSelectivityEstimation(ColumnSelector columnSelector, BitmapIndexSelector indexSelector) { return false; } @Override public Set<String> getRequiredColumns() { return null; } @Override public boolean shouldUseIndex(BitmapIndexSelector bitmapIndexSelector) { return false; } @Override public double estimateSelectivity(BitmapIndexSelector indexSelector) { return 1.0; } }; final Sequence<Cursor> cursors = makeCursorSequence(postFilteringFilter); Sequence<List<String>> seq = Sequences.map( cursors, cursor -> { final DimensionSelector selector = cursor .getColumnSelectorFactory() .makeDimensionSelector(new DefaultDimensionSpec(selectColumn, selectColumn)); final List<String> values = new ArrayList<>(); while (!cursor.isDone()) { IndexedInts row = selector.getRow(); Preconditions.checkState(row.size() == 1); values.add(selector.lookupName(row.get(0))); cursor.advance(); } return values; } ); return seq.toList().get(0); }

Target:
private List<String> selectColumnValuesMatchingFilterUsingPostFiltering( final DimFilter filter, final String selectColumn ) { final Filter theFilter = makeFilter(filter); final Filter postFilteringFilter = new Filter() { @Override public <T> T getBitmapResult(BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory) { throw new UnsupportedOperationException(); } @Override public ValueMatcher makeMatcher(ColumnSelectorFactory factory) { return theFilter.makeMatcher(factory); } @Override public boolean supportsBitmapIndex(BitmapIndexSelector selector) { return false; } @Override public boolean shouldUseBitmapIndex(BitmapIndexSelector selector) { return false; } @Override public boolean supportsSelectivityEstimation(ColumnSelector columnSelector, BitmapIndexSelector indexSelector) { return false; } @Override public Set<String> getRequiredColumns() { return Collections.emptySet(); } @Override public double estimateSelectivity(BitmapIndexSelector indexSelector) { return 1.0; } }; final Sequence<Cursor> cursors = makeCursorSequence(postFilteringFilter); Sequence<List<String>> seq = Sequences.map( cursors, cursor -> { final DimensionSelector selector = cursor .getColumnSelectorFactory() .makeDimensionSelector(new DefaultDimensionSpec(selectColumn, selectColumn)); final List<String> values = new ArrayList<>(); while (!cursor.isDone()) { IndexedInts row = selector.getRow(); Preconditions.checkState(row.size() == 1); values.add(selector.lookupName(row.get(0))); cursor.advance(); } return values; } ); return seq.toList().get(0); }