auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void send(final String topic, final byte[] message) { final String combinedTopic = topicPrefix + topic; if (!healthchecker.isHealthy()) { <START> log.warn("will not publish message to pubsub topic={} as the pubsub client " <END> + "appears to be unhealthy"); return; } try { Futures.addCallback( JdkFutureAdapters.listenInPoolThread( pubsub.publishAsync(combinedTopic, Message.of(ByteArray.copyFrom(message)))), new FutureCallback<String>() { @Override public void onSuccess(@Nullable final String ackId) { log.debug("Sent an event to Google PubSub, topic: {}, ack: {}", combinedTopic, ackId); } @Override public void onFailure(final Throwable t) { log.warn("Unable to send an event to Google PubSub, topic: {}", combinedTopic, t); } }); } catch (Exception e) { log.warn("Failed to publish Google PubSub message, topic: {}", combinedTopic, e); } }</code><technical_language>missing topic for interpolation here</technical_language>

Target:
public void send(final String topic, final byte[] message) { final String combinedTopic = topicPrefix + topic; if (!healthchecker.isHealthy()) { log.warn("will not publish message to pubsub topic={} as the pubsub client " + "appears to be unhealthy", combinedTopic); return; } try { Futures.addCallback( JdkFutureAdapters.listenInPoolThread( pubsub.publishAsync(combinedTopic, Message.of(ByteArray.copyFrom(message)))), new FutureCallback<String>() { @Override public void onSuccess(@Nullable final String ackId) { log.debug("Sent an event to Google PubSub, topic: {}, ack: {}", combinedTopic, ackId); } @Override public void onFailure(final Throwable t) { log.warn("Unable to send an event to Google PubSub, topic: {}", combinedTopic, t); } }); } catch (Exception e) { log.warn("Failed to publish Google PubSub message, topic: {}", combinedTopic, e); } }
Source:
<code>void assertValidUserFields(UserDto userResource, UserPurpose userPurpose) { if (StringUtils.isBlank(userResource.getFirstName())) { throw InvalidDataException.blankFirstName(); } if (StringUtils.isBlank(userResource.getLastName())) { throw InvalidDataException.blankLastName(); } if (userPurpose == UserPurpose.USER && StringUtils.isBlank(userResource.getPrivateData().getNickname())) { throw InvalidDataException.blankNickname(); } if (StringUtils.isBlank(userResource.getMobileNumber())) { throw InvalidDataException.blankMobileNumber(); } assertValidMobileNumber(userResource.getMobileNumber()); if (userPurpose == UserPurpose.BUDDY) { if (StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.blankEmailAddress(); } assertValidEmailAddress(userResource.getEmailAddress()); <START> if (!userResource.getPrivateData().getGoals().isEmpty()) <END> { throw InvalidDataException.excessGoals(); } } else { if (!StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.excessEmailAddress(); } } }</code><technical_language>Good addition</technical_language>

Target:
void assertValidUserFields(UserDto userResource, UserPurpose userPurpose) { if (StringUtils.isBlank(userResource.getFirstName())) { throw InvalidDataException.blankFirstName(); } if (StringUtils.isBlank(userResource.getLastName())) { throw InvalidDataException.blankLastName(); } if (userPurpose == UserPurpose.USER && StringUtils.isBlank(userResource.getPrivateData().getNickname())) { throw InvalidDataException.blankNickname(); } if (StringUtils.isBlank(userResource.getMobileNumber())) { throw InvalidDataException.blankMobileNumber(); } assertValidMobileNumber(userResource.getMobileNumber()); if (userPurpose == UserPurpose.BUDDY) { if (StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.blankEmailAddress(); } assertValidEmailAddress(userResource.getEmailAddress()); if (!userResource.getPrivateData().getGoals().isEmpty()) { throw InvalidDataException.goalsNotSupported(); } } else { if (!StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.excessEmailAddress(); } } }
Source:
<code>public String getResourceLoaderPath() { <START> return "https://" + language + ".wikipedia.org/w/load.php"; <END> }</code><technical_language>replaced getFullUrl calls instead</technical_language>

Target:
public String getResourceLoaderPath() { return getScriptPath("load.php"); }
Source:
<code>public void validate(Object target, Errors errors) { <START> ValidationUtils.rejectIfEmpty(errors, "BloodTest.testName", "testName.empty", "The testName is required"); <END> ValidationUtils.rejectIfEmpty(errors, "BloodTest.category", "category.empty", "The bloodTestCategory is required"); ValidationUtils.rejectIfEmpty(errors, "BloodTest.validResults", "validResults.empty", "The validResults is required"); ValidationUtils.rejectIfEmpty(errors, "BloodTest.testNameShort", "testNameShort.empty", "The testNameShort is required"); ValidationUtils.rejectIfEmpty(errors, "BloodTest.rankInCategory", "rankInCategory.empty", "The rankInCategory is required"); }</code><technical_language>@debonair - This of ValidationUtils rejectIfEmpty validation consistent other validators, want move ValidationUtils. reconsider if is validation suited here</technical_language>

Target:
public void validate(Object target, Errors errors) { BloodTestBackingForm form = (BloodTestBackingForm) target; if (StringUtils.isBlank(form.getTestName())) errors.rejectValue("BloodTest.testName", "testName.empty", "The testName is required"); if (form.getBloodTestCategory() == null) errors.rejectValue("BloodTest.category", "category.empty", "The bloodTestCategory is required"); if (StringUtils.isBlank(form.getValidResults())) errors.rejectValue("BloodTest.validResults", "validResults.empty", "The validResults is required"); if (StringUtils.isBlank(form.getTestNameShort())) errors.rejectValue("BloodTest.testNameShort", "testNameShort.empty", "The testNameShort is required"); if (form.getRankInCategory() == null) errors.rejectValue("BloodTest.rankInCategory", "rankInCategory.empty", "The rankInCategory is required"); }
Source:
<code>public void testWithQualifiedPrefix() { assertQuery("" + "WITH a AS (SELECT 123)" + "SELECT a.* FROM a", <START> "SELECT 123"); <END> }</code><technical_language>concat lines</technical_language>

Target:
public void testWithQualifiedPrefix() { assertQuery("WITH a AS (SELECT 123) SELECT a.* FROM a", "SELECT 123"); }
Source:
<code>private Set<VCFHeaderLine> getSampleHeaderLines(){ final Set<VCFHeaderLine> sampleLines = new HashSet<>(); if (hasNormal()) { <START> final Map<String, String> normalSampleHeaderAttributes = ImmutableMap.of("ID", "NORMAL", "Sample", MTAC.normalSampleName); <END> sampleLines.add(new VCFSimpleHeaderLine("sample", normalSampleHeaderAttributes)); } final Map<String, String> tumorSampleHeaderAttributes = ImmutableMap.of("ID", "TUMOR", "Sample", MTAC.tumorSampleName); sampleLines.add(new VCFSimpleHeaderLine("sample", tumorSampleHeaderAttributes)); return sampleLines; }</code><technical_language>Sample a subfield of sample header line feels redundant. name sampleName</technical_language>

Target:
private Set<VCFHeaderLine> getSampleHeaderLines(){ final Set<VCFHeaderLine> sampleLines = new HashSet<>(); if (hasNormal()) { final Map<String, String> normalSampleHeaderAttributes = ImmutableMap.of("ID", "NORMAL", "name", MTAC.normalSampleName); sampleLines.add(new VCFSimpleHeaderLine("sample", normalSampleHeaderAttributes)); } final Map<String, String> tumorSampleHeaderAttributes = ImmutableMap.of("ID", "TUMOR", "name", MTAC.tumorSampleName); sampleLines.add(new VCFSimpleHeaderLine("sample", tumorSampleHeaderAttributes)); return sampleLines; }
Source:
<code>public void tearDown() throws InterruptedException { verifyNoMoreInteractions(mockedEvents); monitorByServer.clear(); <START> previousRequestsByServer.clear(); <END> }</code><technical_language>lines unnecessary</technical_language>

Target:
public void tearDown() throws InterruptedException { verifyNoMoreInteractions(mockedEvents); }
Source:
<code>public JobStatus getJobStatus(JobInstance jobInstance) { Job job = retriableHttpGet(baseUrl -> String.format(ResourceConstants.GET_JOBS_URL, baseUrl, <START> jobInstance.getJobName(), jobInstance.getJobId()), new TypeReference<Job>(){}); <END> return job.getStatus(); }</code><technical_language>do need a TypeReference? retriableHttpGet need generic? a private method, once, logic logging specific fetching tasks</technical_language>

Target:
public JobStatus getJobStatus(JobInstance jobInstance) { Job job = queryJobStatusServers(baseUrl -> String.format(ResourceConstants.GET_JOBS_URL, baseUrl, jobInstance.getJobName(), jobInstance.getJobId()), new TypeReference<Job>(){}); return job.getStatus(); }
Source:
<code>public T VALUES(String columns, String values) { sql().columns.add(columns); <START> sql().values.add(Collections.singletonList(values)); <END> return getSelf(); }</code><technical_language>This breaks test case is of [examples in doc](<LINK_0> java @Test public void testValues() { final SQL sql = new SQL() {{ INSERT_INTO("PERSON"); VALUES("ID, FIRST_NAME", "#{id}, #{firstName}"); VALUES("LAST_NAME", "#{lastName}"); }}; assertThat(sql.toString()).isEqualToIgnoringWhitespace("INSERT PERSON (ID, FIRST_NAME, LAST_NAME) VALUES (#{id}, #{firstName}, #{lastName})"); } I OK delegate task other methods. java public T VALUES(String columns, String values) { INTO_COLUMNS(columns); INTO_VALUES(values); return getSelf(); }</technical_language>

Target:
public T VALUES(String columns, String values) { INTO_COLUMNS(columns); INTO_VALUES(values); return getSelf(); }
Source:
<code><START> public static SleepPeriod createSleepPeriod(final DateTime inBedTime){ <END> final Integer inBedHour = inBedTime.getHourOfDay(); if (inBedHour >= 4 && inBedHour < 12){ final DateTime targetDate = inBedTime.withTimeAtStartOfDay(); return SleepPeriod.morning(targetDate); } else if (inBedHour >= 12 && inBedHour < 20){ final DateTime targetDate = inBedTime.withTimeAtStartOfDay(); return SleepPeriod.afternoonEvening(targetDate); } else { final DateTime targetDate; if (inBedHour < 4){ targetDate = inBedTime.withTimeAtStartOfDay().minusDays(1); }else{ targetDate = inBedTime.withTimeAtStartOfDay(); } return SleepPeriod.night(targetDate); } }</code><technical_language>put hard coded constants top final static int NAME_OF_CONSTANT = 42;</technical_language>

Target:
public static SleepPeriod createSleepPeriod(final DateTime inBedTime){ final Integer inBedHour = inBedTime.getHourOfDay(); if (inBedHour >= MORNING_START_HOUR && inBedHour < MORNING_IN_BED_END_HOUR){ final DateTime targetDate = inBedTime.withTimeAtStartOfDay(); return SleepPeriod.morning(targetDate); } else if (inBedHour >= AFTERNOON_START_HOUR && inBedHour < AFTERNOON_IN_BED_END_HOUR){ final DateTime targetDate = inBedTime.withTimeAtStartOfDay(); return SleepPeriod.afternoonEvening(targetDate); } else { final DateTime targetDate; if (inBedHour < MORNING_START_HOUR){ targetDate = inBedTime.withTimeAtStartOfDay().minusDays(1); }else{ targetDate = inBedTime.withTimeAtStartOfDay(); } return SleepPeriod.night(targetDate); } }
Source:
<code>public static boolean validWebForm(final SurveyGroup surveyGroup, final Survey survey, final List<Question> questions){ boolean validQuestionGroups = validQuestionGroups(survey); <START> if (!validQuestionGroups) return false; <END> boolean validSurveyGroup = validSurveyGroup(surveyGroup); if (!validSurveyGroup) return false; List<Question> validQuestions = questions.stream().filter(i -> !unsupportedQuestionTypes().contains(i.getType().toString())).collect(Collectors.toList()); return validQuestions.size() == questions.size(); }</code><technical_language>{ } in if conditions</technical_language>

Target:
public static boolean validWebForm(final SurveyGroup surveyGroup, final Survey survey, final List<Question> questions) { boolean validQuestionGroups = validQuestionGroups(survey); if (!validQuestionGroups) { return false; } boolean validSurveyGroup = validForm(survey, surveyGroup); if (!validSurveyGroup) { return false; } List<Question> validQuestions = questions.stream().filter(i -> !unsupportedQuestionTypes().contains(i.getType().toString())).collect(Collectors.toList()); return validQuestions.size() == questions.size(); }
Source:
<code>@Override public byte fieldsCount() { <START> return 11; <END> }</code><technical_language>11 here? I 2 fileds added, 8+2 == 10 :)</technical_language>

Target:
@Override public byte fieldsCount() { return 8; }
Source:
<code>public void toggleTriggerFavouriteStatus(){ Context context = getActivity(); final Animation myAnim = AnimationUtils.loadAnimation(context, R.anim.bounce); MyBounceInterpolator interpolator = new MyBounceInterpolator(0.2, 20); myAnim.setInterpolator(interpolator); addButton.startAnimation(myAnim); SQLStore<Trigger> store = openStore(context); if (store.read(trigger.getId()) == null) { store.save(trigger); <START> Toast.makeText(getContext(),"Added to Favourites", Toast.LENGTH_SHORT).show(); <END> addButton.setColorFilter(getResources().getColor(R.color.background_primary)); addButton.startAnimation(myAnim); } else { store.remove(trigger.getId()); Toast.makeText(getContext(),"Removed from Favourites", Toast.LENGTH_SHORT).show(); addButton.setColorFilter(getResources().getColor(R.color.background_secondary)); addButton.startAnimation(myAnim); } store.close(); }</code><technical_language>strings provided strings.xml</technical_language>

Target:
public void toggleTriggerFavouriteStatus(){ Context context = getActivity(); final Animation myAnim = AnimationUtils.loadAnimation(context, R.anim.bounce); MyBounceInterpolator interpolator = new MyBounceInterpolator(0.2, 20); myAnim.setInterpolator(interpolator); addButton.startAnimation(myAnim); SQLStore<Trigger> store = openStore(context); if (store.read(trigger.getId()) == null) { store.save(trigger); Snackbar snackbar = Snackbar.make(getView(),R.string.favourites_added, Snackbar.LENGTH_SHORT); snackbar.show(); addButton.setColorFilter(getResources().getColor(R.color.background_primary)); addButton.startAnimation(myAnim); } else { store.remove(trigger.getId()); Snackbar snackbar = Snackbar.make(getView(),R.string.favourites_removed, Snackbar.LENGTH_SHORT); snackbar.show(); addButton.setColorFilter(getResources().getColor(R.color.background_secondary)); addButton.startAnimation(myAnim); } store.close(); }
Source:
<code>public InputStream getContent() throws IOException { if (!contentRead) { InputStream lowLevelResponseContent = this.response.getContent(); if (lowLevelResponseContent != null) { boolean contentProcessed = false; try { String contentEncoding = this.contentEncoding; if (!returnRawInputStream && contentEncoding != null <START> && (CONTENT_ENCODING_GZIP.equalsIgnoreCase(contentEncoding.trim()) <END> || CONTENT_ENCODING_XGZIP.equalsIgnoreCase(contentEncoding.trim()))) { lowLevelResponseContent = new GZIPInputStream(lowLevelResponseContent); } Logger logger = HttpTransport.LOGGER; if (loggingEnabled && logger.isLoggable(Level.CONFIG)) { lowLevelResponseContent = new LoggingInputStream( lowLevelResponseContent, logger, Level.CONFIG, contentLoggingLimit); } content = lowLevelResponseContent; contentProcessed = true; } catch (EOFException e) { } finally { if (!contentProcessed) { lowLevelResponseContent.close(); } } } contentRead = true; } return content; }</code><technical_language>equalsIgnoreCase needs a character set; in this context UTF-8 works</technical_language>

Target:
public InputStream getContent() throws IOException { if (!contentRead) { InputStream lowLevelResponseContent = this.response.getContent(); if (lowLevelResponseContent != null) { boolean contentProcessed = false; try { if (!returnRawInputStream && this.contentEncoding != null) { String oontentencoding = this.contentEncoding.trim().toLowerCase(Locale.ENGLISH); if (CONTENT_ENCODING_GZIP.equals(oontentencoding) || CONTENT_ENCODING_XGZIP.equals(oontentencoding)) { lowLevelResponseContent = new ConsumingInputStream(new GZIPInputStream(lowLevelResponseContent)); } } Logger logger = HttpTransport.LOGGER; if (loggingEnabled && logger.isLoggable(Level.CONFIG)) { lowLevelResponseContent = new LoggingInputStream( lowLevelResponseContent, logger, Level.CONFIG, contentLoggingLimit); } content = lowLevelResponseContent; contentProcessed = true; } catch (EOFException e) { } finally { if (!contentProcessed) { lowLevelResponseContent.close(); } } } contentRead = true; } return content; }
Source:
<code>public Object getData() { if (!parsed) { <START> throw new IllegalStateException("This method should only be called on events created through the parse method"); <END> } if (cloudEvent.getDataBase64() != null) { return cloudEvent.getDataBase64(); } String eventType = SystemEventMappings.canonicalizeEventType(cloudEvent.getType()); if (SystemEventMappings.getSystemEventMappings().containsKey(eventType)) { return deserializer.deserialize(new ByteArrayInputStream((byte[]) this.cloudEvent.getData()), TypeReference.createInstance(SystemEventMappings.getSystemEventMappings().get(eventType))); } return cloudEvent.getData(); }</code><technical_language>I Srikanta called this out, instead of throwing directly, get a ClientLogger instance call throw logger.logExceptionAsWarning/Error(...) instead</technical_language>

Target:
public Object getData() { if (!parsed) { throw logger.logExceptionAsError(new IllegalStateException( "This method should only be called on events created through the parse method")); } if (cloudEvent.getDataBase64() != null) { return cloudEvent.getDataBase64(); } String eventType = SystemEventMappings.canonicalizeEventType(cloudEvent.getType()); if (SystemEventMappings.getSystemEventMappings().containsKey(eventType)) { return deserializer.deserialize(new ByteArrayInputStream((byte[]) this.cloudEvent.getData()), TypeReference.createInstance(SystemEventMappings.getSystemEventMappings().get(eventType))); } return cloudEvent.getData(); }
Source:
<code>public void start() { webServer.start(); if (config.isGrid()) { class GridRegistrationTask extends TimerTask { private final SelendroidStandaloneDriver driver; private final SelendroidConfiguration configuration; private final Logger log = Logger.getLogger(GridRegistrationTask.class.getName()); private boolean firstTime = true; GridRegistrationTask(SelendroidStandaloneDriver driver, SelendroidConfiguration configuration) { this.driver = driver; this.configuration = configuration; } @Override public void run() { try { final SelfRegisteringRemote remote = new SelfRegisteringRemote(configuration, driver); <START> if (firstTime) { <END> remote.performRegistrationIfNotRegistered(firstTime); firstTime = false; } else { remote.performRegistrationIfNotRegistered(firstTime); } } catch (Exception e) { log.log(Level.SEVERE, "An error occurred while registering selendroid into grid hub.", e); } } } log.info("Scheduling task for self registration in GRID."); Timer regTimer = new Timer(); GridRegistrationTask regTask = new GridRegistrationTask(driver, config); regTimer.schedule(regTask, 0, config.getRegisterCycle()); } log.info("Selendroid standalone server has been started on port: " + config.getPort()); }</code><technical_language>need for this if, set firstTime false. checking in performRegistrationIfNotRegistered()</technical_language>

Target:
public void start() { webServer.start(); if (config.isGrid()) { selfRegisterInGrid(); } log.info("Selendroid standalone server has been started on port: " + config.getPort()); }
Source:
<code>private Pair find(T value) { retry: while (true) { Node current = head; Node next = head.currentFlagAndNext.getReference(); Node tmp; while (true) { if (next == null) { return new Pair(current, null); } tmp = next.currentFlagAndNext.getReference(); if (next.currentFlagAndNext.isMarked()) { if (!current.currentFlagAndNext.compareAndSet(next, tmp, false, false)) { <START> continue retry; <END> } next = tmp; } else { if (next.value.compareTo(value) >= 0) { return new Pair(current, next); } current = next; next = tmp; } } } }</code><technical_language>break</technical_language>

Target:
private Pair find(T value) { while (true) { Node current = head; Node next = head.currentFlagAndNext.getReference(); Node tmp; while (true) { if (next == null) { return new Pair(current, null); } tmp = next.currentFlagAndNext.getReference(); if (next.currentFlagAndNext.isMarked()) { if (!current.currentFlagAndNext.compareAndSet(next, tmp, false, false)) { break; } next = tmp; } else { if (next.value.compareTo(value) >= 0) { return new Pair(current, next); } current = next; next = tmp; } } } }
Source:
<code>protected TableConfiguration getEditedTableConfiguration(final Resource resource) { TableConfiguration configuration = null; boolean isCreation = true; if (null != resource) { <START> if (resource.getContents().get(0) instanceof TableConfiguration) { <END> configuration = EcoreUtil.copy((TableConfiguration) resource.getContents().get(0)); isCreation = false; } } if (isCreation) { configuration = NattableconfigurationFactory.eINSTANCE.createTableConfiguration(); final TableHeaderAxisConfiguration rowHeaderAxisConfiguration = NattableaxisconfigurationFactory.eINSTANCE.createTableHeaderAxisConfiguration(); final TableHeaderAxisConfiguration columnHeaderAxisConfiguration = NattableaxisconfigurationFactory.eINSTANCE.createTableHeaderAxisConfiguration(); configuration.setColumnHeaderAxisConfiguration(columnHeaderAxisConfiguration); configuration.setRowHeaderAxisConfiguration(rowHeaderAxisConfiguration); } return configuration; }</code><technical_language>getContents() empty</technical_language>

Target:
protected TableConfiguration getEditedTableConfiguration(final Resource resource) { TableConfiguration configuration = null; boolean isCreation = true; if (null != resource) { if (!resource.getContents().isEmpty() && resource.getContents().get(0) instanceof TableConfiguration) { configuration = EcoreUtil.copy((TableConfiguration) resource.getContents().get(0)); isCreation = false; } } if (isCreation) { configuration = NattableconfigurationFactory.eINSTANCE.createTableConfiguration(); final TableHeaderAxisConfiguration rowHeaderAxisConfiguration = NattableaxisconfigurationFactory.eINSTANCE.createTableHeaderAxisConfiguration(); final TableHeaderAxisConfiguration columnHeaderAxisConfiguration = NattableaxisconfigurationFactory.eINSTANCE.createTableHeaderAxisConfiguration(); configuration.setColumnHeaderAxisConfiguration(columnHeaderAxisConfiguration); configuration.setRowHeaderAxisConfiguration(rowHeaderAxisConfiguration); } return configuration; }
Source:
<code>public BAMFileSpan getSpanOverlapping(final Bin bin) { if(bin == null) return null; final int referenceSequence = bin.getReferenceSequence(); final BAMIndexContent queryResults = getQueryResults(referenceSequence); if(queryResults == null) <START> return null; <END> final int binLevel = getLevelForBin(bin); final int firstLocusInBin = getFirstLocusInBin(bin); long minimumOffset = bin instanceof BinWithOffset ? ((BinWithOffset)bin).getlOffset() : 0L; final List<Bin> binTree = new ArrayList<Bin>(); if(queryResults.containsBin(bin)) binTree.add(queryResults.getBins().getBin(bin.getBinNumber())); int currentBinLevel = binLevel; while(--currentBinLevel >= 0) { final int binStart = getFirstBinOnLevel(currentBinLevel); final int binWidth = getMaxSpan()/getLevelSize(currentBinLevel); final int parentBinNumber = firstLocusInBin/binWidth + binStart; final Bin parentBin = queryResults.getBins().getBin(parentBinNumber); if(parentBin != null && queryResults.containsBin(parentBin)) binTree.add(parentBin); } List<Chunk> chunkList = new ArrayList<Chunk>(); for(final Bin coveringBin: binTree) { for(final Chunk chunk: coveringBin.getChunkList()) chunkList.add(chunk.clone()); } chunkList = Chunk.optimizeChunkList(chunkList, minimumOffset); return new BAMFileSpan(chunkList); }</code><technical_language>{}</technical_language>

Target:
public BAMFileSpan getSpanOverlapping(final Bin bin) { if(bin == null) { return null; } final int referenceSequence = bin.getReferenceSequence(); final BAMIndexContent queryResults = getQueryResults(referenceSequence); if(queryResults == null) { return null; } final int binLevel = getLevelForBin(bin); final int firstLocusInBin = getFirstLocusInBin(bin); long minimumOffset = bin instanceof BinWithOffset ? ((BinWithOffset)bin).getlOffset() : 0L; final List<Bin> binTree = new ArrayList<Bin>(); if(queryResults.containsBin(bin)) { binTree.add(queryResults.getBins().getBin(bin.getBinNumber())); } int currentBinLevel = binLevel; while(--currentBinLevel >= 0) { final int binStart = getFirstBinInLevelForCSI(currentBinLevel); final int binWidth = getMaxSpan()/getLevelSize(currentBinLevel); final int parentBinNumber = firstLocusInBin/binWidth + binStart; final Bin parentBin = queryResults.getBins().getBin(parentBinNumber); if(parentBin != null && queryResults.containsBin(parentBin)) { binTree.add(parentBin); } } List<Chunk> chunkList = new ArrayList<Chunk>(); for(final Bin coveringBin: binTree) { for(final Chunk chunk: coveringBin.getChunkList()) chunkList.add(chunk.clone()); } chunkList = Chunk.optimizeChunkList(chunkList, minimumOffset); return new BAMFileSpan(chunkList); }
Source:
<code>public void addPath(final String path) { Objects.requireNonNull(path, "Path cannot be null"); final String[] pathComponents = StringUtils.split(path, '/'); if (pathComponents.length == 0) { throw new IllegalArgumentException("Invalid path: " + path); } writeLock.lock(); try { TrieNode parent = rootNode; for (final String part : pathComponents) { TrieNode child = parent.getChild(part); if (child == null) { child = new TrieNode(parent, part); <START> parent.addChild(part, child); <END> } parent = child; } parent.setProperty(true); } finally { writeLock.lock(); } }</code><technical_language>addPath() example. In previous version of TrieNode class consistent, methods protected synchronized getChild() addChild() validated if child added children. For instance, if a thread interrupted getChild() addChild() modifying trie adding child another thread, addChild() a no-op. In version TrieNode is longer thread-safe, removed synchronized of methods, entire tree is guarded Read/Write lock in PathTrie class. This heavier, if multiple threads manipulating parts of Trie, locking entire object is needed, threads conflicting. previous version more accurate in workloads</technical_language>

Target:
public void addPath(final String path) { Objects.requireNonNull(path, "Path cannot be null"); final String[] pathComponents = StringUtils.split(path, '/'); if (pathComponents.length == 0) { throw new IllegalArgumentException("Invalid path: " + path); } writeLock.lock(); try { TrieNode parent = rootNode; for (final String part : pathComponents) { TrieNode child = parent.getChild(part); if (child == null) { child = new TrieNode(parent, part); parent.addChild(part, child); } parent = child; } parent.setProperty(true); } finally { writeLock.unlock(); } }
Source:
<code>MemoryRevokingScheduler( List<MemoryPool> memoryPools, Supplier<? extends Collection<SqlTask>> currentTasksSupplier, ScheduledExecutorService taskManagementExecutor, double memoryRevokingThreshold, double memoryRevokingTarget) { <START> this.memoryPools = ImmutableList.copyOf(memoryPools); <END> this.currentTasksSupplier = currentTasksSupplier; this.taskManagementExecutor = taskManagementExecutor; this.memoryRevokingThreshold = memoryRevokingThreshold; this.memoryRevokingTarget = memoryRevokingTarget; }</code><technical_language>check for nulls validate ranges for numbers</technical_language>

Target:
MemoryRevokingScheduler( List<MemoryPool> memoryPools, Supplier<? extends Collection<SqlTask>> currentTasksSupplier, ScheduledExecutorService taskManagementExecutor, double memoryRevokingThreshold, double memoryRevokingTarget) { this.memoryPools = ImmutableList.copyOf(requireNonNull(memoryPools, "memoryPools is null")); this.currentTasksSupplier = requireNonNull(currentTasksSupplier, "currentTasksSupplier is null"); this.taskManagementExecutor = requireNonNull(taskManagementExecutor, "taskManagementExecutor is null"); this.memoryRevokingThreshold = checkFraction(memoryRevokingThreshold, "memoryRevokingThreshold"); this.memoryRevokingTarget = checkFraction(memoryRevokingTarget, "memoryRevokingTarget"); checkArgument( memoryRevokingTarget <= memoryRevokingThreshold, "memoryRevokingTarget should be less than or equal memoryRevokingThreshold, but got %s and %s respectively", memoryRevokingTarget, memoryRevokingThreshold); }
Source:
<code>@Test public void withConstructorParameters() throws IOException { ClassWriter classWriter = ClassWriter.forClassName(className); classWriter.addField(threadName, "thread"); ConstructorWriter constructorWriter = classWriter.addConstructor(); constructorWriter.addParameter(Runnable.class, "runnable"); AnonymousClassWriter threadWriter = AnonymousClassWriter.forClassName(threadName); threadWriter.passConstructorParameters("runnable"); MethodWriter threadStartMethod = threadWriter.addMethod(void.class, "start"); threadStartMethod.annotate(Override.class); threadStartMethod.addModifiers(PUBLIC); threadStartMethod.body().addSnippet("System.out.println(\"Hello World!\");"); constructorWriter.body().addSnippet("thread = %s;", threadWriter); StringBuilder stringBuilder = new StringBuilder(); <START> assertThat(classWriter.writeTypeToAppendable(stringBuilder).toString()).isEqualTo("" <END> + "package com.foo;\n" + "\n" + "class Bar {\n" + " Thread thread;\n" + "\n" + " Bar(Runnable runnable) {\n" + " thread = new Thread(runnable) {\n" + " @Override\n" + " public void start() {\n" + " System.out.println(\"Hello World!\");\n" + " }\n" + " };\n" + " }\n" + "}\n"); }</code><technical_language>Writeables.writeToString</technical_language>

Target:
@Test public void withConstructorParameters() throws IOException { ClassWriter classWriter = ClassWriter.forClassName(className); classWriter.addField(threadName, "thread"); ConstructorWriter constructorWriter = classWriter.addConstructor(); constructorWriter.addParameter(Runnable.class, "runnable"); AnonymousClassWriter threadWriter = AnonymousClassWriter.forClassName(threadName); threadWriter.setConstructorArguments("runnable"); MethodWriter threadStartMethod = threadWriter.addMethod(void.class, "start"); threadStartMethod.annotate(Override.class); threadStartMethod.addModifiers(PUBLIC); threadStartMethod.body().addSnippet("System.out.println(\"Hello World!\");"); constructorWriter.body().addSnippet("thread = %s;", threadWriter); assertThat(classWriter.toString()).isEqualTo("" + "package com.foo;\n" + "\n" + "class Bar {\n" + " Thread thread;\n" + "\n" + " Bar(Runnable runnable) {\n" + " thread = new Thread(runnable) {\n" + " @Override\n" + " public void start() {\n" + " System.out.println(\"Hello World!\");\n" + " }\n" + " };\n" + " }\n" + "}\n"); }
Source:
<code>private event_notification_hist geteventNotificationHist(EventAuditLogSubscriber eals, boolean isNotified, <START> String reason) { <END> event_notification_hist eventHistory = new event_notification_hist(); eventHistory.setaudit_log_id(eals.getaudit_log_id()); eventHistory.setevent_name(eals.getevent_up_name()); eventHistory.setmethod_type(eals.getEventNotificationMethod().name()); eventHistory.setreason(reason); eventHistory.setsent_at(new Date()); eventHistory.setstatus(isNotified); eventHistory.setsubscriber_id(eals.getsubscriber_id()); return eventHistory; }</code><technical_language>Please leave formatting was, pretty standard in Java</technical_language>

Target:
private event_notification_hist geteventNotificationHist(EventAuditLogSubscriber eals, boolean isNotified, String reason) { event_notification_hist eventHistory = new event_notification_hist(); eventHistory.setaudit_log_id(eals.getaudit_log_id()); eventHistory.setevent_name(eals.getevent_up_name()); eventHistory.setmethod_type(EventNotificationMethods.forValue(eals.getmethod_id()).name()); eventHistory.setreason(reason); eventHistory.setsent_at(new Date()); eventHistory.setstatus(isNotified); eventHistory.setsubscriber_id(eals.getsubscriber_id()); return eventHistory; }
Source:
<code>public JsonImportDownloadReader ctjImportDownloadReader(@Value("${import.judgments.constitutionalTribunal.dir}") String importDir) { JsonImportDownloadReader ctjImportDownloadReader = new JsonImportDownloadReader(); ctjImportDownloadReader.setImportDir(importDir); <START> ctjImportDownloadReader.setImportFileUtils(importFileUtils); <END> ctjImportDownloadReader.setJsonFactory(jsonFactory); ctjImportDownloadReader.setJsonUtilService(jsonUtilService); return ctjImportDownloadReader; }</code><technical_language>set importDir if left Autowired annotation</technical_language>

Target:
public JsonImportDownloadReader ctjImportDownloadReader(@Value("${import.judgments.constitutionalTribunal.dir}") String importDir) { JsonImportDownloadReader ctjImportDownloadReader = new JsonImportDownloadReader(); ctjImportDownloadReader.setImportDir(importDir); return ctjImportDownloadReader; }
Source:
<code>private void reorderRepositories() { Collections.sort(cachedRepos, recentRepos); <START> getActivity().runOnUiThread(new Runnable() { <END> @Override public void run() { getListAdapter().getWrappedAdapter().setItems(cachedRepos.toArray()); updateHeaders(cachedRepos); } }); }</code><technical_language>do explicitly mark this run UI thread? this method called main thread</technical_language>

Target:
private void reorderRepositories() { Collections.sort(cachedRepos, recentRepos); getListAdapter().getWrappedAdapter().setItems(cachedRepos.toArray()); updateHeaders(cachedRepos); }
Source:
<code>private void freezeVm() { if (!shouldFreezeOrThawVm()) { return; } VDSReturnValue returnValue; try { auditLogDirector.log(this, AuditLogType.FREEZE_VM_INITIATED); <START> returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase(getVds().getId(), getVmId())); <END> } catch (EngineException e) { handleFreezeVmFailure(e); return; } if (!returnValue.getSucceeded()) { handleFreezeVmFailure(new EngineException(EngineError.freezeErr)); } else { auditLogDirector.log(this, AuditLogType.FREEZE_VM_SUCCESS); } }</code><technical_language>formatter</technical_language>

Target:
private void freezeVm() { if (!shouldFreezeOrThawVm()) { return; } VDSReturnValue returnValue; try { auditLogDirector.log(this, AuditLogType.FREEZE_VM_INITIATED); returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase( getVds().getId(), getVmId())); } catch (EngineException e) { handleFreezeVmFailure(e); return; } if (returnValue.getSucceeded()) { auditLogDirector.log(this, AuditLogType.FREEZE_VM_SUCCESS); } else { handleFreezeVmFailure(new EngineException(EngineError.freezeErr)); } }
Source:
<code>public String getViewIndexesSql(String viewName, String schemaName, String tenantId) { return "SELECT DISTINCT COLUMN_FAMILY FROM " + "SYSTEM.CATALOG " + "WHERE TABLE_NAME = \'" + viewName + "\'" <START> + (!StringUtil.EMPTY_STRING.equals(schemaName) ? "AND TABLE_SCHEM = \'" <END> + schemaName + "\' " : "") + "AND LINK_TYPE = " + PTable.LinkType.INDEX_TABLE.getSerializedValue() + (tenantId != null ? " AND TENANT_ID = \'" + tenantId + "\'" : ""); }</code><technical_language>Nit: Add space</technical_language>

Target:
public String getViewIndexesSql(String viewName, String schemaName, String tenantId) { return "SELECT DISTINCT COLUMN_FAMILY FROM " + "SYSTEM.CATALOG " + "WHERE TABLE_NAME = \'" + viewName + "\'" + (!Strings.isNullOrEmpty(schemaName) ? " AND TABLE_SCHEM = \'" + schemaName + "\'" : "") + " AND LINK_TYPE = " + PTable.LinkType.INDEX_TABLE.getSerializedValue() + (tenantId != null ? " AND TENANT_ID = \'" + tenantId + "\'" : ""); }
Source:
<code>@Test public void readsHealth() throws Exception { Response response = get("/health"); assertThat(response.isSuccessful()).isTrue(); String json = response.body().string(); assertThat(readString(json, "$.status")) .isIn("UP", "DOWN", "UNKNOWN"); assertThat(readString(json, "$.zipkin.status")) .isIn("UP", "DOWN", "UNKNOWN"); <START> assertThat(readString(json, "$.diskSpace.status")) <END> .isIn("UP", "DOWN", "UNKNOWN"); }</code><technical_language>need this</technical_language>

Target:
@Test public void readsHealth() throws Exception { Response response = get("/health"); assertThat(response.isSuccessful()).isTrue(); String json = response.body().string(); assertThat(readString(json, "$.status")) .isIn("UP", "DOWN", "UNKNOWN"); assertThat(readString(json, "$.zipkin.status")) .isIn("UP", "DOWN", "UNKNOWN"); }
Source:
<code>public static String toAccountQuery(final String fullname) { <START> String user = KeyUtil.encode(fullname).replaceAll("%3[Aa]", ":"); <END> return "/q/owner:\"" + user + "\"," + TOP; }</code><technical_language>need this replacement of "%3[Aa]" ":"</technical_language>

Target:
public static String toAccountQuery(final String fullname) { return "/q/owner:\"" + KeyUtil.encode(fullname) + "\"," + TOP; }
Source:
<code>public void testUpdateCertificateVersion() { <START> assertTrue(true); <END> }</code><technical_language>throw a SkipException reason this is executed in test output. this serve a reminder for this needs implemented</technical_language>

Target:
public void testUpdateCertificateVersion() { throw new SkipException("bug in requirements for function"); }
Source:
<code>public static synchronized GoogleCastDelegate getInstance(AnalyticsRegistry analyticsRegistry) { if (delegate == null) { delegate = new GoogleCastDelegate(MainApplication.instance()); } <START> delegate.analyticsRegistry = analyticsRegistry; <END> return delegate; }</code><technical_language>I passing this field in a constructor a approach</technical_language>

Target:
public static synchronized GoogleCastDelegate getInstance(AnalyticsRegistry analyticsRegistry) { if (delegate == null) { delegate = new GoogleCastDelegate(MainApplication.instance(), analyticsRegistry); } return delegate; }
Source:
<code>public void shouldReturnFactoryFromRepositoryWithFactoryJson() throws Exception { String githubUrl = "<LINK_0>"; FactoryDto computedFactory = generateWsConfigFactory(); when(urlFactoryBuilder.createFactoryFromJson(any(RemoteFactoryUrl.class))) .thenReturn(Optional.of(computedFactory)); <START> Map<String, String> params = new HashMap<>(); <END> params.put(URL_PARAMETER_NAME, githubUrl); githubFactoryParametersResolver.createFactory(params); verify(urlFactoryBuilder).createFactoryFromJson(factoryUrlArgumentCaptor.capture()); verify(urlFactoryBuilder, never()).buildDefaultDevfile(eq("che")); assertEquals( factoryUrlArgumentCaptor.getValue().factoryFileLocation(), "<LINK_1>"); assertEquals(factoryUrlArgumentCaptor.getValue().getFactoryFilename(), ".factory.json"); }</code><technical_language>ImmutableMap.of(</technical_language>

Target:
public void shouldReturnFactoryFromRepositoryWithFactoryJson() throws Exception { String githubUrl = "<LINK_0>"; FactoryDto computedFactory = generateWsConfigFactory(); when(urlFactoryBuilder.createFactoryFromJson(any(RemoteFactoryUrl.class))) .thenReturn(Optional.of(computedFactory)); Map<String, String> params = ImmutableMap.of(URL_PARAMETER_NAME, githubUrl); githubFactoryParametersResolver.createFactory(params); verify(urlFactoryBuilder).createFactoryFromJson(factoryUrlArgumentCaptor.capture()); verify(urlFactoryBuilder, never()).buildDefaultDevfile(eq("che")); assertEquals( factoryUrlArgumentCaptor.getValue().factoryFileLocation(), "<LINK_1>"); assertEquals(factoryUrlArgumentCaptor.getValue().getFactoryFilename(), ".factory.json"); }
Source:
<code>public void should_create_spans_from_stream_with_tracing_filter_not_predicate_true() throws Exception { String inputTopic = testName.getMethodName() + "-input"; String outputTopic = testName.getMethodName() + "-output"; StreamsBuilder builder = new StreamsBuilder(); builder.stream(inputTopic, Consumed.with(Serdes.String(), Serdes.String())) .transform(kafkaStreamsTracing.filterNot("filterNot-1", (key, value) -> true)) .peek((s, s2) -> { <START> System.out.println(s + "-" + s2); <END> }) .to(outputTopic, Produced.with(Serdes.String(), Serdes.String())); Topology topology = builder.build(); KafkaStreams streams = buildKafkaStreams(topology); producer = createProducer(); producer.send(new ProducerRecord<>(inputTopic, TEST_KEY, TEST_VALUE)).get(); waitForStreamToRun(streams); Span spanInput = takeSpan(), spanProcessor = takeSpan(); assertThat(spanInput.kind().name()).isEqualTo(brave.Span.Kind.CONSUMER.name()); assertThat(spanInput.traceId()).isEqualTo(spanProcessor.traceId()); assertThat(spanInput.tags()).containsEntry("kafka.topic", inputTopic); assertThat(spanProcessor.tags()).containsEntry(KAFKA_STREAMS_FILTERED_TAG, "true"); streams.close(); streams.cleanUp(); }</code><technical_language>Accidentally committed System.out</technical_language>

Target:
public void should_create_spans_from_stream_with_tracing_filter_not_predicate_true() throws Exception { String inputTopic = testName.getMethodName() + "-input"; String outputTopic = testName.getMethodName() + "-output"; StreamsBuilder builder = new StreamsBuilder(); builder.stream(inputTopic, Consumed.with(Serdes.String(), Serdes.String())) .transform(kafkaStreamsTracing.filterNot("filterNot-1", (key, value) -> true)) .to(outputTopic, Produced.with(Serdes.String(), Serdes.String())); Topology topology = builder.build(); KafkaStreams streams = buildKafkaStreams(topology); producer = createProducer(); producer.send(new ProducerRecord<>(inputTopic, TEST_KEY, TEST_VALUE)).get(); waitForStreamToRun(streams); Span spanInput = takeSpan(), spanProcessor = takeSpan(); assertThat(spanInput.kind().name()).isEqualTo(brave.Span.Kind.CONSUMER.name()); assertThat(spanInput.traceId()).isEqualTo(spanProcessor.traceId()); assertThat(spanInput.tags()).containsEntry("kafka.topic", inputTopic); assertThat(spanProcessor.tags()).containsEntry(KAFKA_STREAMS_FILTERED_TAG, "true"); streams.close(); streams.cleanUp(); }
Source:
<code>public Object create(NewOperator operator) { <START> Long countName = datastore.entityCount(OperatorEntity.class, Filter.where("name").is(operator.name)); <END> if (countName != 0) { throw new OperatorException("Operator with name: " + operator.name + " already exists."); } Long countEmergency = datastore.entityCount(OperatorEntity.class, Filter.where("emergencyNumber").is(operator.emergencyNumber)); if (countEmergency != 0) { throw new EmergencyNumberException("Emergency call number: " + operator.emergencyNumber + " is already used from another operator."); } return datastore.save(adapt(operator)); }</code><technical_language>operatorCount</technical_language>

Target:
public Object create(NewOperator operator) { Long operCount = datastore.entityCount(OperatorEntity.class, Filter.where("name").is(operator.name)); if (operCount != 0) { throw new OperatorException("Operator with name: " + operator.name + " already exists."); } Long countEmergency = datastore.entityCount(OperatorEntity.class, Filter.where("emergencyNumber").is(operator.emergencyNumber)); if (countEmergency != 0) { throw new EmergencyNumberException("Emergency call number: " + operator.emergencyNumber + " is already used from another operator."); } return datastore.save(adapt(operator)); }
Source:
<code>public String toShortString() { if (m_map.isEmpty()) { return "Empty Map"; } StringBuilder sb = new StringBuilder(); sb.append("lastSpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastSpUniqueId)).append(" "); sb.append("lastMpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastMpUniqueId)).append(" "); if (m_map.isEmpty()) { sb.append("[empty map]"); } else { <START> sb.append("span [").append(DRLogSegmentId.getSequenceNumberFromDRId(getFirstDrId())).append("-"); <END> sb.append(DRLogSegmentId.getSequenceNumberFromDRId(getLastDrId())).append("]"); } return sb.toString(); }</code><technical_language>I helpful print number of entries in map</technical_language>

Target:
public String toShortString() { if (m_map.isEmpty()) { return "Empty Map"; } StringBuilder sb = new StringBuilder(); sb.append("lastSpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastSpUniqueId)).append(" "); sb.append("lastMpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastMpUniqueId)).append(" "); if (m_map.isEmpty()) { sb.append("[empty map]"); } else { sb.append("span [").append(DRLogSegmentId.getSequenceNumberFromDRId(getFirstDrId())).append("-"); sb.append(DRLogSegmentId.getSequenceNumberFromDRId(getLastDrId())); sb.append(", size=").append(size()).append("]"); } return sb.toString(); }
Source:
<code>private void getDeprecatedContainers() { deprecatedContainers.clear(); if (accountService != null) { accountService.getContainersByStatus(Container.ContainerStatus.DELETE_IN_PROGRESS).forEach((container) -> { if (container.getDeleteTriggerTime() + TimeUnit.DAYS.toMillis(config.storeContainerDeletionRetentionDays) >= System.currentTimeMillis()) { deprecatedContainers.add(new Pair<>(container.getParentAccountId(), container.getId())); } }); <START> accountService.getContainersByStatus(Container.ContainerStatus.INACTIVE).forEach((container) -> { <END> deprecatedContainers.add(new Pair<>(container.getParentAccountId(), container.getId())); }); } }</code><technical_language>Is this a TODO</technical_language>

Target:
private void getDeprecatedContainers() { deprecatedContainers.clear(); if (accountService != null) { accountService.getContainersByStatus(Container.ContainerStatus.DELETE_IN_PROGRESS).forEach((container) -> { if (container.getDeleteTriggerTime() + TimeUnit.DAYS.toMillis(config.storeContainerDeletionRetentionDays) <= System.currentTimeMillis()) { deprecatedContainers.add(new Pair<>(container.getParentAccountId(), container.getId())); } }); accountService.getContainersByStatus(Container.ContainerStatus.INACTIVE).forEach((container) -> { deprecatedContainers.add(new Pair<>(container.getParentAccountId(), container.getId())); }); } }
Source:
<code>public void sendError(HttpResponseStatus status, String errorMessage) { <START> Preconditions.checkArgument(!status.equals(HttpResponseStatus.OK), "Response status cannot be OK for errors"); <END> ChannelBuffer errorContent = ChannelBuffers.wrappedBuffer(Charsets.UTF_8.encode(errorMessage)); sendContent(status, errorContent, "text/plain; charset=utf-8", ImmutableMultimap.<String, String>of()); }</code><technical_language>check for 2xx codes instead of 200</technical_language>

Target:
public final void sendError(HttpResponseStatus status, String errorMessage) { sendString(status, errorMessage); }
Source:
<code>static boolean getBooleanProperty(String name) { <START> if (System.getSecurityManager() == null) <END> return SysProps.NON_PRIVILEGED.getBooleanProperty(name); return SysProps.PRIVILEGED.getBooleanProperty(name); }</code><technical_language>@tristantarrant Is this new of this? previous system property security actions this instead</technical_language>

Target:
static boolean getBooleanProperty(String name) { return doPrivileged(new GetSystemPropertyAsBooleanAction(name)); }
Source:
<code>public void testSendFromExecuteBlocking() throws Exception { String expectedBody = TestUtils.randomAlphaString(20); CountDownLatch receivedLatch = new CountDownLatch(1); startNodes(2); vertices[1].eventBus().<String>consumer(ADDRESS1, msg -> { assertEquals(expectedBody, msg.body()); receivedLatch.countDown(); }).completionHandler(ar -> { assertTrue(ar.succeeded()); <START> vertices[0].deployVerticle(new AbstractVerticle() { <END> @Override public void start() throws Exception { vertx().executeBlocking(fut -> { vertices[0].eventBus().send(ADDRESS1, expectedBody); try { awaitLatch(receivedLatch); } catch (InterruptedException e) { Thread.interrupted(); fut.fail(e); } fut.complete(); }, ar -> { if (ar.succeeded()) { testComplete(); } else { fail(ar.cause()); } }); } }); }); await(); }</code><technical_language>do need deploy a verticle ? get a new context</technical_language>

Target:
public void testSendFromExecuteBlocking() throws Exception { String expectedBody = TestUtils.randomAlphaString(20); CountDownLatch receivedLatch = new CountDownLatch(1); startNodes(2); vertices[1].eventBus().<String>consumer(ADDRESS1, msg -> { assertEquals(expectedBody, msg.body()); receivedLatch.countDown(); }).completionHandler(ar -> { assertTrue(ar.succeeded()); vertices[0].executeBlocking(fut -> { vertices[0].eventBus().send(ADDRESS1, expectedBody); try { awaitLatch(receivedLatch); } catch (InterruptedException e) { Thread.interrupted(); fut.fail(e); } fut.complete(); }, ar2 -> { if (ar2.succeeded()) { testComplete(); } else { fail(ar2.cause()); } }); }); await(); }