auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void start() { super.start(); if (!config.simpleCache()) { this.distExecutorService = SecurityActions.getDefaultExecutorService(cache.wired()); } if (filterIndexingServiceProviders == null) { Collection<FilterIndexingServiceProvider> providers = ServiceFinder.load(FilterIndexingServiceProvider.class); filterIndexingServiceProviders = new ArrayList<>(providers.size()); for (FilterIndexingServiceProvider provider : providers) { componentRegistry.wireDependencies(provider, false); provider.start(); filterIndexingServiceProviders.add(provider); } } }

Target:
public void start() { super.start(); if (!config.simpleCache()) { this.distExecutorService = SecurityActions.getDefaultExecutorService(cache.wired()); } Collection<FilterIndexingServiceProvider> providers = ServiceFinder.load(FilterIndexingServiceProvider.class); filterIndexingServiceProviders = new ArrayList<>(providers.size()); for (FilterIndexingServiceProvider provider : providers) { componentRegistry.wireDependencies(provider, false); provider.start(); filterIndexingServiceProviders.add(provider); } }
Source:
private List<Event> createRefundEvents(RefundStateTransition refundStateTransition) throws EventCreationException { RefundHistory refundHistory = refundDao.getRefundHistoryByRefundExternalIdAndRefundStatus( refundStateTransition.getRefundExternalId(), refundStateTransition.getRefundStatus()) .orElseThrow(() -> new EventCreationException(refundStateTransition.getIdentifier())); Event refundEvent = createRefundEvent(refundHistory, refundStateTransition.getStateTransitionEventClass()); Optional<Event> refundAvailabilityEvent = createRefundAvailabilityUpdatedEvent( refundHistory.getChargeEntity().getExternalId(), refundHistory.getHistoryEndDate(), refundStateTransition.getStateTransitionEventClass() ); return Stream.of(Optional.of(refundEvent), refundAvailabilityEvent) .flatMap(Optional::stream) .collect(Collectors.toList()); }

Target:
private List<Event> createRefundEvents(RefundStateTransition refundStateTransition) throws EventCreationException { RefundHistory refundHistory = refundDao.getRefundHistoryByRefundExternalIdAndRefundStatus( refundStateTransition.getRefundExternalId(), refundStateTransition.getRefundStatus()) .orElseThrow(() -> new EventCreationException(refundStateTransition.getIdentifier())); Event refundEvent = createRefundEvent(refundHistory, refundStateTransition.getStateTransitionEventClass()); Optional<Event> refundAvailabilityEvent = createRefundAvailabilityUpdatedEvent( refundHistory.getChargeEntity().getExternalId(), refundHistory.getHistoryStartDate(), refundStateTransition.getStateTransitionEventClass() ); return Stream.of(Optional.of(refundEvent), refundAvailabilityEvent) .flatMap(Optional::stream) .collect(Collectors.toList()); }
Source:
private TDigest( double compression, double min, double max, double totalWeight, int centroidCount, double[] means, double[] weights, boolean needsMerge, boolean backwards) { checkArgument(compression >= 10, "compression factor too small (< 10)"); this.compression = compression; this.maxSize = (int) (10 * compression); this.totalWeight = totalWeight; this.min = min; this.max = max; this.centroidCount = centroidCount; this.means = means; this.weights = weights; this.needsMerge = needsMerge; this.backwards = backwards; }

Target:
private TDigest( double compression, double min, double max, double totalWeight, int centroidCount, double[] means, double[] weights, boolean needsMerge, boolean backwards) { checkArgument(compression >= 10, "compression factor too small (< 10)"); this.compression = compression; this.maxSize = (int) (10 * compression); this.totalWeight = totalWeight; this.min = min; this.max = max; this.centroidCount = centroidCount; this.means = requireNonNull(means, "means is null"); this.weights = requireNonNull(weights, "weights is null"); this.needsMerge = needsMerge; this.backwards = backwards; }
Source:
public void testRepo() { SharedPreferences sharedPref = getSharedPrefs(InstrumentationRegistry.getContext()); User pre = User.builder() .name(UUID.randomUUID().toString()) .id(UUID.randomUUID().toString()) .email(UUID.randomUUID().toString()) .build(); User.Repo repo = new User.Repo(sharedPref); repo.set(pre); User post = repo.get(); assertThat(post, is(not(nullValue()))); assertThat(post.getId(), is(pre.getId())); assertThat(post.getEmail(), is(pre.getEmail())); assertThat(post.getName(), is(pre.getName())); repo.set(null); assertThat(repo.get(), is(nullValue())); }

Target:
public void testRepo() { SharedPreferences sharedPref = getSharedPrefs(InstrumentationRegistry.getContext()); sharedPref.edit().clear().apply(); User pre = new User.Builder() .name(UUID.randomUUID().toString()) .id(UUID.randomUUID().toString()) .email(UUID.randomUUID().toString()) .build(); User.Repo repo = new User.Repo(sharedPref); assertThat(repo.get(),is(nullValue())); repo.set(pre); User post = repo.get(); assertThat(post, is(not(nullValue()))); assertThat(post.getId(), is(pre.getId())); assertThat(post.getEmail(), is(pre.getEmail())); assertThat(post.getName(), is(pre.getName())); repo.set(null); assertThat(repo.get(), is(nullValue())); }
Source:
public void invoke() { if (dmrAttribute == null) dmrAttribute = identifier; if (rowName != null) page.getResourceManager().selectByName(rowName); ConfigAreaFragment area = page.getConfig(); ConfigFragment fragment; if (tab != null) { area.clickTabByLabel(tab); } fragment = Graphene.createPageFragment(ConfigFragment.class, area.getRoot()); Editor edit = fragment.edit(); if (disclosureLabel != null) { By disclosure = ByJQuery.selector("a.header:has(td:contains('" + disclosureLabel + "'):visible)"); fragment.getRoot().findElement(disclosure).click(); } if (defineFirst) { edit.checkbox(defineIdentifier, true); } if (defineClass) { edit.text(defineClassIdentifier, "clazz"); } for(String i : inputsToClear){ edit.text(i, ""); } switch (type) { case TEXTAREA: edit.text(identifier, String.join("\n", lineValues)); break; case TEXT: edit.text(identifier, stringValue); break; case CHECKBOX: edit.checkbox(identifier, booleanValue); break; case SELECT: edit.select(identifier, stringValue); break; } fragment.saveAndAssert(expectedChange); if (expectedChange) { if (this.insideVerifier == null) { this.insideVerifier = verifier; } switch (type) { case TEXTAREA: insideVerifier.verifyAttribute(dmrAttribute, lineValues); break; case SELECT: case TEXT: insideVerifier.verifyAttribute(dmrAttribute, stringValue); break; case CHECKBOX: insideVerifier.verifyAttribute(dmrAttribute, String.valueOf(booleanValue)); break; } } else { fragment.cancel(); } }

Target:
public void invoke() { if (dmrAttribute == null) dmrAttribute = identifier; if (rowName != null) page.getResourceManager().selectByName(rowName); ConfigAreaFragment area = page.getConfig(); ConfigFragment fragment; if (tab != null) { area.clickTabByLabel(tab); } fragment = Graphene.createPageFragment(ConfigFragment.class, area.getRoot()); Editor edit = fragment.edit(); if (disclosureLabel != null) { By disclosure = ByJQuery.selector("a.header:has(td:contains('" + disclosureLabel + "'):visible)"); fragment.getRoot().findElement(disclosure).click(); } for(String i : inputsToClear){ edit.text(i, ""); } switch (type) { case TEXTAREA: edit.text(identifier, String.join("\n", lineValues)); break; case TEXT: edit.text(identifier, stringValue); break; case CHECKBOX: edit.checkbox(identifier, booleanValue); break; case SELECT: edit.select(identifier, stringValue); break; } boolean finished = fragment.save(); if (expectedChange) { Assert.assertTrue("Config was supposed to be saved successfully, read view should be active.", finished); } else { Assert.assertFalse("Config wasn't supposed to be saved, read-write view should be active.", finished); } if (expectedChange) { if (this.insideVerifier == null) { this.insideVerifier = verifier; } switch (type) { case TEXTAREA: insideVerifier.verifyAttribute(dmrAttribute, lineValues); break; case SELECT: case TEXT: insideVerifier.verifyAttribute(dmrAttribute, stringValue); break; case CHECKBOX: insideVerifier.verifyAttribute(dmrAttribute, String.valueOf(booleanValue)); break; } } else { fragment.cancel(); } }
Source:
protected void encryptData(Property property, boolean encrypt) { if (property.getStoredValue() == null) { return; } String oldValue = String.valueOf(property.getStoredValue()); if (encrypt) { property.setStoredValue(ComponentEncryption.encrypt(oldValue)); } else { if (ComponentEncryption.isEncrypted(oldValue)) { property.setStoredValue(ComponentEncryption.decrypt(oldValue)); return; } super.encryptData(property, encrypt); } }

Target:
protected void encryptData(Property property, boolean encrypt) { if (property.getStoredValue() == null) { return; } String storedValue = String.valueOf(property.getStoredValue()); if (encrypt) { property.setStoredValue(ComponentEncryption.encrypt(storedValue)); } else { if (ComponentEncryption.isEncrypted(storedValue)) { property.setStoredValue(ComponentEncryption.decrypt(storedValue)); } else { super.encryptData(property, encrypt); } } }
Source:
protected Events executeStateAction(final ExecutionContext executionContext) { log.info("Shutting down..."); try { log.info("Attempting to archive job folder..."); final String archiveLocationURIString = jobRequestArguments.getArchiveLocation(); if (!TextUtils.isBlank(archiveLocationURIString)) { archivalService.archive( executionContext.getJobDirectory(), new URI(archiveLocationURIString) ); } else { log.info("Archiving of job folder cannot be done to a empty location"); } log.info("Job folder archived to: " + archiveLocationURIString); } catch (ArchivalException | URISyntaxException e) { log.error("Error archiving job folder", e); } return Events.SHUTDOWN_COMPLETE; }

Target:
protected Events executeStateAction(final ExecutionContext executionContext) { log.info("Shutting down..."); try { final JobSpecification jobSpecification = executionContext.getJobSpecification(); final String archiveLocation = jobSpecification.getArchiveLocation().orElse(null); if (StringUtils.isNotBlank(archiveLocation)) { log.info("Attempting to archive job folder to: " + archiveLocation); archivalService.archive( executionContext.getJobDirectory().toPath(), new URI(archiveLocation) ); } else { log.info("Job folder archival location is empty. Skipping archiving the job folder."); } log.info("Job folder archived to: " + archiveLocation); } catch (ArchivalException | URISyntaxException e) { log.error("Error archiving job folder", e); } return Events.SHUTDOWN_COMPLETE; }
Source:
public void testAddProvidedStorage() throws Exception { BlockInfo blockInfo = new BlockInfoContiguous((short) 3); DatanodeStorageInfo storage = mock(DatanodeStorageInfo.class); when(storage.getStorageType()).thenReturn(StorageType.PROVIDED); boolean added = blockInfo.addStorage(storage, blockInfo); Assert.assertTrue(added); Assert.assertEquals(storage, blockInfo.getStorageInfo(0)); Assert.assertTrue(blockInfo.isProvided()); blockInfo = new BlockInfoContiguous((short) 3); storage = mock(DatanodeStorageInfo.class); when(storage.getStorageType()).thenReturn(StorageType.DISK); added = blockInfo.addStorage(storage, blockInfo); Assert.assertTrue(added); Assert.assertEquals(storage, blockInfo.getStorageInfo(0)); Assert.assertFalse(blockInfo.isProvided()); }

Target:
public void testAddProvidedStorage() throws Exception { BlockInfo blockInfo = new BlockInfoContiguous((short) 3); DatanodeStorageInfo providedStorage = mock(DatanodeStorageInfo.class); when(providedStorage.getStorageType()).thenReturn(StorageType.PROVIDED); boolean added = blockInfo.addStorage(providedStorage, blockInfo); Assert.assertTrue(added); Assert.assertEquals(providedStorage, blockInfo.getStorageInfo(0)); Assert.assertTrue(blockInfo.isProvided()); }
Source:
public boolean doesDataExist(ItemStack itemStack) { return true; }

Target:
public boolean doesDataExist(ItemStack itemStack) { return itemStack.getItem().isDamageable(); }
Source:
public DynamicTabAdapter(Tab tab, Context context) { this.lInflater = LayoutInflater.from(context); this.context = context; this.id_layout = R.layout.form_without_score; this.navigationController = initNavigationController(tab); this.readOnly = Session.getSurvey() != null && !Session.getSurvey().isInProgress(); this.isSwipeAdded=false; if(!readOnly){ Question question=navigationController.getCurrentQuestion(); Value value = question.getValueBySession(); if(value!=null) { comeFromReview(); } } int totalPages=navigationController.getCurrentQuestion().getTotalQuestions(); if(readOnly){ if(Session.getSurvey()!=null){ Question lastQuestion=Session.getSurvey().findLastSavedQuestion(); if(lastQuestion!=null){ totalPages=lastQuestion.getTotalQuestions(); } } } navigationController.setTotalPages(totalPages); isClicked=false; }

Target:
public DynamicTabAdapter(Tab tab, Context context) { this.lInflater = LayoutInflater.from(context); this.context = context; this.id_layout = R.layout.form_without_score; this.navigationController = initNavigationController(tab); this.readOnly = Session.getSurvey() != null && !Session.getSurvey().isInProgress(); this.isSwipeAdded=false; if(!readOnly){ Question question=navigationController.getCurrentQuestion(); if(question.getValueBySession()!=null) { goToLastQuestion(); } } int totalPages=navigationController.getCurrentQuestion().getTotalQuestions(); if(readOnly){ if(Session.getSurvey()!=null){ Question lastQuestion=Session.getSurvey().findLastSavedQuestion(); if(lastQuestion!=null){ totalPages=lastQuestion.getTotalQuestions(); } } } navigationController.setTotalPages(totalPages); isClicked=false; }
Source:
public void init() { final InstanceInfo self = instanceInfoProvider.get(); discoveryClientProvider.get().registerRefreshCallback(new RefreshCallback() { @Override public void postRefresh(DiscoveryClient discoveryClient) { for (Application app : discoveryClient.getApplications().getRegisteredApplications()) { InstanceInfo remoteSelf = app.getByInstanceId(self.getId()); if (remoteSelf != null) { setIsUp(remoteSelf.getStatus().equals(InstanceStatus.UP)); return; } } setIsUp(false); } private void setIsUp(boolean isUp) { if (upStatus.compareAndSet(!isUp, isUp)) { LOG.info("Discovery upStatus change to " + isUp); subject.onNext(isUp); } } }); }

Target:
public void init() { try { eventBus.registerSubscriber(this); currentStatus.compareAndSet(InstanceInfo.InstanceStatus.UNKNOWN, client.getInstanceRemoteStatus()); } catch (InvalidSubscriberException e) { LOG.error("Error registring for discovery status change events.", e); } }
Source:
public Builder(final InfluxDB influxDB) { this.influxDB = (InfluxDB) influxDB; }

Target:
public Builder(final InfluxDB influxDB) { this.influxDB = influxDB; }
Source:
private boolean onlyRepositoryNodesSelected(ISelection selection) { if (selection instanceof IStructuredSelection) { List<?> list = ((IStructuredSelection) selection).toList(); for (Object element : list) { if (!(element instanceof RepositoryNode)) { return false; } } return true; } return false; }

Target:
private boolean onlyRepositoryNodesSelected(ISelection selection) { if (selection instanceof IStructuredSelection) { return ((List<?>) ((IStructuredSelection) selection).toList()) .stream().allMatch(e -> (e instanceof RepositoryNode)); } return false; }
Source:
public void triggerMovementEvent(long timestamp, float positionX, float positionY) { when(motionEvent.getAction()).thenReturn(MotionEvent.ACTION_MOVE); when(motionEvent.getRawX()).thenReturn(positionX); when(motionEvent.getRawY()).thenReturn(positionY); when(timeProvider.elapsedRealtime()).thenReturn(timestamp); when(imageView.getX()).thenReturn(positionX); when(imageView.getY()).thenReturn(positionY); listener.onTouch(imageView, motionEvent, coordinateInterface); }

Target:
public void triggerMovementEvent(long timestamp, float positionX, float positionY) { when(motionEvent.getAction()).thenReturn(MotionEvent.ACTION_MOVE); when(motionEvent.getRawX()).thenReturn(positionX); when(motionEvent.getRawY()).thenReturn(positionY); when(motionEvent.getEventTime()).thenReturn(timestamp); listener.onTouch(imageView, motionEvent, coordinateInterface); when(imageView.getX()).thenReturn(positionX); when(imageView.getY()).thenReturn(positionY); }
Source:
private static void CleanUp() { synchronized (entryIdToKalturaLiveEntryMap) { long currentTime = System.currentTimeMillis(); if (currentTime - lastMapCleanUp > Constants.KALTURA_TIME_BETWEEN_PERSISTENCE_CLEANUP) { try { Set<String> playingEntriesList = Utils.getEntriesFromApplication(_appInstance); Set<String> hashedEntriesList = entryIdToKalturaLiveEntryMap.keySet(); long currTime = System.currentTimeMillis(); for (String entry : hashedEntriesList) { long startTime = (long) getPropertyByEntry(entry, Constants.KALTURA_ENTRY_START_TIME); if ((!playingEntriesList.contains(entry)) && (currTime - startTime > Constants.KALTURA_PERSISTENCE_DATA_MIN_ENTRY_TIME)) { logger.info("Entry " + entry + " no longer exists. Removing it from Persistence Hash Map"); entryIdToKalturaLiveEntryMap.remove(entry); } } lastMapCleanUp = currentTime; } catch (Exception e) { logger.error("Error occurred while cleaning Persistence Data map: " + e); } } else { logger.debug("Persistence hash map was cleaned less than 1 min ago. Ignoring call!"); } } }

Target:
private static void CleanUp() { try { synchronized (entryIdToKalturaLiveEntryMap) { logger.debug("KalturaEntryDataPersistence CleanUp started"); Set<String> playingEntriesList = Utils.getEntriesFromApplication(_appInstance); Set<String> hashedEntriesList = entryIdToKalturaLiveEntryMap.keySet(); long currentTime = System.currentTimeMillis(); for (String entry : hashedEntriesList) { long validationTime = (long)getPropertyByEntry(entry, Constants.KALTURA_ENTRY_VALIDATED_TIME); if (!playingEntriesList.contains(entry)) { logger.info("(" + entry + ") Entry is no longer playing!"); int minTimeInMap = Constants.KALTURA_PERSISTENCE_DATA_MIN_ENTRY_TIME; if (currentTime - validationTime > minTimeInMap) { logger.info("(" + entry + ") Entry validation time is greater than " + minTimeInMap / 1000 + " seconds; Removing it from Map!"); entryIdToKalturaLiveEntryMap.remove(entry); } } } } } catch (Exception e) { logger.error("Error occurred while cleaning Persistence Data map: " + e); } }
Source:
public void testIsComplexNonExpression() { assertTrue(!isComplexTemplate("something")); }

Target:
public void testIsComplexNonExpression() { assertFalse(isComplexTemplate("something")); }
Source:
public Map<String, Object> apply(ServerOAuth2AuthorizeRequest authorizeRequest) { Map<String, Object> contextAttributes = new HashMap<>(); String scope = authorizeRequest.getServerWebExchange().getRequest().getQueryParams().getFirst(OAuth2ParameterNames.SCOPE); if (StringUtils.hasText(scope)) { contextAttributes.put(OAuth2AuthorizationContext.REQUEST_SCOPE_ATTRIBUTE_NAME, StringUtils.delimitedListToStringArray(scope, " ")); } String username = authorizeRequest.getServerWebExchange().getRequest().getQueryParams().getFirst(OAuth2ParameterNames.USERNAME); String password = authorizeRequest.getServerWebExchange().getRequest().getQueryParams().getFirst(OAuth2ParameterNames.PASSWORD); if (StringUtils.hasText(username) && StringUtils.hasText(password)) { contextAttributes.put(OAuth2AuthorizationContext.USERNAME_ATTRIBUTE_NAME, username); contextAttributes.put(OAuth2AuthorizationContext.PASSWORD_ATTRIBUTE_NAME, password); } return contextAttributes; }

Target:
public Mono<Map<String, Object>> apply(ServerOAuth2AuthorizeRequest authorizeRequest) { Map<String, Object> contextAttributes = new HashMap<>(); String scope = authorizeRequest.getServerWebExchange().getRequest().getQueryParams().getFirst(OAuth2ParameterNames.SCOPE); if (StringUtils.hasText(scope)) { contextAttributes.put(OAuth2AuthorizationContext.REQUEST_SCOPE_ATTRIBUTE_NAME, StringUtils.delimitedListToStringArray(scope, " ")); } return Mono.just(contextAttributes); }
Source:
public void truncate(long toDeleteInclusive) { lock.writeLock().lock(); try { long greatestLogEntry = getGreatestLogEntry(); if (greatestLogEntry >= 0) { toDeleteInclusive = Math.min(greatestLogEntry - 1, toDeleteInclusive); } File dir = new File(path); List<File> files = getLogEntries(dir); files.sort(nameAsLongComparator()); for (File file : files) { long fileSeq = getSeqFromFilename(file); if (fileSeq <= toDeleteInclusive) { if (!file.delete()) { log.warn("failed to delete log file {}", file.getAbsolutePath()); } } else { break; } } } finally { lock.writeLock().unlock(); } }

Target:
public void truncate(long toDeleteInclusive) { lock.writeLock().lock(); try { long greatestLogEntry = getGreatestLogEntry(); if (greatestLogEntry >= 0) { toDeleteInclusive = Math.min(greatestLogEntry - 1, toDeleteInclusive); } File dir = new File(path); List<File> files = getLogEntries(dir); files.sort(nameAsLongComparator()); for (File file : files) { long fileSeq = getSeqFromFilename(file); if (fileSeq <= toDeleteInclusive) { deleteLogFile(file); } else { break; } } } finally { lock.writeLock().unlock(); } }
Source:
protected void deleteDataFiles() throws IOException { String pathToJsonFile = getPathToTestDataFile(getJsonDataPath()); String pathToCsvFile = getPathToTestDataFile(getCsvConfigPath()); String pathToStatisticsJsonFile = getPathToStatisticsResultsFile(); Files.delete(Paths.get(pathToJsonFile)); Files.delete(Paths.get(pathToCsvFile)); Files.delete(Paths.get(pathToStatisticsJsonFile)); }

Target:
protected void deleteDataFiles() throws IOException { String pathToJsonFile = getPathToTestDataFile(getJsonDataPath()); String pathToCsvFile = getPathToTestDataFile(getCsvConfigPath()); Files.delete(Paths.get(pathToJsonFile)); Files.delete(Paths.get(pathToCsvFile)); }
Source:
public void testHaplotypeMapLiftover() throws Exception { Map<String, Interval> hg19 = new HashMap<>(); hg19.put("rs1210110", new Interval("1", 14096821, 14096821)); hg19.put("rs7555566", new Interval("1", 14804874, 14804874)); hg19.put("rs1364054", new Interval("2", 8178735, 8178735)); hg19.put("rs6734275", new Interval("2", 67241174, 67241174)); hg19.put("rs7584993", new Interval("2", 223845942, 223845942)); final File tmp = File.createTempFile("hg19Map", ".txt"); tmp.deleteOnExit(); new LiftOverHaplotypeMap().instanceMain(new String[] {"INPUT=" + HG18_HAPLOTYPE_MAP, "OUTPUT=" + tmp.getAbsolutePath(), "SEQUENCE_DICTIONARY=" + HG_19_SD, "CHAIN=" + CHAIN }); final HaplotypeMap results = new HaplotypeMap(tmp); final SamReader samReader = SamReaderFactory.makeDefault().open(new File(HG_19_SD)); SequenceUtil.assertSequenceDictionariesEqual( results.getHeader().getSequenceDictionary(), samReader.getFileHeader().getSequenceDictionary()); for (Snp snp : results.getAllSnps()) { Interval i = hg19.remove(snp.getName()); Assert.assertNotNull(i, "No lifted-over interval found for Snp: " + snp.getName()); Assert.assertEquals(snp.getChrom(), i.getContig(), "Sequence doesn't match for " + snp.getName()); Assert.assertEquals(snp.getPos(), i.getStart(), "Start position doesn't match for " + snp.getName()); } Assert.assertEquals(hg19.size(), 0, "Extra intervals remain after liftover: " + hg19); CloserUtil.close(samReader); }

Target:
public void testHaplotypeMapLiftover() throws Exception { Map<String, Interval> hg19 = new HashMap<>(); hg19.put("rs1210110", new Interval("1", 14096821, 14096821)); hg19.put("rs7555566", new Interval("1", 14804874, 14804874)); hg19.put("rs1364054", new Interval("2", 8178735, 8178735)); hg19.put("rs6734275", new Interval("2", 67241174, 67241174)); hg19.put("rs7584993", new Interval("2", 223845942, 223845942)); final File tmp = File.createTempFile("hg19Map", ".txt"); tmp.deleteOnExit(); new LiftOverHaplotypeMap().instanceMain(new String[]{"INPUT=" + HG18_HAPLOTYPE_MAP, "OUTPUT=" + tmp.getAbsolutePath(), "SEQUENCE_DICTIONARY=" + HG_19_SD, "CHAIN=" + CHAIN}); final HaplotypeMap results = new HaplotypeMap(tmp); try(final SamReader samReader = SamReaderFactory.makeDefault().open(new File(HG_19_SD))) { SequenceUtil.assertSequenceDictionariesEqual( results.getHeader().getSequenceDictionary(), samReader.getFileHeader().getSequenceDictionary()); for (Snp snp : results.getAllSnps()) { Interval i = hg19.remove(snp.getName()); Assert.assertNotNull(i, "No lifted-over interval found for Snp: " + snp.getName()); Assert.assertEquals(snp.getChrom(), i.getContig(), "Sequence doesn't match for " + snp.getName()); Assert.assertEquals(snp.getPos(), i.getStart(), "Start position doesn't match for " + snp.getName()); } Assert.assertEquals(hg19.size(), 0, "Extra intervals remain after liftover: " + hg19); } }
Source:
public void synchToRange(final TmfRangeSynchSignal signal) { if (signal.getSource() == this || fTrace == null) { return; } if (signal.getCurrentRange().getIntersection(fTrace.getTimeRange()) == null) { return; } final long startTime = signal.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); final long endTime = signal.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphCombo.isDisposed()) { return; } fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(startTime, endTime); startZoomThread(startTime, endTime); } }); }

Target:
public void synchToRange(final TmfRangeSynchSignal signal) { if (signal.getSource() == this || fTrace == null) { return; } if (signal.getCurrentRange().getIntersection(fTrace.getTimeRange()) == null) { return; } final long startTime = signal.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); final long endTime = signal.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphWrapper.isDisposed()) { return; } fTimeGraphWrapper.getTimeGraphViewer().setStartFinishTime(startTime, endTime); startZoomThread(startTime, endTime); } }); }
Source:
public void testWithArrayCreateFullIdentWithArrayDeclare() { final DetailAST ast = new DetailAST(); ast.setType(TokenTypes.ARRAY_DECLARATOR); ast.setColumnNo(18); ast.setLineNo(15); ast.setText("["); final DetailAST ast1 = new DetailAST(); ast1.setType(TokenTypes.LITERAL_INT); ast1.setColumnNo(14); ast1.setLineNo(15); ast1.setText("int"); final DetailAST ast2 = new DetailAST(); ast2.setType(TokenTypes.RBRACK); ast2.setText("]"); final DetailAST ast3 = new DetailAST(); ast3.setType(TokenTypes.ARRAY_DECLARATOR); ast3.setText("["); final DetailAST ast4 = new DetailAST(); ast4.setType(TokenTypes.RBRACK); ast4.setText("]"); ast.addChild(ast1); ast3.addChild(ast); ast1.setNextSibling(ast2); ast.setNextSibling(ast4); final FullIdent indent = FullIdent.createFullIdent(ast3); Assert.assertEquals("Invalid full indent", "int[][][15x14]", indent.toString()); }

Target:
public void testWithArrayCreateFullIdentWithArrayDeclare() throws Exception { final FileText testFileText = new FileText( new File(getPath("InputFullIdentTestArrayType.java")).getAbsoluteFile(), System.getProperty("file.encoding", StandardCharsets.UTF_8.name())); final DetailAST packageDefinitionNode = JavaParser.parse(new FileContents(testFileText)); final DetailAST arrayDeclarator = packageDefinitionNode.getNextSibling() .findFirstToken(TokenTypes.OBJBLOCK) .findFirstToken(TokenTypes.VARIABLE_DEF) .findFirstToken(TokenTypes.TYPE) .getFirstChild(); final FullIdent ident = FullIdent.createFullIdent(arrayDeclarator); Assert.assertEquals("Invalid full indent", "int[][][5x12]", ident.toString()); }
Source:
private void checkForTVFileConversion(String externalID) { if (SageConstants.PVR && Sage.getBoolean("enable_converting_imported_videos_to_tv_recordings", true) && (externalID.startsWith("EP") || externalID.startsWith("SH") || externalID.startsWith("SP") || externalID.startsWith("MV") || externalID.startsWith("DT") || externalID.startsWith("IE") || externalID.startsWith("IM"))) { if (generalType != MEDIAFILE_LOCAL_PLAYBACK) generalType = MEDIAFILE_TV; addMediaMask(MEDIA_MASK_TV); } }

Target:
private void checkForTVFileConversion(String externalID) { if (Sage.getBoolean("enable_converting_imported_videos_to_tv_recordings", true) && (externalID.startsWith("EP") || externalID.startsWith("SH") || externalID.startsWith("SP") || externalID.startsWith("MV") || externalID.startsWith("DT") || externalID.startsWith("IE") || externalID.startsWith("IM"))) { if (generalType != MEDIAFILE_LOCAL_PLAYBACK) generalType = MEDIAFILE_TV; addMediaMask(MEDIA_MASK_TV); } }
Source:
public static PypiWheelArtifactCoordinates parse(String path) { String[] splitArray = path.split("-"); if (splitArray.length != 5 && splitArray.length != 6) { throw new IllegalArgumentException("Invalid Wheel filename specified"); } String distribution = splitArray[0]; String version = splitArray[1]; String build = ""; String lang_impl_version = ""; String abi = ""; String platform = ""; if (splitArray.length == 5) { lang_impl_version = splitArray[2]; abi = splitArray[3]; platform = splitArray[4].substring(0, splitArray[4].indexOf(".whl")); } else if (splitArray.length == 6) { build = splitArray[2]; lang_impl_version = splitArray[3]; abi = splitArray[4]; platform = splitArray[5].substring(0, splitArray[5].indexOf(".whl")); } return new PypiWheelArtifactCoordinates(distribution, version, build, lang_impl_version, abi, platform); }

Target:
public static PypiWheelArtifactCoordinates parse(String path) { String[] splitArray = path.split("-"); if (splitArray.length != 5 && splitArray.length != 6) { throw new IllegalArgumentException("Invalid Wheel filename specified"); } String distribution = splitArray[0]; String version = splitArray[1]; String build = ""; String languageImplementationVersion; String abi; String platform; if (splitArray.length == 5) { languageImplementationVersion = splitArray[2]; abi = splitArray[3]; platform = splitArray[4].substring(0, splitArray[4].indexOf(".whl")); } else { build = splitArray[2]; languageImplementationVersion = splitArray[3]; abi = splitArray[4]; platform = splitArray[5].substring(0, splitArray[5].indexOf(".whl")); } return new PypiWheelArtifactCoordinates(distribution, version, build, languageImplementationVersion, abi, platform); }
Source:
private void reply(final HttpServletResponse rsp, final byte[] result) throws IOException { nocache(rsp); rsp.setContentType(RSP_TYPE); rsp.setContentLength(result.length); final OutputStream os = rsp.getOutputStream(); try { os.write(result); } finally { os.close(); } }

Target:
private void reply(final HttpServletResponse rsp, final byte[] result) throws IOException { nocache(rsp); rsp.setContentType(RSP_TYPE); rsp.setContentLength(result.length); final OutputStream os = rsp.getOutputStream(); try { os.write(result); os.flush(); } finally { os.close(); } }
Source:
public void teardown() throws Exception { if (lifeCycleManager != null) { lifeCycleManager.stop(); } }

Target:
public void teardown() throws Exception { if (lifeCycleManager != null) { lifeCycleManager.stop(); lifeCycleManager = null; } }
Source:
private URI createContentRoot(URI contentUri) { String contentRootString = URIUtil.join( contentUri, RepositoryPathConstants.CONTENT_ROOT_ID); URI contentRootUri = URI.create(contentRootString); if (objectExists(contentRootUri)) { return contentUri; } Model model = ModelFactory.createDefaultModel(); Resource resc = model.createResource(contentRootString); resc.addProperty(DC.title, "Content Collections Root"); objFactory.createContentRootObject(contentRootUri, model); return contentRootUri; }

Target:
private URI createContentRoot(URI contentUri) { String contentRootString = URIUtil.join( contentUri, RepositoryPathConstants.CONTENT_ROOT_ID); URI contentRootUri = URI.create(contentRootString); if (objectExists(contentRootUri)) { return contentRootUri; } Model model = ModelFactory.createDefaultModel(); Resource resc = model.createResource(contentRootString); resc.addProperty(DC.title, "Content Collections Root"); objFactory.createContentRootObject(contentRootUri, model); return contentRootUri; }
Source:
public static void setUpTsc() throws Exception { if (!TSC.toFile().exists()) { System.err.println("Installing typescript..."); runChecked("npm", "install", "typescript@1.8.0"); } }

Target:
public static void setUpTsc() throws Exception { if (!TSC.toFile().exists()) { System.err.println("Installing typescript..."); runChecked("npm", "install", "typescript@1.8.7"); } }
Source:
private Sets.SetView<Symbol> extractInliningTargets(ProjectNode parent, ProjectNode child) { Set<Symbol> childOutputSet = ImmutableSet.copyOf(child.getOutputSymbols()); Map<Symbol, Long> dependencies = parent.getAssignments() .getExpressions().stream() .flatMap(expression -> SymbolsExtractor.extractAll(expression).stream()) .filter(childOutputSet::contains) .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); Set<Symbol> constants = dependencies.keySet().stream() .filter(input -> child.getAssignments().get(input) instanceof Literal) .collect(toSet()); Set<Symbol> tryArguments = parent.getAssignments() .getExpressions().stream() .flatMap(expression -> extractTryArguments(expression).stream()) .collect(toSet()); Set<Symbol> singletons = dependencies.entrySet().stream() .filter(entry -> entry.getValue() == 1) .filter(entry -> !tryArguments.contains(entry.getKey())) .filter(entry -> !child.getAssignments().isIdentity(entry.getKey())) .filter(entry -> !(child.getAssignments().get(entry.getKey()) instanceof DereferenceExpression)) .map(Map.Entry::getKey) .collect(toSet()); return Sets.union(singletons, constants); }

Target:
private Sets.SetView<Symbol> extractInliningTargets(ProjectNode parent, ProjectNode child) { Set<Symbol> childOutputSet = ImmutableSet.copyOf(child.getOutputSymbols()); Map<Symbol, Long> dependencies = parent.getAssignments() .getExpressions().stream() .flatMap(expression -> SymbolsExtractor.extractAll(expression).stream()) .filter(childOutputSet::contains) .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); Set<Symbol> constants = dependencies.keySet().stream() .filter(input -> child.getAssignments().get(input) instanceof Literal) .collect(toSet()); Set<Symbol> tryArguments = parent.getAssignments() .getExpressions().stream() .flatMap(expression -> extractTryArguments(expression).stream()) .collect(toSet()); Set<Symbol> singletons = dependencies.entrySet().stream() .filter(entry -> entry.getValue() == 1) .filter(entry -> !tryArguments.contains(entry.getKey())) .filter(entry -> !child.getAssignments().isIdentity(entry.getKey())) .map(Map.Entry::getKey) .collect(toSet()); return Sets.union(singletons, constants); }
Source:
public void run() { try { if (!pickledGraphite.isConnected()) { log.info("trying to connect to graphite server"); pickledGraphite.connect(); } while (eventsQueue.size() > 0 && !exec.isShutdown()) { try { final GraphiteEvent graphiteEvent = eventsQueue.poll(graphiteEmitterConfig.getEmitWaitTime(), TimeUnit.MILLISECONDS); if (graphiteEvent != null) { log.debug( "sent [%s] with value [%s] and time [%s]", graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); pickledGraphite.send( graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); } } catch (InterruptedException | IOException e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } pickledGraphite.flush(); } catch (Exception e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } }

Target:
public void run() { try { if (!pickledGraphite.isConnected()) { log.info("trying to connect to graphite server"); pickledGraphite.connect(); } while (eventsQueue.size() > 0 && !exec.isShutdown()) { try { final GraphiteEvent graphiteEvent = eventsQueue.poll( graphiteEmitterConfig.getWaitForEventTime(), TimeUnit.MILLISECONDS ); if (graphiteEvent != null) { log.debug( "sent [%s] with value [%s] and time [%s]", graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); pickledGraphite.send( graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); } } catch (InterruptedException | IOException e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } pickledGraphite.flush(); } catch (Exception e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } }
Source:
private ModelAndView generateJsonLd(FullBean bean, RequestData data, HttpServletResponse response) { OutputStream outputStream = new ByteArrayOutputStream(); String rdf = EdmUtils.toEDM((FullBeanImpl) bean); try (InputStream rdfInput = IOUtils.toInputStream(rdf)) { Model modelResult = ModelFactory.createDefaultModel().read(rdfInput, "", "RDF/XML"); if (StringUtils.equalsIgnoreCase(data.profile, "compacted")) { DatasetGraph graph = DatasetFactory.wrap(modelResult).asDatasetGraph(); PrefixMap pm = RiotLib.prefixMap(graph); JsonLDWriteContext ctx = new JsonLDWriteContext(); ctx.setJsonLDContext(ObjectController.jsonldContext); WriterDatasetRIOT writer = RDFDataMgr.createDatasetWriter(RDFFormat.JSONLD_FLATTEN_PRETTY); writer.write(outputStream, graph, pm, null, ctx); } else if (StringUtils.equalsIgnoreCase(data.profile, "flattened")) { RDFDataMgr.write(outputStream, modelResult, RDFFormat.JSONLD_FLAT); } else if (StringUtils.equalsIgnoreCase(data.profile, "normalized")) { RDFDataMgr.write(outputStream, modelResult, RDFFormat.JSONLD_PRETTY); } } catch (IOException e) { LOG.error("Error parsing JSON-LD data", e); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return JsonUtils.toJson(new ApiError(data.wskey, e.getClass().getSimpleName() + ": " + e.getMessage()), data.callback); } return JsonUtils.toJsonLd(outputStream.toString(), data.callback); }

Target:
private ModelAndView generateJsonLd(FullBean bean, RequestData data, HttpServletResponse response) { String rdf = EdmUtils.toEDM((FullBeanImpl) bean); try (InputStream rdfInput = IOUtils.toInputStream(rdf); OutputStream outputStream = new ByteArrayOutputStream()) { Model modelResult = ModelFactory.createDefaultModel().read(rdfInput, "", "RDF/XML"); DatasetGraph graph = DatasetFactory.wrap(modelResult).asDatasetGraph(); PrefixMap pm = RiotLib.prefixMap(graph); JsonLDWriteContext ctx = new JsonLDWriteContext(); ctx.setJsonLDContext(ObjectController.jsonldContext); WriterDatasetRIOT writer = RDFDataMgr.createDatasetWriter(RDFFormat.JSONLD_FLAT); writer.write(outputStream, graph, pm, null, ctx); return JsonUtils.toJsonLd(outputStream.toString(), data.callback); } catch (IOException e) { LOG.error("Error parsing JSON-LD data", e); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return JsonUtils.toJson(new ApiError(data.apikey, e.getClass().getSimpleName() + ": " + e.getMessage()), data.callback); } }
Source:
public PatientData<String> load(Patient patient) { try { XWikiDocument doc = (XWikiDocument) this.documentAccessBridge.getDocument(patient.getDocument()); Map<String, String> result = new LinkedHashMap<String, String>(); SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd"); result.put(DOCUMENT_NAME, doc.getDocumentReference().getName()); result.put(REFERRER, (doc.getCreatorReference() != null) ? doc.getCreatorReference().getName() : UNKNOWN_USER); result.put(CREATION_DATE, format.format(doc.getCreationDate())); result.put(AUTHOR, (doc.getAuthorReference() != null) ? doc.getAuthorReference().getName() : UNKNOWN_USER); result.put(DATE, format.format(doc.getDate())); return new DictionaryPatientData<>(getName(), result); } catch (Exception e) { this.logger.error("Could not find requested document or some unforeseen" + " error has occurred during controller loading ", e.getMessage()); } return null; }

Target:
public PatientData<String> load(Patient patient) { try { XWikiDocument doc = (XWikiDocument) this.documentAccessBridge.getDocument(patient.getDocument()); Map<String, String> result = new LinkedHashMap<String, String>(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); result.put(DOCUMENT_NAME, doc.getDocumentReference().getName()); result.put(REFERRER, (doc.getCreatorReference() != null) ? doc.getCreatorReference().getName() : UNKNOWN_USER); result.put(CREATION_DATE, format.format(doc.getCreationDate())); result.put(AUTHOR, (doc.getAuthorReference() != null) ? doc.getAuthorReference().getName() : UNKNOWN_USER); result.put(DATE, format.format(doc.getDate())); return new DictionaryPatientData<>(getName(), result); } catch (Exception e) { this.logger.error("Could not find requested document or some unforeseen" + " error has occurred during controller loading ", e.getMessage()); } return null; }
Source:
public boolean keyPressed(KeyEvent event) { AdvancedScrollingGraphicalViewer viewer = (AdvancedScrollingGraphicalViewer) getViewer(); if (event.keyCode == SWT.ARROW_DOWN) { viewer.scrollByOffset(0, 400); return true; } if (event.keyCode == SWT.ARROW_UP) { viewer.scrollByOffset(0, -400); return true; } if (event.keyCode == SWT.ARROW_RIGHT) { viewer.scrollByOffset(400, 0); return true; } if (event.keyCode == SWT.ARROW_LEFT) { viewer.scrollByOffset(-400, 0); return true; } if (event.keyCode == SWT.PAGE_DOWN) { org.eclipse.swt.graphics.Point canvasSize = viewer.getFigureCanvasSize(); if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { viewer.scrollByOffset(0, canvasSize.y); return true; } else { viewer.scrollByOffset(canvasSize.x, 0); return true; } } if (event.keyCode == SWT.PAGE_UP) { org.eclipse.swt.graphics.Point canvasSize = viewer.getFigureCanvasSize(); if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { viewer.scrollByOffset(0, -canvasSize.y); return true; } else { viewer.scrollByOffset(-canvasSize.x, 0); return true; } } return super.keyPressed(event); }

Target:
public boolean keyPressed(KeyEvent event) { switch (event.keyCode) { case SWT.ARROW_DOWN: getViewer().scrollByOffset(0, 400); return true; case SWT.ARROW_UP: getViewer().scrollByOffset(0, -400); return true; case SWT.ARROW_RIGHT: getViewer().scrollByOffset(400, 0); return true; case SWT.ARROW_LEFT: getViewer().scrollByOffset(-400, 0); return true; case SWT.PAGE_DOWN: if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { getViewer().scrollByOffset(0, getViewer().getFigureCanvasSize().y); } else { getViewer().scrollByOffset(getViewer().getFigureCanvasSize().x, 0); } return true; case SWT.PAGE_UP: if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { getViewer().scrollByOffset(0, -getViewer().getFigureCanvasSize().y); } else { getViewer().scrollByOffset(-getViewer().getFigureCanvasSize().x, 0); } return true; default: return super.keyPressed(event); } }
Source:
public void publishSegments(final String tableName, final List<DataSegment> segments, final ObjectMapper mapper) { dbi.withHandle( new HandleCallback<Void>() { @Override public Void withHandle(Handle handle) throws Exception { final PreparedBatch batch = handle.prepareBatch( String.format( "INSERT INTO %s (id, dataSource, created_date, start, \"end\", partitioned, version, used, payload) " + "VALUES (:id, :dataSource, :created_date, :start, :end, :partitioned, :version, :used, :payload)", tableName ) ); for (final DataSegment segment : segments) { batch.add( new ImmutableMap.Builder<String, Object>() .put("id", segment.getIdentifier()) .put("dataSource", segment.getDataSource()) .put("created_date", new DateTime().toString()) .put("start", segment.getInterval().getStart().toString()) .put("end", segment.getInterval().getEnd().toString()) .put("partitioned", (segment.getShardSpec() instanceof NoneShardSpec) ? false : true) .put("version", segment.getVersion()) .put("used", true) .put("payload", mapper.writeValueAsString(segment).getBytes()) .build() ); log.info("Published %s", segment.getIdentifier()); } batch.execute(); return null; } } ); }

Target:
public void publishSegments(final String tableName, final List<DataSegment> segments, final ObjectMapper mapper) { dbi.withHandle( new HandleCallback<Void>() { @Override public Void withHandle(Handle handle) throws Exception { final PreparedBatch batch = handle.prepareBatch( String.format( "INSERT INTO %s (id, dataSource, created_date, start, \"end\", partitioned, version, used, payload) " + "VALUES (:id, :dataSource, :created_date, :start, :end, :partitioned, :version, :used, :payload)", tableName ) ); for (final DataSegment segment : segments) { batch.add( new ImmutableMap.Builder<String, Object>() .put("id", segment.getIdentifier()) .put("dataSource", segment.getDataSource()) .put("created_date", new DateTime().toString()) .put("start", segment.getInterval().getStart().toString()) .put("end", segment.getInterval().getEnd().toString()) .put("partitioned", (segment.getShardSpec() instanceof NoneShardSpec) ? false : true) .put("version", segment.getVersion()) .put("used", true) .put("payload", mapper.writeValueAsBytes(segment)) .build() ); log.info("Published %s", segment.getIdentifier()); } batch.execute(); return null; } } ); }
Source:
public Template update(Template incoming) { validateEnums(Template.class, incoming); if (incoming.isSetPlacementPolicy() && incoming.getPlacementPolicy().isSetHost()) { Host host = incoming.getPlacementPolicy().getHost(); if (host.isSetName() && !host.isSetId()) { host.setId(getHostId(host).toString()); } } return performUpdate(incoming, new QueryIdResolver<Guid>(VdcQueryType.GetVmTemplate, GetVmTemplateParameters.class), VdcActionType.UpdateVmTemplate, new UpdateParametersProvider()); }

Target:
public Template update(Template incoming) { validateEnums(Template.class, incoming); if (!isFiltered()) { if (incoming.isSetPlacementPolicy() && incoming.getPlacementPolicy().isSetHost() && incoming.getPlacementPolicy().getHost().isSetName() && !incoming.getPlacementPolicy().getHost().isSetId()) { incoming.getPlacementPolicy().getHost().setId(getHostId(incoming.getPlacementPolicy().getHost()).toString()); } } else { incoming.setPlacementPolicy(null); } return performUpdate(incoming, new QueryIdResolver<Guid>(VdcQueryType.GetVmTemplate, GetVmTemplateParameters.class), VdcActionType.UpdateVmTemplate, new UpdateParametersProvider()); }
Source:
public boolean hasNext() { while (next == null && iterator.isValid()) { next = new AbstractMap.SimpleEntry( serializer.deserialize(Unpooled.wrappedBuffer(iterator.key()), null), serializer.deserialize(Unpooled.wrappedBuffer(iterator.value()), null)); iterator.next(); checkInvariants(); } return next != null; }

Target:
public boolean hasNext() { if (next == null && wrappedRocksIterator.isOpen() && wrappedRocksIterator.isValid()) { next = new AbstractMap.SimpleEntry( serializer.deserialize(Unpooled.wrappedBuffer(wrappedRocksIterator.key()), null), serializer.deserialize(Unpooled.wrappedBuffer(wrappedRocksIterator.value()), null)); wrappedRocksIterator.next(); } if (next == null && wrappedRocksIterator.isOpen()) { wrappedRocksIterator.close(); readOptions.close(); } return next != null; }
Source:
public static Retryer<Boolean> makeSlackMessageSendingRetryer() { return RetryerBuilder.<Boolean>newBuilder() .retryIfResult(Predicates.equalTo(Boolean.FALSE)) .withWaitStrategy(WaitStrategies.exponentialWait(3000, TimeUnit.MILLISECONDS)) .build(); }

Target:
public static Retryer<Boolean> makeSlackMessageSendingRetryer() { return RetryerBuilder.<Boolean>newBuilder() .retryIfResult(Predicates.equalTo(Boolean.FALSE)) .withWaitStrategy(WaitStrategies.fixedWait(1, TimeUnit.SECONDS)) .withStopStrategy(StopStrategies.stopAfterAttempt(3)) .build(); }