auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUpTopicPartitions() { topicPartitions = topics.stream() .flatMap((String topic) -> consumer.partitionsFor(topic).stream()) .map(p -> new TopicPartition(p.topic(), p.partition())) .collect(ImmutableList.toImmutableList()); }

Target:
private ImmutableList<TopicPartition> setUpTopicPartitions() { return topics.stream() .flatMap((String topic) -> consumer.partitionsFor(topic).stream()) .map(p -> new TopicPartition(p.topic(), p.partition())) .collect(ImmutableList.toImmutableList()); }
Source:
public void onBumpGiveItemToEntity(CollideEvent event, EntityRef entity, PickupComponent pickupComponent) { if ( entity.getComponent(ItemComponent.class).pickableUp == true ) { GiveItemEvent giveItemEvent = new GiveItemEvent(event.getOtherEntity()); entity.send(giveItemEvent); if (giveItemEvent.isHandled()) { ItemComponent itemComponent = entity.getComponent(ItemComponent.class); if (itemComponent != null) { for (Component component : itemComponent.pickupPrefab.iterateComponents()) { entity.removeComponent(component.getClass()); } } } } }

Target:
public void onBumpGiveItemToEntity(CollideEvent event, EntityRef entity, PickupComponent pickupComponent) { ItemComponent itemComponent = entity.getComponent(ItemComponent.class); if (itemComponent != null) { if (itemComponent.pickUpTime + itemComponent.timeToPickUp < time.getGameTimeInMs()) { GiveItemEvent giveItemEvent = new GiveItemEvent(event.getOtherEntity()); entity.send(giveItemEvent); if (giveItemEvent.isHandled()) { for (Component component : itemComponent.pickupPrefab.iterateComponents()) { entity.removeComponent(component.getClass()); } } } } }
Source:
private static Spawn createXmlGeneratingSpawn( TestRunnerAction action, ImmutableMap<String, String> testEnv, SpawnResult result) { ImmutableList<String> args = ImmutableList.of( action.getTestXmlGeneratorScript().getExecPath().getCallablePathString(), action.getTestLog().getExecPathString(), action.getXmlOutputPath().getPathString(), Long.toString(result.getWallTime().orElse(Duration.ZERO).getSeconds()), Integer.toString(result.exitCode())); ImmutableMap.Builder<String, String> envBuilder = ImmutableMap.builder(); envBuilder.putAll(testEnv).put("TEST_NAME", action.getTestName()); if (!action.isSharded()) { envBuilder.put("TEST_SHARD_INDEX", "0"); envBuilder.put("TEST_TOTAL_SHARDS", "0"); } return new SimpleSpawn( action, args, envBuilder.build(), ImmutableMap.copyOf(action.getExecutionInfo()), null, ImmutableMap.of(), NestedSetBuilder.create( Order.STABLE_ORDER, action.getTestXmlGeneratorScript(), action.getTestLog()), NestedSetBuilder.emptySet(Order.STABLE_ORDER), ImmutableSet.of(ActionInputHelper.fromPath(action.getXmlOutputPath())), SpawnAction.DEFAULT_RESOURCE_SET); }

Target:
private static Spawn createXmlGeneratingSpawn( TestRunnerAction action, ImmutableMap<String, String> testEnv, SpawnResult result) { ImmutableList<String> args = ImmutableList.of( action.getTestXmlGeneratorScript().getExecPath().getCallablePathString(), action.getTestLog().getExecPathString(), action.getXmlOutputPath().getPathString(), Long.toString(result.getWallTime().orElse(Duration.ZERO).getSeconds()), Integer.toString(result.exitCode())); ImmutableMap.Builder<String, String> envBuilder = ImmutableMap.builder(); Preconditions.checkArgument(testEnv.containsKey("PATH")); Preconditions.checkArgument(testEnv.containsKey("TEST_BINARY")); envBuilder.putAll(testEnv).put("TEST_NAME", action.getTestName()); if (!action.isSharded()) { envBuilder.put("TEST_SHARD_INDEX", "0"); envBuilder.put("TEST_TOTAL_SHARDS", "0"); } return new SimpleSpawn( action, args, envBuilder.build(), ImmutableMap.copyOf(action.getExecutionInfo()), null, ImmutableMap.of(), NestedSetBuilder.create( Order.STABLE_ORDER, action.getTestXmlGeneratorScript(), action.getTestLog()), NestedSetBuilder.emptySet(Order.STABLE_ORDER), ImmutableSet.of(ActionInputHelper.fromPath(action.getXmlOutputPath())), SpawnAction.DEFAULT_RESOURCE_SET); }
Source:
protected void setUp() throws Exception { buildSessionFactories( getAnnotatedClasses(), getAnnotatedPackages(), getXmlFiles() ); lastTestClass = getClass(); }

Target:
public void setUp() throws Exception { buildSessionFactories( getAnnotatedClasses(), getAnnotatedPackages(), getXmlFiles() ); lastTestClass = getClass(); }
Source:
protected long getElapsed(DataNode node) { return Time.currentWallTime() - node.stat.getCtime(); }

Target:
protected long getElapsed(DataNode node) { return Time.currentWallTime() - node.stat.getMtime(); }
Source:
public String getContext() { if (context != null) { return context; } else if (config.getContext() != null) { return config.getContext(); } else if (appData != null) { return appData.getActiveScreenClass(); } else { return null; } }

Target:
public String getContext() { if (!TextUtils.isEmpty(context)) { return context; } else if (config.getContext() != null) { return config.getContext(); } else if (appData != null) { return appData.getActiveScreenClass(); } else { return null; } }
Source:
boolean insertResources(URI namedGraphUri, final Object... resources) throws StoreAccessException; void deleteResources(URI namedGraphUri, final URI... nodeUris); void deleteResources(URI namedGraphUri, final AbstractResource... resources); boolean namedGraphExists(URI namedGraphUri); boolean resourceExists(URI namedGraphUri, URI resourceUri); Model getJenaModelForSubject(URI namedGraphUri, URI subject) throws NoSuchElementException, StoreAccessException, ModelUnmarshallingException; <T extends AbstractResource> List<T> getResources(URI namedGraphUri, final Class<T> clazz) throws StoreAccessException, ModelUnmarshallingException; <T extends AbstractResource> List<T> getResources(URI namedGraphUri, Class<T> clazz, int limit, int offset) throws StoreAccessException, ModelUnmarshallingException; <T extends AbstractResource> T getResource(URI namedGraphUri, URI uri, Class<T> clazz) throws NoSuchElementException, StoreAccessException, ModelUnmarshallingException; <T extends AbstractResource> boolean updateResources(URI namedGraphUri, final T... resources) throws StoreAccessException; <T extends AbstractResource> boolean putResources(URI namedGraphUri, final Collection<T> resources) throws StoreAccessException; <T extends AbstractResource> boolean appendResources(URI namedGraphUri, final Collection<T> resources) throws StoreAccessException; default <T extends AbstractResource> boolean appendResource(URI namedGraphUri, final T resource) throws StoreAccessException { return appendResources(namedGraphUri, Collections.singletonList(resource)); }

Target:
boolean insertResources(URI namedGraphUri, final Object... resources) throws StoreAccessException; void deleteResources(URI namedGraphUri, final URI... nodeUris); void deleteResources(URI namedGraphUri, final IResource... resources); boolean namedGraphExists(URI namedGraphUri); boolean resourceExists(URI namedGraphUri, URI resourceUri); Model getJenaModelForSubject(URI namedGraphUri, URI subject) throws NoSuchElementException, StoreAccessException, ModelUnmarshallingException; <T extends IResource> List<T> getResources(URI namedGraphUri, final Class<T> clazz) throws StoreAccessException, ModelUnmarshallingException; <T extends IResource> List<T> getResources(URI namedGraphUri, Class<T> clazz, int limit, int offset) throws StoreAccessException, ModelUnmarshallingException; <T extends IResource> T getResource(URI namedGraphUri, URI uri, Class<T> clazz) throws NoSuchElementException, StoreAccessException, ModelUnmarshallingException; <T extends IResource> boolean updateResources(URI namedGraphUri, final T... resources) throws StoreAccessException; <T extends IResource> boolean putResources(URI namedGraphUri, final Collection<T> resources) throws StoreAccessException; <T extends IResource> boolean appendResources(URI namedGraphUri, final Collection<T> resources) throws StoreAccessException; default <T extends IResource> boolean appendResource(URI namedGraphUri, final T resource) throws StoreAccessException { return appendResources(namedGraphUri, Collections.singletonList(resource)); }
Source:
private boolean doReceiveAndExecute(BlockingQueueConsumer consumer) throws Throwable { Channel channel = consumer.getChannel(); for (int i = 0; i < txSize; i++) { logger.trace("Waiting for message from consumer."); Message message = consumer.nextMessage(receiveTimeout); if (message == null) { break; } try { Object batchFormat = message.getMessageProperties().getHeaders().get(MessageProperties.SPRING_BATCH_FORMAT); if (MessageProperties.BATCH_FORMAT_LENGTH_HEADER4.equals(batchFormat) && this.deBatchingEnabled) { ByteBuffer byteBuffer = ByteBuffer.wrap(message.getBody()); MessageProperties messageProperties = message.getMessageProperties(); messageProperties.getHeaders().remove(MessageProperties.SPRING_BATCH_FORMAT); while (byteBuffer.hasRemaining()) { int length = byteBuffer.getInt(); if (length < 0 || length > byteBuffer.remaining()) { throw new ListenerExecutionFailedException("Insufficient batch data at offset " + byteBuffer.position(), new ArrayIndexOutOfBoundsException(byteBuffer.position()), message); } byte[] body = new byte[length]; byteBuffer.get(body); messageProperties.setContentLength(length); Message fragment = new Message(body, messageProperties); executeListener(channel, fragment); } } else { executeListener(channel, message); } } catch (ImmediateAcknowledgeAmqpException e) { break; } catch (Throwable ex) { consumer.rollbackOnExceptionIfNecessary(ex); throw ex; } } return consumer.commitIfNecessary(isChannelLocallyTransacted(channel)); }

Target:
private boolean doReceiveAndExecute(BlockingQueueConsumer consumer) throws Throwable { Channel channel = consumer.getChannel(); for (int i = 0; i < txSize; i++) { logger.trace("Waiting for message from consumer."); Message message = consumer.nextMessage(receiveTimeout); if (message == null) { break; } try { executeListener(channel, message); } catch (ImmediateAcknowledgeAmqpException e) { break; } catch (Throwable ex) { consumer.rollbackOnExceptionIfNecessary(ex); throw ex; } } return consumer.commitIfNecessary(isChannelLocallyTransacted(channel)); }
Source:
public ImmutableList<LocalDate> createUnadjustedDates() { LocalDate start = getStartDate().getUnadjusted(); LocalDate end = getEndDate().getUnadjusted(); LocalDate regStart = getEffectiveFirstRegularStartDate(); LocalDate regEnd = getEffectiveLastRegularEndDate(); boolean explicitInitialStub = start.equals(regStart) == false; boolean explicitFinalStub = end.equals(regEnd) == false; if (frequency == Frequency.TERM) { if (explicitInitialStub || explicitFinalStub) { throw new PeriodicScheduleException(this, "Explict stubs must not be specified when using 'Term' frequency"); } return ImmutableList.of(start, end); } RollConvention rollConv = getEffectiveRollConvention(); StubConvention implicitStubConv = generateImplicitStubConvention(explicitInitialStub, explicitFinalStub); List<LocalDate> unadj = new ArrayList<>(); if (implicitStubConv.isCalculateBackwards()) { unadj = generateBackwards(regStart, regEnd, rollConv, implicitStubConv); } else { unadj = generateForwards(regStart, regEnd, rollConv, implicitStubConv); } if (explicitInitialStub) { unadj.add(0, start); } if (explicitFinalStub) { unadj.add(end); } ImmutableList<LocalDate> deduplicated = ImmutableSet.copyOf(unadj).asList(); if (deduplicated.size() < unadj.size()) { throw new PeriodicScheduleException(this, "Schedule calculation resulted in duplicate unadjusted dates: {}", unadj); } return deduplicated; }

Target:
public ImmutableList<LocalDate> createUnadjustedDates() { LocalDate start = getStartDate().getUnadjusted(); LocalDate end = getEndDate().getUnadjusted(); LocalDate regStart = getEffectiveFirstRegularStartDate(); LocalDate regEnd = getEffectiveLastRegularEndDate(); boolean explicitInitialStub = !start.equals(regStart); boolean explicitFinalStub = !end.equals(regEnd); if (frequency == Frequency.TERM) { if (explicitInitialStub || explicitFinalStub) { throw new PeriodicScheduleException(this, "Explict stubs must not be specified when using 'Term' frequency"); } return ImmutableList.of(start, end); } RollConvention rollConv = getEffectiveRollConvention(); StubConvention implicitStubConv = generateImplicitStubConvention(explicitInitialStub, explicitFinalStub); List<LocalDate> unadj = (implicitStubConv.isCalculateBackwards() ? generateBackwards(regStart, regEnd, rollConv, implicitStubConv) : generateForwards(regStart, regEnd, rollConv, implicitStubConv)); if (explicitInitialStub) { unadj.add(0, start); } if (explicitFinalStub) { unadj.add(end); } ImmutableList<LocalDate> deduplicated = ImmutableSet.copyOf(unadj).asList(); if (deduplicated.size() < unadj.size()) { throw new PeriodicScheduleException(this, "Schedule calculation resulted in duplicate unadjusted dates: {}", unadj); } return deduplicated; }
Source:
private RexNode transformIntoOrAndClause(RexBuilder rexBuilder, RexCall expression) { assert expression.getKind() == SqlKind.IN; if (expression.getOperands().get(0).getKind() != SqlKind.ROW) { return expression; } final List<RexNode> disjuncts = HiveCalciteUtil.transformIntoOrAndClause( expression.getOperands(), rexBuilder); if (disjuncts == null) { return expression; } if (disjuncts.size() > 1) { return rexBuilder.makeCall(SqlStdOperatorTable.OR, disjuncts); } else { return disjuncts.get(0); } }

Target:
private RexNode transformIntoOrAndClause(RexBuilder rexBuilder, RexCall expression) { assert expression.getKind() == SqlKind.IN; if (expression.getOperands().get(0).getKind() != SqlKind.ROW) { return expression; } final List<RexNode> disjuncts = RexNodeConverter.transformInToOrOperands( expression.getOperands(), rexBuilder); if (disjuncts == null) { return expression; } if (disjuncts.size() > 1) { return rexBuilder.makeCall(SqlStdOperatorTable.OR, disjuncts); } else { return disjuncts.get(0); } }
Source:
public void testIsPageview( String test_description, String project, String dialect, String pageTitle, boolean is_pageview, boolean is_legacy_pageview, boolean is_app_pageview, String ip_address, String x_forwarded_for, String uri_host, String uri_path, String uri_query, String http_status, String content_type, String user_agent ){ assertEquals( test_description, is_pageview, udf.isPageview( uri_host, uri_path, uri_query, http_status, content_type, user_agent, "" ) ); }

Target:
public void testIsPageview( String test_description, String project, String dialect, String pageTitle, boolean is_pageview, boolean is_legacy_pageview, boolean is_app_pageview, String ip_address, String x_forwarded_for, String uri_host, String uri_path, String uri_query, String http_status, String content_type, String user_agent ){ GenericUDF.DeferredJavaObject uri_host_udf = new GenericUDF.DeferredJavaObject(uri_host); GenericUDF.DeferredJavaObject uri_path_udf = new GenericUDF.DeferredJavaObject(uri_path); GenericUDF.DeferredJavaObject uri_query_udf = new GenericUDF.DeferredJavaObject(uri_query); GenericUDF.DeferredJavaObject http_status_udf = new GenericUDF.DeferredJavaObject(http_status); GenericUDF.DeferredJavaObject content_type_udf = new GenericUDF.DeferredJavaObject(content_type); GenericUDF.DeferredJavaObject user_agent_udf = new GenericUDF.DeferredJavaObject(user_agent); GenericUDF.DeferredJavaObject x_analytics_udf = new GenericUDF.DeferredJavaObject(""); GenericUDF.DeferredObject[] args = {uri_host_udf, uri_path_udf, uri_query_udf, http_status_udf, content_type_udf, user_agent_udf, x_analytics_udf}; try { assertEquals(test_description, is_pageview, udf.evaluate(args)); } catch (HiveException e) { e.printStackTrace(); } }
Source:
public MapReduceJobState(RunningJob runningJob, TaskReport[] mapTaskReport, TaskReport[] reduceTaskReport) throws IOException { jobId = runningJob.getID().toString(); jobName = runningJob.getJobName(); trackingURL = runningJob.getTrackingURL(); isComplete = runningJob.isComplete(); isSuccessful = runningJob.isSuccessful(); mapProgress = runningJob.mapProgress(); reduceProgress = runningJob.reduceProgress(); totalMappers = mapTaskReport.length; totalReducers = reduceTaskReport.length; mapTaskStartTime = Long.MAX_VALUE; reduceTaskStartTime = Long.MAX_VALUE; mapTaskEndTime = 0L; reduceTaskEndTime = 0L; finishedMappers = 0; finishedReducers = 0; for (TaskReport report : mapTaskReport) { if (mapTaskEndTime < report.getFinishTime()) mapTaskEndTime = report.getFinishTime(); if (report.getStartTime() < mapTaskStartTime) mapTaskStartTime = report.getStartTime(); TIPStatus status = report.getCurrentStatus(); if (status != TIPStatus.PENDING && status != TIPStatus.RUNNING) { finishedMappers++; } } for (TaskReport report : reduceTaskReport) { if (reduceTaskEndTime < report.getFinishTime()) reduceTaskEndTime = report.getFinishTime(); if (report.getStartTime() < reduceTaskStartTime) reduceTaskStartTime = report.getStartTime(); TIPStatus status = report.getCurrentStatus(); if (status != TIPStatus.PENDING && status != TIPStatus.RUNNING) { finishedReducers++; } } }

Target:
public MapReduceJobState(RunningJob runningJob, TaskReport[] mapTaskReport, TaskReport[] reduceTaskReport) throws IOException { jobId = runningJob.getID().toString(); jobName = runningJob.getJobName(); trackingURL = runningJob.getTrackingURL(); isComplete = runningJob.isComplete(); isSuccessful = runningJob.isSuccessful(); mapProgress = runningJob.mapProgress(); reduceProgress = runningJob.reduceProgress(); totalMappers = mapTaskReport.length; totalReducers = reduceTaskReport.length; for (TaskReport report : mapTaskReport) { if (report.getStartTime() < jobStartTime || jobStartTime == 0L) { jobStartTime = report.getStartTime(); } TIPStatus status = report.getCurrentStatus(); if (status != TIPStatus.PENDING && status != TIPStatus.RUNNING) { finishedMappersCount++; } } for (TaskReport report : reduceTaskReport) { if (jobLastUpdateTime < report.getFinishTime()) { jobLastUpdateTime = report.getFinishTime(); } TIPStatus status = report.getCurrentStatus(); if (status != TIPStatus.PENDING && status != TIPStatus.RUNNING) { finishedReducersCount++; } } if (finishedReducersCount != reduceTaskReport.length || jobLastUpdateTime == 0) { jobLastUpdateTime = System.currentTimeMillis(); } }
Source:
public Object visit(NativeFilter nativeFilter, Object extraData) { throw new UnsupportedOperationException("Native filter is not supported"); }

Target:
public Object visit(NativeFilter nativeFilter, Object extraData) { throw new UnsupportedOperationException("XML encoding of native filters is not supported."); }
Source:
public String shortenUrl(String url, int expireInSeconds) { Preconditions.checkNotNull(url); String token = getToken(); CacheKey cacheKey = CacheKey.shortenUrl(token); String foundValue = cacheProvider.getObject(cacheKey, String.class); while(foundValue != null && !foundValue.equals(url)) { token = getToken(); cacheKey = CacheKey.shortenUrl(token); foundValue = cacheProvider.getObject(cacheKey, String.class); } if (foundValue == null) { cacheProvider.setObject(cacheKey, url, expireInSeconds); } return WEBSERVICES_URL + "/r/" + token; }

Target:
public String shortenUrl(String url, int expireInSeconds) { Preconditions.checkNotNull(url); String token = null; CacheKey cacheKey = null; String foundValue = null; do { token = getToken(); cacheKey = CacheKey.shortenUrl(token); foundValue = cacheProvider.getObject(cacheKey, String.class); } while(foundValue != null && !foundValue.equals(url)); if (foundValue == null) { cacheProvider.setObject(cacheKey, url, expireInSeconds); } return WEBSERVICES_URL + "/r/" + token; }
Source:
@Override public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) { QuickAssistAssistant quickAssistAssistant = new QuickAssistAssistant(); List<IQuickAssistProcessor> quickAssistProcessors = new ArrayList<IQuickAssistProcessor>(); quickAssistProcessors.add(new MarkerResoltionQuickAssistProcessor()); ExtensionBasedQuickAssistProcessor compQuickAssistProcessor = new ExtensionBasedQuickAssistProcessor(quickAssistProcessors); quickAssistAssistant.setQuickAssistProcessor(compQuickAssistProcessor); quickAssistAssistant.setRestoreCompletionProposalSize(EditorsPlugin.getDefault().getDialogSettingsSection("quick_assist_proposal_size")); quickAssistAssistant.setInformationControlCreator(parent -> new DefaultInformationControl(parent, EditorsPlugin.getAdditionalInfoAffordanceString())); return quickAssistAssistant; }

Target:
@Override public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) { QuickAssistAssistant quickAssistAssistant = new QuickAssistAssistant(); List<IQuickAssistProcessor> quickAssistProcessors = new ArrayList<IQuickAssistProcessor>(); quickAssistProcessors.add(new MarkerResoltionQuickAssistProcessor()); quickAssistProcessors.addAll(GenericEditorPlugin.getDefault().getQuickAssistProcessorRegistry().getQuickAssistProcessors()); CompositeQuickAssistProcessor compQuickAssistProcessor = new CompositeQuickAssistProcessor(quickAssistProcessors); quickAssistAssistant.setQuickAssistProcessor(compQuickAssistProcessor); quickAssistAssistant.setRestoreCompletionProposalSize(EditorsPlugin.getDefault().getDialogSettingsSection("quick_assist_proposal_size")); quickAssistAssistant.setInformationControlCreator(parent -> new DefaultInformationControl(parent, EditorsPlugin.getAdditionalInfoAffordanceString())); return quickAssistAssistant; }
Source:
public void trackVideoSpeed(String videoId, Double currentTime, String courseId, String unitUrl, float oldSpeed, float newSpeed) { }

Target:
public void trackVideoSpeed(String videoId, Double currentTime, String courseId, String unitUrl, float oldSpeed, float newSpeed) { final FirebaseEvent event = new FirebaseEvent(Events.SPEED_CHANGE_VIDEO, videoId, Values.VIDEO_PLAYBACK_SPEED_CHANGED, currentTime); event.setCourseContext(courseId, unitUrl, Values.VIDEOPLAYER); event.putFloat(Keys.NEW_SPEED, newSpeed); event.putFloat(Keys.OLD_SPEED, oldSpeed); logFirebaseEvent(event.getName(), event.getBundle()); }
Source:
private CompletionStage<Boolean> doPassivate(Object key, InternalCacheEntry<?, ?> entry) { if (trace) log.tracef("Passivating entry %s", toStr(key)); MarshallableEntry marshalledEntry = marshalledEntryFactory.create((InternalCacheEntry) entry); CompletionStage<Void> stage = passivationPersistenceManager.passivate(marshalledEntry, keyPartitioner.getSegment(key)); return stage.handle((v, t) -> { if (t != null) { CONTAINER.unableToPassivateEntry(key, t); return false; } if (statsEnabled) { passivations.getAndIncrement(); } return true; }); }

Target:
private CompletionStage<Boolean> doPassivate(Object key, InternalCacheEntry<?, ?> entry) { if (trace) log.tracef("Passivating entry %s", toStr(key)); MarshallableEntry<?, ?> marshalledEntry = marshalledEntryFactory.create((InternalCacheEntry) entry); CompletionStage<Void> stage = passivationPersistenceManager.passivate(marshalledEntry, keyPartitioner.getSegment(key)); return stage.handle((v, t) -> { if (t != null) { CONTAINER.unableToPassivateEntry(key, t); return false; } if (statsEnabled) { passivations.getAndIncrement(); } return true; }); }
Source:
public final void collectExistingBucket(LeafBucketCollector subCollector, int doc, long bucketOrd) throws IOException { if (doc == 1) { breaker.addEstimateBytesAndMaybeBreak(0, "allocated_buckets"); } docCounts.increment(bucketOrd, 1); subCollector.collect(doc, bucketOrd); }

Target:
public final void collectExistingBucket(LeafBucketCollector subCollector, int doc, long bucketOrd) throws IOException { if (docCounts.increment(bucketOrd, 1) == 1) { multiBucketConsumer.accept(0); } subCollector.collect(doc, bucketOrd); }
Source:
public void getAllChannelsShouldReturnThreeElementListWhenThereAreThreeChannels() { given(channelRepository.findAll()).willReturn(expectedChannelEntityList); given(modelMapper.map(expectedChannelEntityList, CHANNEL_DTO_LIST_TYPE)) .willReturn(expectedChannelDTOList); Collection<ChannelDTO> result = channelService.getAllChannels(); assertEquals(result, expectedChannelDTOList); then(channelRepository).should(times(1)).findAll(); }

Target:
public void getAllChannelsShouldReturnThreeElementListWhenThereAreThreeChannels() { given(channelRepository.findAll()).willReturn(expectedChannelEntityList); given(modelMapper.map(expectedChannelEntityList, CHANNEL_DTO_LIST_TYPE)) .willReturn(expectedChannelDTOList); Collection<ChannelDTO> result = channelService.getAllChannels(); assertEquals(result, expectedChannelDTOList); then(channelRepository).should().findAll(); then(modelMapper).should().map(expectedChannelEntityList, CHANNEL_DTO_LIST_TYPE); }
Source:
private Map<String, Map<String, DataColumn>> generateTableMetaData() { int i = 1; Map<String, Map<String, DataColumn>> metaData = new HashMap<>(); HashMap<String, DataColumn> column = new HashMap<>(); for (String tableName : this.tableList) { DBCollection readResult = jongo.getDatabase().getCollection(tableName); Iterator<DBObject> cursor = readResult.find(); while (cursor.hasNext()) { final DBObject current = cursor.next(); String tempValue = current.toString(); Iterator<?> keys = new JSONObject(tempValue).keys(); while (keys.hasNext()) { String columnName = (String) keys.next(); DataColumn dataColumn = new DataColumn(columnName, DataColumn.ODataDataType.STRING, i, true, 100, columnName.equals(DOCUMENT_ID)); column.put(columnName, dataColumn); i++; } metaData.put(tableName, column); } } return metaData; }

Target:
private Map<String, Map<String, DataColumn>> generateTableMetaData() { int ordinalPosition = 1; Map<String, Map<String, DataColumn>> metaData = new HashMap<>(); HashMap<String, DataColumn> column = new HashMap<>(); for (String tableName : this.tableList) { DBCollection readResult = jongo.getDatabase().getCollection(tableName); Iterator<DBObject> cursor = readResult.find(); while (cursor.hasNext()) { DBObject doumentData = cursor.next(); String tempValue = doumentData.toString(); Iterator<?> keys = new JSONObject(tempValue).keys(); while (keys.hasNext()) { String columnName = (String) keys.next(); DataColumn dataColumn = new DataColumn(columnName, DataColumn.ODataDataType.STRING, ordinalPosition, true, 100, columnName.equals(DOCUMENT_ID)); column.put(columnName, dataColumn); ordinalPosition++; } metaData.put(tableName, column); } } return metaData; }
Source:
public List<Capabilities> getSupportedCapabilities() { return Collections.unmodifiableList(Arrays.asList(Capabilities.values())); }

Target:
public List<Capabilities> getSupportedCapabilities() { return ImmutableList.copyOf(Capabilities.values()); }
Source:
private void displayReplyDetail(Optional<Replay> replay, String url) { if (!replay.isPresent()) { logger.warn("Replay with url: " + url + "could not be found"); return; } replayDetailController = uiService.loadFxml("theme/vault/replay/replay_detail.fxml"); replayDetailController.setReplay(replay.get()); Node replayDetailRoot = replayDetailController.getRoot(); replayDetailRoot.setVisible(true); replayDetailRoot.requestFocus(); Stage stage = new Stage(StageStyle.UNDECORATED); WindowController windowController = uiService.loadFxml("theme/window.fxml"); windowController.configure(stage, (Region) ((AnchorPane) replayDetailRoot).getChildren().get(0), true); replayDetailController.setOnClosure(stage::close); stage.setWidth(((Region) replayDetailRoot).getWidth()); stage.setHeight(((Region) replayDetailRoot).getHeight()); Stage mainStage = StageHolder.getStage(); stage.setX(mainStage.getX()); stage.setY(mainStage.getY()); stage.show(); }

Target:
private void displayReplyDetail(Optional<Replay> replay, String url) { if (!replay.isPresent()) { logger.warn("Replay with url: could not be found", url); return; } replayDetailController = uiService.loadFxml("theme/vault/replay/replay_detail.fxml"); replayDetailController.setReplay(replay.get()); Node replayDetailRoot = replayDetailController.getRoot(); replayDetailRoot.setVisible(true); replayDetailRoot.requestFocus(); Stage stage = new Stage(StageStyle.UNDECORATED); WindowController windowController = uiService.loadFxml("theme/window.fxml"); windowController.configure(stage, (Region) ((AnchorPane) replayDetailRoot).getChildren().get(0), true); replayDetailController.setOnClosure(stage::close); stage.setWidth(((Region) replayDetailRoot).getWidth()); stage.setHeight(((Region) replayDetailRoot).getHeight()); Stage mainStage = StageHolder.getStage(); stage.setX(mainStage.getX()); stage.setY(mainStage.getY()); stage.show(); }
Source:
public List<String> filePaths(PatchSet ps) throws OrmException { if (!files.containsKey(Integer.valueOf(ps.getPatchSetId()))) { Change c = change(); if (c == null) { return null; } PatchList p; try { p = patchListCache.get(c, ps); } catch (PatchListNotAvailableException e) { List<String> emptyFileList = Collections.emptyList(); files.put(Integer.valueOf(ps.getPatchSetId()), emptyFileList); return emptyFileList; } List<String> r = new ArrayList<String>(p.getPatches().size()); for (PatchListEntry e : p.getPatches()) { if (Patch.COMMIT_MSG.equals(e.getNewName())) { continue; } switch (e.getChangeType()) { case ADDED: case MODIFIED: case DELETED: case COPIED: case REWRITE: r.add(e.getNewName()); break; case RENAMED: r.add(e.getOldName()); r.add(e.getNewName()); break; } } Collections.sort(r); files.put(Integer.valueOf(ps.getPatchSetId()), Collections.unmodifiableList(r)); } return files.get(Integer.valueOf(ps.getPatchSetId())); }

Target:
public List<String> filePaths(PatchSet ps) throws OrmException { if (!files.containsKey(ps.getPatchSetId())) { Change c = change(); if (c == null) { return null; } PatchList p; try { p = patchListCache.get(c, ps); } catch (PatchListNotAvailableException e) { List<String> emptyFileList = Collections.emptyList(); files.put(ps.getPatchSetId(), emptyFileList); return emptyFileList; } List<String> r = new ArrayList<String>(p.getPatches().size()); for (PatchListEntry e : p.getPatches()) { if (Patch.COMMIT_MSG.equals(e.getNewName())) { continue; } switch (e.getChangeType()) { case ADDED: case MODIFIED: case DELETED: case COPIED: case REWRITE: r.add(e.getNewName()); break; case RENAMED: r.add(e.getOldName()); r.add(e.getNewName()); break; } } Collections.sort(r); files.put(ps.getPatchSetId(), Collections.unmodifiableList(r)); } return files.get(ps.getPatchSetId()); }
Source:
static SwapTrade parse(CsvRow row, TradeInfo info) { List<FloatingRateIndex> indices = new ArrayList<>(); Set<DayCount> dayCounts = new LinkedHashSet<>(); boolean missingDayCount = false; String legPrefix = "Leg 1 "; Optional<String> payReceiveOpt = Optional.of(getValue(row, legPrefix, DIRECTION_FIELD)); int i = 1; while (payReceiveOpt.isPresent()) { FloatingRateIndex index = parseIndex(row, legPrefix); if (index != null) { indices.add(index); dayCounts.add(index.getDefaultFixedLegDayCount()); } else { indices.add(null); if (!findValue(row, legPrefix, DAY_COUNT_FIELD).isPresent()) { missingDayCount = true; } } i++; legPrefix = "Leg " + i + " "; payReceiveOpt = findValue(row, legPrefix, DIRECTION_FIELD); } DayCount defaultFixedLegDayCount = null; if (missingDayCount) { if (dayCounts.size() > 1) { throw new IllegalArgumentException( "Swap leg must define day count on fixed legs when more than 2 floating legs"); } defaultFixedLegDayCount = dayCounts.iterator().next(); } List<SwapLeg> legs = parseLegs(row, indices, defaultFixedLegDayCount); Swap swap = Swap.of(legs); return SwapTrade.of(info, swap); }

Target:
static SwapTrade parse(CsvRow row, TradeInfo info) { List<FloatingRateIndex> indices = new ArrayList<>(); Set<DayCount> dayCounts = new LinkedHashSet<>(); boolean missingDayCount = false; String legPrefix = "Leg 1 "; Optional<String> payReceiveOpt = Optional.of(getValue(row, legPrefix, DIRECTION_FIELD)); int i = 1; while (payReceiveOpt.isPresent()) { FloatingRateIndex index = parseIndex(row, legPrefix); indices.add(index); if (index != null) { dayCounts.add(index.getDefaultFixedLegDayCount()); } if (index == null && !findValue(row, legPrefix, DAY_COUNT_FIELD).isPresent()) { missingDayCount = true; } i++; legPrefix = "Leg " + i + " "; payReceiveOpt = findValue(row, legPrefix, DIRECTION_FIELD); } DayCount defaultFixedLegDayCount = null; if (missingDayCount) { if (dayCounts.size() != 1) { throw new IllegalArgumentException("Invalid swap definition, day count must be defined on each fixed leg"); } defaultFixedLegDayCount = Iterables.getOnlyElement(dayCounts); } List<SwapLeg> legs = parseLegs(row, indices, defaultFixedLegDayCount); Swap swap = Swap.of(legs); return SwapTrade.of(info, swap); }
Source:
private void executeTask(Task task, Multimap<NodeType, NodeId> allNodes, NodeContext nodeContext) throws TerminateException { log.debug("Distributing task {}", task); @SuppressWarnings("unchecked") TaskDistributor<Task> taskDistributor = (TaskDistributor<Task>) distributorRegistry.getTaskDistributor(task.getClass()); DistributionListener decisionMakerListener = new DecisionMakerDistributionListener(nodeContext); Map<NodeId, RemoteExecutor> remotes = Maps.newHashMap(); log.debug("Distributed task will be executed on nodes", remotes.size()); String taskId = taskIdProvider.getTaskId(); Service distribute = taskDistributor.distribute(executor, sessionIdProvider.getSessionId(), taskId, allNodes, coordinator, task, distributionListener(decisionMakerListener), nodeContext); try{ Future<Service.State> start; synchronized (terminateConfigurationLock) { distributes.put(distribute, null); start = distribute.start(); } Futures.get(start, timeoutConfiguration.getDistributionStartTime()); Services.awaitTermination(distribute, timeoutConfiguration.getTaskExecutionTime().getValue()); } finally { Future<Service.State> stop = distribute.stop(); Futures.get(stop, timeoutConfiguration.getDistributionStopTime()); } }

Target:
private void executeTask(Task task, Multimap<NodeType, NodeId> allNodes, NodeContext nodeContext) throws TerminateException { log.debug("Distributing task {}", task); @SuppressWarnings("unchecked") TaskDistributor<Task> taskDistributor = (TaskDistributor<Task>) distributorRegistry.getTaskDistributor(task.getClass()); Map<NodeId, RemoteExecutor> remotes = Maps.newHashMap(); log.debug("Distributed task will be executed on nodes", remotes.size()); String taskId = taskIdProvider.getTaskId(); Service distribute = taskDistributor.distribute(executor, sessionIdProvider.getSessionId(), taskId, allNodes, coordinator, task, distributionListener(nodeContext), nodeContext); try{ Future<Service.State> start; synchronized (terminateConfigurationLock) { distributes.put(distribute, null); start = distribute.start(); } Futures.get(start, timeoutConfiguration.getDistributionStartTime()); Services.awaitTermination(distribute, timeoutConfiguration.getTaskExecutionTime().getValue()); } finally { Future<Service.State> stop = distribute.stop(); Futures.get(stop, timeoutConfiguration.getDistributionStopTime()); } }
Source:
public void getDescriptionWithAnnotation() { JUnit38ClassRunner runner = new JUnit38ClassRunner(JUnit3ClassWithAnnotatedMethod.class); Description d = runner.getDescription(); Assert.assertEquals(2, d.testCount()); for (Description methodDesc : d.getChildren()) { if (methodDesc.getMethodName().equals("testAnnotated")) { assertNotNull(methodDesc.getAnnotation(MyAnnotation.class)); } else { assertNull( methodDesc.getAnnotation(MyAnnotation.class)); } } }

Target:
public void getDescriptionWithAnnotation() { JUnit38ClassRunner runner = new JUnit38ClassRunner(JUnit3ClassWithAnnotatedMethod.class); Description d = runner.getDescription(); assertEquals(2, d.testCount()); for (Description methodDesc : d.getChildren()) { if (methodDesc.getMethodName().equals("testAnnotated")) { assertNotNull(methodDesc.getAnnotation(MyAnnotation.class)); } else { assertNull(methodDesc.getAnnotation(MyAnnotation.class)); } } }
Source:
void unsubscribe() { eventService.subscribe(this); }

Target:
void unsubscribe() { eventService.unsubscribe(this); }
Source:
public void testPointFromTextNegative() throws Exception { Client client = getClient(); validateTableOfScalarLongs(client, "insert into t (pk) values (0)", new long[] {1}); assertSelectGeographyPointValueWktParseError(client, "expected input of the form 'POINT\\(<lng> <lat>\\)", "point(20.0)"); assertSelectGeographyPointValueWktParseError(client, "Latitude must be in the range", "point(10 100)"); assertInsertGeographyPointValueWktParseError(client, "Latitude must be in the range", "point(10 100)", 100); assertSelectGeographyPointValueWktParseError(client, "Latitude must be in the range", "point(20 -100)"); assertInsertGeographyPointValueWktParseError(client, "Latitude must be in the range", "point(20 -100)", 101); assertSelectGeographyPointValueWktParseError(client, "Longitude must be in the range", "point(200 20)"); assertInsertGeographyPointValueWktParseError(client, "Longitude must be in the range", "point(200 20)", 200); assertSelectGeographyPointValueWktParseError(client, "Longitude must be in the range", "point(-200 20)"); assertInsertGeographyPointValueWktParseError(client, "Longitude must be in the range", "point(-200 20)", 201); }

Target:
public void testPointFromTextNegative() throws Exception { Client client = getClient(); for (String tbl : TABLES) { fillTable(client, tbl, 0); } assertSelectGeographyPointValueWktParseError(client, "expected input of the form 'POINT\\(<lng> <lat>\\)", "point(20.0)"); assertSelectGeographyPointValueWktParseError(client, "Latitude must be in the range", "point(10 100)"); assertInsertGeographyPointValueWktParseError(client, "Latitude must be in the range", "point(10 100)", 100); assertSelectGeographyPointValueWktParseError(client, "Latitude must be in the range", "point(20 -100)"); assertInsertGeographyPointValueWktParseError(client, "Latitude must be in the range", "point(20 -100)", 101); assertSelectGeographyPointValueWktParseError(client, "Longitude must be in the range", "point(200 20)"); assertInsertGeographyPointValueWktParseError(client, "Longitude must be in the range", "point(200 20)", 200); assertSelectGeographyPointValueWktParseError(client, "Longitude must be in the range", "point(-200 20)"); assertInsertGeographyPointValueWktParseError(client, "Longitude must be in the range", "point(-200 20)", 201); }
Source:
public void setUp() throws IOException { Assume.assumeTrue(new MercurialRepository().isWorking()); Assume.assumeTrue(new SubversionRepository().isWorking()); Assume.assumeTrue(new GitRepository().isWorking()); repository = new TestRepository(); repository.create(HistoryGuru.class.getResourceAsStream( "repositories.zip")); env = RuntimeEnvironment.getInstance(); env.removeAllMessages(); env.setSourceRoot(repository.getSourceRoot()); env.setDataRoot(repository.getDataRoot()); env.setProjectsEnabled(true); RepositoryFactory.initializeIgnoredNames(env); }

Target:
public void setUp() throws IOException { repository = new TestRepository(); repository.create(HistoryGuru.class.getResourceAsStream( "repositories.zip")); env = RuntimeEnvironment.getInstance(); env.removeAllMessages(); env.setSourceRoot(repository.getSourceRoot()); env.setDataRoot(repository.getDataRoot()); env.setProjectsEnabled(true); RepositoryFactory.initializeIgnoredNames(env); }
Source:
private OsiamConnector(Builder builder) { String authServiceEndpoint = authServiceEndpoint(builder.authServiceEndpoint, builder.combinedEndpoint); if (builder.connectTimeout == null) { builder.connectTimeout = DEFAULT_CONNECT_TIMEOUT; } if (builder.readTimeout == null) { builder.readTimeout = DEFAULT_READ_TIMEOUT; } if (!Strings.isNullOrEmpty(authServiceEndpoint)) { AuthService.Builder authServiceBuilder = new AuthService.Builder(authServiceEndpoint); if (builder.clientId != null) { authServiceBuilder = authServiceBuilder.setClientId(builder.clientId); } if (builder.clientSecret != null) { authServiceBuilder = authServiceBuilder.setClientSecret(builder.clientSecret); } if (builder.clientRedirectUri != null) { authServiceBuilder = authServiceBuilder.setClientRedirectUri(builder.clientRedirectUri); } authServiceBuilder.withConnectTimeout(builder.connectTimeout); authServiceBuilder.withReadTimeout(builder.readTimeout); authService = authServiceBuilder.build(); } String resourceServiceEndpoint = resourceServiceEndpoint(builder.resourceServiceEndpoint, builder.combinedEndpoint); if (!Strings.isNullOrEmpty(resourceServiceEndpoint)) { userService = new OsiamUserService.Builder(resourceServiceEndpoint) .withConnectTimeout(builder.connectTimeout).withReadTimeout(builder.readTimeout).build(); groupService = new OsiamGroupService.Builder(resourceServiceEndpoint) .withConnectTimeout(builder.connectTimeout).withReadTimeout(builder.readTimeout).build(); } }

Target:
private OsiamConnector(Builder builder) { String authServiceEndpoint = authServiceEndpoint(builder.authServiceEndpoint, builder.combinedEndpoint); if (!Strings.isNullOrEmpty(authServiceEndpoint)) { AuthService.Builder authServiceBuilder = new AuthService.Builder(authServiceEndpoint); if (builder.clientId != null) { authServiceBuilder = authServiceBuilder.setClientId(builder.clientId); } if (builder.clientSecret != null) { authServiceBuilder = authServiceBuilder.setClientSecret(builder.clientSecret); } if (builder.clientRedirectUri != null) { authServiceBuilder = authServiceBuilder.setClientRedirectUri(builder.clientRedirectUri); } authService = authServiceBuilder.withConnectTimeout(builder.connectTimeout) .withReadTimeout(builder.readTimeout).build(); } String resourceServiceEndpoint = resourceServiceEndpoint(builder.resourceServiceEndpoint, builder.combinedEndpoint); if (!Strings.isNullOrEmpty(resourceServiceEndpoint)) { userService = new OsiamUserService.Builder(resourceServiceEndpoint) .withConnectTimeout(builder.connectTimeout).withReadTimeout(builder.readTimeout).build(); groupService = new OsiamGroupService.Builder(resourceServiceEndpoint) .withConnectTimeout(builder.connectTimeout).withReadTimeout(builder.readTimeout).build(); } }
Source:
public Map<String, Map<String, String>> rebalanceTable(Map<String, Map<String, String>> currentAssignment, Map<InstancePartitionsType, InstancePartitions> instancePartitionsMap, @Nullable List<Tier> sortedTiers, @Nullable Map<String, InstancePartitions> tierInstancePartitionsMap, Configuration config) { Map<String, Map<String, String>> newAssignment = new TreeMap<>(); for (String segment : currentAssignment.keySet()) { List<String> assignedInstances = assignSegment(segment, newAssignment, instancePartitionsMap); newAssignment.put(segment, SegmentAssignmentUtils .getInstanceStateMap(assignedInstances, CommonConstants.Helix.StateModel.SegmentStateModel.ONLINE)); } return newAssignment; }

Target:
public Map<String, Map<String, String>> rebalanceTable(Map<String, Map<String, String>> currentAssignment, Map<InstancePartitionsType, InstancePartitions> instancePartitionsMap, @Nullable List<Tier> sortedTiers, @Nullable Map<String, InstancePartitions> tierInstancePartitionsMap, Configuration config) { String serverTag = TagNameUtils.extractOfflineServerTag(_tenantConfig); List<String> instances = HelixHelper.getInstancesWithTag(_helixManager, serverTag); Map<String, Map<String, String>> newAssignment = new TreeMap<>(); for (String segment : currentAssignment.keySet()) { newAssignment.put(segment, SegmentAssignmentUtils .getInstanceStateMap(instances, CommonConstants.Helix.StateModel.SegmentStateModel.ONLINE)); } return newAssignment; }
Source:
protected void onInitialize() { super.onInitialize(); featureLocationModel = Model.of(new LongLat(-72.638382, 42.313181, "EPSG:4326")); Style style = new Style(new Icon("<LINK_0>") .crossOrigin(CorsPolicy.ANONYMOUS)); Feature feature = new PersistentFeature( new Point(featureLocationModel.getObject().transform(View.DEFAULT_PROJECTION)), "Miles Office"); feature.setStyle(style); Vector vectorFeatures = new Vector(new VectorSource(Arrays.asList(feature))); add(featureLocationLabel = new Label("featureLocationLabel", new LoadableDetachableModel<String>() { @Override protected String load() { StringBuilder builder = new StringBuilder(); if(featureLocationModel.getObject() != null) { builder.append(featureLocationModel.getObject().getX()); builder.append(", "); builder.append(featureLocationModel.getObject().getY()); } else { builder.append("Unkown..."); } return builder.toString(); } })); featureLocationLabel.setOutputMarkupId(true); add(map = new DefaultOpenLayersMap("map", Model.of(new Map( Arrays.<Layer>asList( new Tile("Streets", new Osm()), vectorFeatures), new View( new LongLat(-72.638382, 42.313181, "EPSG:4326").transform(View.DEFAULT_PROJECTION), 16)) .interactions(Arrays.<Interaction>asList(new Modify(vectorFeatures)))))); map.add(new FeatureChangeListener(feature) { @Override public void handleChange(AjaxRequestTarget target, String featureId, LongLat longLat, JsonObject properties) { featureLocationModel.setObject(longLat); target.add(featureLocationLabel); } }); }

Target:
protected void onInitialize() { super.onInitialize(); featureLocationModel = Model.of(new LongLat(-72.638382, 42.313181, "EPSG:4326")); Style style = new Style(new Icon("<LINK_0>") .crossOrigin(CorsPolicy.ANONYMOUS)); Feature feature = new PersistentFeature( new Point(featureLocationModel.getObject().transform(View.DEFAULT_PROJECTION)), "Miles Office"); feature.setStyle(style); Vector vectorFeatures = new Vector(new VectorSource(Arrays.asList(feature))); add(featureLocationLabel = new Label("featureLocationLabel", new LoadableDetachableModel<String>() { @Override protected String load() { StringBuilder builder = new StringBuilder(); if(featureLocationModel.getObject() != null) { builder.append(featureLocationModel.getObject().getX()); builder.append(", "); builder.append(featureLocationModel.getObject().getY()); } else { builder.append("Unknown..."); } return builder.toString(); } })); featureLocationLabel.setOutputMarkupId(true); add(map = new DefaultOpenLayersMap("map", Model.of(new Map( Arrays.<Layer>asList( new Tile("Streets", new Osm()), vectorFeatures), new View( new LongLat(-72.638382, 42.313181, "EPSG:4326").transform(View.DEFAULT_PROJECTION), 16)) .interactions(Arrays.<Interaction>asList(new Modify(vectorFeatures)))))); map.add(new FeatureChangeListener(feature) { @Override public void handleChange(AjaxRequestTarget target, String featureId, LongLat longLat, JsonObject properties) { featureLocationModel.setObject(longLat); target.add(featureLocationLabel); } }); }
Source:
public HllSketchMergeBufferAggregator( final ColumnValueSelector<HllSketch> selector, final int lgK, final TgtHllType tgtHllType, final int size ) { this.selector = selector; this.lgK = lgK; this.tgtHllType = tgtHllType; this.size = size; this.emptySketch = new byte[size]; new Union(lgK, WritableMemory.wrap(emptySketch, ByteOrder.LITTLE_ENDIAN).writableRegion(0, size)); }

Target:
public HllSketchMergeBufferAggregator( final ColumnValueSelector<HllSketch> selector, final int lgK, final TgtHllType tgtHllType, final int size ) { this.selector = selector; this.lgK = lgK; this.tgtHllType = tgtHllType; this.size = size; this.emptyUnion = new byte[size]; new Union(lgK, WritableMemory.wrap(emptyUnion)); }
Source:
private IjFolder mergePromotingToSourceIfDifferent(IjFolder from, IjFolder to) { if (from.getClass().equals(to.getClass())) { return from.merge(to); } if ((from.getClass().equals(JavaResourceFolder.class) && to.getClass().equals(JavaTestResourceFolder.class)) || (to.getClass().equals(JavaResourceFolder.class) && from.getClass().equals(JavaTestResourceFolder.class))) { Path resourcesRoot = (to instanceof JavaResourceFolder) ? ((JavaResourceFolder) to).getResourcesRoot() : ((JavaTestResourceFolder) to).getResourcesRoot(); return new JavaResourceFolder(to.getPath(), IjFolder.combineInputs(from, to), resourcesRoot); } return new SourceFolder( to.getPath(), from.getWantsPackagePrefix() || to.getWantsPackagePrefix(), IjFolder.combineInputs(from, to)); }

Target:
private IjFolder mergePromotingToSourceIfDifferent(IjFolder from, IjFolder to) { if (from.getClass().equals(to.getClass())) { return from.merge(to); } if (ResourceFolder.class.isInstance(from) && ResourceFolder.class.isInstance(to)) { Path resourcesRoot = ((ResourceFolder) to).getResourcesRoot(); return new JavaResourceFolder(to.getPath(), resourcesRoot, IjFolder.combineInputs(from, to)); } if ((from.getClass().equals(TestFolder.class) && ResourceFolder.class.isInstance(to)) || (to.getClass().equals(TestFolder.class) && ResourceFolder.class.isInstance(from))) { return new TestFolder( to.getPath(), from.getWantsPackagePrefix() || to.getWantsPackagePrefix(), IjFolder.combineInputs(from, to)); } return new SourceFolder( to.getPath(), from.getWantsPackagePrefix() || to.getWantsPackagePrefix(), IjFolder.combineInputs(from, to)); }