auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
String getBucketName(URI uri) { if (uri.getHost() != null) { return uri.getHost(); } else if (uri.getUserInfo() == null) { return uri.getAuthority(); } throw new IllegalArgumentException("Unable to determine S3 bucket from URI."); }

Target:
public static String getBucketName(URI uri) { if (uri.getHost() != null) { return uri.getHost(); } if (uri.getUserInfo() == null) { return uri.getAuthority(); } throw new IllegalArgumentException("Unable to determine S3 bucket from URI."); }
Source:
public void onClickCourseInfo(String pathId) { if(pathId!=null && !pathId.isEmpty()){ logger.debug("PathId" +pathId); Router.getInstance().showCourseInfo(this, pathId); } }

Target:
public void onClickCourseInfo(String pathId) { if(!StringUtil.isStringEmpty(pathId)){ logger.debug("PathId" +pathId); Router.getInstance().showCourseInfo(this, pathId); } }
Source:
protected static boolean indexLimitReached(Index index, Map<String, Object> existingIndexes) { if (index.indexType.equalsIgnoreCase(Index.TEXT_TYPE)) { for (String name : existingIndexes.keySet()) { Map<String, Object> existingIndex = (Map<String, Object>) existingIndexes.get(name); String type = (String) existingIndex.get("type"); if (type.equalsIgnoreCase("text") && !name.equalsIgnoreCase(index.indexName)) { String msg = String.format("The text index %s already exists.", name); logger.log(Level.SEVERE, msg); return true; } } } return false; }

Target:
protected static boolean indexLimitReached(Index index, Map<String, Object> existingIndexes) { if (index.indexType.equalsIgnoreCase(Index.TEXT_TYPE)) { for (String name : existingIndexes.keySet()) { Map<String, Object> existingIndex = (Map<String, Object>) existingIndexes.get(name); String type = (String) existingIndex.get("type"); if (type.equalsIgnoreCase(Index.TEXT_TYPE) && !name.equalsIgnoreCase(index.indexName)) { logger.log(Level.SEVERE, String.format("The text index %s already exists. ", name) + "One text index per datastore permitted. " + String.format("Delete %s and recreate %s.", name, index.indexName)); return true; } } } return false; }
Source:
synchronized GoConfigHolder forceLoad() throws Exception { File configFile = goConfigFileReader.fileLocation(); CruiseConfig cruiseConfig = this.magicalGoConfigXmlLoader.deserializeConfig(goConfigFileReader.configXml()); if (LOGGER.isDebugEnabled()) { LOGGER.debug(String.format("Reloading config file: %s",configFile.getAbsolutePath())); } GoConfigHolder goConfigHolder; try { try { goConfigHolder = fullConfigSaveNormalFlow.execute(new FullConfigUpdateCommand(cruiseConfig, null), cachedGoPartials.lastKnownPartials(), FILESYSTEM); } catch (GoConfigInvalidException e) { if (!canUpdateConfigWithLastValidPartials()) throw e; goConfigHolder = fullConfigSaveNormalFlow.execute(new FullConfigUpdateCommand(cruiseConfig, null), cachedGoPartials.lastValidPartials(), FILESYSTEM); } reloadStrategy.latestState(goConfigHolder.config); return goConfigHolder; } catch (Exception e) { LOGGER.error(String.format("Unable to load config file: %s %s", configFile.getAbsolutePath(), e.getMessage()), e); if (configFile.exists()) { LOGGER.warn(String.format("--- %s ---", configFile.getAbsolutePath())); LOGGER.warn(FileUtil.readContentFromFile(configFile)); LOGGER.warn("------"); } LOGGER.debug(e); throw e; } }

Target:
synchronized GoConfigHolder forceLoad() throws Exception { File configFile = goConfigFileReader.fileLocation(); CruiseConfig cruiseConfig = this.magicalGoConfigXmlLoader.deserializeConfig(goConfigFileReader.configXml()); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Reloading config file: {}", configFile.getAbsolutePath()); } GoConfigHolder goConfigHolder; try { try { goConfigHolder = fullConfigSaveNormalFlow.execute(new FullConfigUpdateCommand(cruiseConfig, null), cachedGoPartials.lastKnownPartials(), FILESYSTEM); } catch (GoConfigInvalidException e) { if (!canUpdateConfigWithLastValidPartials()) throw e; goConfigHolder = fullConfigSaveNormalFlow.execute(new FullConfigUpdateCommand(cruiseConfig, null), cachedGoPartials.lastValidPartials(), FILESYSTEM); } reloadStrategy.latestState(goConfigHolder.config); return goConfigHolder; } catch (Exception e) { LOGGER.error("Unable to load config file: {}", configFile.getAbsolutePath(), e.getMessage(), e); if (configFile.exists()) { LOGGER.warn("--- ---", configFile.getAbsolutePath()); LOGGER.warn(FileUtil.readContentFromFile(configFile)); LOGGER.warn("------"); } LOGGER.debug("", e); throw e; } }
Source:
private String translateRequest(@Nonnull final HttpServletRequest request) throws JsonProcessingException { final String text = request.getParameter(CONTENT_LABEL); final Map<String, String> params = new HashMap<>(); params.put(TEXT_LABEL, StringUtils.isNotBlank(text) ? text : StringUtils.EMPTY); return MAPPER.writeValueAsString(params); }

Target:
private String translateRequest(@Nonnull final HttpServletRequest request) throws JsonProcessingException { final String text = request.getParameter(CONTENT_LABEL); final Map<String, String> params = new HashMap<>(); params.put(TEXT_LABEL, StringUtils.defaultIfBlank(text, StringUtils.EMPTY)); return MAPPER.writeValueAsString(params); }
Source:
protected List<ExecutionStatus> getFilteredItems() { ProcessStatusTracker tracker = GeoServerApplication.get().getBeanOfType(ProcessStatusTracker.class); ProcessStatusStore store = tracker.getStore(); Query query = new Query("status", getFilter()); if (count > 0) { query.setStartIndex((int) first); query.setMaxFeatures((int) count); } SortParam sort = getSort(); if (sort != null) { SortByImpl[] sortBys = new SortByImpl[1]; final Property<?> property = getProperty(sort); if (property.isSearchable()) { sortBys[0] = new SortByImpl(FF.property(property.getName()), SortOrder.ASCENDING); FF.sort(property.getName(), SortOrder.ASCENDING); if (!sort.isAscending()) { sortBys[0].setSortOrder(SortOrder.DESCENDING); } query.setSortBy(sortBys); } } LOGGER.fine("built query " + query + " to filter statuses"); return store.list(query); }

Target:
protected List<ExecutionStatus> getFilteredItems() { ProcessStatusTracker tracker = GeoServerApplication.get().getBeanOfType(ProcessStatusTracker.class); ProcessStatusStore store = tracker.getStore(); Query query = new Query("status", getFilter()); if (count > 0) { query.setStartIndex((int) first); query.setMaxFeatures((int) count); } final SortParam sort = getSort(); SortBy sortOrder = null; if (sort != null) { final Property<?> property = getProperty(sort); if (property.isSearchable()) { final String sortProperty = ((BeanProperty<StoreInfo>) property).getPropertyPath(); sortOrder = sortBy(sortProperty, sort.isAscending()); query.setSortBy(new SortBy[] {sortOrder}); } } LOGGER.fine("built query " + query + " to filter statuses"); return store.list(query); }
Source:
private String[] superTypes(ObjectType cmisType) { if (cmisType.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) { return new String[] {"nt:folder"}; } if (cmisType.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) { return new String[] {"nt:file"}; } return new String[]{cmisType.getParentType().getLocalName()}; }

Target:
private String[] superTypes(ObjectType cmisType) { if (cmisType.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) { return new String[] {JcrConstants.NT_FOLDER}; } if (cmisType.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) { return new String[] {JcrConstants.NT_FILE}; } return new String[]{cmisType.getParentType().getId()}; }
Source:
public boolean runTest() { Display display = mContext.getWindowManager().getDefaultDisplay(); boolean passing = checkEqualsAndLog(R.string.tv_hdr_display_is_hdr, true, display.isHdr()); passing &= hasExpectedHdrSupportedTypes(display); passing &= hasSaneLuminanceValues(display); return passing; }

Target:
public void runTest() { Display display = mContext.getWindowManager().getDefaultDisplay(); getAsserter() .withFailureMessage("Display.isHdr()") .that(display.isHdr()) .isTrue(); Display.HdrCapabilities hdrCapabilities = display.getHdrCapabilities(); int[] supportedHdrTypes = hdrCapabilities.getSupportedHdrTypes(); Arrays.sort(supportedHdrTypes); getAsserter() .withFailureMessage("Display.getHdrCapabilities().getSupportedTypes()") .that(supportedHdrTypes) .isEqualTo(EXPECTED_SUPPORTED_HDR_TYPES_SORTED); float maxLuminance = hdrCapabilities.getDesiredMaxLuminance(); float maxAvgLuminance = hdrCapabilities.getDesiredMaxAverageLuminance(); float minLuminance = hdrCapabilities.getDesiredMinLuminance(); getAsserter() .withFailureMessage("Display.getHdrCapabilities().getDesiredMaxLuminance()") .that(maxLuminance) .isIn(Range.openClosed(0f, MAX_EXPECTED_LUMINANCE)); getAsserter() .withFailureMessage( "Display.getHdrCapabilities().getDesiredMaxAverageLuminance()") .that(maxLuminance) .isIn(Range.openClosed(0f, MAX_EXPECTED_LUMINANCE)); getAsserter() .withFailureMessage("MaxAvgLuminance is between min and max") .that(maxAvgLuminance) .isIn(Range.openClosed(minLuminance, maxLuminance)); }
Source:
double getMillisAtPercentile(double percentile) { return current.getValueAtPercentile(percentile) / TimeValue.NSEC_PER_MSEC; }

Target:
synchronized double getMillisAtPercentile(double percentile) { return current.getValueAtPercentile(percentile) / TimeValue.NSEC_PER_MSEC; }
Source:
public void serializationOrderTest() throws IOException { Project project = new Project("project"); Group apache = new Group("Apache", "test.*"); Group bsd = new Group("BSD", "test.*"); Group opensource = new Group("OpenSource", "test.*"); opensource.addGroup(apache); opensource.addGroup(bsd); bsd.addProject(project); opensource.addProject(project); project.getGroups().add(opensource); project.getGroups().add(bsd); Configuration cfg = new Configuration(); Configuration oldCfg = cfg; cfg.addGroup(apache); cfg.addGroup(bsd); cfg.addGroup(opensource); ByteArrayOutputStream out = new ByteArrayOutputStream(); try (XMLEncoder enc = new XMLEncoder(out)) { enc.writeObject(cfg); } final LinkedList<Exception> exceptions = new LinkedList<>(); try (ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); XMLDecoder dec = new XMLDecoder(in, null, (Exception e) -> { exceptions.addLast(e); })) { cfg = (Configuration) dec.readObject(); assertNotNull(cfg); dec.close(); if (!exceptions.isEmpty()) { AssertionFailedError afe = new AssertionFailedError( "Got " + exceptions.size() + " exception(s)"); afe.initCause(exceptions.getFirst()); throw afe; } assertEquals(oldCfg.getGroups(), cfg.getGroups()); } }

Target:
public void serializationOrderTest() throws IOException { Project project = new Project("project"); Group apache = new Group("Apache", "test.*"); Group bsd = new Group("BSD", "test.*"); Group opensource = new Group("OpenSource", "test.*"); opensource.addGroup(apache); opensource.addGroup(bsd); bsd.addProject(project); opensource.addProject(project); project.getGroups().add(opensource); project.getGroups().add(bsd); Configuration cfg = new Configuration(); Configuration oldCfg = cfg; cfg.addGroup(apache); cfg.addGroup(bsd); cfg.addGroup(opensource); ByteArrayOutputStream out = new ByteArrayOutputStream(); try (XMLEncoder enc = new XMLEncoder(out)) { enc.writeObject(cfg); } final LinkedList<Exception> exceptions = new LinkedList<>(); try (ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); XMLDecoder dec = new XMLDecoder(in, null, (Exception e) -> { exceptions.addLast(e); })) { cfg = (Configuration) dec.readObject(); assertNotNull(cfg); if (!exceptions.isEmpty()) { AssertionFailedError afe = new AssertionFailedError( "Got " + exceptions.size() + " exception(s)"); afe.initCause(exceptions.getFirst()); throw afe; } assertEquals(oldCfg.getGroups(), cfg.getGroups()); } }
Source:
private static boolean isValid(@Nullable Object element) { if (element instanceof ITmfTrimmableTrace) { return true; } if (!(element instanceof ITmfTrace)) { return false; } ITmfTrace trace = (ITmfTrace) element; List<ITmfEventProvider> children = trace.getChildren(); if (children.isEmpty()) { return false; } for (ITmfEventProvider child : children) { if (!isValid(child)) { return false; } } return true; }

Target:
private static boolean isValid(@Nullable Object element) { if (element instanceof ITmfTrimmableTrace) { return true; } if (!(element instanceof ITmfTrace)) { return false; } ITmfTrace trace = (ITmfTrace) element; if (trace.getChildren().isEmpty()) { return false; } for (ITmfEventProvider child : trace.getChildren()) { if (!isValid(child)) { return false; } } return true; }
Source:
private boolean doesLogExists(JobIdentifier jobIdentifier) { return consoleService.doesLogExists(jobIdentifier); }

Target:
private boolean doesLogExists(JobIdentifier jobIdentifier) { return consoleService.doesLogExist(jobIdentifier); }
Source:
public void testHelixNotifier() throws Exception { notifier.subscribe(refTopics.get(0), listeners.get(0)); latch0.set(new CountDownLatch(1)); notifier.sendMessage(refTopics.get(0), refMessages.get(0)); awaitLatchOrTimeout(latch0.get(), latchTimeoutMs); assertEquals("Received topic is different from expected", refTopics.get(0), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(0), receivedMessagesByListener0.get(0)); resetTopicListeners(); latch0.set(new CountDownLatch(1)); notifier.sendMessage(refTopics.get(0), refMessages.get(1)); awaitLatchOrTimeout(latch0.get(), latchTimeoutMs); assertEquals("Received topic is different from expected", refTopics.get(0), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(1), receivedMessagesByListener0.get(0)); resetTopicListeners(); notifier.subscribe(refTopics.get(1), listeners.get(0)); latch0.set(new CountDownLatch(1)); notifier.sendMessage(refTopics.get(1), refMessages.get(0)); awaitLatchOrTimeout(latch0.get(), latchTimeoutMs); assertEquals("Received topic is different from expected", refTopics.get(1), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(0), receivedMessagesByListener0.get(0)); }

Target:
public void testHelixNotifier() throws Exception { notifier.subscribe(refTopics.get(0), listeners.get(0)); latch0.set(new CountDownLatch(1)); notifier.publish(refTopics.get(0), refMessages.get(0)); awaitLatchOrTimeout(latch0.get(), LATCH_TIMEOUT_MS); assertEquals("Received topic is different from expected", refTopics.get(0), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(0), receivedMessagesByListener0.get(0)); resetListeners(); latch0.set(new CountDownLatch(1)); notifier.publish(refTopics.get(0), refMessages.get(1)); awaitLatchOrTimeout(latch0.get(), LATCH_TIMEOUT_MS); assertEquals("Received topic is different from expected", refTopics.get(0), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(1), receivedMessagesByListener0.get(0)); resetListeners(); notifier.subscribe(refTopics.get(1), listeners.get(0)); latch0.set(new CountDownLatch(1)); notifier.publish(refTopics.get(1), refMessages.get(0)); awaitLatchOrTimeout(latch0.get(), LATCH_TIMEOUT_MS); assertEquals("Received topic is different from expected", refTopics.get(1), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(0), receivedMessagesByListener0.get(0)); }
Source:
public Map<String, CassandraHttpSession> findByIndexNameAndIndexValue(String indexName, String indexValue) { Select select = QueryBuilder.select("id") .from("session_by_name"); select.where(QueryBuilder.eq("principal_name", indexValue)); List<UUID> uuids = this.template.queryForList(select, UUID.class); Map<String, CassandraHttpSession> result = new HashMap<String, CassandraHttpSession>(); for (UUID id : uuids) { CassandraHttpSession session = getSession(id.toString()); if (session != null) { result.put(id.toString(), getSession(id.toString())); } } return result; }

Target:
public Map<String, CassandraHttpSession> findByIndexNameAndIndexValue(String indexName, String indexValue) { Select select = QueryBuilder.select("id") .from(this.getIndexTableName()); select.where(QueryBuilder.eq("principal_name", indexValue)); select.setConsistencyLevel(this.consistencyLevel); List<UUID> uuids = this.cassandraOperations.queryForList(select, UUID.class); Map<String, CassandraHttpSession> result = new HashMap<String, CassandraHttpSession>(); for (UUID id : uuids) { CassandraHttpSession session = getSession(id.toString()); if (session != null) { result.put(id.toString(), getSession(id.toString())); } } return result; }
Source:
public Map<Object, Object> getPatientProgramAttributeByAttributeName(List<Integer> patientIds, String attributeName) { Map<Object, Object> patientProgramAttributes = new HashMap<>(); if (patientIds.isEmpty() || attributeName == null) { return patientProgramAttributes; } String commaSeperatedPatientIds = StringUtils.join(patientIds, ","); List list = sessionFactory.getCurrentSession().createSQLQuery( "SELECT p.patient_id as person_id, " + " concat('{',group_concat(DISTINCT (coalesce(concat('\"',ppt.name,'\":\"', COALESCE (cn.name, ppa.value_reference),'\"'))) SEPARATOR ','),'}') AS patientProgramAttributeValue " + " from patient p " + " join patient_program pp on p.patient_id = pp.patient_id and p.patient_id in (" + commaSeperatedPatientIds + ")" + " join patient_program_attribute ppa on pp.patient_program_id = ppa.patient_program_id and ppa.voided=0" + " join program_attribute_type ppt on ppa.attribute_type_id = ppt.program_attribute_type_id and ppt.name ='" + attributeName + "'"+ " and ppt.datatype like '%ConceptDataType%' LEFT OUTER JOIN concept_name cn on ppa.value_reference = cn.concept_id and cn.concept_name_type= 'FULLY_SPECIFIED' and cn.voided=0" + " group by p.patient_id") .addScalar("person_id", StandardBasicTypes.INTEGER) .addScalar("patientProgramAttributeValue", StandardBasicTypes.STRING) .list(); for (Object o : list) { Object[] arr = (Object[]) o; patientProgramAttributes.put(arr[0], arr[1]); } return patientProgramAttributes; }

Target:
public Map<Object, Object> getPatientProgramAttributeByAttributeName(List<Integer> patientIds, String attributeName) { Map<Object, Object> patientProgramAttributes = new HashMap<>(); if (patientIds.isEmpty() || attributeName == null) { return patientProgramAttributes; } List list = sessionFactory.getCurrentSession().createSQLQuery( "SELECT p.patient_id as person_id, " + " concat('{',group_concat(DISTINCT (coalesce(concat('\"',ppt.name,'\":\"', COALESCE (cn.name, ppa.value_reference),'\"'))) SEPARATOR ','),'}') AS patientProgramAttributeValue " + " from patient p " + " join patient_program pp on p.patient_id = pp.patient_id and p.patient_id in (:patientIds)" + " join patient_program_attribute ppa on pp.patient_program_id = ppa.patient_program_id and ppa.voided=0" + " join program_attribute_type ppt on ppa.attribute_type_id = ppt.program_attribute_type_id and ppt.name = :attributeName"+ " and ppt.datatype like '%ConceptDataType%' LEFT OUTER JOIN concept_name cn on ppa.value_reference = cn.concept_id and cn.concept_name_type= 'FULLY_SPECIFIED' and cn.voided=0" + " group by p.patient_id") .addScalar("person_id", StandardBasicTypes.INTEGER) .addScalar("patientProgramAttributeValue", StandardBasicTypes.STRING) .setParameter("attributeName", attributeName) .setParameterList("patientIds", patientIds) .list(); for (Object o : list) { Object[] arr = (Object[]) o; patientProgramAttributes.put(arr[0], arr[1]); } return patientProgramAttributes; }
Source:
public EAttribute[] getImagePathAttributes() { EAttribute[] attrs = {DescriptionPackage.eINSTANCE.getViewpoint_Icon(), DescriptionPackage.eINSTANCE.getDecorationDescription_DecoratorPath(), StylePackage.eINSTANCE.getBasicLabelStyleDescription_IconPath(), ToolPackage.eINSTANCE.getMenuItemDescription_Icon(), ToolPackage.eINSTANCE.getPaneBasedSelectionWizardDescription_IconPath(), ToolPackage.eINSTANCE.getPaneBasedSelectionWizardDescription_WindowImagePath(), ToolPackage.eINSTANCE.getSelectionWizardDescription_IconPath(), ToolPackage.eINSTANCE.getSelectionWizardDescription_WindowImagePath(), ToolPackage.eINSTANCE.getToolDescription_IconPath()}; return attrs; }

Target:
public EAttribute[] getImagePathAttributes() { return attrs; }
Source:
public EventEmittingStepExecutionListener(MessageChannel output,int order) { Assert.notNull(output, "An output channel is required"); this.messagePublisher = new MessagePublisher<>(output); this.order = order; }

Target:
public EventEmittingStepExecutionListener(MessageChannel output, int order) { this(output); this.order = order; }
Source:
public AccountAttributes build() { return accountAttributes; }

Target:
public AccountAttributes build() { accountAttributes.googleId = SanitizationHelper.sanitizeGoogleId(accountAttributes.googleId); accountAttributes.name = SanitizationHelper.sanitizeName(accountAttributes.name); accountAttributes.email = SanitizationHelper.sanitizeEmail(accountAttributes.email); accountAttributes.institute = SanitizationHelper.sanitizeTitle(accountAttributes.institute); if (accountAttributes.studentProfile != null) { accountAttributes.studentProfile.sanitizeForSaving(); } return accountAttributes; }
Source:
public void setLeftX(double x) { double value = x * (xLeftInverted ? -1 : 1); this.x = value; setRawAxis(0, value); }

Target:
public void setLeftX(double x) { leftJoystickAxis.x = x; }
Source:
public void testLoadNewTemplateFile() throws Exception { CountDownLatch loadTemplate = new CountDownLatch(2); configureTemplateManager(loadTemplate, null); String expected = "<html><body>Hello John</body></html>"; Map<String, Object> parameters = new HashMap<>(); parameters.put("Name", "John"); String rendered = templateManager.render("basic-email", parameters); assertEquals(expected, rendered); String advancedTemplate = "<html><body>Hello ${Name}, welcome!</body></html>"; String expectedAdvanced = "<html><body>Hello John, welcome!</body></html>"; Thread.sleep(3000); Files.write(new File(templateDir, "advanced-email.html").toPath(), advancedTemplate.getBytes()); loadTemplate.await(); rendered = templateManager.render("advanced-email", parameters); assertEquals(expectedAdvanced, rendered); }

Target:
public void testLoadNewTemplateFile() throws Exception { CountDownLatch loadTemplate = new CountDownLatch(1); configureTemplateManager(loadTemplate, null); String expected = "<html><body>Hello John</body></html>"; Map<String, Object> parameters = new HashMap<>(); parameters.put("Name", "John"); String rendered = templateManager.render("basic-email", parameters); assertEquals(expected, rendered); String advancedTemplate = "<html><body>Hello ${Name}, welcome!</body></html>"; String expectedAdvanced = "<html><body>Hello John, welcome!</body></html>"; Thread.sleep(3000); Files.write(new File(templateDir, "advanced-email.html").toPath(), advancedTemplate.getBytes()); loadTemplate.await(); rendered = templateManager.render("advanced-email", parameters); assertEquals(expectedAdvanced, rendered); }
Source:
public String build(String serverName, String machineName, String workspaceID) { StringJoiner joiner = new StringJoiner("."); if (serverName != null) { joiner.add("server-" + serverName.replace('/', '-')); } if (machineName != null) { joiner.add(machineName); } if (workspaceID != null) { joiner.add(workspaceID); } joiner.add( externalAddress != null ? getWildcardNipDomain(externalAddress) : getWildcardNipDomain(internalAddress)); return joiner.toString(); }

Target:
public String build(String serverName, String machineName, String workspaceID) { StringJoiner joiner = new StringJoiner("."); if (serverName != null) { joiner.add(normalize(serverName)); } if (machineName != null) { joiner.add(normalize(machineName)); } if (workspaceID != null) { joiner.add(normalize(workspaceID)); } joiner.add(wildcardDomain); return joiner.toString(); }
Source:
public Object visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { Object keys = super.visitKeySetCommand(ctx, command); if (enabled && passivationEnabled && !shouldSkipCacheLoader(command)) { Set<Object> set = loader.loadAllKeys(Collections.emptySet()); Set<Object> union = new HashSet<Object>(set); union.addAll((Set<Object>)keys); return Collections.unmodifiableSet(union); } return keys; }

Target:
public Object visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { Object keys = super.visitKeySetCommand(ctx, command); if (enabled && !shouldSkipCacheLoader(command)) { Set<Object> union = new HashSet<Object>((Set<Object>)keys); union.addAll(loader.loadAllKeys(union)); return Collections.unmodifiableSet(union); } return keys; }
Source:
public BuildDiscarder getBuildDiscarder() { BuildDiscarderProperty prop = getProperty(BuildDiscarderProperty.class); return prop != null ? prop.getStrategy() : logRotator; }

Target:
public synchronized BuildDiscarder getBuildDiscarder() { BuildDiscarderProperty prop = getProperty(BuildDiscarderProperty.class); return prop != null ? prop.getStrategy() : logRotator; }
Source:
private void addHandlers() { isUseFileMask.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { filesMask.setEnabled(event.getValue()); } }); isUseDirectory.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { directory.setEnabled(event.getValue()); selectPathButton.setEnabled(event.getValue()); } }); text.addKeyUpHandler( new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { acceptButton.setEnabled(!text.getValue().isEmpty()); } }); selectPathButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { showSelectPathDialog(); } }); text.addKeyUpHandler( new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { acceptButton.setEnabled(!text.getValue().isEmpty()); if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { if (!text.getValue().isEmpty()) { delegate.search(text.getText()); } } } }); }

Target:
private void addHandlers() { isUseFileMask.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { filesMask.setEnabled(event.getValue()); } }); isUseDirectory.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { directory.setEnabled(event.getValue()); selectPathButton.setEnabled(event.getValue()); } }); text.addKeyUpHandler( new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { acceptButton.setEnabled(!text.getValue().isEmpty()); } }); selectPathButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { showSelectPathDialog(); } }); }
Source:
public void testJournalScanIOException() throws Exception { File journalDir = createTempDir("bookie", "journal"); Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(journalDir)); File ledgerDir = createTempDir("bookie", "ledger"); Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(ledgerDir)); writeV4Journal(Bookie.getCurrentDirectory(journalDir), 100, "testPasswd".getBytes()); ServerConfiguration conf = TestBKConfiguration.newServerConfiguration(); conf.setJournalDirName(journalDir.getPath()) .setLedgerDirNames(new String[] { ledgerDir.getPath() }) .setMetadataServiceUri(null); Journal.JournalScanner journalScanner = new DummyJournalScan(); FileChannel fileChannel = PowerMockito.mock(FileChannel.class); PowerMockito.when(fileChannel.position(Mockito.anyLong())) .thenThrow(new IOException()); PowerMockito.mockStatic(JournalChannel.class); PowerMockito.when(JournalChannel.openFileChannel(Mockito.any(RandomAccessFile.class))).thenReturn(fileChannel); Bookie b = new Bookie(conf); for (Journal journal : b.journals) { List<Long> journalIds = journal.listJournalIds(journal.getJournalDirectory(), null); assert journalIds.size() == 1; journal.scanJournal(journalIds.get(0), Long.MAX_VALUE, journalScanner); } }

Target:
public void testJournalScanIOException() throws Exception { File journalDir = createTempDir("bookie", "journal"); Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(journalDir)); File ledgerDir = createTempDir("bookie", "ledger"); Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(ledgerDir)); writeV4Journal(Bookie.getCurrentDirectory(journalDir), 100, "testPasswd".getBytes()); ServerConfiguration conf = TestBKConfiguration.newServerConfiguration(); conf.setJournalDirName(journalDir.getPath()) .setLedgerDirNames(new String[] { ledgerDir.getPath() }) .setMetadataServiceUri(null); Journal.JournalScanner journalScanner = new DummyJournalScan(); FileChannel fileChannel = PowerMockito.mock(FileChannel.class); PowerMockito.when(fileChannel.position(Mockito.anyLong())) .thenThrow(new IOException()); PowerMockito.mockStatic(JournalChannel.class); PowerMockito.when(JournalChannel.openFileChannel(Mockito.any(RandomAccessFile.class))).thenReturn(fileChannel); Bookie b = new Bookie(conf); for (Journal journal : b.journals) { List<Long> journalIds = journal.listJournalIds(journal.getJournalDirectory(), null); assertEquals(journalIds.size(), 1); try { journal.scanJournal(journalIds.get(0), Long.MAX_VALUE, journalScanner); fail("Should not have been able to scan the journal"); } catch (Exception e) { } } b.shutdown(); }
Source:
public void onTraversalStart() { final CachingIndexedFastaSequenceFile referenceReader; final File reference = new File(referenceArguments.getReferenceFileName()); try { referenceReader = new CachingIndexedFastaSequenceFile(reference); } catch (FileNotFoundException e) { throw new UserException.CouldNotReadInputFile(reference, e); } hcEngine = new HaplotypeCallerEngine(hcArgs, getHeaderForReads(), referenceReader); vcfWriter = hcEngine.makeVCFWriter(outputVCF, getHeaderForReads().getSequenceDictionary()); hcEngine.writeHeader(vcfWriter); }

Target:
public void onTraversalStart() { final ReferenceSequenceFile referenceReader = getReferenceReader(referenceArguments); hcEngine = new HaplotypeCallerEngine(hcArgs, getHeaderForReads(), referenceReader); final SAMSequenceDictionary sequenceDictionary = getHeaderForReads().getSequenceDictionary(); vcfWriter = hcEngine.makeVCFWriter(outputVCF, sequenceDictionary); hcEngine.writeHeader(vcfWriter, sequenceDictionary); }
Source:
@Override public SecurityContext authenticateNode(ClusterNode node, SecurityCredentials cred) throws IgniteCheckedException { SecurityContext res = secPrc.authenticateNode(node, cred); if (res != null) { Map<String, Object> attrs = new HashMap<>(node.attributes()); attrs.put(ATTR_SECURITY_SUBJECT_ID, res.subject().id()); ((TcpDiscoveryNode)node).setAttributes(attrs); } return res; }

Target:
@Override public SecurityContext authenticateNode(ClusterNode node, SecurityCredentials cred) throws IgniteCheckedException { SecurityContext res = secPrc.authenticateNode(node, cred); if (res != null) { Map<String, Object> attrs = new HashMap<>(node.attributes()); attrs.put(ATTR_SECURITY_SUBJECT_ID, res.subject().id()); if (node instanceof IgniteClusterNode) ((IgniteClusterNode)node).setAttributes(attrs); else throw new IgniteCheckedException("Node must implement interface IgniteClusterNode."); } return res; }
Source:
public void testDropsExcessRequests() throws Exception { AsyncSpanObserver asyncObserver = createAsyncObserver(2); asyncObserver.consume(span(1)); asyncObserver.consume(span(2)); asyncObserver.consume(span(3)); verify(observer, never()).consume(any(Span.class)); scheduler.runNextPendingCommand(); verify(observer).consume(span(1)); scheduler.runNextPendingCommand(); verify(observer).consume(span(2)); scheduler.runUntilIdle(); Mockito.verifyNoMoreInteractions(observer); }

Target:
public void testDropsExcessRequests() throws Exception { AsyncSpanObserver asyncObserver = createAsyncObserver(2); asyncObserver.consume(span(1)); asyncObserver.consume(span(2)); asyncObserver.consume(span(3)); verify(observer, never()).consume(any(Span.class)); scheduler.runNextPendingCommand(); verify(observer).consume(span(1)); scheduler.runNextPendingCommand(); verify(observer).consume(span(2)); scheduler.runUntilIdle(); verifyNoMoreInteractions(observer); }
Source:
public void testBucketCount() { String regionName = "testCreateRegion"; gfsh.executeAndAssertThat("create region" + " --name=" + regionName + " --type=PARTITION_PERSISTENT" + " --total-num-buckets=1000").statusIsSuccess(); server1.invoke(() -> createBuckets(regionName)); server2.invoke(() -> createBuckets(regionName)); server3.invoke(() -> createBuckets(regionName)); server4.invoke(() -> createBuckets(regionName)); await().untilAsserted(() -> { final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) + server2.invoke(() -> getBucketsInitialized()) + server3.invoke(() -> getBucketsInitialized()) + server4.invoke(() -> getBucketsInitialized()); assertEquals("Expected bucket count is 1000, and actual count is " + sumOfBuckets, sumOfBuckets, 1000); }); for (int i = 1; i < 4; i++) { gfsh.executeAndAssertThat("create region" + " --name=" + regionName + i + " --type=PARTITION_PERSISTENT" + " --total-num-buckets=1000" + " --colocated-with=" + regionName).statusIsSuccess(); } await().untilAsserted(() -> { final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) + server2.invoke(() -> getBucketsInitialized()) + server3.invoke(() -> getBucketsInitialized()) + server4.invoke(() -> getBucketsInitialized()); assertTrue("Expected bucket count is greather than 3500, and actual count is " + sumOfBuckets, sumOfBuckets > 3500); }); }

Target:
public void testBucketCount() { String regionName = "testCreateRegion"; gfsh.executeAndAssertThat("create region" + " --name=" + regionName + " --type=PARTITION_PERSISTENT" + " --total-num-buckets=1000").statusIsSuccess(); server1.invoke(() -> createBuckets(regionName)); server2.invoke(() -> createBuckets(regionName)); server3.invoke(() -> createBuckets(regionName)); server4.invoke(() -> createBuckets(regionName)); for (int i = 1; i < 4; i++) { final int index = i; await().untilAsserted(() -> { final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) + server2.invoke(() -> getBucketsInitialized()) + server3.invoke(() -> getBucketsInitialized()) + server4.invoke(() -> getBucketsInitialized()); final int expectedBuckets = index * 1000; assertThat(sumOfBuckets).isEqualTo(expectedBuckets); }); final String tempRegioName = regionName + i; gfsh.executeAndAssertThat("create region" + " --name=" + tempRegioName + " --type=PARTITION_PERSISTENT" + " --total-num-buckets=1000" + " --colocated-with=" + regionName).statusIsSuccess(); server1.invoke(() -> createBuckets(tempRegioName)); server2.invoke(() -> createBuckets(tempRegioName)); server3.invoke(() -> createBuckets(tempRegioName)); server4.invoke(() -> createBuckets(tempRegioName)); } await().untilAsserted(() -> { final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) + server2.invoke(() -> getBucketsInitialized()) + server3.invoke(() -> getBucketsInitialized()) + server4.invoke(() -> getBucketsInitialized()); assertThat(sumOfBuckets).isEqualTo(4000); }); }
Source:
private KernelTransaction safeAcquireTransaction() { KernelTransaction transaction = actions.kernelTransaction(); Optional<Status> terminationReason = transaction.getReasonIfTerminated(); if ( terminationReason.isPresent() ) { throw new TransactionTerminatedException( terminationReason.get() ); } return transaction; }

Target:
private KernelTransaction safeAcquireTransaction() { KernelTransaction transaction = actions.kernelTransaction(); if ( transaction.isTerminated() ) { Status terminationReason = transaction.getReasonIfTerminated().orElse( Status.Transaction.Terminated ); throw new TransactionTerminatedException( terminationReason ); } return transaction; }
Source:
protected void sendDmxData() { if (this.thing.getStatus().equals(ThingStatus.ONLINE)) { long now = System.currentTimeMillis(); universe.calculateBuffer(now); for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if (socket.isConnected()) { try { socket.getOutputStream().write(universe.getBuffer()); } catch (IOException e) { logger.debug("Could not send to in {}: ", receiverNode, this.thing.getUID(), e); closeConnection(ThingStatusDetail.COMMUNICATION_ERROR, "could not send DMX data"); return; } } else { closeConnection(ThingStatusDetail.NONE, "reconnect"); return; } } } else { openConnection(); } }

Target:
protected void sendDmxData() { if (this.thing.getStatus().equals(ThingStatus.ONLINE)) { long now = System.currentTimeMillis(); universe.calculateBuffer(now); for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if (socket.isConnected()) { try { socket.getOutputStream().write(universe.getBuffer()); } catch (IOException e) { logger.debug("Could not send to in {}: {}", receiverNode, this.thing.getUID(), e.getMessage()); closeConnection(ThingStatusDetail.COMMUNICATION_ERROR, "could not send DMX data"); return; } } else { closeConnection(ThingStatusDetail.NONE, "reconnect"); return; } } } else { openConnection(); } }
Source:
char sendIMKeyEvent (int type, long event, char chars) { int index = 0, count = 0, state = 0; long ptr = 0; if (event == 0) { ptr = GTK.gtk_get_current_event (); if (ptr != 0) { int eventType = GDK.gdk_event_get_event_type(ptr); eventType = Control.fixGdkEventTypeValues(eventType); switch (eventType) { case GDK.GDK_KEY_PRESS: case GDK.GDK_KEY_RELEASE: int eventState = new int[1]; GDK.gdk_event_get_state(ptr, eventState); state = eventState[0]; break; default: event = 0; break; } } else { int buffer = new int [1]; GTK.gtk_get_current_event_state (buffer); state = buffer [0]; } } else { ptr = event; } while (index < chars.length) { Event javaEvent = new Event (); if (ptr != 0 && chars.length <= 1) { setKeyState (javaEvent, ptr); } else { setInputState (javaEvent, state); } javaEvent.character = chars [index]; sendEvent (type, javaEvent); if (isDisposed ()) { if (ptr != 0) gdk_event_free (ptr); return null; } if (javaEvent.doit) chars [count++] = chars [index]; index++; } if (ptr != 0) gdk_event_free (ptr); if (count == 0) return null; if (index != count) { char result = new char [count]; System.arraycopy (chars, 0, result, 0, count); return result; } return chars; }

Target:
char sendIMKeyEvent (int type, long event, char chars) { int index = 0, count = 0, state = 0; long ptr = 0; if (event == 0) { ptr = GTK.gtk_get_current_event (); if (ptr != 0) { int eventType = GDK.gdk_event_get_event_type(ptr); eventType = Control.fixGdkEventTypeValues(eventType); switch (eventType) { case GDK.GDK_KEY_PRESS: case GDK.GDK_KEY_RELEASE: int eventState = new int[1]; GDK.gdk_event_get_state(ptr, eventState); state = eventState[0]; break; default: event = 0; break; } } else { int buffer = new int [1]; GTK.gtk_get_current_event_state (buffer); state = buffer [0]; } } else { ptr = event; } while (index < chars.length) { Event javaEvent = new Event (); if (ptr != 0 && chars.length <= 1) { setKeyState (javaEvent, ptr); } else { setInputState (javaEvent, state); } javaEvent.character = chars [index]; sendEvent (type, javaEvent); if (isDisposed ()) { if (ptr != 0 && ptr != event) gdk_event_free (ptr); return null; } if (javaEvent.doit) chars [count++] = chars [index]; index++; } if (ptr != 0 && ptr != event) gdk_event_free (ptr); if (count == 0) return null; if (index != count) { char result = new char [count]; System.arraycopy (chars, 0, result, 0, count); return result; } return chars; }
Source:
public void initialise() { infoArea = find("infoArea", UIText.class); updateInfoButton = find("updateInfoButton", UIButton.class); Calendar c = Calendar.getInstance(); c.setTimeInMillis(System.currentTimeMillis()); String date = c.get(Calendar.YEAR)+"-"+c.get(Calendar.MONTH)+"-"+c.get(Calendar.DAY_OF_MONTH); String time = c.get(Calendar.HOUR_OF_DAY)+":"+c.get(Calendar.MINUTE)+":"+c.get(Calendar.SECOND); infoArea.setText("Real Time: "+date + " " + time+"\nPress ESC to exit"); if (updateInfoButton != null) { updateInfoButton.subscribe(button -> { Calendar d = Calendar.getInstance(); d.setTimeInMillis(System.currentTimeMillis()); String date2 = d.get(Calendar.YEAR)+"-"+d.get(Calendar.MONTH)+"-"+d.get(Calendar.DAY_OF_MONTH); String time2 = d.get(Calendar.HOUR_OF_DAY)+":"+d.get(Calendar.MINUTE)+":"+d.get(Calendar.SECOND); infoArea.setText("Real Time: "+date2 + " " + time2+"\nPress ESC to exit"); }); } }

Target:
public void initialise() { infoArea = find("infoArea", UIText.class); updateInfoButton = find("updateInfoButton", UIButton.class); setInfoAreaText(); if (updateInfoButton != null) { updateInfoButton.subscribe((UIWidget button) -> setInfoAreaText()); } }
Source:
public static boolean isIdentity(ProjectNode projectNode) { for (Map.Entry<Symbol, Expression> entry : projectNode.getAssignments().entrySet()) { Expression expression = entry.getValue(); Symbol symbol = entry.getKey(); if (!(expression instanceof SymbolReference && ((SymbolReference) expression).getName().equals(symbol.getName()))) { return false; } } return true; }

Target:
public static boolean isIdentity(ProjectNode projectNode) { for (Symbol symbol : projectNode.getAssignments().getSymbols()) { if (!isIdentity(projectNode, symbol)) { return false; } } return true; }
Source:
public ArrayInterface setString(int index, String value) { return setObject(index, value); }

Target:
public Array setString(int index, String value) { return setObject(index, value); }
Source:
private void handleConnectionFailed(Exception exception) { try { if (isHandling) return; isHandling = true; if (!(exception instanceof XMPPException)) { MessageDialog.openError( SWTUtils.getShell(), "Connecting Error", MessageFormat.format( "Could not connect to XMPP server. Unexpected error: {0}", exception.getMessage())); return; } final XMPPAccount accountUsedForConnecting = XMPPConnectionSupport.getInstance().getCurrentXMPPAccount(); if (accountUsedForConnecting == null) return; final String errorMessesage = generateHumanReadableErrorMessage((XMPPException) exception); final boolean editAccountAndConnectAgain = MessageDialog.openQuestion(SWTUtils.getShell(), "Connecting Error", errorMessesage); if (!editAccountAndConnectAgain) return; if (WizardUtils.openEditXMPPAccountWizard(accountUsedForConnecting) == null) return; XMPPConnectionSupport.getInstance().connect(accountUsedForConnecting, false); } finally { isHandling = false; } }

Target:
private void handleConnectionFailed(Exception exception) { try { if (isHandling) return; isHandling = true; if (!(exception instanceof XMPPException)) { MessageDialog.openError( SWTUtils.getShell(), "Connecting Error", MessageFormat.format( "Could not connect to XMPP server. Unexpected error: {0}", exception.getMessage())); return; } final XMPPAccount accountUsedForConnecting = XMPPConnectionSupport.getInstance().getCurrentXMPPAccount(); if (accountUsedForConnecting == null) { log.warn( "could not found the account that was used for establishing the connection - " + "this can happen if connections are not established through class: " + XMPPConnectionSupport.class.getSimpleName()); return; } final String errorMessesage = generateHumanReadableErrorMessage((XMPPException) exception); final boolean editAccountAndConnectAgain = MessageDialog.openQuestion(SWTUtils.getShell(), "Connecting Error", errorMessesage); if (!editAccountAndConnectAgain) return; if (WizardUtils.openEditXMPPAccountWizard(accountUsedForConnecting) == null) return; XMPPConnectionSupport.getInstance().connect(accountUsedForConnecting, false); } finally { isHandling = false; } }
Source:
public TimestampStoreInvalidator createTimestampStoreInvalidator(KeyValueService rawKvs, Optional<DbTimestampCreationSetting> creationParameters) { ConnectionManagerAwareDbKvs dbkvs = (ConnectionManagerAwareDbKvs) rawKvs; return creationParameters.map(params -> DbTimestampCreationSettings.caseOf(params) .multipleSeries((table, series) -> defaultTimestampStoreInvalidator(dbkvs, creationParameters)) .singleSeries(table -> timestampStoreInvalidator(dbkvs, table))) .orElseGet(() -> timestampStoreInvalidator(dbkvs, Optional.empty())); }

Target:
public TimestampStoreInvalidator createTimestampStoreInvalidator(KeyValueService rawKvs, Optional<DbTimestampCreationSetting> creationParameters) { ConnectionManagerAwareDbKvs dbkvs = (ConnectionManagerAwareDbKvs) rawKvs; return creationParameters.map(params -> DbTimestampCreationSettings.caseOf(params) .singleSeries(table -> timestampStoreInvalidator(dbkvs, table)) .otherwise(() -> { throw new SafeIllegalStateException("Invalidator must only be called by embedded DB timeLock that " + "does not support multi series timestamp store. This is unexpected, " + "please contact support."); })) .orElseGet(() -> timestampStoreInvalidator(dbkvs, Optional.empty())); }
Source:
protected void onCancelled() { super.onCancelled(); mainActivityWeakReference.get().getSupportLoaderManager().destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEY); mainActivityWeakReference.get().getSupportLoaderManager().destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEYS); }

Target:
protected void onCancelled() { super.onCancelled(); final MainActivity mainActivity = this.mainActivity.get(); if (mainActivity != null) { mainActivity.getSupportLoaderManager().destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEY); mainActivity.getSupportLoaderManager().destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEYS); } }
Source:
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_provider_management, container, false); providerList = new ArrayList<>(); providersAdapter = new ProviderManagerDashboardRecyclerViewAdapter(this, mPresenter, providerList); mProviderManagementRecyclerView = root.findViewById(R.id.providerManagementRecyclerView); mProviderManagementRecyclerView.setHasFixedSize(true); mProviderManagementRecyclerView.setAdapter(providersAdapter); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(root.getContext()); mProviderManagementRecyclerView.setLayoutManager(linearLayoutManager); mEmptyList = root.findViewById(R.id.emptyProviderManagementList); mProgressBar = root.findViewById(R.id.providerManagementInitialProgressBar); addProviderFab = root.findViewById(R.id.providerManagementFragAddFAB); refreshUI(); addProviderFab.setOnClickListener(v -> { Intent intent = new Intent(getActivity(),AddProviderActivity.class); ArrayList<Provider> providerArrayList = new ArrayList<>(providerList); intent.putExtra(ApplicationConstants.BundleKeys.EXISTING_PROVIDERS_BUNDLE,providerArrayList); startActivityForResult(intent, ADD_PROVIDER_REQ_CODE); }); FontsUtil.setFont(Objects.requireNonNull(this.getActivity()).findViewById(android.R.id.content)); return root; }

Target:
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_provider_management, container, false); providerList = new ArrayList<>(); providersAdapter = new ProviderManagerDashboardRecyclerViewAdapter(this, mPresenter, providerList); mProviderManagementRecyclerView = root.findViewById(R.id.providerManagementRecyclerView); mProviderManagementRecyclerView.setHasFixedSize(true); mProviderManagementRecyclerView.setAdapter(providersAdapter); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(root.getContext()); mProviderManagementRecyclerView.setLayoutManager(linearLayoutManager); mEmptyList = root.findViewById(R.id.emptyProviderManagementList); mProgressBar = root.findViewById(R.id.providerManagementInitialProgressBar); addProviderFab = root.findViewById(R.id.providerManagementFragAddFAB); refreshUI(); addProviderFab.setOnClickListener(view -> { Intent intent = new Intent(getActivity(), AddProviderActivity.class); ArrayList<Provider> providerArrayList = new ArrayList<>(providerList); intent.putExtra(ApplicationConstants.BundleKeys.EXISTING_PROVIDERS_BUNDLE, providerArrayList); startActivityForResult(intent, ADD_PROVIDER_REQ_CODE); }); FontsUtil.setFont(Objects.requireNonNull(this.getActivity()).findViewById(android.R.id.content)); return root; }
Source:
private boolean isRemoveAutoGeneratedSnapshotRequired() { return getParameters().getStage() == LiveMigrateStage.LIVE_MIGRATE_DISK_EXEC_START || getParameters().getStage() == LiveMigrateStage.LIVE_MIGRATE_DISK_EXEC_COMPLETED; }

Target:
private boolean isRemoveAutoGeneratedSnapshotRequired() { return getParameters().getStage() != LiveMigrateStage.CREATE_SNAPSHOT; }