auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>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()); <START> logger.info("Deleted contributor with id {}", contributorEntity.getId()); <END> } firstEntity.setDisplayName(displayName); contributorRepository.save(firstEntity, 1); }</code><technical_language>a log deleting a contributor confusing if merging them</technical_language>

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:
<code>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")) { <START> Helper.setErrorMessage("goobiScriptfield", "missing delimiter / unknown parameter: ", tok); <END> } } 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"); } }</code><technical_language>is goobi kitodo</technical_language>

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:
<code>private String[] getItemStrings(List<TmfEventTableColumn> columns, ITmfEvent event) { if (event == null) { return EMPTY_STRING_ARRAY; } synchronized (columns) { Map<TmfEventTableColumn, String> itemStrings = new HashMap<>(); <START> for (TableColumn viewColumn : fTable.getColumns()) { <END> 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; } }</code><technical_language>This resolve visible columns if requested method..</technical_language>

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:
<code>public Collection<Descriptor> getDescriptors() { Collection<Descriptor> descriptors = super.getDescriptors(); descriptors.add(new Settings() <START> .set("type", getCapabilityName()) <END> .set("defaultServerResource", ehcacheStateService.getDefaultServerResource())); return descriptors; }</code><technical_language>@mathieucarbou right, change TMS backend topology wil impact TMS / TMC TMS ready for changes I approve; I super this week; try best</technical_language>

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:
<code>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)) <START> .setApplicationName("service-accounts") <END> .build(); return service; }</code><technical_language>if "Java IAM Quickstart snippet"</technical_language>

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:
<code>private void storeToken(SalesforceOAuthAccessTokenResponse token, String tokenFilePath) { File tokenFile = new File(tokenFilePath); if (!tokenFile.exists()) { try { tokenFile.getParentFile().mkdirs(); tokenFile.createNewFile(); } catch (IOException e) { <START> new RuntimeException("The token file creation failed, the refresh token can't be stored correctly.", e); <END> } } 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); } }</code><technical_language>Need a throw</technical_language>

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:
<code>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"); <START> assertThat(resolved.getInfo().get(MuleExceptionInfo.INFO_CAUSED_BY_KEY), is(nullValue())); <END> }</code><technical_language>static import</technical_language>

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:
<code>private void setUpCheckList(ConnectorConfiguration connectorConfiguration) { checkList.add(new SqsHealthCheckQueueHolder(connectorConfiguration.getSqsConfig().getCaptureQueueUrl(), "capture")); checkList.add(new SqsHealthCheckQueueHolder(connectorConfiguration.getSqsConfig().getEventQueueUrl(), "event")); <START> } <END></code><technical_language>A slightly more streamy solution List<String> queueChecks = checkList.stream() .map(queue -> this.checkQueue(queue.queueUrl)) .flatMap(Optional::stream) .collect(Collectors.toUnmodifiableList()); if (queueChecks.isEmpty()) { return Result.healthy(); } else { String errorSummary = String.join(",", queueChecks); return Result.unhealthy(format("Queue healthcheck failed: %s", errorSummary)); } advantage of returning result for queues (although include identifier is). Arguably gain</technical_language>

Target:
private void setUpCheckList(ConnectorConfiguration connectorConfiguration) { checkList.add(new BasicNameValuePair("capture", connectorConfiguration.getSqsConfig().getCaptureQueueUrl())); checkList.add(new BasicNameValuePair("event", connectorConfiguration.getSqsConfig().getEventQueueUrl())); }
Source:
<code>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()) { <START> metrics.CALL_SAMPLE = "CHMI_CHMI3_WGS2"; <END> metrics.TRUTH_SAMPLE = "/dev/stdin"; } }</code><technical_language>asserted here</technical_language>

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:
<code>public static Set<Class> getSystemClasss(Resource resource) { if (resource != null && resource.getContents().size() > 0) { Set<Class> result = new HashSet<>(); for (EObject eObject : resource.getContents()) { <START> if (eObject instanceof Class) { <END> 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(); }</code><technical_language>classes resource roots</technical_language>

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:
<code>public Owner getOwner() { <START> return thingIfApi.getOwner(); <END> }</code><technical_language>Adding this a field is good manner</technical_language>

Target:
public Owner getOwner() { return this.thingIfApi.getOwner(); }
Source:
<code>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()); <START> Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getAction()).name().toLowerCase(), "reset"); <END> Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getModel()).name().toLowerCase(), "i3600esb"); }</code><technical_language>toString() is preferable, matter here. I this related patch , enum is i6300esb i3600esb, idea this is working</technical_language>

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:
<code>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(); <START> ResourceStrategyRegistry.getInstance().clearRegistry(); <END> super.stop(context); }</code><technical_language>sessionFactoryRegistryListener.dispose() other extension points</technical_language>

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:
<code>public void InteractiveMaps_034_PalantirUpdateMapPosition() { InteractiveMapPageObject selectedMap = new InteractiveMapPageObject(driver); <START> selectedMap.openMap(wikiURL, 3); <END> 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); }</code><technical_language>Suggest move 2nd param a class variable I other tests value</technical_language>

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:
<code>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()) { <START> if (mv.getTermId() == 8201){ <END> 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); }</code><technical_language>TermId.PLOT_ID</technical_language>

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:
<code>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, <START> StatusCorrectedToCapturedToMatchGatewayStatus.class); <END> } return charge; }).orElseThrow(() -> new InvalidForceStateTransitionException(fromChargeState, targetChargeState)); }</code><technical_language>argument eventClass</technical_language>

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:
<code>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)); <START> return; <END> } 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())); } }</code><technical_language>Illegal arguments</technical_language>

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:
<code>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); <START> } <END> } return StringUtils.toHexString(tokenBytes); }</code><technical_language>get this get always... patterns: sync { tokenBytes = (byte[]) session.getAttribute(XSRF_TOKEN); if (tokenBytes == null) { ... session.setAttribute(XSRF_TOKEN, tokenBytes); } } or: sync { if (session.getAttribute(XSRF_TOKEN) == null) { ... session.setAttribute(XSRF_TOKEN, tokenBytes); } } tokenBytes = (byte[]) session.getAttribute(XSRF_TOKEN);</technical_language>

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:
<code>public boolean bindCloudletToVm(Cloudlet cloudlet, Vm vm) { <START> if (!getCloudletWaitingList().contains(cloudlet)) { <END> return false; } cloudlet.setVm(vm); return true; }</code><technical_language>access attribute</technical_language>

Target:
public boolean bindCloudletToVm(Cloudlet cloudlet, Vm vm) { if (!cloudletWaitingList.contains(cloudlet)) { return false; } cloudlet.setVm(vm); return true; }
Source:
<code>public Retaggable(String word, String restrictToPos, String appendTag) { <START> this.word = word; <END> this.restrictToPos = restrictToPos; this.appendTag = appendTag; }</code><technical_language>Objects.requireNotNull(word) nice (if sense)</technical_language>

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:
<code>public <T extends BaseModel> T get(String path, Class<T> cls) throws IOException { HttpGet getMethod = new HttpGet(api(path)); System.out.println(getMethod.getURI()); <START> System.out.println(getMethod.getRequestLine()); <END> 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); } }</code><technical_language>System.out is good idea in production code...better logging..? I introduced a logging in <LINK_0></technical_language>

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:
<code>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, " <START> + "auth_failed BOOLEAN, theEarliestNextSynchronistation TIMESTAMP, numberSynchronizationFailed BIGINT, transfertType VARCHAR(255), deleteFilesFromSource BOOLEAN DEFAULT 0, PRIMARY KEY(email,LFCDir), FOREIGN KEY (email) REFERENCES VIPUsers(email) " <END> + "ON DELETE CASCADE ON UPDATE CASCADE"); } catch (DAOException ex) { logger.error(ex); } }</code><technical_language>Split request line</technical_language>

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:
<code>@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; <START> while (evicted < memoryToReserve && currentClockHead != null && fullClockRotation < maxCircles) { <END> 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(); } }</code><technical_language>is currently code path, lead currentClockHead null</technical_language>

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:
<code>private void assertInvalidMultiPoint(String errorMessage, String... pointWkts) { <START> assertInvalidFunction(format("ST_MultiPoint(array[%s])", ImmutableList.copyOf(pointWkts).stream() <END> .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)); }</code><technical_language>formatting</technical_language>

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:
<code>public Boolean isReduced() { <START> return isReduced; <END> }</code><technical_language>!result.equals(fullResult), need a separate field</technical_language>

Target:
public Boolean isReduced() { return !truncatedResult.equals(fullResult); }
Source:
<code>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{ <START> final String u = (user == null) ? "Unknown" : user.getUserId(); <END> throw new DotSecurityException("User:" + u + " does not have permissions on Contentlet "+ContentletUtil .toShortString(contentlet)); } }</code><technical_language>userId instead of u</technical_language>

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:
<code>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<>(); <START> int i; <END> 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); } }</code><technical_language>I this variable is of loop</technical_language>

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:
<code><START> public Integer getEstimatedMaxTopStateCount() { <END> return _estimatedMaxTopStateCount; }</code><technical_language>Same. Return int</technical_language>

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

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:
<code>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; <START> case COPY_KEY_AND_LINK: copyKeyAndLink(); break; <END> } }</code><technical_language>add a default case checkstyle complain</technical_language>

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:
<code>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"); <START> p2.setDescription(source.getId()); <END> } }); 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); } }); }</code><technical_language>Side-effect invalidates test imho. I need grab ID reflection package scope in order prove issue is fixed</technical_language>

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:
<code>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); <START> models.Configuration conf = new models.Configuration(config[0], config[1], config[2], config[3], config[4], config[5]); <END> configurations.add(conf); } } return configurations; }</code><technical_language>I feel a do this..</technical_language>

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:
<code>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()) <START> ); <END> 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"))) ); }</code><technical_language>nit: convention pill-up end of line</technical_language>

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:
<code>public void actionPerformed(ActionEvent evt) { try { HashSet<Alert> alerts = getAlertNodes(); performActions(alerts); } catch (Exception e) { <START> log.debug(e.getMessage(),e); <END> } }</code><technical_language>This logged error, if exception this a bug in custom menu items</technical_language>

Target:
public void actionPerformed(ActionEvent evt) { try { Set<Alert> alerts = getAlertNodes(); performActions(alerts); } catch (Exception e) { log.error(e.getMessage(),e); } }
Source:
<code>boolean testRow(final int i, final long startTime) throws IOException { List<RegionInfo> regionInfos = new ArrayList<RegionInfo>(); for (int index = 0; index < i; index++) { <START> regionInfos.add(RegionInfoBuilder.newBuilder(TableName.valueOf("hbase:meta")) <END> .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; }</code><technical_language>This a bit confusing add "hbase:meta" hbase:meta</technical_language>

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; }