auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Map<K, V> copy(Map<K, V> source, Map dest) { for (Entry<K, V> entry : source.entrySet()) { K key = entry.getKey(); K altKey; if (key instanceof String) { altKey = (K) new CaseInsensitiveString((String) key); } else { altKey = key; } dest.put(altKey, entry.getValue()); } return dest; }

Target:
protected Map<K, V> copy(Map<K, V> source, Map dest) { for (Entry<K, V> entry : source.entrySet()) { K key = entry.getKey(); if (key instanceof String) { key = (K) new CaseInsensitiveString((String) key); } dest.put(key, entry.getValue()); } return dest; }
Source:
public void mergeContributors(List<Long> contributorIds, String displayName) { List<ContributorEntity> contributors = contributorRepository.findAllByIdsWithProjects(contributorIds); contributors.sort(Ordering.explicit(contributorIds).onResultOf(ContributorEntity::getId)); contributorIds.forEach( id -> { if (contributors.stream().noneMatch(c -> c.getId().equals(id))) { throw new ContributorNotFoundException(id); } }); ContributorEntity firstEntity = contributors.get(0); for (int i = 1; i < contributors.size(); i++) { ContributorEntity contributorEntity = contributors.get(i); firstEntity.getNames().addAll(contributorEntity.getNames()); firstEntity.getEmails().addAll(contributorEntity.getEmails()); firstEntity.getProjects().addAll(contributorEntity.getProjects()); contributorRepository.deleteById(contributorEntity.getId()); logger.info("Deleted contributor with id {}", contributorEntity.getId()); } firstEntity.setDisplayName(displayName); contributorRepository.save(firstEntity, 1); }

Target:
public void mergeContributors(List<Long> contributorIds, String displayName) { List<ContributorEntity> contributors = contributorRepository.findAllByIdsWithProjects(contributorIds); contributors.sort(Ordering.explicit(contributorIds).onResultOf(ContributorEntity::getId)); contributorIds.forEach( id -> { if (contributors.stream().noneMatch(c -> c.getId().equals(id))) { throw new ContributorNotFoundException(id); } }); ContributorEntity firstEntity = contributors.get(0); for (int i = 1; i < contributors.size(); i++) { ContributorEntity contributorEntity = contributors.get(i); firstEntity.getNames().addAll(contributorEntity.getNames()); firstEntity.getEmails().addAll(contributorEntity.getEmails()); firstEntity.getProjects().addAll(contributorEntity.getProjects()); contributorRepository.deleteById(contributorEntity.getId()); } firstEntity.setDisplayName(displayName); contributorRepository.save(firstEntity, 1); }
Source:
public void execute(List<Process> processes, String script) throws DataException { this.parameters = new HashMap<>(); StrTokenizer tokenizer = new StrTokenizer(script, ' ', '\"'); while (tokenizer.hasNext()) { String tok = tokenizer.nextToken(); if (Objects.isNull(tok) || !tok.contains(":")) { if (Objects.nonNull(parameters.get("action")) && !parameters.get("action").equals("copyData")) { Helper.setErrorMessage("goobiScriptfield", "missing delimiter / unknown parameter: ", tok); } } else { String key = tok.substring(0, tok.indexOf(':')); String value = tok.substring(tok.indexOf(':') + 1); this.parameters.put(key, value); } } if (Objects.isNull(this.parameters.get("action"))) { Helper.setErrorMessage("missing action", " - possible: 'action:addRole, action:setTaskProperty, action:setStepStatus, " + "action:swapprozessesout, action:swapprozessesin, action:deleteTiffHeaderFile, " + "action:importFromFileSystem'"); return; } if (executeScript(processes, script)) { Helper.setMessage("kitodoScript finished"); } }

Target:
public void execute(List<Process> processes, String script) throws DataException { this.parameters = new HashMap<>(); StrTokenizer tokenizer = new StrTokenizer(script, ' ', '\"'); while (tokenizer.hasNext()) { String tok = tokenizer.nextToken(); if (Objects.isNull(tok) || !tok.contains(":")) { if (Objects.nonNull(parameters.get("action")) && !parameters.get("action").equals("copyData")) { Helper.setErrorMessage("missing delimiter / unknown parameter: ", tok); } } else { String key = tok.substring(0, tok.indexOf(':')); String value = tok.substring(tok.indexOf(':') + 1); this.parameters.put(key, value); } } if (Objects.isNull(this.parameters.get("action"))) { Helper.setErrorMessage("missing action", " - possible: 'action:addRole, action:setTaskProperty, action:setStepStatus, " + "action:swapprozessesout, action:swapprozessesin, action:deleteTiffHeaderFile, " + "action:importFromFileSystem'"); return; } if (executeScript(processes, script)) { Helper.setMessage("kitodoScript finished"); } }
Source:
private String[] getItemStrings(List<TmfEventTableColumn> columns, ITmfEvent event) { if (event == null) { return EMPTY_STRING_ARRAY; } synchronized (columns) { Map<TmfEventTableColumn, String> itemStrings = new HashMap<>(); for (TableColumn viewColumn : fTable.getColumns()) { TmfEventTableColumn column = fColumns.get((int) viewColumn.getData(Key.INDEX)); ITmfEvent passedEvent = event; if (!(column instanceof TmfMarginColumn) && (event instanceof CachedEvent)) { passedEvent = ((CachedEvent) event).event; } if (passedEvent == null || (!viewColumn.getResizable() && viewColumn.getWidth() == 0)) { itemStrings.put(column, EMPTY_STRING); } else { itemStrings.put(column, column.getItemString(passedEvent)); } } String[] displayStrings = new String[columns.size()]; int i = 0; for (TmfEventTableColumn column : columns) { displayStrings[i] = itemStrings.get(column); i++; } return displayStrings; } }

Target:
private String[] getItemStrings(List<TmfEventTableColumn> columns, ITmfEvent event) { if (event == null) { return EMPTY_STRING_ARRAY; } synchronized (columns) { String[] itemStrings = new String[columns.size()]; TableColumn[] tableColumns = fTable.getColumns(); for (int i = 0; i < columns.size(); i++) { TmfEventTableColumn column = columns.get(i); ITmfEvent passedEvent = event; if (!(column instanceof TmfMarginColumn) && (event instanceof CachedEvent)) { passedEvent = ((CachedEvent) event).event; } TableColumn tableColumn = tableColumns[fColumns.indexOf(column)]; if (passedEvent == null || (!tableColumn.getResizable() && tableColumn.getWidth() == 0)) { itemStrings[i] = EMPTY_STRING; } else { itemStrings[i] = column.getItemString(passedEvent); } } return itemStrings; } }
Source:
public Collection<Descriptor> getDescriptors() { Collection<Descriptor> descriptors = super.getDescriptors(); descriptors.add(new Settings() .set("type", getCapabilityName()) .set("defaultServerResource", ehcacheStateService.getDefaultServerResource())); return descriptors; }

Target:
public Collection<? extends Descriptor> getDescriptors() { Collection<Descriptor> descriptors = new ArrayList<>(super.getDescriptors()); descriptors.add(new Settings() .set("type", getCapabilityName()) .set("defaultServerResource", ehcacheStateService.getDefaultServerResource())); return descriptors; }
Source:
public static CloudResourceManager initializeService() throws IOException, GeneralSecurityException { GoogleCredentials credential = GoogleCredentials.getApplicationDefault() .createScoped(Collections.singleton(IamScopes.CLOUD_PLATFORM)); CloudResourceManager service = new CloudResourceManager.Builder( GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance(), new HttpCredentialsAdapter(credential)) .setApplicationName("service-accounts") .build(); return service; }

Target:
public static CloudResourceManager initializeService() throws IOException, GeneralSecurityException { GoogleCredentials credential = GoogleCredentials.getApplicationDefault() .createScoped(Collections.singleton(IamScopes.CLOUD_PLATFORM)); CloudResourceManager service = new CloudResourceManager.Builder( GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance(), new HttpCredentialsAdapter(credential)) .setApplicationName("iam-quickstart") .build(); return service; }
Source:
private void storeToken(SalesforceOAuthAccessTokenResponse token, String tokenFilePath) { File tokenFile = new File(tokenFilePath); if (!tokenFile.exists()) { try { tokenFile.getParentFile().mkdirs(); tokenFile.createNewFile(); } catch (IOException e) { new RuntimeException("The token file creation failed, the refresh token can't be stored correctly.", e); } } try (FileOutputStream outputStream = new FileOutputStream(tokenFile)) { Properties prop = new Properties(); prop.setProperty(REFRESHTOKEN_KEY, token.getRefreshToken()); prop.store(outputStream, null); } catch (IOException e) { throw new RuntimeException("Unexpected error, the refresh token can't be stored correctly.", e); } }

Target:
private void storeToken(SalesforceOAuthAccessTokenResponse token, String tokenFilePath) { File tokenFile = new File(tokenFilePath); if (!tokenFile.exists()) { try { tokenFile.getParentFile().mkdirs(); tokenFile.createNewFile(); } catch (IOException e) { throw new RuntimeException("The token file creation failed, the refresh token can't be stored correctly.", e); } } try (FileOutputStream outputStream = new FileOutputStream(tokenFile)) { Properties prop = new Properties(); prop.setProperty(REFRESHTOKEN_KEY, token.getRefreshToken()); prop.store(outputStream, null); } catch (IOException e) { throw new RuntimeException("Unexpected error, the refresh token can't be stored correctly.", e); } }
Source:
public void resolveSuppressedMuleException() { ErrorType expected = DISPATCH; Throwable exception = new DispatchException(createStaticMessage("DISPATCH PROBLEM"), new ValidateResponse(), suppressIfPresent(CONNECTION_EXCEPTION, CONNECTION_EXCEPTION.getClass(), false)); MessagingException me = newMessagingException(exception, event, processor); MessagingExceptionResolver anotherResolver = new MessagingExceptionResolver(new TestProcessor()); MessagingException resolved = anotherResolver.resolve(me, locator, emptyList()); assertExceptionErrorType(resolved, expected); assertExceptionMessage(resolved.getMessage(), "DISPATCH PROBLEM"); assertThat(resolved.getInfo().get(MuleExceptionInfo.INFO_CAUSED_BY_KEY), is(nullValue())); }

Target:
public void resolveSuppressedMuleException() { ErrorType expected = DISPATCH; Throwable exception = new DispatchException(createStaticMessage("DISPATCH PROBLEM"), new ValidateResponse(), suppressIfPresent(CONNECTION_EXCEPTION, CONNECTION_EXCEPTION.getClass())); MessagingException me = newMessagingException(exception, event, processor); MessagingExceptionResolver anotherResolver = new MessagingExceptionResolver(new TestProcessor()); MessagingException resolved = anotherResolver.resolve(me, locator, emptyList()); assertExceptionErrorType(resolved, expected); assertExceptionMessage(resolved.getMessage(), "DISPATCH PROBLEM"); assertExceptionMessage(resolved.getInfo().get(INFO_CAUSED_BY_KEY).toString(), "CONNECTION PROBLEM"); }
Source:
private void setUpCheckList(ConnectorConfiguration connectorConfiguration) { checkList.add(new SqsHealthCheckQueueHolder(connectorConfiguration.getSqsConfig().getCaptureQueueUrl(), "capture")); checkList.add(new SqsHealthCheckQueueHolder(connectorConfiguration.getSqsConfig().getEventQueueUrl(), "event")); }

Target:
private void setUpCheckList(ConnectorConfiguration connectorConfiguration) { checkList.add(new BasicNameValuePair("capture", connectorConfiguration.getSqsConfig().getCaptureQueueUrl())); checkList.add(new BasicNameValuePair("event", connectorConfiguration.getSqsConfig().getEventQueueUrl())); }
Source:
public void testSpanningDeletion() throws FileNotFoundException { final File truthVcfPath = new File(TEST_DATA_PATH.getAbsolutePath(), "spanningDeletionTruth.vcf"); final File callVcfPath = new File(TEST_DATA_PATH.getAbsolutePath(), "spanningDeletionCallset.vcf"); final File outputBaseFileName = new File(OUTPUT_DATA_PATH, "spanningDeletion"); final File outputContingencyMetrics = new File(outputBaseFileName.getAbsolutePath() + GenotypeConcordance.CONTINGENCY_METRICS_FILE_EXTENSION); outputContingencyMetrics.deleteOnExit(); final GenotypeConcordance genotypeConcordance = new GenotypeConcordance(); genotypeConcordance.TRUTH_VCF = truthVcfPath; genotypeConcordance.TRUTH_SAMPLE = "/dev/stdin"; genotypeConcordance.CALL_VCF = callVcfPath; genotypeConcordance.CALL_SAMPLE = "CHMI_CHMI3_WGS2"; genotypeConcordance.OUTPUT = new File(OUTPUT_DATA_PATH, "spanningDeletion"); genotypeConcordance.OUTPUT_VCF = true; Assert.assertEquals(genotypeConcordance.instanceMain(new String[0]), 0); final MetricsFile<GenotypeConcordanceContingencyMetrics, Comparable<?>> output = new MetricsFile<GenotypeConcordanceContingencyMetrics, Comparable<?>>(); output.read(new FileReader(outputContingencyMetrics)); for (final GenotypeConcordanceContingencyMetrics metrics : output.getMetrics()) { metrics.CALL_SAMPLE = "CHMI_CHMI3_WGS2"; metrics.TRUTH_SAMPLE = "/dev/stdin"; } }

Target:
public void testSpanningDeletion() throws FileNotFoundException { final File truthVcfPath = new File(TEST_DATA_PATH.getAbsolutePath(), "spanningDeletionTruth.vcf"); final File callVcfPath = new File(TEST_DATA_PATH.getAbsolutePath(), "spanningDeletionCallset.vcf"); final File outputBaseFileName = new File(OUTPUT_DATA_PATH, "spanningDeletion"); final File outputContingencyMetrics = new File(outputBaseFileName.getAbsolutePath() + GenotypeConcordance.CONTINGENCY_METRICS_FILE_EXTENSION); outputContingencyMetrics.deleteOnExit(); final GenotypeConcordance genotypeConcordance = new GenotypeConcordance(); genotypeConcordance.TRUTH_VCF = truthVcfPath; genotypeConcordance.TRUTH_SAMPLE = "/dev/stdin"; genotypeConcordance.CALL_VCF = callVcfPath; genotypeConcordance.CALL_SAMPLE = "CHMI_CHMI3_WGS2"; genotypeConcordance.OUTPUT = new File(OUTPUT_DATA_PATH, "spanningDeletion"); genotypeConcordance.OUTPUT_VCF = true; Assert.assertEquals(genotypeConcordance.instanceMain(new String[0]), 0); final MetricsFile<GenotypeConcordanceContingencyMetrics, Comparable<?>> output = new MetricsFile<GenotypeConcordanceContingencyMetrics, Comparable<?>>(); output.read(new FileReader(outputContingencyMetrics)); for (final GenotypeConcordanceContingencyMetrics metrics : output.getMetrics()) { if (metrics.VARIANT_TYPE == VariantContext.Type.SNP) { Assert.assertEquals(metrics.TP_COUNT, 0); Assert.assertEquals(metrics.TN_COUNT,0); Assert.assertEquals(metrics.FP_COUNT, 0); Assert.assertEquals(metrics.FN_COUNT, 0); Assert.assertEquals(metrics.EMPTY_COUNT, 0); } } }
Source:
public static Set<Class> getSystemClasss(Resource resource) { if (resource != null && resource.getContents().size() > 0) { Set<Class> result = new HashSet<>(); for (EObject eObject : resource.getContents()) { if (eObject instanceof Class) { if (isSystemClass((Class) eObject)) { result.add((Class) eObject); } } } return result; } else { Activator.log.error("Impossible to get content of the Model Library", null); } return Collections.emptySet(); }

Target:
public static Set<Class> getSystemClasss(Resource resource) { if (resource != null && resource.getContents().size() > 0) { Set<Class> result = new HashSet<>(); TreeIterator<EObject> allContents = resource.getAllContents(); while (allContents.hasNext()) { EObject eObject = allContents.next(); if (eObject instanceof Class) { if (isSystemClass((Class) eObject)) { result.add((Class) eObject); } } } return result; } else { Activator.log.error("Impossible to get content of the Model Library", null); } return Collections.emptySet(); }
Source:
public Owner getOwner() { return thingIfApi.getOwner(); }

Target:
public Owner getOwner() { return this.thingIfApi.getOwner(); }
Source:
public void executeQueryCommandWithWatchdog() { final Guid vmId = new Guid("ee655a4d-effc-4aab-be2b-2f80ff40cd1c"); VmDeviceDAO vmDeviceDaoMock = Mockito.mock(VmDeviceDAO.class); HashMap<String, Object> watchdogSpecParams = new HashMap<String, Object>(); watchdogSpecParams.put("model", "i3600esb"); watchdogSpecParams.put("action", "reset"); VmDevice vmDevice = new VmDevice(new VmDeviceId(new Guid("6f86b8a4-e721-4149-b2df-056eb621b16a"), vmId), VmDeviceType.WATCHDOG.getName(), "watchdog", "", 1, watchdogSpecParams, true, true, true, ""); Mockito.when(vmDeviceDaoMock.getVmDeviceByVmIdAndType(vmId, VmDeviceType.WATCHDOG.getName())) .thenReturn(Arrays.asList(vmDevice)); GetWatchdogQuery<IdQueryParameters> query = new GetWatchdogQuery<IdQueryParameters>(new IdQueryParameters(vmId)); query = Mockito.spy(query); Mockito.when(query.getVmDeviceDAO()).thenReturn(vmDeviceDaoMock); IdQueryParameters params = new IdQueryParameters(vmId); Mockito.when(query.getParameters()) .thenReturn(params); Mockito.doCallRealMethod().when(query).executeQueryCommand(); Mockito.doCallRealMethod().when(query).getReturnValue(); Mockito.doCallRealMethod().when(query).setReturnValue(Mockito.any(Object.class)); query.executeQueryCommand(); Assert.assertNotNull(query.getReturnValue()); Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getAction()).name().toLowerCase(), "reset"); Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getModel()).name().toLowerCase(), "i3600esb"); }

Target:
public void executeQueryCommandWithWatchdog() { final Guid vmId = new Guid("ee655a4d-effc-4aab-be2b-2f80ff40cd1c"); VmDeviceDAO vmDeviceDaoMock = Mockito.mock(VmDeviceDAO.class); HashMap<String, Object> watchdogSpecParams = new HashMap<String, Object>(); watchdogSpecParams.put("model", "i3600esb"); watchdogSpecParams.put("action", "reset"); VmDevice vmDevice = new VmDevice(new VmDeviceId(new Guid("6f86b8a4-e721-4149-b2df-056eb621b16a"), vmId), VmDeviceType.WATCHDOG.getName(), "watchdog", "", 1, watchdogSpecParams, true, true, true, ""); Mockito.when(vmDeviceDaoMock.getVmDeviceByVmIdAndType(vmId, VmDeviceType.WATCHDOG.getName())) .thenReturn(Arrays.asList(vmDevice)); GetWatchdogQuery<IdQueryParameters> query = new GetWatchdogQuery<IdQueryParameters>(new IdQueryParameters(vmId)); query = Mockito.spy(query); Mockito.when(query.getVmDeviceDAO()).thenReturn(vmDeviceDaoMock); IdQueryParameters params = new IdQueryParameters(vmId); Mockito.when(query.getParameters()) .thenReturn(params); Mockito.doCallRealMethod().when(query).executeQueryCommand(); Mockito.doCallRealMethod().when(query).getReturnValue(); Mockito.doCallRealMethod().when(query).setReturnValue(Mockito.any(Object.class)); query.executeQueryCommand(); Assert.assertNotNull(query.getReturnValue()); Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getAction()).name().toLowerCase(), "reset"); Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getModel()).name().toLowerCase(), "i6300esb"); }
Source:
public void stop(BundleContext context) throws Exception { REGISTRY.dispose(); sessionFactoryRegistryListener.dispose(); sessionFactoryRegistryListener = null; deleteHookDescriptorRegistryListener.dispose(); deleteHookDescriptorRegistryListener = null; javaActionRegistryListener.dispose(); javaActionRegistryListener = null; ViewpointRegistry.getInstance().dispose(); MultiLanguagesValidator.getInstance().dispose(); ResourceStrategyRegistry.getInstance().clearRegistry(); super.stop(context); }

Target:
public void stop(BundleContext context) throws Exception { REGISTRY.dispose(); sessionFactoryRegistryListener.dispose(); sessionFactoryRegistryListener = null; deleteHookDescriptorRegistryListener.dispose(); deleteHookDescriptorRegistryListener = null; javaActionRegistryListener.dispose(); javaActionRegistryListener = null; ViewpointRegistry.getInstance().dispose(); MultiLanguagesValidator.getInstance().dispose(); ResourceStrategyRegistry.getInstance().dispose(); super.stop(context); }
Source:
public void InteractiveMaps_034_PalantirUpdateMapPosition() { InteractiveMapPageObject selectedMap = new InteractiveMapPageObject(driver); selectedMap.openMap(wikiURL, 3); selectedMap.verifyMapOpened(); PalantirComponentObject poi = new PalantirComponentObject(driver); PalantirContent handle = new PalantirContent(); handle = poi.setAndVerifyPlayerPosition(-40, -10, 3, true); poi.verifyCorrectPlayerPos(handle.success, handle.responseCode, handle.message); handle = poi.updateMapPosition(-90, -10, 3); poi.verifyMapPositionUpdated(handle.success, handle.responseCode, handle.message); }

Target:
public void InteractiveMaps_034_PalantirUpdateMapPosition() { InteractiveMapsPageObject specialMap = new InteractiveMapsPageObject(driver); InteractiveMapPageObject selectedMap = specialMap.openMap(wikiURL, PalantirContent.PALANTIR_MAP); selectedMap.verifyMapOpened(); PalantirComponentObject poi = new PalantirComponentObject(driver); PalantirContent handle = poi.setAndVerifyPlayerPosition(-40, -10, 3, true); poi.verifyCorrectPlayerPos(handle); handle = poi.updateMapPosition(-90, -10, 3); poi.verifyMapPositionUpdated(handle); }
Source:
public List<MeasurementRow> extractExcelFileData(final Workbook workbook, final UserSelection userSelection, final org.generationcp.middleware.domain.etl.Workbook importData, final boolean discardInvalidValues) { final List<MeasurementVariable> variableList = importData.getAllVariables(); boolean hasPlotId = false; for (MeasurementVariable mv: importData.getAllVariables()) { if (mv.getTermId() == 8201){ hasPlotId = true; break; } } final List<String> columnHeaders = this.retrieveColumnHeaders(workbook, userSelection, hasPlotId); final Map<Integer, MeasurementVariable> variableIndexMap = new LinkedHashMap<Integer, MeasurementVariable>(); for (final MeasurementVariable measurementVariable : variableList) { final int columnIndex = columnHeaders.indexOf(measurementVariable.getName()); if (columnIndex != -1) { variableIndexMap.put(columnIndex, measurementVariable); } } return this.extractExcelFileData(workbook, userSelection, variableIndexMap, discardInvalidValues); }

Target:
public List<MeasurementRow> extractExcelFileData(final Workbook workbook, final UserSelection userSelection, final org.generationcp.middleware.domain.etl.Workbook importData, final boolean discardInvalidValues) { final List<MeasurementVariable> variableList = importData.getAllVariables(); final List<String> columnHeaders = this.retrieveColumnHeaders(workbook, userSelection, this.headersContainsPlotId(importData)); final Map<Integer, MeasurementVariable> variableIndexMap = new LinkedHashMap<Integer, MeasurementVariable>(); for (final MeasurementVariable measurementVariable : variableList) { final int columnIndex = columnHeaders.indexOf(measurementVariable.getName()); if (columnIndex != -1) { variableIndexMap.put(columnIndex, measurementVariable); } } return this.extractExcelFileData(workbook, userSelection, variableIndexMap, discardInvalidValues); }
Source:
public <T extends Event> ChargeEntity forceTransitionChargeState(ChargeEntity charge, ChargeStatus targetChargeState) { ChargeStatus fromChargeState = ChargeStatus.fromString(charge.getStatus()); return PaymentGatewayStateTransitions.getEventForForceUpdate(targetChargeState).map(eventClass -> { charge.setStatusIgnoringValidTransitions(targetChargeState); ChargeEventEntity chargeEventEntity = chargeEventDao.persistChargeEventOf(charge); if (shouldEmitPaymentStateTransitionEvents) { stateTransitionService.offerPaymentStateTransition( charge.getExternalId(), fromChargeState, targetChargeState, chargeEventEntity, StatusCorrectedToCapturedToMatchGatewayStatus.class); } return charge; }).orElseThrow(() -> new InvalidForceStateTransitionException(fromChargeState, targetChargeState)); }

Target:
public <T extends Event> ChargeEntity forceTransitionChargeState(ChargeEntity charge, ChargeStatus targetChargeState) { ChargeStatus fromChargeState = ChargeStatus.fromString(charge.getStatus()); return PaymentGatewayStateTransitions.getEventForForceUpdate(targetChargeState).map(eventClass -> { charge.setStatusIgnoringValidTransitions(targetChargeState); ChargeEventEntity chargeEventEntity = chargeEventDao.persistChargeEventOf(charge); if (shouldEmitPaymentStateTransitionEvents) { stateTransitionService.offerPaymentStateTransition( charge.getExternalId(), fromChargeState, targetChargeState, chargeEventEntity, eventClass); } return charge; }).orElseThrow(() -> new InvalidForceStateTransitionException(fromChargeState, targetChargeState)); }
Source:
public void removeFileFromFileSystem(Long userEntityId, String fileId) { if (userEntityId == null || fileId == null) { logger.severe(String.format("Invalid remove parameters: file %s of user %d", fileId, userEntityId)); return; } SystemSetting fileFolderSetting = systemSettingDAO.findByKey(SETTING_FILEFOLDER); if (fileFolderSetting == null || StringUtils.isBlank(fileFolderSetting.getValue())) { logger.warning("File answer storage folder not set"); return; } java.io.File answerFile = Paths.get(fileFolderSetting.getValue(), userEntityId.toString(), fileId).toFile(); if (!answerFile.exists()) { logger.warning(String.format("File %s to be removed is not found", answerFile.getPath())); return; } if (!answerFile.delete()) { logger.warning(String.format("Failed to delete file %s", answerFile.getPath())); } }

Target:
public void removeFileFromFileSystem(Long userEntityId, String fileId) throws IOException { if (userEntityId == null || fileId == null) { logger.severe(String.format("Invalid remove parameters: file %s of user %d", fileId, userEntityId)); throw new IllegalArgumentException("Invalid remove parameters"); } SystemSetting fileFolderSetting = systemSettingDAO.findByKey(SETTING_FILEFOLDER); if (fileFolderSetting == null || StringUtils.isBlank(fileFolderSetting.getValue())) { logger.warning("File answer storage folder not set"); throw new IOException("File answer storage folder not set"); } java.io.File answerFile = Paths.get(fileFolderSetting.getValue(), userEntityId.toString(), fileId).toFile(); if (!answerFile.exists()) { logger.warning(String.format("File %s to be removed is not found", answerFile.getPath())); throw new IOException("File to remove not found"); } if (!answerFile.delete()) { logger.warning(String.format("Failed to delete file %s", answerFile.getPath())); throw new IOException("File removal failed"); } }
Source:
private String generateTokenValueResponse() { byte[] tokenBytes; HttpSession session = getThreadLocalRequest().getSession(); synchronized (session) { if (session.getAttribute(XSRF_TOKEN) == null) { tokenBytes = new byte[TOKEN_SIZE]; random.nextBytes(tokenBytes); session.setAttribute(XSRF_TOKEN, tokenBytes); } else { tokenBytes = (byte[]) session.getAttribute(XSRF_TOKEN); } } return StringUtils.toHexString(tokenBytes); }

Target:
private String generateTokenValueResponse() { byte[] tokenBytes; HttpSession session = getThreadLocalRequest().getSession(); synchronized (session) { tokenBytes = (byte[]) session.getAttribute(XSRF_TOKEN); if (session.getAttribute(XSRF_TOKEN) == null) { tokenBytes = new byte[TOKEN_SIZE]; random.nextBytes(tokenBytes); session.setAttribute(XSRF_TOKEN, tokenBytes); } } return StringUtils.toHexString(tokenBytes); }
Source:
public boolean bindCloudletToVm(Cloudlet cloudlet, Vm vm) { if (!getCloudletWaitingList().contains(cloudlet)) { return false; } cloudlet.setVm(vm); return true; }

Target:
public boolean bindCloudletToVm(Cloudlet cloudlet, Vm vm) { if (!cloudletWaitingList.contains(cloudlet)) { return false; } cloudlet.setVm(vm); return true; }
Source:
public Retaggable(String word, String restrictToPos, String appendTag) { this.word = word; this.restrictToPos = restrictToPos; this.appendTag = appendTag; }

Target:
Retaggable(String word, String restrictToPos, String appendTag) { Objects.requireNonNull(word, "word must not be null"); this.word = word; this.restrictToPos = restrictToPos; this.appendTag = appendTag; }
Source:
public <T extends BaseModel> T get(String path, Class<T> cls) throws IOException { HttpGet getMethod = new HttpGet(api(path)); System.out.println(getMethod.getURI()); System.out.println(getMethod.getRequestLine()); HttpResponse response = client.execute(getMethod, localContext); System.out.println(response.getStatusLine()); getJenkinsVersionFromHeader(response); try { httpResponseValidator.validateResponse(response); return objectFromResponse(cls, response); } finally { EntityUtils.consume(response.getEntity()); releaseConnection(getMethod); } }

Target:
public <T extends BaseModel> T get(String path, Class<T> cls) throws IOException { HttpGet getMethod = new HttpGet(api(path)); HttpResponse response = client.execute(getMethod, localContext); getJenkinsVersionFromHeader(response); try { httpResponseValidator.validateResponse(response); return objectFromResponse(cls, response); } finally { EntityUtils.consume(response.getEntity()); releaseConnection(getMethod); } }
Source:
private MySQLDAOFactory() { try { logger.info("Configuring VIP SSH database."); PlatformConnection.getInstance().createTable("VIPSSHAccounts","email VARCHAR(255), LFCDir VARCHAR(255), " + "sshUser VARCHAR(255), sshHost VARCHAR(255), sshDir VARCHAR(255), sshPort INT, validated BOOLEAN, " + "auth_failed BOOLEAN, theEarliestNextSynchronistation TIMESTAMP, numberSynchronizationFailed BIGINT, transfertType VARCHAR(255), deleteFilesFromSource BOOLEAN DEFAULT 0, PRIMARY KEY(email,LFCDir), FOREIGN KEY (email) REFERENCES VIPUsers(email) " + "ON DELETE CASCADE ON UPDATE CASCADE"); } catch (DAOException ex) { logger.error(ex); } }

Target:
private MySQLDAOFactory() { try { logger.info("Configuring VIP SSH database."); PlatformConnection.getInstance().createTable("VIPSSHAccounts","email VARCHAR(255), LFCDir VARCHAR(255), " + "sshUser VARCHAR(255), sshHost VARCHAR(255), sshDir VARCHAR(255), sshPort INT, validated BOOLEAN, " + "auth_failed BOOLEAN, theEarliestNextSynchronistation TIMESTAMP, numberSynchronizationFailed BIGINT, " + "transfertType VARCHAR(255), deleteFilesFromSource BOOLEAN DEFAULT 0, PRIMARY KEY(email,LFCDir), " + "FOREIGN KEY (email) REFERENCES VIPUsers(email) " + "ON DELETE CASCADE ON UPDATE CASCADE"); } catch (DAOException ex) { logger.error(ex); } }
Source:
@Override public long evictSomeBlocks(long memoryToReserve) { long evicted = 0; if (clockHand == null) { return evicted; } int fullClockRotation = 0; listLock.lock(); try { LlapCacheableBuffer ringTail = clockHand.prev; LlapCacheableBuffer currentClockHead = clockHand; while (evicted < memoryToReserve && currentClockHead != null && fullClockRotation < maxCircles) { if (ringTail == currentClockHead) { fullClockRotation++; } if (currentClockHead.isClockBitSet()) { currentClockHead.unSetClockBit(); currentClockHead = currentClockHead.next; } else { int invalidateFlag = currentClockHead.invalidate(); if (invalidateFlag == LlapCacheableBuffer.INVALIDATE_OK || invalidateFlag == LlapCacheableBuffer.INVALIDATE_ALREADY_INVALID) { if (invalidateFlag == LlapCacheableBuffer.INVALIDATE_OK) { evictionListener.notifyEvicted(currentClockHead); evicted += currentClockHead.getMemoryUsage(); } LlapCacheableBuffer newHand = currentClockHead.next; if (newHand == currentClockHead) { currentClockHead = null; break; } else { if (currentClockHead == ringTail) { ringTail = ringTail.prev; } currentClockHead.prev.next = newHand; newHand.prev = currentClockHead.prev; currentClockHead = newHand; } } else if (invalidateFlag == LlapCacheableBuffer.INVALIDATE_FAILED) { currentClockHead = currentClockHead.next; } else { throw new IllegalStateException("Unknown invalidation flag " + invalidateFlag); } } } clockHand = currentClockHead; return evicted; } finally { listLock.unlock(); } }

Target:
@Override public long evictSomeBlocks(long memoryToReserve) { long evicted = 0; if (clockHand == null) { return evicted; } int fullClockRotation = 0; listLock.lock(); try { LlapCacheableBuffer ringTail = clockHand.prev; LlapCacheableBuffer currentClockHead = clockHand; while (evicted < memoryToReserve && fullClockRotation < maxCircles) { if (ringTail == currentClockHead) { fullClockRotation++; } if (currentClockHead.unSetClockBit()) { currentClockHead = currentClockHead.next; } else { int invalidateFlag = currentClockHead.invalidate(); if (invalidateFlag == LlapCacheableBuffer.INVALIDATE_OK || invalidateFlag == LlapCacheableBuffer.INVALIDATE_ALREADY_INVALID) { if (invalidateFlag == LlapCacheableBuffer.INVALIDATE_OK) { evictionListener.notifyEvicted(currentClockHead); evicted += currentClockHead.getMemoryUsage(); } LlapCacheableBuffer newHand = currentClockHead.next; if (newHand == currentClockHead) { currentClockHead = null; break; } else { if (currentClockHead == ringTail) { ringTail = ringTail.prev; } currentClockHead.prev.next = newHand; newHand.prev = currentClockHead.prev; currentClockHead = newHand; } } else if (invalidateFlag == LlapCacheableBuffer.INVALIDATE_FAILED) { currentClockHead = currentClockHead.next; } else { throw new IllegalStateException("Unknown invalidation flag " + invalidateFlag); } } } clockHand = currentClockHead; return evicted; } finally { listLock.unlock(); } }
Source:
private void assertInvalidMultiPoint(String errorMessage, String... pointWkts) { assertInvalidFunction(format("ST_MultiPoint(array[%s])", ImmutableList.copyOf(pointWkts).stream() .map(wkt -> wkt.equalsIgnoreCase("null") ? "null" : format("ST_GeometryFromText('%s')", wkt)) .collect(Collectors.joining(","))), INVALID_FUNCTION_ARGUMENT, format("Invalid input to ST_MultiPoint: %s", errorMessage)); }

Target:
private void assertInvalidMultiPoint(String errorMessage, String... pointWkts) { assertInvalidFunction( format( "ST_MultiPoint(array[%s])", Arrays.stream(pointWkts) .map(wkt -> wkt == null ? "null" : format("ST_GeometryFromText('%s')", wkt)) .collect(Collectors.joining(","))), INVALID_FUNCTION_ARGUMENT, format("Invalid input to ST_MultiPoint: %s", errorMessage)); }
Source:
public Boolean isReduced() { return isReduced; }

Target:
public Boolean isReduced() { return !truncatedResult.equals(fullResult); }
Source:
public Contentlet find(String inode, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { final Contentlet contentlet = contentFactory.find(inode); if(contentlet == null) { return null; } if(permissionAPI.doesUserHavePermission(contentlet, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)){ return contentlet; }else{ final String u = (user == null) ? "Unknown" : user.getUserId(); throw new DotSecurityException("User:" + u + " does not have permissions on Contentlet "+ContentletUtil .toShortString(contentlet)); } }

Target:
public Contentlet find(String inode, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { final Contentlet contentlet = contentFactory.find(inode); if(contentlet == null) { return null; } if(permissionAPI.doesUserHavePermission(contentlet, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)){ return contentlet; }else{ final String userId = (user == null) ? "Unknown" : user.getUserId(); throw new DotSecurityException("User:" + userId + " does not have permissions on Contentlet "+ContentletUtil .toShortString(contentlet)); } }
Source:
private Pair<List<CloseableIterator<Entry<KeyType>>>, List<Future>> buildCombineTree( List<? extends CloseableIterator<Entry<KeyType>>> childIterators, Supplier<ByteBuffer> bufferSupplier, AggregatorFactory[] combiningFactories, int combineDegree, List<String> dictionary ) { final int numChildLevelIterators = childIterators.size(); final List<CloseableIterator<Entry<KeyType>>> childIteratorsOfNextLevel = new ArrayList<>(); final List<Future> combineFutures = new ArrayList<>(); int i; for (i = 0; i < numChildLevelIterators; i += combineDegree) { if (i < numChildLevelIterators - 1) { final List<? extends CloseableIterator<Entry<KeyType>>> subIterators = childIterators.subList( i, Math.min(i + combineDegree, numChildLevelIterators) ); final Pair<CloseableIterator<Entry<KeyType>>, Future> iteratorAndFuture = runCombiner( subIterators, bufferSupplier.get(), combiningFactories, dictionary ); childIteratorsOfNextLevel.add(iteratorAndFuture.lhs); combineFutures.add(iteratorAndFuture.rhs); } else { childIteratorsOfNextLevel.add(childIterators.get(i)); } } if (childIteratorsOfNextLevel.size() == 1) { return Pair.of(childIteratorsOfNextLevel, combineFutures); } else { final Pair<List<CloseableIterator<Entry<KeyType>>>, List<Future>> parentIteratorsAndFutures = buildCombineTree(childIteratorsOfNextLevel, bufferSupplier, combiningFactories, combineDegree, dictionary); combineFutures.addAll(parentIteratorsAndFutures.rhs); return Pair.of(parentIteratorsAndFutures.lhs, combineFutures); } }

Target:
private Pair<List<CloseableIterator<Entry<KeyType>>>, List<Future>> buildCombineTree( List<? extends CloseableIterator<Entry<KeyType>>> childIterators, Supplier<ByteBuffer> bufferSupplier, AggregatorFactory[] combiningFactories, int combineDegree, List<String> dictionary ) { final int numChildLevelIterators = childIterators.size(); final List<CloseableIterator<Entry<KeyType>>> childIteratorsOfNextLevel = new ArrayList<>(); final List<Future> combineFutures = new ArrayList<>(); for (int i = 0; i < numChildLevelIterators; i += combineDegree) { if (i < numChildLevelIterators - 1) { final List<? extends CloseableIterator<Entry<KeyType>>> subIterators = childIterators.subList( i, Math.min(i + combineDegree, numChildLevelIterators) ); final Pair<CloseableIterator<Entry<KeyType>>, Future> iteratorAndFuture = runCombiner( subIterators, bufferSupplier.get(), combiningFactories, dictionary ); childIteratorsOfNextLevel.add(iteratorAndFuture.lhs); combineFutures.add(iteratorAndFuture.rhs); } else { childIteratorsOfNextLevel.add(childIterators.get(i)); } } if (childIteratorsOfNextLevel.size() == 1) { return Pair.of(childIteratorsOfNextLevel, combineFutures); } else { final Pair<List<CloseableIterator<Entry<KeyType>>>, List<Future>> parentIteratorsAndFutures = buildCombineTree( childIteratorsOfNextLevel, bufferSupplier, combiningFactories, intermediateCombineDegree, dictionary ); combineFutures.addAll(parentIteratorsAndFutures.rhs); return Pair.of(parentIteratorsAndFutures.lhs, combineFutures); } }
Source:
public Integer getEstimatedMaxTopStateCount() { return _estimatedMaxTopStateCount; }

Target:
public int getEstimatedMaxTopStateCount() { return _estimatedMaxTopStateCount; }
Source:
private static PublicKey getPublicKey(String keyName) { PublicKey publicKey = null; try { KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); Certificate cert = keyStore.getCertificate(keyName); publicKey = cert.getPublicKey(); } catch (KeyStoreException e) { log.error(e.getMessage()); throw new IllegalArgumentException("Key " + keyName + " is not availabe in keystore"); } return publicKey; }

Target:
private static PublicKey getPublicKey(String keyName) throws KeyStoreException { PublicKey publicKey = null; KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); Certificate cert = keyStore.getCertificate(keyName); publicKey = cert.getPublicKey(); return publicKey; }
Source:
public void execute() { if (stateManager.getActiveDatabase().isEmpty() || stateManager.getSelectedEntries().isEmpty()) { return; } if (!Arrays.asList( StandardActions.COPY_TITLE, StandardActions.COPY_KEY, StandardActions.COPY_CITE_KEY, StandardActions.COPY_KEY_AND_TITLE, StandardActions.COPY_KEY_AND_LINK) .contains(action)) { return; } switch (action) { case COPY_TITLE: copyTitle(); break; case COPY_KEY: copyKey(); break; case COPY_CITE_KEY: copyCiteKey(); break; case COPY_KEY_AND_TITLE: copyKeyAndTitle(); break; case COPY_KEY_AND_LINK: copyKeyAndLink(); break; } }

Target:
public void execute() { if (stateManager.getActiveDatabase().isEmpty() || stateManager.getSelectedEntries().isEmpty()) { return; } switch (action) { case COPY_TITLE: copyTitle(); break; case COPY_KEY: copyKey(); break; case COPY_CITE_KEY: copyCiteKey(); break; case COPY_KEY_AND_TITLE: copyKeyAndTitle(); break; case COPY_KEY_AND_LINK: copyKeyAndLink(); break; default: LOGGER.info("Unknown copy command."); break; } }
Source:
public void uuidIdPersists() throws Exception { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { BogusSCMSource source = new BogusSCMSource(); SCMItem p = story.j.jenkins.createProject(SCMItem.class, "test-with-source"); p.setSource(source); FreeStyleProject p2 = story.j.createFreeStyleProject("test-without-source"); p2.setDescription(source.getId()); } }); story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SCMItem p = (SCMItem) story.j.jenkins.getItem("test-with-source"); FreeStyleProject p2 = (FreeStyleProject)story.j.jenkins.getItem("test-without-source"); assertNotNull(p); assertNotNull(p2); SCMSource source = p.getSCMSource(p2.getDescription()); assertNotNull(source); assertFalse(source instanceof NullSCMSource); } }); }

Target:
public void uuidIdPersists() throws Exception { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { BogusSCMSource source = new BogusSCMSource(); SCMItem p = story.j.jenkins.createProject(SCMItem.class, "test-with-source"); p.setSource(source); uuid.set(source.getId()); } }); story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SCMItem p = (SCMItem) story.j.jenkins.getItem("test-with-source"); assertNotNull(p); SCMSource source = p.getSCMSource(uuid.get()); assertNotNull(source); assertFalse(source instanceof NullSCMSource); } }); }
Source:
private List<models.Configuration> getConfigurations() { List<models.Configuration> configurations = new ArrayList<>(); FrontEndDatabase f = new FrontEndDatabase(); ArrayList<String[]> configList = f.getConfigList(); if (configList != null) { for (int i = 0; i < configList.size(); i++) { String config[] = configList.get(i); models.Configuration conf = new models.Configuration(config[0], config[1], config[2], config[3], config[4], config[5]); configurations.add(conf); } } return configurations; }

Target:
private List<models.Configuration> getConfigurations() { List<models.Configuration> configurations = new ArrayList<>(); FrontEndDatabase f = new FrontEndDatabase(); List<models.Configuration> configList = f.getConfigList(); if (configList != null) { for (int i = 0; i < configList.size(); i++) { configurations.add(configList.get(i)); } } return configList; }
Source:
public void testNextRun() { final Schedule schedule = new OneOffSchedule.Builder() .setWhenRun(ZonedDateTime.parse("2019-01-01T00:00:00Z")) .setRunAtAndAfter(ZonedDateTime.parse("2019-01-01T00:00:00Z")) .build(); assertEquals( Optional.of(ZonedDateTime.parse("2019-01-01T00:00:00Z")), schedule.nextRun(Optional.empty()) ); assertEquals( Optional.empty(), schedule.nextRun(Optional.of(ZonedDateTime.parse("2019-01-01T00:00:00Z"))) ); assertEquals( Optional.empty(), schedule.nextRun(Optional.of(ZonedDateTime.parse("2018-12-20T12:34:56Z"))) ); assertEquals( Optional.empty(), schedule.nextRun(Optional.of(ZonedDateTime.parse("2019-01-02T12:34:56Z"))) ); assertEquals( Optional.empty(), schedule.nextRun(Optional.of(ZonedDateTime.parse("9999-01-01T00:00:00Z"))) ); }

Target:
public void testNextRun() { final Schedule schedule = new OneOffSchedule.Builder() .setRunAtAndAfter(ZonedDateTime.parse("2019-01-01T00:00:00Z")) .build(); assertEquals( Optional.of(ZonedDateTime.parse("2019-01-01T00:00:00Z")), schedule.nextRun(Optional.empty())); assertEquals( Optional.empty(), schedule.nextRun(Optional.of(ZonedDateTime.parse("2019-01-01T00:00:00Z")))); assertEquals( Optional.empty(), schedule.nextRun(Optional.of(ZonedDateTime.parse("2018-12-20T12:34:56Z")))); assertEquals( Optional.empty(), schedule.nextRun(Optional.of(ZonedDateTime.parse("2019-01-02T12:34:56Z")))); assertEquals( Optional.empty(), schedule.nextRun(Optional.of(ZonedDateTime.parse("9999-01-01T00:00:00Z")))); }
Source:
public void actionPerformed(ActionEvent evt) { try { HashSet<Alert> alerts = getAlertNodes(); performActions(alerts); } catch (Exception e) { log.debug(e.getMessage(),e); } }

Target:
public void actionPerformed(ActionEvent evt) { try { Set<Alert> alerts = getAlertNodes(); performActions(alerts); } catch (Exception e) { log.error(e.getMessage(),e); } }
Source:
boolean testRow(final int i, final long startTime) throws IOException { List<RegionInfo> regionInfos = new ArrayList<RegionInfo>(); for (int index = 0; index < i; index++) { regionInfos.add(RegionInfoBuilder.newBuilder(TableName.valueOf("hbase:meta")) .setRegionId(this.rand.nextLong()) .setStartKey(new byte [0]) .setEndKey(new byte [0]) .setOffline(false) .setReplicaId(0) .setSplit(false) .build()); } MetaTableAccessor.addRegionsToMeta(this.connection, regionInfos, 1); return true; }

Target:
boolean testRow(final int i, final long startTime) throws IOException { List<RegionInfo> regionInfos = new ArrayList<RegionInfo>(); RegionInfo regionInfo = (RegionInfoBuilder.newBuilder(TableName.valueOf(TABLE_NAME)) .setStartKey(getSplitKey(i)) .setEndKey(getSplitKey(i + 1)) .build()); regionInfos.add(regionInfo); MetaTableAccessor.addRegionsToMeta(connection, regionInfos, 1); MetaTableAccessor.updateRegionLocation(connection, regionInfo, ServerName.valueOf("localhost", 60010, rand.nextLong()), i, System.currentTimeMillis()); return true; }
Source:
public void deleteSequencerServiceRecord(SequencerServiceRecord serviceRecord) throws IOException { backingManager.deleteSequencerServiceRecord(serviceRecord); }

Target:
public void deleteSequencerServiceRecord(SequencerServiceRecord serviceRecord) throws IOException { if (getCurrentUser().isAdmin()) { backingManager.deleteSequencerServiceRecord(serviceRecord); } }
Source:
public void init(H http) throws Exception { validateInput(); String key = getKey(); RememberMeServices rememberMeServices = getRememberMeServices(http, key); if (rememberMeServices instanceof AbstractRememberMeServices) { key = ((AbstractRememberMeServices) rememberMeServices).getKey(); } http.setSharedObject(RememberMeServices.class, rememberMeServices); LogoutConfigurer<H> logoutConfigurer = http.getConfigurer(LogoutConfigurer.class); if (logoutConfigurer != null && this.logoutHandler != null) { logoutConfigurer.addLogoutHandler(this.logoutHandler); } RememberMeAuthenticationProvider authenticationProvider = new RememberMeAuthenticationProvider( key); authenticationProvider = postProcess(authenticationProvider); http.authenticationProvider(authenticationProvider); initDefaultLoginFilter(http); }

Target:
public void init(H http) throws Exception { validateInput(); String key = getKey(); RememberMeServices rememberMeServices = getRememberMeServices(http, key); http.setSharedObject(RememberMeServices.class, rememberMeServices); LogoutConfigurer<H> logoutConfigurer = http.getConfigurer(LogoutConfigurer.class); if (logoutConfigurer != null && this.logoutHandler != null) { logoutConfigurer.addLogoutHandler(this.logoutHandler); } RememberMeAuthenticationProvider authenticationProvider = new RememberMeAuthenticationProvider( key); authenticationProvider = postProcess(authenticationProvider); http.authenticationProvider(authenticationProvider); initDefaultLoginFilter(http); }
Source:
public void testBasicProvider() { BasicSymbolProvider symbolProvider = getSymbolProvider(); symbolProvider.setMappingFiles(MappingFileTest.getMappingFiles()); String symbolText = symbolProvider.getSymbolText(Long.parseUnsignedLong("601050", 16)); assertEquals("__dso_handle", symbolText); symbolText = symbolProvider.getSymbolText(Long.parseUnsignedLong("400752", 16)); assertEquals("A little bit after nm_ouput's frame_dummy", symbolText); symbolText = symbolProvider.getSymbolText(1, 0L, Long.parseUnsignedLong("400752", 16)); assertEquals("frame_dummy", symbolText); symbolText = symbolProvider.getSymbolText(123, 0L, Long.parseUnsignedLong("4005d0", 16)); assertEquals("same address as nm_output", symbolText); symbolText = symbolProvider.getSymbolText(123, 0L, Long.parseUnsignedLong("400735", 16)); assertEquals("A little bit before nm_ouput's frame_dummy", symbolText); symbolText = symbolProvider.getSymbolText(123, 0L, Long.parseUnsignedLong("ffeeddccbbaa0090", 16)); assertEquals("One huge sombol from nm mapping", symbolText); symbolText = symbolProvider.getSymbolText(1, 0L, Long.parseUnsignedLong("ffeeddccbbaa0090", 16)); assertNull(symbolText); }

Target:
public void testBasicProvider() { BasicSymbolProvider symbolProvider = getSymbolProvider(); symbolProvider.setMappingFiles(MappingFileTest.getMappingFiles()); String symbolText = symbolProvider.getSymbolText(Long.parseUnsignedLong("601050", 16)); assertEquals("__dso_handle", symbolText); symbolText = symbolProvider.getSymbolText(Long.parseUnsignedLong("400752", 16)); assertEquals("A little bit after nm_ouput's frame_dummy", symbolText); symbolText = symbolProvider.getSymbolText(1, 0L, Long.parseUnsignedLong("400752", 16)); assertEquals("frame_dummy", symbolText); symbolText = symbolProvider.getSymbolText(123, 0L, Long.parseUnsignedLong("4005d0", 16)); assertEquals("same address as nm_output", symbolText); symbolText = symbolProvider.getSymbolText(123, 0L, Long.parseUnsignedLong("400735", 16)); assertEquals("A little bit before nm_ouput's frame_dummy", symbolText); symbolText = symbolProvider.getSymbolText(123, 0L, Long.parseUnsignedLong("ffeeddccbbaa0090", 16)); assertEquals("One huge symbol from nm mapping", symbolText); symbolText = symbolProvider.getSymbolText(1, 0L, Long.parseUnsignedLong("ffeeddccbbaa0090", 16)); assertNull(symbolText); }