auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void TestATFDelayBTF(String wikiName, String article, int delaySec, boolean isWgVarOn) throws InterruptedException { PageObjectLogging.log("wgAdDriverDelayBelowTheFold", String.valueOf(isWgVarOn), true); String testedPage = urlBuilder.getUrlForPath(wikiName, article); AdsBaseObject adsBaseObject = new AdsBaseObject(driver, testedPage, PAGE_SIZE); adsBaseObject.waitPageLoaded(); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.MEDREC)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.TOP_LB)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.INVISIBLE_SKIN)); if (isWgVarOn) { Assertion.assertFalse(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.PREFOOTER_LEFT)); Assertion.assertFalse(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.PREFOOTER_RIGHT)); Assertion.assertFalse(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.LEFT_SKYSCRAPPER_3)); Assertion.assertFalse(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.FLOATING_MEDREC)); Thread.sleep(1000 * delaySec); } Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.PREFOOTER_LEFT)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.PREFOOTER_RIGHT)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.LEFT_SKYSCRAPPER_3)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.FLOATING_MEDREC)); }

Target:
public void TestATFDelayBTF(String wikiName, String article, int delaySec, boolean isWgVarOn) throws InterruptedException { PageObjectLogging.log("wgAdDriverDelayBelowTheFold", String.valueOf(isWgVarOn), true); String testedPage = urlBuilder.getUrlForPath(wikiName, article); AdsBaseObject adsBaseObject = new AdsBaseObject(driver, testedPage, PAGE_SIZE); adsBaseObject.waitPageLoaded(); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.MEDREC)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.TOP_LB)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.INVISIBLE_SKIN)); if (isWgVarOn) { Assertion.assertFalse(adsBaseObject.isSlotOnPageLoaded(AdsContent.PREFOOTER_LEFT)); Assertion.assertFalse(adsBaseObject.isSlotOnPageLoaded(AdsContent.PREFOOTER_RIGHT)); Assertion.assertFalse(adsBaseObject.isSlotOnPageLoaded(AdsContent.LEFT_SKYSCRAPPER_3)); Assertion.assertFalse(adsBaseObject.isSlotOnPageLoaded(AdsContent.FLOATING_MEDREC)); Thread.sleep(1000 * delaySec); } Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.PREFOOTER_LEFT)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.PREFOOTER_RIGHT)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.LEFT_SKYSCRAPPER_3)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.FLOATING_MEDREC)); }
Source:
public static String validateContribQnGiverRecipient( FeedbackQuestionAttributes updatedQuestion) { if(updatedQuestion.questionType == FeedbackQuestionType.CONTRIB) { String errorMsg = ""; if(FeedbackParticipantType.STUDENTS != updatedQuestion.giverType) { log.severe("Unexpected giverType for contribution question: " + updatedQuestion.giverType + " (forced to :" + FeedbackParticipantType.STUDENTS + ")"); updatedQuestion.giverType = FeedbackParticipantType.STUDENTS; errorMsg = ERROR_CONTRIB_QN_INVALID_FEEDBACK_PATH; } if(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF != updatedQuestion.recipientType) { log.severe("Unexpected recipientType for contribution question: " + updatedQuestion.recipientType + " (forced to :" + FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF + ")"); updatedQuestion.recipientType = FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF; errorMsg = ERROR_CONTRIB_QN_INVALID_FEEDBACK_PATH; } Assumption.assertTrue("Contrib Qn Invalid visibility options", (updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER) == updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) && (updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) == updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.OWN_TEAM_MEMBERS)))); return errorMsg; } else { return ""; } }

Target:
public static String validateContribQnGiverRecipient( FeedbackQuestionAttributes updatedQuestion) { if(updatedQuestion.questionType != FeedbackQuestionType.CONTRIB){ return ""; } String errorMsg = ""; if(FeedbackParticipantType.STUDENTS != updatedQuestion.giverType) { log.severe("Unexpected giverType for contribution question: " + updatedQuestion.giverType + " (forced to :" + FeedbackParticipantType.STUDENTS + ")"); updatedQuestion.giverType = FeedbackParticipantType.STUDENTS; errorMsg = ERROR_CONTRIB_QN_INVALID_FEEDBACK_PATH; } if(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF != updatedQuestion.recipientType) { log.severe("Unexpected recipientType for contribution question: " + updatedQuestion.recipientType + " (forced to :" + FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF + ")"); updatedQuestion.recipientType = FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF; errorMsg = ERROR_CONTRIB_QN_INVALID_FEEDBACK_PATH; } Assumption.assertTrue("Contrib Qn Invalid visibility options", (updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER) == updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) && (updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) == updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.OWN_TEAM_MEMBERS)))); return errorMsg; }
Source:
public <K> AbstractKeyedStateBackend<K> createKeyedStateBackend( Environment env, JobID jobID, String operatorIdentifier, TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, MetricGroup metricGroup, @Nonnull Collection<KeyedStateHandle> stateHandles, CloseableRegistry cancelStreamRegistry) throws BackendBuildingException { TaskStateManager taskStateManager = env.getTaskStateManager(); LocalRecoveryConfig localRecoveryConfig = taskStateManager.createLocalRecoveryConfig(); HeapPriorityQueueSetFactory priorityQueueSetFactory = new HeapPriorityQueueSetFactory(keyGroupRange, numberOfKeyGroups, 128); ReadableConfig config = env.getTaskManagerInfo().getConfiguration(); int fsReadBufferSize = config.get(CheckpointingOptions.FS_READ_BUFFER_SIZE); return new HeapKeyedStateBackendBuilder<>( kvStateRegistry, keySerializer, env.getUserCodeClassLoader().asClassLoader(), numberOfKeyGroups, keyGroupRange, env.getExecutionConfig(), fsReadBufferSize, ttlTimeProvider, stateHandles, AbstractStateBackend.getCompressionDecorator(env.getExecutionConfig()), localRecoveryConfig, priorityQueueSetFactory, isUsingAsynchronousSnapshots(), cancelStreamRegistry).build(); }

Target:
public <K> AbstractKeyedStateBackend<K> createKeyedStateBackend( Environment env, JobID jobID, String operatorIdentifier, TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, MetricGroup metricGroup, @Nonnull Collection<KeyedStateHandle> stateHandles, CloseableRegistry cancelStreamRegistry) throws BackendBuildingException { TaskStateManager taskStateManager = env.getTaskStateManager(); LocalRecoveryConfig localRecoveryConfig = taskStateManager.createLocalRecoveryConfig(); HeapPriorityQueueSetFactory priorityQueueSetFactory = new HeapPriorityQueueSetFactory(keyGroupRange, numberOfKeyGroups, 128); return new HeapKeyedStateBackendBuilder<>( kvStateRegistry, keySerializer, env.getUserCodeClassLoader().asClassLoader(), numberOfKeyGroups, keyGroupRange, env.getExecutionConfig(), ttlTimeProvider, stateHandles, AbstractStateBackend.getCompressionDecorator(env.getExecutionConfig()), localRecoveryConfig, priorityQueueSetFactory, isUsingAsynchronousSnapshots(), cancelStreamRegistry).build(); }
Source:
public static void validateOptions(GenomicsDatasetOptions options) { Preconditions.checkState(0 < options.getBinSize(), "binSize must be greater than zero"); }

Target:
public static void validateOptions(GenomicsDatasetOptions options) { Preconditions.checkArgument(0 < options.getBinSize(), "binSize must be greater than zero"); GenomicsOptions.Methods.validateOptions(options); }
Source:
public Mono<Void> processChanges(ChangeFeedObserverContext context, List<CosmosItemProperties> docs) { AutoCheckpointer self = this; return self.observer.processChanges(context, docs) .then(self.afterProcessChanges(context)); }

Target:
public Mono<Void> processChanges(ChangeFeedObserverContext context, List<CosmosItemProperties> docs) { return this.observer.processChanges(context, docs) .then(this.afterProcessChanges(context)); }
Source:
public FiltersDataPanel(FilterSubTab parentPanel) { this.parentSubTab = parentPanel; getElement().setId("filters_container"); FlowPanel panel = new FlowPanel(); FlexTable filterGroupButtons = new FlexTable(); filterGroupButtons.setWidget(0, 0, new SaveFilterGroupButton(parentSubTab)); copyButton = new SaveAsFilterGroupButton(parentSubTab); filterGroupButtons.setWidget(0, 1, copyButton); removeButton = new RemoveFilterGroupButton(parentSubTab); filterGroupButtons.setWidget(0, 2, removeButton); panel.add(filterGroupButtons); HTML filterText = new HTML("<h2 id=\"filter_header\">Filters Applied</h2>"); filterText.getElement().setId("filter_desc_title"); VerticalPanel filterGlobal = new VerticalPanel(); FlexTable paginationTable = new FlexTable(); paginationTable.setHTML(0, 0, "<p id=\"filter_header\">Submissions per page</p>"); paginationTable.setWidget(0, 1, new PaginationNumTextBox(parentSubTab)); filterGlobal.add(paginationTable); filterGlobal.add(filterText); panel.add(filterGlobal); filterHeader = new FlowPanel(); panel.add(filterHeader); filtersTree = new Tree(); panel.add(filtersTree); String latestVersion = getLatestVersion(); boolean needsUpdate = !BuildConfig.VERSION.startsWith(latestVersion); HTML versionNote = new HTML("" + "<small>ODK Aggregate " + BuildConfig.VERSION + "<br/>" + (needsUpdate ? "Update available: <a href=\"<LINK_0>\" target=\"_blank\">" + latestVersion + "</a>" : "You're up to date" ) + "</small>"); Style style = versionNote.getElement().getStyle(); style.setProperty("position", "fixed"); style.setProperty("bottom", "10px"); style.setProperty("left", "10px"); panel.add(versionNote); addFilter = new AddFilterButton(parentPanel); add(panel); }

Target:
public FiltersDataPanel(FilterSubTab parentPanel) { this.parentSubTab = parentPanel; getElement().setId("filters_container"); FlowPanel panel = new FlowPanel(); FlexTable filterGroupButtons = new FlexTable(); filterGroupButtons.setWidget(0, 0, new SaveFilterGroupButton(parentSubTab)); copyButton = new SaveAsFilterGroupButton(parentSubTab); filterGroupButtons.setWidget(0, 1, copyButton); removeButton = new RemoveFilterGroupButton(parentSubTab); filterGroupButtons.setWidget(0, 2, removeButton); panel.add(filterGroupButtons); HTML filterText = new HTML("<h2 id=\"filter_header\">Filters Applied</h2>"); filterText.getElement().setId("filter_desc_title"); VerticalPanel filterGlobal = new VerticalPanel(); FlexTable paginationTable = new FlexTable(); paginationTable.setHTML(0, 0, "<p id=\"filter_header\">Submissions per page</p>"); paginationTable.setWidget(0, 1, new PaginationNumTextBox(parentSubTab)); filterGlobal.add(paginationTable); filterGlobal.add(filterText); panel.add(filterGlobal); filterHeader = new FlowPanel(); panel.add(filterHeader); filtersTree = new Tree(); panel.add(filtersTree); panel.add(buildVersionNote()); addFilter = new AddFilterButton(parentPanel); add(panel); }
Source:
public void testDestroyCreatureLifeLoss(){ addCard(Zone.BATTLEFIELD, playerA, "Mountain"); addCard(Zone.BATTLEFIELD, playerA, "Swamp"); addCard(Zone.BATTLEFIELD, playerA, "Swamp"); addCard(Zone.HAND, playerA, "Unlicensed Disintegration"); addCard(Zone.BATTLEFIELD, playerB, "Volrath, the Shapestealer"); addCard(Zone.BATTLEFIELD, playerA, "Sol Ring"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unlicensed Disintegration", "Volrath, the Shapestealer"); setStopAt(1, PhaseStep.BEGIN_COMBAT); setStrictChooseMode(true); execute(); assertAllCommandsUsed(); assertLife(playerA, 20); assertGraveyardCount(playerA, "Unlicensed Disintegration", 1); assertLife(playerB, 17); assertGraveyardCount(playerB, "Volrath, the Shapestealer", 1); }

Target:
public void testDestroyCreatureLifeLoss(){ addCard(Zone.HAND, playerA, "Unlicensed Disintegration"); addCard(Zone.BATTLEFIELD, playerB, "Balduvian Bears"); addCard(Zone.BATTLEFIELD, playerA, "Mountain"); addCard(Zone.BATTLEFIELD, playerA, "Swamp",2); addCard(Zone.BATTLEFIELD, playerA, "Sol Ring"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unlicensed Disintegration", "Balduvian Bears"); setStopAt(1, PhaseStep.BEGIN_COMBAT); setStrictChooseMode(true); execute(); assertAllCommandsUsed(); assertLife(playerA, 20); assertGraveyardCount(playerA, "Unlicensed Disintegration", 1); assertLife(playerB, 17); assertGraveyardCount(playerB, "Balduvian Bears", 1); }
Source:
public Tuple next() throws IOException { if (currentPosInBatch == batchSize) { getNextBatch(); if (batchSize == -1) { return null; } } Tuple tuple = new VTuple(targets.length); for (int i=0; i<targetColInfo.length; i++) { tuple.put(i, createValueDatum(vectors[i], targetColInfo[i].type)); } currentPosInBatch++; return tuple; }

Target:
public Tuple next() throws IOException { if (currentPosInBatch == batchSize) { getNextBatch(); if (batchSize == -1) { return null; } } for (int i=0; i<targetColInfo.length; i++) { outTuple.put(i, createValueDatum(vectors[i], targetColInfo[i].type)); } currentPosInBatch++; return outTuple; }
Source:
public Page getOutput() { if (finished) { return null; } if (unfinishedWork != null) { if (unfinishedWork.process()) { unfinishedWork = null; } aggregationBuilder.updateMemory(); return null; } if (outputIterator == null) { outputIterator = null; if (finishing) { if (!inputProcessed && produceDefaultOutput) { finished = true; return getGlobalAggregationOutput(); } if (aggregationBuilder == null) { finished = true; return null; } } if (!finishing && (aggregationBuilder == null || !aggregationBuilder.isFull())) { return null; } outputIterator = aggregationBuilder.buildResult(); if (!outputIterator.hasNext()) { closeAggregationBuilder(); return null; } } Page output = outputIterator.next(); if (!outputIterator.hasNext()) { closeAggregationBuilder(); } return output; }

Target:
public Page getOutput() { if (finished) { return null; } if (unfinishedWork != null) { boolean workDone = unfinishedWork.process(); aggregationBuilder.updateMemory(); if (!workDone) { return null; } unfinishedWork = null; } if (outputIterator == null) { outputIterator = null; if (finishing) { if (!inputProcessed && produceDefaultOutput) { finished = true; return getGlobalAggregationOutput(); } if (aggregationBuilder == null) { finished = true; return null; } } if (!finishing && (aggregationBuilder == null || !aggregationBuilder.isFull())) { return null; } outputIterator = aggregationBuilder.buildResult(); if (!outputIterator.hasNext()) { closeAggregationBuilder(); return null; } } Page output = outputIterator.next(); if (!outputIterator.hasNext()) { closeAggregationBuilder(); } return output; }
Source:
public void modelChanged(String modelName, EventType type) { if (type != EventType.MODIFIED || !modelName.endsWith("." + SITEMAP_SUFFIX)) { return; } String changedSitemapName = modelName.substring(0, modelName.indexOf(".")); for (Entry<String, PageChangeListener> listenerEntry : pageChangeListeners.entrySet()) { String sitemapWithPage = listenerEntry.getKey(); String sitemapName = sitemapWithPage.substring(0, sitemapWithPage.indexOf(SITEMAP_PAGE_SEPARATOR)); String pageId = sitemapWithPage.substring(sitemapWithPage.indexOf(SITEMAP_PAGE_SEPARATOR) + 1, sitemapWithPage.length()); if (sitemapName.equals(changedSitemapName)) { EList<Widget> widgets = collectWidgets(sitemapName, pageId); listenerEntry.getValue().sitemapContentChanged(widgets); } } }

Target:
public void modelChanged(String modelName, EventType type) { if (type != EventType.MODIFIED || !modelName.endsWith(SITEMAP_SUFFIX)) { return; } String changedSitemapName = StringUtils.removeEnd(modelName, SITEMAP_SUFFIX); for (Entry<String, PageChangeListener> listenerEntry : pageChangeListeners.entrySet()) { String sitemapWithPage = listenerEntry.getKey(); String sitemapName = extractSitemapName(sitemapWithPage); String pageId = extractPageId(sitemapWithPage); if (sitemapName.equals(changedSitemapName)) { EList<Widget> widgets = collectWidgets(sitemapName, pageId); listenerEntry.getValue().sitemapContentChanged(widgets); } } }
Source:
private static String getCounterLabel(int counterIndex) { switch (counterIndex) { case ON_POST_DIAL_WAIT: return "onPostDialWait"; case ON_CALL_EVENT: return "onCallEvent"; case ON_PULL_EXTERNAL_CALL: return "onPullExternalCall"; case ON_EXTRAS_CHANGED: return "onExtrasChanged"; case ON_START_RTT: return "onStartRtt"; default: return "Callback"; } }

Target:
private static String getCounterLabel(int counterIndex) { switch (counterIndex) { case ON_POST_DIAL_WAIT: return "onPostDialWait"; case ON_CALL_EVENT: return "onCallEvent"; case ON_PULL_EXTERNAL_CALL: return "onPullExternalCall"; case ON_EXTRAS_CHANGED: return "onExtrasChanged"; case ON_START_RTT: return "onStartRtt"; case ON_RTT_REQUEST_RESPONSE: return "onRttRequestResponse"; case ON_STOP_RTT: return "onStopRtt"; default: return "Callback"; } }
Source:
public void analyzeClass(final InputStream input, final String location) throws IOException { try { analyzeClass(new ClassReader(input)); } catch (final Exception cause) { throw analyzerError(location, cause); } }

Target:
public void analyzeClass(final InputStream input, final String location) throws IOException { final byte[] buffer; try { buffer = InputStreams.readFully(input); } catch (final IOException e) { throw analyzerError(location, e); } analyzeClass(buffer, location); }
Source:
public StringDataValue split_part( StringDataValue delimiter, NumberDataValue fieldNumber, StringDataValue result) throws StandardException { StringDataValue stringResult; if (result == null) { result = getNewVarchar(); } stringResult = (StringDataValue) result; if (this.isNull() || delimiter == null || delimiter.isNull() || delimiter.getString() == null || fieldNumber == null || fieldNumber.isNull()) { stringResult.setToNull(); return stringResult; } String valueParts[] = getString().split(Pattern.quote(delimiter.getString())); int partIndex = fieldNumber.getInt(); if (partIndex == 0) { throw StandardException.newException(SQLState.LANG_FIELD_POSITION_ZERO); } if (partIndex > valueParts.length) { stringResult.setToNull(); } else { stringResult.setValue(valueParts[partIndex - 1]); } return stringResult; }

Target:
public StringDataValue split_part( StringDataValue delimiter, NumberDataValue fieldNumber, StringDataValue result) throws StandardException { StringDataValue stringResult; if (result == null) { result = getNewVarchar(); } stringResult = (StringDataValue) result; if (this.isNull() || delimiter == null || delimiter.isNull() || delimiter.getString() == null || fieldNumber == null || fieldNumber.isNull()) { stringResult.setToNull(); return stringResult; } String valueParts[] = getString().split(Pattern.quote(delimiter.getString())); int partIndex = fieldNumber.getInt(); if (partIndex <= 0) { throw StandardException.newException(SQLState.LANG_FIELD_POSITION_ZERO); } if (partIndex > valueParts.length) { stringResult.setToNull(); } else { stringResult.setValue(valueParts[partIndex - 1]); } return stringResult; }
Source:
private void setParent(MtpObject parent) { mParent = parent; if (mId != parent.getStorageId()) { mStorage = Preconditions.checkNotNull(parent.getStorage()); } }

Target:
private void setParent(MtpObject parent) { mParent = parent; if (this.getStorageId() != parent.getStorageId()) { mStorage = Preconditions.checkNotNull(parent.getStorage()); } }
Source:
private void checkEquality(JsonApiDocument doc1) { JsonApiDocument doc2; try { String json = mapper.writeJsonApiDocument(doc1); doc2 = mapper.readJsonApiDocument(json); } catch (IOException e) { throw new UncheckedIOException(e); } if (doc2.getData() == null) { doc2.setData(doc1.getData()); } assertEquals(doc1.hashCode(), doc2.hashCode()); assertEquals(doc1, doc2); }

Target:
private void checkEquality(JsonApiDocument doc1) { JsonApiDocument doc2; try { String json = mapper.writeJsonApiDocument(doc1); doc2 = mapper.readJsonApiDocument(json); } catch (IOException e) { throw new UncheckedIOException(e); } assertEquals(doc1, doc2); assertEquals(doc1.hashCode(), doc2.hashCode()); }
Source:
private static Properties getDefaultProperties() { if (defaultProperties == null) { String[] keyArr = { "serverName", "portNumber", "databaseName", "url", "user", "password", "driverClassName", "className", "maxPoolSize", "allowLocalTransactions" }; String[] defaultPropArr = { "", "", "", "jdbc:h2:tcp://localhost/JPADroolsFlow", "sa", "", "org.h2.Driver", "org.h2.jdbcx.JdbcDataSource", "16", "true" }; assert keyArr.length == defaultPropArr.length : "Unequal number of keys for default properties"; defaultProperties = new Properties(); for (int i = 0; i < keyArr.length; ++i) { defaultProperties.put(keyArr[i], defaultPropArr[i]); } } return defaultProperties; }

Target:
private static Properties getDefaultProperties() { if (defaultProperties == null) { String[] keyArr = { "serverName", "portNumber", "databaseName", "url", "user", "password", "driverClassName", "className", "maxPoolSize", "allowLocalTransactions" }; String[] defaultPropArr = { "", "", "", "jdbc:h2:tcp://localhost/JPADroolsFlow", "sa", "", "org.h2.Driver", "org.h2.jdbcx.JdbcDataSource", "16", "true" }; if (keyArr.length != defaultPropArr.length) { throw new IllegalStateException("Unequal number of keys for default properties!"); } defaultProperties = new Properties(); for (int i = 0; i < keyArr.length; ++i) { defaultProperties.put(keyArr[i], defaultPropArr[i]); } } return defaultProperties; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_provider); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { getSupportActionBar().setElevation(0); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } addProviderFragment = (AddProviderFragment) getSupportFragmentManager().findFragmentById(R.id.activity_add_provider_content_frame); if (addProviderFragment == null) { addProviderFragment = AddProviderFragment.newInstance(); } if (!addProviderFragment.isActive()) { addFragmentToActivity(getSupportFragmentManager(), addProviderFragment, R.id.activity_add_provider_content_frame); } if (savedInstanceState != null) { AddProviderPresenter mPresenter = new AddProviderPresenter(addProviderFragment); } else { AddProviderPresenter mPresenter = new AddProviderPresenter(addProviderFragment); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_provider); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { getSupportActionBar().setElevation(0); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } addProviderFragment = (AddProviderFragment) getSupportFragmentManager().findFragmentById(R.id.activity_add_provider_content_frame); if (addProviderFragment == null) { addProviderFragment = AddProviderFragment.newInstance(); } if (!addProviderFragment.isActive()) { addFragmentToActivity(getSupportFragmentManager(), addProviderFragment, R.id.activity_add_provider_content_frame); } AddProviderPresenter mPresenter = new AddProviderPresenter(addProviderFragment); }
Source:
public Response getSitemapData(@Context HttpHeaders headers, @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @ApiParam(value = "language") String language, @PathParam("sitemapname") @ApiParam(value = "sitemap name") String sitemapname, @QueryParam("type") String type, @QueryParam("jsoncallback") @DefaultValue("callback") String callback) { final Locale locale = localeService.getLocale(language); logger.debug("Received HTTP GET request from IP at '{}' for media type '{}'.", new Object[] { request.getRemoteAddr(), uriInfo.getPath(), type }); Object responseObject = getSitemapBean(sitemapname, uriInfo.getBaseUriBuilder().build(), locale); return Response.ok(responseObject).build(); }

Target:
public Response getSitemapData(@Context HttpHeaders headers, @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @ApiParam(value = "language") String language, @PathParam("sitemapname") @ApiParam(value = "sitemap name") String sitemapname, @QueryParam("type") String type, @QueryParam("jsoncallback") @DefaultValue("callback") String callback) { final Locale locale = localeService.getLocale(language); logger.debug("Received HTTP GET request from IP at '{}' for media type '{}'.", request.getRemoteAddr(), uriInfo.getPath(), type); Object responseObject = getSitemapBean(sitemapname, uriInfo.getBaseUriBuilder().build(), locale); return Response.ok(responseObject).build(); }
Source:
private void closeInterpreter(Interpreter interpreter) { Scheduler scheduler = interpreter.getScheduler(); if (false == remoteIntpProcessIsShutdown()) { for (final Job job : scheduler.getAllJobs()) { job.abort(); job.setStatus(Job.Status.ABORT); LOGGER.info("Job " + job.getJobName() + " aborted "); } try { LOGGER.info("Trying to close interpreter " + interpreter.getClassName()); interpreter.close(); } catch (InterpreterException e) { LOGGER.warn("Fail to close interpreter " + interpreter.getClassName(), e); } } SchedulerFactory.singleton().removeScheduler(scheduler.getName()); }

Target:
private void closeInterpreter(Interpreter interpreter) { Scheduler scheduler = interpreter.getScheduler(); if (false == remoteIntpProcessIsInvalid()) { for (final Job job : scheduler.getAllJobs()) { job.abort(); job.setStatus(Job.Status.ABORT); LOGGER.info("Job " + job.getJobName() + " aborted "); } try { LOGGER.info("Trying to close interpreter " + interpreter.getClassName()); interpreter.close(); } catch (InterpreterException e) { LOGGER.warn("Fail to close interpreter " + interpreter.getClassName(), e); } } SchedulerFactory.singleton().removeScheduler(scheduler.getName()); }
Source:
public void refresh(Command callback) { libraryPreferences.load(loadedLibraryPreferences -> { organizationalUnitAliasInSingular = loadedLibraryPreferences.getOrganizationalUnitPreferences().getAliasInSingular(); if (organizationalUnitAliasInSingular == null || organizationalUnitAliasInSingular.isEmpty()) { organizationalUnitAliasInSingular = ts.format(LibraryConstants.OrganizationalUnitDefaultAliasInSingular); } organizationalUnitAliasInPlural = loadedLibraryPreferences.getOrganizationalUnitPreferences().getAliasInPlural(); if (organizationalUnitAliasInPlural == null || organizationalUnitAliasInPlural.isEmpty()) { organizationalUnitAliasInPlural = ts.format(LibraryConstants.OrganizationalUnitDefaultAliasInPlural); } }, error -> { }); callback.execute(); }

Target:
public void refresh(Command callback) { libraryPreferences.load(loadedLibraryPreferences -> { organizationalUnitAliasInSingular = loadedLibraryPreferences.getOrganizationalUnitPreferences().getAliasInSingular(); if (organizationalUnitAliasInSingular == null || organizationalUnitAliasInSingular.isEmpty()) { organizationalUnitAliasInSingular = getOrganizationalUnitDefaultAliasInSingular(); } organizationalUnitAliasInPlural = loadedLibraryPreferences.getOrganizationalUnitPreferences().getAliasInPlural(); if (organizationalUnitAliasInPlural == null || organizationalUnitAliasInPlural.isEmpty()) { organizationalUnitAliasInPlural = getOrganizationalUnitDefaultAliasInPlural(); } }, error -> { organizationalUnitAliasInSingular = getOrganizationalUnitDefaultAliasInSingular(); organizationalUnitAliasInPlural = getOrganizationalUnitDefaultAliasInPlural(); }); callback.execute(); }
Source:
Optional<List<String>> find(Map<String, String> parameters) { Supplier<List<String>> reportLocationsSupplier = () -> { try { return parameters.entrySet().stream() .filter(entry -> isParameterReportLocation(entry.getKey())) .map(Map.Entry::getValue) .collect(Collectors.toList()); } catch (Exception e) { logger.error("Report locations finder failed."); e.printStackTrace(); return null; } }; return find(reportLocationsSupplier); }

Target:
Optional<List<String>> find(Map<String, String> parameters) { Supplier<List<String>> reportLocationsSupplier = () -> { try { return HdfsUtils.listDirs(Job.getInstance().getConfiguration(), parameters.get(REPORTS_DIR_PATH)); } catch (Exception e) { logger.error("Report locations finder failed.", e); return null; } }; return find(reportLocationsSupplier); }
Source:
public int compareTo(final ITmfTimestamp ts) { if (ts == null) { return 1; } if (this == ts || (fValue == ts.getValue() && fScale == ts.getScale())) { return 0; } if ((fValue == BIG_BANG.getValue() && fScale == BIG_BANG.getScale()) || (ts.getValue() == BIG_CRUNCH.getValue() && ts.getScale() == BIG_CRUNCH.getScale())) { return -1; } if ((fValue == BIG_CRUNCH.getValue() && fScale == BIG_CRUNCH.getScale()) || (ts.getValue() == BIG_BANG.getValue() && ts.getScale() == BIG_BANG.getScale())) { return 1; } try { final ITmfTimestamp nts = ts.normalize(0, fScale); final long delta = fValue - nts.getValue(); if (delta > 0) { return 1; } else if (delta < 0) { return -1; } else { return 0; } } catch (final ArithmeticException e) { final long value = ts.getValue(); if (fValue == 0 && value == 0) { return 0; } if (fValue < 0 && value >= 0) { return -1; } if (fValue >= 0 && value < 0) { return 1; } final int scale = ts.getScale(); return (fScale > scale) ? (fValue >= 0) ? 1 : -1 : (fValue >= 0) ? -1 : 1; } }

Target:
public int compareTo(final ITmfTimestamp ts) { if (ts == null) { return 1; } if (this == ts || (fValue == ts.getValue() && fScale == ts.getScale())) { return 0; } if ((fValue == BIG_BANG.getValue() && fScale == BIG_BANG.getScale()) || (ts.getValue() == BIG_CRUNCH.getValue() && ts.getScale() == BIG_CRUNCH.getScale())) { return -1; } if ((fValue == BIG_CRUNCH.getValue() && fScale == BIG_CRUNCH.getScale()) || (ts.getValue() == BIG_BANG.getValue() && ts.getScale() == BIG_BANG.getScale())) { return 1; } try { final ITmfTimestamp nts = ts.normalize(0, fScale); final long delta = fValue - nts.getValue(); return Long.compare(delta, 0); } catch (final ArithmeticException e) { final long value = ts.getValue(); if (fValue == 0 && value == 0) { return 0; } if (fValue < 0 && value >= 0) { return -1; } if (fValue >= 0 && value < 0) { return 1; } final int scale = ts.getScale(); return (fScale > scale) ? (fValue >= 0) ? 1 : -1 : (fValue >= 0) ? -1 : 1; } }
Source:
private ConsumerRebalanceListener getExceptionConsumerRebalanceListener() { return new ConsumerRebalanceListener() { @Override public void onPartitionsRevoked(Collection<TopicPartition> partitions) { throw new RuntimeException("Hit partition revoke"); } @Override public void onPartitionsAssigned(Collection<TopicPartition> partitions) { throw new RuntimeException("Hit partition assign"); } @Override public void onPartitionsLost(Collection<TopicPartition> partitions) { throw new RuntimeException("Hit partition lost"); } }; }

Target:
private ConsumerRebalanceListener getExceptionConsumerRebalanceListener() { return new ConsumerRebalanceListener() { @Override public void onPartitionsRevoked(Collection<TopicPartition> partitions) { throw new RuntimeException(partitionRevoked + partitions); } @Override public void onPartitionsAssigned(Collection<TopicPartition> partitions) { throw new RuntimeException(partitionAssigned + partitions); } @Override public void onPartitionsLost(Collection<TopicPartition> partitions) { throw new RuntimeException(partitionLost + partitions); } }; }
Source:
public FileInfo toFileInfo() { FileInfo info = new FileInfo(); info.setExists(true); info.setLength(st_size); info.setLastModified((st_mtime * 1_000) + (st_mtime_nsec / 1_000_000)); if ((st_mode & UnixFileFlags.S_IFMT) == UnixFileFlags.S_IFDIR) info.setDirectory(true); if ((st_flags & (UnixFileFlags.UF_IMMUTABLE | UnixFileFlags.SF_IMMUTABLE)) != 0) info.setAttribute(EFS.ATTRIBUTE_IMMUTABLE, true); if ((st_mode & UnixFileFlags.S_IRUSR) == 0) info.setAttribute(EFS.ATTRIBUTE_OWNER_READ, false); if ((st_mode & UnixFileFlags.S_IWUSR) == 0) info.setAttribute(EFS.ATTRIBUTE_OWNER_WRITE, false); if ((st_mode & UnixFileFlags.S_IXUSR) != 0) info.setAttribute(EFS.ATTRIBUTE_OWNER_EXECUTE, true); if ((st_mode & UnixFileFlags.S_IRGRP) != 0) info.setAttribute(EFS.ATTRIBUTE_GROUP_READ, true); if ((st_mode & UnixFileFlags.S_IWGRP) != 0) info.setAttribute(EFS.ATTRIBUTE_GROUP_WRITE, true); if ((st_mode & UnixFileFlags.S_IXGRP) != 0) info.setAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE, true); if ((st_mode & UnixFileFlags.S_IROTH) != 0) info.setAttribute(EFS.ATTRIBUTE_OTHER_READ, true); if ((st_mode & UnixFileFlags.S_IWOTH) != 0) info.setAttribute(EFS.ATTRIBUTE_OTHER_WRITE, true); if ((st_mode & UnixFileFlags.S_IXOTH) != 0) info.setAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE, true); return info; }

Target:
public FileInfo toFileInfo() { FileInfo info = new FileInfo(); info.setExists(true); info.setLength(st_size); info.setLastModified((st_mtime * 1_000) + st_mtime_msec); if ((st_mode & UnixFileFlags.S_IFMT) == UnixFileFlags.S_IFDIR) info.setDirectory(true); if ((st_flags & (UnixFileFlags.UF_IMMUTABLE | UnixFileFlags.SF_IMMUTABLE)) != 0) info.setAttribute(EFS.ATTRIBUTE_IMMUTABLE, true); if ((st_mode & UnixFileFlags.S_IRUSR) == 0) info.setAttribute(EFS.ATTRIBUTE_OWNER_READ, false); if ((st_mode & UnixFileFlags.S_IWUSR) == 0) info.setAttribute(EFS.ATTRIBUTE_OWNER_WRITE, false); if ((st_mode & UnixFileFlags.S_IXUSR) != 0) info.setAttribute(EFS.ATTRIBUTE_OWNER_EXECUTE, true); if ((st_mode & UnixFileFlags.S_IRGRP) != 0) info.setAttribute(EFS.ATTRIBUTE_GROUP_READ, true); if ((st_mode & UnixFileFlags.S_IWGRP) != 0) info.setAttribute(EFS.ATTRIBUTE_GROUP_WRITE, true); if ((st_mode & UnixFileFlags.S_IXGRP) != 0) info.setAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE, true); if ((st_mode & UnixFileFlags.S_IROTH) != 0) info.setAttribute(EFS.ATTRIBUTE_OTHER_READ, true); if ((st_mode & UnixFileFlags.S_IWOTH) != 0) info.setAttribute(EFS.ATTRIBUTE_OTHER_WRITE, true); if ((st_mode & UnixFileFlags.S_IXOTH) != 0) info.setAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE, true); return info; }
Source:
private static String executeScriptOnNode(MySqlNode node, String commands) { return node.invoke(MySqlNode.EXECUTE_SCRIPT, ImmutableMap.of("commands", commands)).getUnchecked(); }

Target:
private static String executeScriptOnNode(MySqlNode node, String commands) { return node.invoke(MySqlNode.EXECUTE_SCRIPT, ImmutableMap.of(MySqlNode.EXECUTE_SCRIPT_COMMANDS, commands)).getUnchecked(); }
Source:
public Fragment getFirstFragment() { Fragment fragment; if (searchQuery != null) { fragment = courseDiscussionPostsSearchFragment; } else { fragment = courseDiscussionPostsThreadFragment; } if (fragment.getArguments() == null) { Bundle args = new Bundle(); args.putSerializable(Router.EXTRA_ENROLLMENT_COURSE_DATA, courseData); fragment.setArguments(args); } fragment.setRetainInstance(true); return fragment; }

Target:
public Fragment getFirstFragment() { Fragment fragment; if (searchQuery != null) { fragment = courseDiscussionPostsSearchFragment; } else { fragment = courseDiscussionPostsThreadFragment; } if (fragment.getArguments() == null) { Bundle args = new Bundle(); args.putSerializable(Router.EXTRA_COURSE_DATA, courseData); args.putBoolean(CourseDiscussionPostsThreadFragment.ARG_DISCUSSION_HAS_TOPIC_NAME, discussionTopic != null); fragment.setArguments(args); } fragment.setRetainInstance(true); return fragment; }
Source:
public void updateStats(TableRef table) throws SQLException { SQLException sqlE = null; HTableInterface hTable = services.getTable(table.getTableName()); try { byte[] minKey = null, maxKey = null; Scan scan = new Scan(HConstants.EMPTY_START_ROW, new KeyOnlyFilter()); ResultScanner scanner = hTable.getScanner(scan); try { Result r = scanner.next(); if (r != null) { minKey = r.getRow(); } } finally { scanner.close(); } int maxPossibleKeyLength = SchemaUtil.estimateKeyLength(table.getTable()); byte[] maxPossibleKey = new byte[maxPossibleKeyLength]; Arrays.fill(maxPossibleKey, (byte)255); @SuppressWarnings("deprecation") Result r = hTable.getRowOrBefore(maxPossibleKey, table.getTable().getColumnFamilies().iterator().next().getName().getBytes()); if (r != null) { maxKey = r.getRow(); } tableStatsMap.put(table, new PTableStats(timeKeeper.currentTimeMillis(),minKey,maxKey)); } catch (IOException e) { sqlE = SQLExceptionInfo.getNewInfoObject(SQLExceptionCodeEnum.IO_EXCEPTION).genWrappedException(e); } finally { try { hTable.close(); } catch (IOException e) { if (sqlE == null) { sqlE = SQLExceptionInfo.getNewInfoObject(SQLExceptionCodeEnum.IO_EXCEPTION).genWrappedException(e); } else { sqlE.setNextException(SQLExceptionInfo.getNewInfoObject(SQLExceptionCodeEnum.IO_EXCEPTION).genWrappedException(e)); } } finally { if (sqlE != null) { throw sqlE; } } } }

Target:
public void updateStats(TableRef table) throws SQLException { SQLException sqlE = null; HTableInterface hTable = services.getTable(table.getTableName()); try { byte[] minKey = null, maxKey = null; Scan scan = new Scan(HConstants.EMPTY_START_ROW, new KeyOnlyFilter()); ResultScanner scanner = hTable.getScanner(scan); try { Result r = scanner.next(); if (r != null) { minKey = r.getRow(); } } finally { scanner.close(); } int maxPossibleKeyLength = SchemaUtil.estimateKeyLength(table.getTable()); byte[] maxPossibleKey = new byte[maxPossibleKeyLength]; Arrays.fill(maxPossibleKey, (byte)255); @SuppressWarnings("deprecation") Result r = hTable.getRowOrBefore(maxPossibleKey, table.getTable().getColumnFamilies().iterator().next().getName().getBytes()); if (r != null) { maxKey = r.getRow(); } tableStatsMap.put(table, new PTableStats(timeKeeper.currentTimeMillis(),minKey,maxKey)); } catch (IOException e) { sqlE = new PhoenixIOException(e); } finally { try { hTable.close(); } catch (IOException e) { if (sqlE == null) { sqlE = new PhoenixIOException(e); } else { sqlE.setNextException(new PhoenixIOException(e)); } } finally { if (sqlE != null) { throw sqlE; } } } }
Source:
public boolean waitForYellowStatus(String[] indexNames, int timeoutSecond) { ClusterHealthStatus healthStatus; Response response; try { response = lowLevelClient.performRequest("GET", String.format("/_cluster/health/%s?wait_for_status=yellow&timeout=%ds", getIndexesAsString(indexNames), timeoutSecond)); try (InputStream is = response.getEntity().getContent()) { Map<String, Object> map = XContentHelper.convertToMap(XContentType.JSON.xContent(), is, true); healthStatus = ClusterHealthStatus.fromString((String) map.get("status")); } } catch (IOException e) { throw new RuntimeException(e); } switch (healthStatus) { case GREEN: log.info("ES Cluster ready: " + response); return true; case YELLOW: log.warn("Es Cluster ready but not GREEN: " + response); return false; default: String error = "ES Cluster health status: " + healthStatus + ", not Yellow after " + timeoutSecond + " give up: " + response; log.error(error); throw new IllegalStateException(error); } }

Target:
public boolean waitForYellowStatus(String[] indexNames, int timeoutSecond) { ClusterHealthStatus healthStatus; Response response; try { response = lowLevelClient.performRequest("GET", String.format("/_cluster/health/%s?wait_for_status=yellow&timeout=%ds", getIndexesAsString(indexNames), timeoutSecond)); try (InputStream is = response.getEntity().getContent()) { Map<String, Object> map = XContentHelper.convertToMap(XContentType.JSON.xContent(), is, true); healthStatus = ClusterHealthStatus.fromString((String) map.get("status")); } } catch (IOException e) { throw new NuxeoException(e); } switch (healthStatus) { case GREEN: log.info("Elasticsearch Cluster ready: " + response); return true; case YELLOW: log.warn("Elasticsearch Cluster ready but not GREEN: " + response); return false; default: String error = "Elasticsearch Cluster health status: " + healthStatus + ", not Yellow after " + timeoutSecond + " give up: " + response; throw new IllegalStateException(error); } }
Source:
public VdsStatic() { serverSslEnabled = false; vdsStrength = 100; vdsSpmPriority = HOST_DEFAULT_SPM_PRIORITY; sshPort = DEFAULT_SSH_PORT; sshUsername = DEFAULT_SSH_USERNAME; name = ""; comment = comment == null ? "" : comment; vdsType = VDSType.VDS; autoRecoverable = true; disablePowerManagementPolicy = false; pmKdumpDetection = true; hostProviderId = null; }

Target:
public VdsStatic() { serverSslEnabled = false; vdsStrength = 100; vdsSpmPriority = HOST_DEFAULT_SPM_PRIORITY; sshPort = DEFAULT_SSH_PORT; sshUsername = DEFAULT_SSH_USERNAME; name = ""; comment = ""; vdsType = VDSType.VDS; autoRecoverable = true; disablePowerManagementPolicy = false; pmKdumpDetection = true; hostProviderId = null; }
Source:
public void pushFileToReview(String testIdent, String refSpec, PrivilegeLevel privilegeLevel) throws Exception { changeId = "I" + StringUtils.rightPad(testIdent, 40, "a"); CommitCommand command = createCommitCommand(changeId); addFile("testFile1.txt"); CommitResult result = gerritHarness.project().commitAndPush(command, refSpec, privilegeLevel); shortId = StringUtils.trimToEmpty(StringUtils.substringAfterLast(result.push.getMessages(), "/")); shortId = StringUtils.removeEnd(shortId, " [DRAFT]"); commitId = result.commit.getId().toString(); assertThat("Bad Push: " + result.push.getMessages(), shortId.length(), greaterThan(0)); }

Target:
public void pushFileToReview(String testIdent, String refSpec, PrivilegeLevel privilegeLevel) throws Exception { changeId = "I" + StringUtils.rightPad(testIdent, 40, "a"); CommitCommand command = createCommitCommand(changeId); addFile("testFile1.txt"); CommitResult result = commitAndPush(command, refSpec, privilegeLevel); shortId = StringUtils.trimToEmpty(StringUtils.substringAfterLast(result.push.getMessages(), "/")); shortId = StringUtils.removeEnd(shortId, " [DRAFT]"); commitId = result.commit.getId().toString(); assertThat("Bad Push: " + result.push.getMessages(), shortId.length(), greaterThan(0)); }
Source:
private void fillReadAheadCache(long orginalLedgerId, long firstEntryId, long firstEntryLocation) { try { long firstEntryLogId = (firstEntryLocation >> 32); long currentEntryLogId = firstEntryLogId; long currentEntryLocation = firstEntryLocation; int count = 0; long size = 0; while (count < readAheadCacheBatchSize && currentEntryLogId == firstEntryLogId) { ByteBuf entry = entryLogger.internalReadEntry(orginalLedgerId, firstEntryId, currentEntryLocation, false ); try { long currentEntryLedgerId = entry.getLong(0); long currentEntryId = entry.getLong(8); if (currentEntryLedgerId != orginalLedgerId) { return; } readCache.put(orginalLedgerId, currentEntryId, entry); count++; firstEntryId++; size += entry.readableBytes(); currentEntryLocation += 4 + entry.readableBytes(); currentEntryLogId = currentEntryLocation >> 32; } finally { entry.release(); } } dbLedgerStorageStats.getReadAheadBatchCountStats().registerSuccessfulValue(count); dbLedgerStorageStats.getReadAheadBatchSizeStats().registerSuccessfulValue(size); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Exception during read ahead for ledger: {}: e", orginalLedgerId, e); } } }

Target:
private void fillReadAheadCache(long orginalLedgerId, long firstEntryId, long firstEntryLocation) { try { long firstEntryLogId = (firstEntryLocation >> 32); long currentEntryLogId = firstEntryLogId; long currentEntryLocation = firstEntryLocation; int count = 0; long size = 0; while (count < readAheadCacheBatchSize && currentEntryLogId == firstEntryLogId) { ByteBuf entry = entryLogger.internalReadEntry(orginalLedgerId, -1, currentEntryLocation, false ); try { long currentEntryLedgerId = entry.getLong(0); long currentEntryId = entry.getLong(8); if (currentEntryLedgerId != orginalLedgerId) { return; } readCache.put(orginalLedgerId, currentEntryId, entry); count++; size += entry.readableBytes(); currentEntryLocation += 4 + entry.readableBytes(); currentEntryLogId = currentEntryLocation >> 32; } finally { entry.release(); } } dbLedgerStorageStats.getReadAheadBatchCountStats().registerSuccessfulValue(count); dbLedgerStorageStats.getReadAheadBatchSizeStats().registerSuccessfulValue(size); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Exception during read ahead for ledger: {}: e", orginalLedgerId, e); } } }
Source:
private void init() { try { hostname = InetAddress.getLocalHost().getHostName(); hostname = "localhost"; } catch (UnknownHostException e) { logger.warn("Error getting the value of localhost. " + "Proceeding with 'localhost'.", e); } }

Target:
private void init() { try { hostname = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { logger.warn("Error getting the value of localhost. " + "Proceeding with 'localhost'.", e); } }
Source:
public Beacon(byte[] rlp) { RLPList items = RLP.unwrapList(rlp); this.parentHash = items.get(0).getRLPData(); this.randaoReveal = items.get(1).getRLPData(); this.mainChainRef = items.get(2).getRLPData(); this.stateHash = items.get(3).getRLPData(); this.slotNumber = ByteUtil.bytesToBigInteger(items.get(4).getRLPData()).longValue(); RLPList attestationsRlp = RLP.unwrapList(items.get(5).getRLPData()); this.attestations = new AttestationRecord[attestationsRlp.size()]; for (int i = 0; i < attestationsRlp.size(); ++i) { attestations[i] = new AttestationRecord(attestationsRlp.get(i).getRLPData()); } }

Target:
public Beacon(byte[] rlp) { RLPList items = RLP.unwrapList(rlp); this.parentHash = items.get(0).getRLPData(); this.randaoReveal = items.get(1).getRLPData(); this.mainChainRef = items.get(2).getRLPData(); this.stateHash = items.get(3).getRLPData(); this.slotNumber = ByteUtil.bytesToBigInteger(items.get(4).getRLPData()).longValue(); this.attestations = new ArrayList<>(); if (!isSingleZero(items.get(5).getRLPData())) { RLPList attestationsRlp = RLP.unwrapList(items.get(5).getRLPData()); for (RLPElement anAttestationsRlp : attestationsRlp) { attestations.add(new AttestationRecord(anAttestationsRlp.getRLPData())); } } }
Source:
public ParameterizedSqlFactory(String initialSql) { sqlStringBuilder = new StringBuilder(initialSql); parameters = new ArrayList(); }

Target:
public ParameterizedSqlFactory(String initialSql) { sqlStringBuilder = new StringBuilder(initialSql); parameters = new ArrayList<>(); }
Source:
protected void doStop() throws Exception { Logger.log(Logger.DEBUG, ACCESSLOG_RESOURCES, "SimpleAccessLogger.Close", this.fileName); if (this.outWriter != null) { this.outWriter.flush(); this.outWriter.close(); this.outWriter = null; } if (this.outStream != null) { try { this.outStream.close(); } catch (IOException err) { throw new WinstoneException(err.getMessage(), err); } this.outStream = null; } this.fileName = null; }

Target:
protected void doStop() throws Exception { Logger.log(Logger.DEBUG, ACCESSLOG_RESOURCES, "SimpleAccessLogger.Close", this.fileName); if (this.outWriter != null) { this.outWriter.flush(); this.outWriter.close(); this.outWriter = null; } if (this.outStream != null) { try { this.outStream.close(); } catch (IOException err) { Logger.logDirectMessage(Logger.ERROR, null, "SimpleAccessLogger.Exception" + err.getMessage(), err); } this.outStream = null; } this.fileName = null; }
Source:
public ObserveOnSubscriber(Scheduler scheduler, Subscriber<? super T> subscriber) { this.observer = subscriber; this.recursiveScheduler = scheduler.createWorker(); this.scheduledUnsubscribe = new ScheduledUnsubscribe(recursiveScheduler); subscriber.add(scheduledUnsubscribe); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { s.unsubscribe(); } })); }

Target:
public ObserveOnSubscriber(Scheduler scheduler, Subscriber<? super T> subscriber) { this.observer = subscriber; this.recursiveScheduler = scheduler.createWorker(); this.scheduledUnsubscribe = new ScheduledUnsubscribe(recursiveScheduler); subscriber.add(scheduledUnsubscribe); subscriber.add(new SynchronizedSubscription(this)); }