auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void afterPropertiesSet() { if (this.beanName == null) { LOGGER.error("The MessageHandler [" + this.handler + "] will be created without a 'componentName'. " + "Consider specifying the 'beanName' property on this ConsumerEndpointFactoryBean."); } else { populateComponentNameIfAny(); } if (!(this.handler instanceof ReactiveMessageHandlerAdapter)) { this.handler = adviceChain(this.handler); } else if (!CollectionUtils.isEmpty(this.adviceChain)) { <START> ReactiveMessageHandler reactiveMessageHandler = ((ReactiveMessageHandlerAdapter) this.handler).getDelegate(); reactiveMessageHandler = adviceChain(reactiveMessageHandler); this.handler = new ReactiveMessageHandlerAdapter(reactiveMessageHandler); <END> } if (this.channelResolver == null) { this.channelResolver = ChannelResolverUtils.getChannelResolver(this.beanFactory); } initializeEndpoint(); }</code><technical_language>suggestion this.handler = new ReactiveMessageHandlerAdapter(adviceChain(((ReactiveMessageHandlerAdapter) this.handler).getDelegate())));</technical_language>

Target:
public void afterPropertiesSet() { if (this.beanName == null) { LOGGER.error("The MessageHandler [" + this.handler + "] will be created without a 'componentName'. " + "Consider specifying the 'beanName' property on this ConsumerEndpointFactoryBean."); } else { populateComponentNameIfAny(); } if (!(this.handler instanceof ReactiveMessageHandlerAdapter)) { this.handler = adviceChain(this.handler); } else if (!CollectionUtils.isEmpty(this.adviceChain)) { this.handler = new ReactiveMessageHandlerAdapter( adviceChain(((ReactiveMessageHandlerAdapter) this.handler).getDelegate())); } if (this.channelResolver == null) { this.channelResolver = ChannelResolverUtils.getChannelResolver(this.beanFactory); } initializeEndpoint(); }
Source:
<code>private float[][] calculateRubricStats(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); int[][] responseFrequency = calculateResponseFrequency(responses, fqd); <START> float[][] pecentageFrequencyOrAverage = new float[fqd.numOfRubricSubQuestions][]; <END> for (int i = 0; i < pecentageFrequencyOrAverage.length; i++) { pecentageFrequencyOrAverage[i] = new float[fqd.numOfRubricChoices + 1]; for (int j = 0; j < pecentageFrequencyOrAverage[i].length - 1; j++) { pecentageFrequencyOrAverage[i][j] = responseFrequency[i][j]; } pecentageFrequencyOrAverage[i][fqd.numOfRubricSubQuestions] = 0; } for (int i = 0; i < pecentageFrequencyOrAverage.length; i++) { int totalForSubQuestion = 0; for (int j = 0; j < pecentageFrequencyOrAverage[i].length - 1; j++) { totalForSubQuestion += responseFrequency[i][j]; } for (int j = 0; j < pecentageFrequencyOrAverage[i].length - 1; j++) { pecentageFrequencyOrAverage[i][j] /= totalForSubQuestion; pecentageFrequencyOrAverage[i][fqd.numOfRubricSubQuestions] += (fqd.numOfRubricChoices - j) * pecentageFrequencyOrAverage[i][j]; } } return pecentageFrequencyOrAverage; }</code><technical_language>percentage..</technical_language>

Target:
private float[][] calculateRubricStats(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); int[][] responseFrequency = calculateResponseFrequency(responses, fqd); float[][] percentageFrequencyOrAverage = new float[fqd.numOfRubricSubQuestions][]; for (int i = 0; i < percentageFrequencyOrAverage.length; i++) { percentageFrequencyOrAverage[i] = new float[fqd.numOfRubricChoices + 1]; for (int j = 0; j < percentageFrequencyOrAverage[i].length - 1; j++) { percentageFrequencyOrAverage[i][j] = responseFrequency[i][j]; } percentageFrequencyOrAverage[i][fqd.numOfRubricChoices] = 0; } for (int i = 0; i < percentageFrequencyOrAverage.length; i++) { int totalForSubQuestion = 0; for (int j = 0; j < percentageFrequencyOrAverage[i].length - 1; j++) { totalForSubQuestion += responseFrequency[i][j]; } for (int j = 0; j < percentageFrequencyOrAverage[i].length - 1; j++) { percentageFrequencyOrAverage[i][j] /= totalForSubQuestion; float choiceWeight = (fqd.numOfRubricChoices - j) * percentageFrequencyOrAverage[i][j]; percentageFrequencyOrAverage[i][fqd.numOfRubricChoices] += choiceWeight; } } return percentageFrequencyOrAverage; }
Source:
<code>private static void setBarData(XWPFChart chart, String chartTitle, String[] categories, Double[] values) { final List<XDDFChartData> series = chart.getChartSeries(); final XDDFBarChartData bar = (XDDFBarChartData) series.get(0); final int numOfPoints = categories.length; final String categoryDataRange = chart.formatRange(new CellRangeAddress(1, numOfPoints, 0, 0)); final String valuesDataRange = chart.formatRange(new CellRangeAddress(1, numOfPoints, 1, 1)); final String valuesDataRange2 = chart.formatRange(new CellRangeAddress(1, numOfPoints, 2, 2)); final XDDFDataSource<?> categoriesData = XDDFDataSourcesFactory.fromArray(categories, categoryDataRange,0); final XDDFNumericalDataSource<? extends Number> valuesData = XDDFDataSourcesFactory.fromArray(values, valuesDataRange,1); <START> values[3]=(double) 10; <END> final XDDFNumericalDataSource<? extends Number> valuesData2 = XDDFDataSourcesFactory.fromArray(values, valuesDataRange2,2); bar.getSeries().get(0).replaceData(categoriesData, valuesData2); bar.addSeries(categoriesData, valuesData); bar.getSeries().get(0).setTitle(chartTitle, chart.setSheetTitle(chartTitle)); chart.plot(bar); }</code><technical_language>values[2] = 10.0; I stumbled this code smell failing execution</technical_language>

Target:
private static void setBarData(XWPFChart chart, String chartTitle, String[] categories, Double[] values) { final List<XDDFChartData> series = chart.getChartSeries(); final XDDFBarChartData bar = (XDDFBarChartData) series.get(0); final int numOfPoints = categories.length; final String categoryDataRange = chart.formatRange(new CellRangeAddress(1, numOfPoints, 0, 0)); final String valuesDataRange = chart.formatRange(new CellRangeAddress(1, numOfPoints, 1, 1)); final String valuesDataRange2 = chart.formatRange(new CellRangeAddress(1, numOfPoints, 2, 2)); final XDDFDataSource<?> categoriesData = XDDFDataSourcesFactory.fromArray(categories, categoryDataRange, 0); final XDDFNumericalDataSource<? extends Number> valuesData = XDDFDataSourcesFactory.fromArray(values, valuesDataRange, 1); values[2] = 10.0; final XDDFNumericalDataSource<? extends Number> valuesData2 = XDDFDataSourcesFactory.fromArray(values, valuesDataRange2, 2); bar.getSeries().get(0).replaceData(categoriesData, valuesData); bar.addSeries(categoriesData, valuesData2); bar.getSeries().get(0).setTitle(chartTitle, chart.setSheetTitle(chartTitle)); chart.plot(bar); }
Source:
<code>public void testGet() { <START> JobRequest jobRequest = createSpace("getJobOrgUnit"); <END> JobResult jobResult = client.getJob(jobRequest.getJobId()); Assertions.assertThat(jobResult.getStatus()).isNotEqualTo(JobStatus.GONE); }</code><technical_language>Maybe, this changed "getJobSpace"</technical_language>

Target:
public void testGet() { JobRequest jobRequest = createSpace("getSpace"); JobResult jobResult = client.getJob(jobRequest.getJobId()); Assertions.assertThat(jobResult.getStatus()).isNotEqualTo(JobStatus.GONE); }
Source:
<code>public void getIpv6AddressOfNetworkReturnsNullWhenThereIsNoNetworkOfGivenName() { nic.setIpv6Address(IPV6_ADDRESS); assertThat(underTest.getIpv6AddressOfNetwork("not" + NETWORK_NAME), <START> nullValue(null)); <END> }</code><technical_language>please do pass value, do pass actual value. This is this matcher used</technical_language>

Target:
public void getIpv6AddressOfNetworkReturnsNullWhenThereIsNoNetworkOfGivenName() { nic.setIpv6Address(IPV6_ADDRESS); assertThat(underTest.getIpv6AddressOfNetwork(NETWORK_NAME2), nullValue(null)); }
Source:
<code>public static void createESBProject(String projectName) { Util.bot.sleep(2000); <START> SWTBotShell newESBConf = Util.bot.shell("New ESB Config Project"); <END> newESBConf.bot().button(CommonConstants.NEXT).click(); Util.bot.sleep(1000); Util.setLableText(newESBConf, ESBProjectConstants.PROJECT_NAME, projectName); Util.bot.sleep(1000); newESBConf.bot().button(CommonConstants.NEXT).click(); Util.bot.sleep(1000); newESBConf.bot().button(CommonConstants.FINISH).click(); Util.bot.sleep(1000); }</code><technical_language>this a constant</technical_language>

Target:
public static void createESBProject(String projectName) { WorkbenchElementsValidator.bot.sleep(2000); SWTBotShell newESBConf = WorkbenchElementsValidator.bot.shell(ESBProjectConstants.NEW_ESB_PROJECT); newESBConf.bot().button(CommonConstants.NEXT).click(); WorkbenchElementsValidator.bot.sleep(1000); WorkbenchElementsValidator.setLableText(newESBConf, ESBProjectConstants.PROJECT_NAME, projectName); WorkbenchElementsValidator.bot.sleep(1000); newESBConf.bot().button(CommonConstants.NEXT).click(); WorkbenchElementsValidator.bot.sleep(1000); newESBConf.bot().button(CommonConstants.FINISH).click(); WorkbenchElementsValidator.bot.sleep(1000); }
Source:
<code>private void finalizeBuildingSectionPanel( InstructorFeedbackResultsSectionPanel sectionPanel, String sectionName, LinkedHashMap<String, Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>> responsesGroupedByTeam, Set<String> teamsWithResponses) { switch (viewType) { case GIVER_QUESTION_RECIPIENT: case RECIPIENT_QUESTION_GIVER: prepareHeadersForTeamPanelsInSectionPanel(sectionPanel); if (!responsesGroupedByTeam.isEmpty()) { buildTeamsStatisticsTableForSectionPanel(sectionPanel, responsesGroupedByTeam, teamsWithResponses); } Map<String, Boolean> isTeamDisplayingStatistics = new HashMap<>(); for (String team : teamsWithResponses) { isTeamDisplayingStatistics.put(team, bundle.rosterTeamNameMembersTable.containsKey(team)); } <START> sectionPanel.setDisplayingTeamStatistics(isTeamDisplayingStatistics); <END> sectionPanel.setSectionName(sectionName); sectionPanel.setSectionNameForDisplay(sectionName.equals(Const.DEFAULT_SECTION) ? DISPLAY_NAME_FOR_DEFAULT_SECTION : sectionName); break; case RECIPIENT_GIVER_QUESTION: case GIVER_RECIPIENT_QUESTION: sectionPanel.setSectionName(sectionName); sectionPanel.setSectionNameForDisplay(sectionName.equals(Const.DEFAULT_SECTION) ? DISPLAY_NAME_FOR_DEFAULT_SECTION : sectionName); break; default: Assumption.fail(); break; } }</code><technical_language>Is some teams anonymous others in teamWithResponses? Mind if mention a configuration for for future reference</technical_language>

Target:
private void finalizeBuildingSectionPanel( InstructorFeedbackResultsSectionPanel sectionPanel, String sectionName, LinkedHashMap<String, Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>> responsesGroupedByTeam, Set<String> teamsWithResponses) { switch (viewType) { case GIVER_QUESTION_RECIPIENT: case RECIPIENT_QUESTION_GIVER: prepareHeadersForTeamPanelsInSectionPanel(sectionPanel); if (!responsesGroupedByTeam.isEmpty()) { buildTeamsStatisticsTableForSectionPanel(sectionPanel, responsesGroupedByTeam, teamsWithResponses); } Map<String, Boolean> isTeamDisplayingStatistics = new HashMap<>(); for (String team : teamsWithResponses) { isTeamDisplayingStatistics.put(team, isTeamVisible(team)); } sectionPanel.setDisplayingTeamStatistics(isTeamDisplayingStatistics); sectionPanel.setSectionName(sectionName); sectionPanel.setSectionNameForDisplay(sectionName.equals(Const.DEFAULT_SECTION) ? DISPLAY_NAME_FOR_DEFAULT_SECTION : sectionName); break; case RECIPIENT_GIVER_QUESTION: case GIVER_RECIPIENT_QUESTION: sectionPanel.setSectionName(sectionName); sectionPanel.setSectionNameForDisplay(sectionName.equals(Const.DEFAULT_SECTION) ? DISPLAY_NAME_FOR_DEFAULT_SECTION : sectionName); break; default: Assumption.fail(); break; } }
Source:
<code>public BoundFilter(final BoundDimFilter boundDimFilter) { super( boundDimFilter.getDimension(), new Predicate<String>() { <START> private Predicate<String> predicate; <END> @Override public boolean apply(String input) { return function().apply(input); } private Predicate<String> function() { if (predicate == null) { final Comparator<String> comparator; if (boundDimFilter.isAlphaNumeric()) { comparator = new AlphaNumericTopNMetricSpec(null).getComparator(null, null); } else { comparator = new LexicographicTopNMetricSpec(null).getComparator(null, null); } predicate = new Predicate<String>() { @Nullable @Override public boolean apply(String input) { if (input == null) { return false; } int lowerComparing = 1; int upperComparing = 1; if (boundDimFilter.getLower() != null) { lowerComparing = comparator.compare(input, boundDimFilter.getLower()); } if (boundDimFilter.getUpper() != null) { upperComparing = comparator.compare(boundDimFilter.getUpper(), input); } if (boundDimFilter.isLowerStrict() && boundDimFilter.isUpperStrict()) { return ((lowerComparing > 0)) && (upperComparing > 0); } else if (boundDimFilter.isLowerStrict()) { return (lowerComparing > 0) && (upperComparing >= 0); } else if (boundDimFilter.isUpperStrict()) { return (lowerComparing >= 0) && (upperComparing > 0); } return (lowerComparing >= 0) && (upperComparing >= 0); } }; } return predicate; } } ); }</code><technical_language>volatile</technical_language>

Target:
public BoundFilter(final BoundDimFilter boundDimFilter) { super( boundDimFilter.getDimension(), new Predicate<String>() { private volatile Predicate<String> predicate; @Override public boolean apply(String input) { return function().apply(input); } private Predicate<String> function() { if (predicate == null) { final Comparator<String> comparator; if (boundDimFilter.isAlphaNumeric()) { comparator = new AlphaNumericTopNMetricSpec(null).getComparator(null, null); } else { comparator = new LexicographicTopNMetricSpec(null).getComparator(null, null); } predicate = new Predicate<String>() { @Override public boolean apply(String input) { if (input == null) { return false; } int lowerComparing = 1; int upperComparing = 1; if (boundDimFilter.getLower() != null) { lowerComparing = comparator.compare(input, boundDimFilter.getLower()); } if (boundDimFilter.getUpper() != null) { upperComparing = comparator.compare(boundDimFilter.getUpper(), input); } if (boundDimFilter.isLowerStrict() && boundDimFilter.isUpperStrict()) { return ((lowerComparing > 0)) && (upperComparing > 0); } else if (boundDimFilter.isLowerStrict()) { return (lowerComparing > 0) && (upperComparing >= 0); } else if (boundDimFilter.isUpperStrict()) { return (lowerComparing >= 0) && (upperComparing > 0); } return (lowerComparing >= 0) && (upperComparing >= 0); } }; } return predicate; } } ); }
Source:
<code>public static <T extends ToolInstallation> T addTool(Jenkins jenkins, Class<T> type) { final ConfigurablePageObject page = ensureConfigPage(jenkins); final String name = type.getAnnotation(ToolInstallationPageObject.class).name(); final Control button = page.control(by.button("Add " + name)); String pathPrefix = button.resolve().getAttribute("path").replaceAll("repeatable-add", "tool"); String path = page.createPageArea(pathPrefix, () -> button.click()); <START> System.out.println("Path: " + path); <END> return page.newInstance(type, jenkins, path); }</code><technical_language>Is this logging statement required</technical_language>

Target:
public static <T extends ToolInstallation> T addTool(Jenkins jenkins, Class<T> type) { final ConfigurablePageObject page = ensureConfigPage(jenkins); final String name = type.getAnnotation(ToolInstallationPageObject.class).name(); final Control button = page.control(by.button("Add " + name)); String pathPrefix = button.resolve().getAttribute("path").replaceAll("repeatable-add", "tool"); String path = page.createPageArea(pathPrefix, button::click); return page.newInstance(type, jenkins, path); }
Source:
<code>public void testParseCertAndPrivateKeyInCredentials() { ZoneList zoneList = new ZoneList() { @Override public Iterator<String> doRun(DNSApiManager mgr) { assertThat(configPath).isEqualTo(getTestConfigPath("test-config-cert.yml")); <START> final Map mapCredentials = Map.class.cast(credentials); <END> assertThat(mapCredentials.get("x509Certificate")).isInstanceOf(X509Certificate.class); assertThat(((X509Certificate) mapCredentials.get("x509Certificate")).getSubjectDN().getName()) .containsIgnoringCase("C=US,ST=California,O=NetflixOSS,OU=Denominator,CN=Denominator"); assertThat(mapCredentials.get("privateKey")).isInstanceOf(PrivateKey.class); final PrivateKey privateKey = (PrivateKey) mapCredentials.get("privateKey"); assertThat(privateKey.getAlgorithm()).isEqualToIgnoringCase("RSA"); assertThat(privateKey.getFormat()).isEqualToIgnoringCase("PKCS#8"); return Collections.<String>emptyList().iterator(); } }; zoneList.providerConfigurationName = "blah"; zoneList.configPath = getTestConfigPath("test-config-cert.yml"); zoneList.run(); }</code><technical_language>I remove instance ofs. Reason is casts fail test. lines. otherwise, alright I top of head do this :)</technical_language>

Target:
public void testParseCertAndPrivateKeyInCredentials() { ZoneList zoneList = new ZoneList() { @Override public Iterator<String> doRun(DNSApiManager mgr) { assertThat(configPath).isEqualTo(getTestConfigPath("test-config-cert.yml")); Map mapCredentials = Map.class.cast(credentials); assertThat(((X509Certificate) mapCredentials.get("x509Certificate")).getSubjectDN().getName()) .containsIgnoringCase("C=US,ST=California,O=NetflixOSS,OU=Denominator,CN=Denominator"); PrivateKey privateKey = (PrivateKey) mapCredentials.get("privateKey"); assertThat(privateKey.getAlgorithm()).isEqualToIgnoringCase("RSA"); assertThat(privateKey.getFormat()).isEqualToIgnoringCase("PKCS#8"); return Collections.<String>emptyList().iterator(); } }; zoneList.providerConfigurationName = "blah"; zoneList.configPath = getTestConfigPath("test-config-cert.yml"); zoneList.run(); }
Source:
<code>private String createFilePath(String basePath, String originalFileChecksum) { String[] binaryFcrepoChecksumSplit = originalFileChecksum.split(":"); String checksum = binaryFcrepoChecksumSplit[2]; String[] tokens = Iterables.toArray (Splitter.fixedLength(2).split(checksum), String.class); <START> String remotePath = new StringJoiner("/") <END> .add(basePath) .add(tokens[0]) .add(tokens[1]) .add(tokens[2]) .add(checksum) .toString(); return remotePath; }</code><technical_language>Fedora 4 levels of hashed containers for identifiers, 3 for file storage</technical_language>

Target:
private String createFilePath(String basePath, String originalFileChecksum) { String[] tokens = Iterables.toArray (Splitter.fixedLength(2).split( originalFileChecksum), String.class); String remotePath = new StringJoiner("/") .add(basePath) .add(tokens[0]) .add(tokens[1]) .add(tokens[2]) .toString(); return remotePath; }
Source:
<code>public static <K, V> Map<K, V> filterEntries(Map<K, V> map, Collection<Object> keys) { Map<K, V> filteredEntries = new HashMap<>(map.size()); map.entrySet().stream() .filter(entry -> keys.contains(entry.getKey())) <START> .forEach(entry -> filteredEntries.put(entry.getKey(), entry.getValue())); <END> return filteredEntries; }</code><technical_language>collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))</technical_language>

Target:
public static <K, V> Map<K, V> filterEntries(Map<K, V> map, Collection<Object> keys) { return map.entrySet().stream() .filter(entry -> keys.contains(entry.getKey())) .collect(HashMap::new, (rMap, entry) -> rMap.put(entry.getKey(), entry.getValue()), HashMap::putAll); }
Source:
<code>private void prepareJavaWorkspaceAndOpenCreateDialog(String workspaceName) { <START> newWorkspace.waitPageLoad(); <END> newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.selectStack(JAVA); newWorkspace.waitStackSelected(JAVA); newWorkspace.clickOnAddOrImportProjectButton(); newWorkspace.waitAddOrImportFormOpened(); newWorkspace.clickOnSampleCheckbox(SPRING_SAMPLE_NAME); newWorkspace.waitSampleCheckboxEnabled(SPRING_SAMPLE_NAME); newWorkspace.clickOnAddButtonInImportProjectForm(); checkProjectTabAppearanceAndFields( SPRING_SAMPLE_NAME, EXPECTED_SAMPLES_WITH_DESCRIPTIONS.get(SPRING_SAMPLE_NAME), EXPECTED_SPRING_REPOSITORY_URL); newWorkspace.clickOnBottomCreateButton(); newWorkspace.waitWorkspaceCreatedDialogIsVisible(); }</code><technical_language>hard understand test scenario here. Please, divide separate steps empty rows</technical_language>

Target:
private void prepareJavaWorkspaceAndOpenCreateDialog(String workspaceName) { newWorkspace.waitPageLoad(); newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.selectStack(JAVA); newWorkspace.waitStackSelected(JAVA); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); addOrImportForm.clickOnSampleCheckbox(SPRING_SAMPLE_NAME); addOrImportForm.waitSampleCheckboxEnabled(SPRING_SAMPLE_NAME); addOrImportForm.clickOnAddButton(); checkProjectTabAppearanceAndFields( SPRING_SAMPLE_NAME, EXPECTED_SAMPLES_WITH_DESCRIPTIONS.get(SPRING_SAMPLE_NAME), EXPECTED_SPRING_REPOSITORY_URL); newWorkspace.clickOnBottomCreateButton(); newWorkspace.waitWorkspaceCreatedDialogIsVisible(); }
Source:
<code>public RowData toInternal(ResultSet resultSet) throws SQLException { GenericRowData genericRowData = new GenericRowData(rowType.getFieldCount()); try { for (int pos = 0; pos < rowType.getFieldCount(); pos++) { genericRowData.setField(pos, toInternalConverters[pos].convert(resultSet.getObject(pos + 1))); } } catch (Exception e) { <START> e.printStackTrace(); <END> } return genericRowData; }</code><technical_language>remove</technical_language>

Target:
public RowData toInternal(ResultSet resultSet) throws SQLException { GenericRowData genericRowData = new GenericRowData(rowType.getFieldCount()); for (int pos = 0; pos < rowType.getFieldCount(); pos++) { genericRowData.setField(pos, toInternalConverters[pos].deserialize(resultSet.getObject(pos + 1))); } return genericRowData; }
Source:
<code>public void addBannerMeta(final CommandSource sender, final boolean allowShortName, final String string, final IEssentials ess) throws Exception { if (MaterialUtil.isBanner(stack.getType()) && string != null) { final String[] split = splitPattern.split(string, 2); if (split.length < 2) { throw new Exception(tl("invalidBanner", string)); } DyeColor baseColor = null; org.bukkit.block.banner.Pattern pattern = null; if (split[0].equalsIgnoreCase("basecolor")) { baseColor = ColorUtil.getDyeColor(split[1]); } else { try { PatternType type = PatternType.valueOf(split[0].toUpperCase()); DyeColor color = ColorUtil.getDyeColor(split[1]); pattern = new org.bukkit.block.banner.Pattern(color, type); } catch (IllegalArgumentException ignored) { } } if (stack.getType().toString().equals("SHIELD")) { BlockStateMeta meta = (BlockStateMeta) stack.getItemMeta(); Banner banner = (Banner) meta.getBlockState(); if (baseColor != null) { banner.setBaseColor(baseColor); } else if (pattern != null) { <START> if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.BukkitVersion.fromString("1.13.0-R0.1-SNAPSHOT"))) { <END> return; } banner.addPattern(pattern); } banner.update(); meta.setBlockState(banner); stack.setItemMeta(meta); } else { if (baseColor != null) { stack.setType(Material.valueOf(baseColor.name() + "_BANNER")); } else if (pattern != null) { final BannerMeta meta = (BannerMeta) stack.getItemMeta(); meta.addPattern(pattern); stack.setItemMeta(meta); } } } }</code><technical_language>I this is temporary typically existing VersionUtil constants, add a new if missing</technical_language>

Target:
public void addBannerMeta(final CommandSource sender, final boolean allowShortName, final String string, final IEssentials ess) throws Exception { if (MaterialUtil.isBanner(stack.getType()) && string != null) { final String[] split = splitPattern.split(string, 2); if (split.length < 2) { throw new Exception(tl("invalidBanner", string)); } DyeColor baseColor = null; org.bukkit.block.banner.Pattern pattern = null; if (split[0].equalsIgnoreCase("basecolor")) { baseColor = ColorUtil.getDyeColor(split[1]); } else { try { PatternType type = PatternType.valueOf(split[0].toUpperCase()); DyeColor color = ColorUtil.getDyeColor(split[1]); pattern = new org.bukkit.block.banner.Pattern(color, type); } catch (IllegalArgumentException ignored) { } } if (stack.getType().toString().equals("SHIELD")) { BlockStateMeta meta = (BlockStateMeta) stack.getItemMeta(); Banner banner = (Banner) meta.getBlockState(); if (baseColor != null) { banner.setBaseColor(baseColor); } else if (pattern != null) { if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(v1_13_0_R01)) { return; } banner.addPattern(pattern); } banner.update(); meta.setBlockState(banner); stack.setItemMeta(meta); } else { if (baseColor != null) { stack.setType(Material.valueOf(baseColor.name() + "_BANNER")); } else if (pattern != null) { final BannerMeta meta = (BannerMeta) stack.getItemMeta(); meta.addPattern(pattern); stack.setItemMeta(meta); } } } }
Source:
<code>public String[] keys() throws BackingStoreException { checkRemoved(); HashSet allKeys = new HashSet(Arrays.asList(getOriginal().keys())); <START> for (Object key : temporarySettings.keySet()) { <END> if (temporarySettings.get(key) != null) { allKeys.add(key); } else { allKeys.remove(key); } } return (String[]) allKeys.toArray(new String[allKeys.size()]); }</code><technical_language>change temporarySettings a Map<String, Object>. iterate entries(), keys, need extra gets</technical_language>

Target:
public String[] keys() throws BackingStoreException { checkRemoved(); HashSet<String> allKeys = new HashSet<String>(Arrays.asList(getOriginal().keys())); for (Entry<String, Object> entry : temporarySettings.entrySet()) { String key = entry.getKey(); if (entry.getValue() != null) { allKeys.add(key); } else { allKeys.remove(key); } } return allKeys.toArray(new String[allKeys.size()]); }
Source:
<code>public FactoryDto createFactory(@NotNull final Map<String, String> factoryParameters) throws BadRequestException { final GithubUrl githubUrl = githubUrlParser.parse(factoryParameters.get(URL_PARAMETER_NAME)); FactoryDto factory = urlFactoryBuilder.createFactoryFromDevfile(githubUrl.devfileFileLocation()); if (factory == null) { factory = urlFactoryBuilder.createFactoryFromJson(githubUrl.factoryJsonFileLocation()); } if (factory == null) { factory = newDto(FactoryDto.class).withV(CURRENT_VERSION); } if (factory.getWorkspace() == null) { factory.setWorkspace( urlFactoryBuilder.buildDefaultWorkspaceConfig(githubUrl.getRepository())); } return projectConfigDtoMerger.merge( factory, () -> { return newDto(ProjectConfigDto.class) .withSource(githubSourceStorageBuilder.build(githubUrl)) .withName(githubUrl.getRepository()) <START> .withType("blank") <END> .withPath("/".concat(githubUrl.getRepository())); }); }</code><technical_language>Type field is needed anymore Sun's description <LINK_0> I leave empty GWT IDE asking project type instead of hardcoding it. WDYT</technical_language>

Target:
public FactoryDto createFactory(@NotNull final Map<String, String> factoryParameters) throws BadRequestException, ServerException { final GithubUrl githubUrl = githubUrlParser.parse(factoryParameters.get(URL_PARAMETER_NAME)); FactoryDto factory = urlFactoryBuilder .createFactoryFromDevfile(githubUrl.devfileFileLocation()) .orElseGet( () -> urlFactoryBuilder .createFactoryFromJson(githubUrl.factoryFileLocation()) .orElseGet(() -> newDto(FactoryDto.class).withV(CURRENT_VERSION))); if (factory.getWorkspace() == null) { factory.setWorkspace( urlFactoryBuilder.buildDefaultWorkspaceConfig(githubUrl.getRepository())); } return projectConfigDtoMerger.merge( factory, () -> { return newDto(ProjectConfigDto.class) .withSource(githubSourceStorageBuilder.build(githubUrl)) .withName(githubUrl.getRepository()) .withPath("/".concat(githubUrl.getRepository())); }); }
Source:
<code>protected void activate(ComponentContext context) { try { ProvisioningServiceDataHolder.getInstance().setBundleContext(context.getBundleContext()); ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(UserOperationEventListener.class.getName(), new DefaultInboundUserProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Identity Provision Event listener registered successfully"); } ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(ApplicationMgtListener.class.getName(), new ApplicationMgtProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Application Management Event listener registered successfully"); } ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(IdentityProviderMgtLister.class.getName(), new IdentityProviderMgtProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Identity Provider Management Event listener registered successfully"); } if (log.isDebugEnabled()) { log.debug("Identity Provisioning framework bundle is activated"); } <START> } catch (IdentityProvisioningException e) { <END> log.error("Error while initiating identity provisioning connector framework", e); log.error("Error while activating Identity Provision bundle", e); } }</code><technical_language>catch throwable</technical_language>

Target:
protected void activate(ComponentContext context) { try { ProvisioningServiceDataHolder.getInstance().setBundleContext(context.getBundleContext()); ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(UserOperationEventListener.class.getName(), new DefaultInboundUserProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Identity Provision Event listener registered successfully"); } ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(ApplicationMgtListener.class.getName(), new ApplicationMgtProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Application Management Event listener registered successfully"); } ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(IdentityProviderMgtLister.class.getName(), new IdentityProviderMgtProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Identity Provider Management Event listener registered successfully"); } if (log.isDebugEnabled()) { log.debug("Identity Provisioning framework bundle is activated"); } } catch (Throwable e) { log.error("Error while initiating identity provisioning connector framework", e); } }
Source:
<code>public boolean eat(GlowPlayer player, ItemStack item) { if (!super.eat(player, item)) { return false; } for (int i = 0; i < 16; i++) { Location attempt = player.getLocation(); <START> double deltaX = Math.random() * 16 - 8; <END> double deltaY = Math.random() * 16 - 8; double deltaZ = Math.random() * 16 - 8; attempt.setX(attempt.getX() + deltaX); attempt.setY(Math.min(Math.max(attempt.getY() + deltaY, 0), player.getWorld().getMaxHeight() - 1)); attempt.setZ(attempt.getZ() + deltaZ); attempt = getSafeLocation(attempt); if (attempt != null) { player.getWorld().playSound(player.getLocation(), Sound.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1, 1); player.teleport(attempt); break; } } return true; }</code><technical_language>ThreadLocalRandom.current().nextDouble() instead of Math.random()</technical_language>

Target:
public boolean eat(GlowPlayer player, ItemStack item) { if (!super.eat(player, item)) { return false; } for (int i = 0; i < 16; i++) { Location attempt = player.getLocation(); double deltaX = ThreadLocalRandom.current().nextDouble() * 16 - 8; double deltaY = ThreadLocalRandom.current().nextDouble() * 16 - 8; double deltaZ = ThreadLocalRandom.current().nextDouble() * 16 - 8; attempt.setX(attempt.getX() + deltaX); attempt.setY(Math.min(Math.max(attempt.getY() + deltaY, 0), player.getWorld().getMaxHeight() - 1)); attempt.setZ(attempt.getZ() + deltaZ); attempt = getSafeLocation(attempt); if (attempt != null) { player.getWorld().playSound(player.getLocation(), Sound.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1, 1); player.teleport(attempt); break; } } return true; }
Source:
<code>public boolean isAnswer(){ boolean answer = false; if(StringUtil.isNotEmpty(getAsString(ForumsXPath.flag))){ List<String> flags = Arrays.asList(getDataHandler().getAsString(ForumsXPath.flag).split(" ")); for (int i = 0; i < flags.size(); i++) { if(StringUtil.equalsIgnoreCase(flags.get(i), FlagType.ANSWER.getFlagType())){ <START> answer = true; <END> } } } return answer; }</code><technical_language>Add a break here, matched answer, exit for loop</technical_language>

Target:
public boolean isAnswer(){ boolean answer = false; if(StringUtil.isNotEmpty(getAsString(ForumsXPath.flag))){ List<String> flags = Arrays.asList(getDataHandler().getAsString(ForumsXPath.flag).split(" ")); for (int i = 0; i < flags.size(); i++) { if(StringUtil.equalsIgnoreCase(flags.get(i), FlagType.ANSWER.getFlagType())){ answer = true; break; } } } return answer; }
Source:
<code>public EditorPartStackView() { this.tabs = new HashMap<>(); this.contents = new LinkedList<>(); initWidget(UI_BINDER.createAndBindUi(this)); plusPanel.getElement().setInnerHTML(FontAwesome.PLUS); plusPanel.addDomHandler( new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { if (addTabButtonClickListener != null) { addTabButtonClickListener.onAddTabButtonClicked( <START> getAbsoluteLeft(plusPanel.getElement()) + 15, <END> getAbsoluteTop(plusPanel.getElement()) + 15); } } }, ClickEvent.getType()); partViewContainer = new AcceptsOneWidget() { @Override public void setWidget(IsWidget widget) { contentPanel.add(widget); } }; addDomHandler(this, MouseDownEvent.getType()); setMaximized(false); }</code><technical_language>15 - const</technical_language>

Target:
public EditorPartStackView() { this.tabs = new HashMap<>(); this.contents = new LinkedList<>(); initWidget(UI_BINDER.createAndBindUi(this)); plusPanel.getElement().setInnerHTML(FontAwesome.PLUS); plusPanel.addDomHandler( new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { if (addTabButtonClickListener != null) { addTabButtonClickListener.onAddTabButtonClicked( getAbsoluteLeft(plusPanel.getElement()) + POPUP_OFFSET, getAbsoluteTop(plusPanel.getElement()) + POPUP_OFFSET); } } }, ClickEvent.getType()); partViewContainer = new AcceptsOneWidget() { @Override public void setWidget(IsWidget widget) { contentPanel.add(widget); } }; addDomHandler(this, MouseDownEvent.getType()); setMaximized(false); }
Source:
<code><START> protected void assertPairedMates(final SAMRecord record1, final SAMRecord record2) { <END> if (!(record1.getFirstOfPairFlag() && record2.getSecondOfPairFlag() || record2.getFirstOfPairFlag() && record1.getSecondOfPairFlag())) { throw new PicardException("Illegal mate state: " + record1.getReadName()); } }</code><technical_language>this static</technical_language>

Target:
protected static void assertPairedMates(final SAMRecord record1, final SAMRecord record2) { if (!(record1.getFirstOfPairFlag() && record2.getSecondOfPairFlag() || record2.getFirstOfPairFlag() && record1.getSecondOfPairFlag())) { throw new PicardException("Illegal mate state: " + record1.getReadName()); } }
Source:
<code><START> public static int getArrivalFilter(Context context, Uri uri) { <END> ContentResolver cr = context.getContentResolver(); Cursor c = cr.query(uri, new String[]{ARRIVAL_FILTER}, null, null, null); int result = 0; if (c != null && c.moveToNext()) { result = c.getInt(0); } if (c != null) { c.close(); } return result; }</code><technical_language>do changing return type enum ArrivalFilter? a conversion needs done anyway, do here</technical_language>

Target:
public static ArrivalFilter getArrivalFilter(Context context, Uri uri) { ContentResolver cr = context.getContentResolver(); Cursor c = cr.query(uri, new String[]{ARRIVAL_FILTER}, null, null, null); int result = 0; if (c != null && c.moveToNext()) { result = c.getInt(0); } if (c != null) { c.close(); } return ArrivalFilter.fromInt(result); }
Source:
<code>public void cleanEnvironment() throws Exception { ArrayList<Starter<?>> reversedStarters = new ArrayList<>(STARTERS.values()); Collections.reverse(reversedStarters); reversedStarters.stream() <START> .filter(Objects::nonNull) <END> .forEach(x -> { try { x.stop(); } catch (Exception e) { e.printStackTrace(); } }); zookeeper.close(); }</code><technical_language>filtering nonNull values? is a possibility for a null all</technical_language>

Target:
public void cleanEnvironment() throws Exception { try { logger.info("Cleaning environment"); ArrayList<Starter<?>> reversedStarters = new ArrayList<>(STARTERS.values()); Collections.reverse(reversedStarters); for (Starter<?> starter : reversedStarters) { starter.stop(); } zookeeper.close(); logger.info("Environment is cleaned"); } catch (Exception e) { logger.error("Exception on cleanEnvironment", e); } }
Source:
<code>public void deployChanges() { Set<PTContainer> newContainers = Sets.newHashSet(); Set<PTContainer> releaseContainers = Sets.newHashSet(); assignContainers(newContainers, releaseContainers); updatePartitionsInfoForPersistOperator(this.dag); this.undeployOpers.removeAll(newOpers.keySet()); this.deployOpers.addAll(this.newOpers.keySet()); Set<PTOperator> ndeps = getDependents(newOpers.keySet()); ndeps.removeAll(newOpers.keySet()); ndeps.removeAll(this.undeployOpers); this.undeployOpers.addAll(ndeps); <START> this.deployOpers.addAll(ndeps); <END> Set<PTOperator> deployOperators = this.getDependents(this.deployOpers); ctx.deploy(releaseContainers, this.undeployOpers, newContainers, deployOperators); this.newOpers.clear(); this.deployOpers.clear(); this.undeployOpers.clear(); }</code><technical_language>This required. Next line includes dependencies</technical_language>

Target:
public void deployChanges() { Set<PTContainer> newContainers = Sets.newHashSet(); Set<PTContainer> releaseContainers = Sets.newHashSet(); assignContainers(newContainers, releaseContainers); updatePartitionsInfoForPersistOperator(this.dag); Set<PTOperator> ndeps = getDependents(this.newOpers.keySet()); this.undeployOpers.addAll(ndeps); this.undeployOpers.removeAll(this.newOpers.keySet()); Set<PTOperator> deployOperators = this.getDependents(this.deployOpers); this.deployOpers.addAll(this.newOpers.keySet()); deployOperators.addAll(ndeps); ctx.deploy(releaseContainers, this.undeployOpers, newContainers, deployOperators); this.newOpers.clear(); this.deployOpers.clear(); this.undeployOpers.clear(); }
Source:
<code><START> default List<String> readLines(Charset charset) throws IOException { <END> try (Reader r = getReader(charset)) { return CharStreams.readLines(r); } }</code><technical_language>get a java stream here? collector collect do more complex operations</technical_language>

Target:
default Stream<String> readLines(Charset charset) { return getReader(charset).lines(); }
Source:
<code>public final boolean containsValue(Object value) { assertValueNotNull(value); return values().stream().filter(value::equals).findFirst().isPresent(); <START> } <END></code><technical_language>replaced anyMatch</technical_language>

Target:
public final boolean containsValue(Object value) { assertValueNotNull(value); return values().stream().anyMatch(StreamMarshalling.equalityPredicate(value)); }
Source:
<code>public Result addConfiguration() { AddConfigurationViewModel viewModel = new AddConfigurationViewModel(); List<String> datasets = new ArrayList<>(); datasets.add("dataset A"); datasets.add("dataset B"); datasets.add("dataset C"); Map<String, List<String>> task_variants = new HashMap<>(); Map<String, List<String>> evaluators = new HashMap<>(); for (int i = 65; i < 65+3; i++) { List<String> task_variants_i = new ArrayList<>(); <START> task_variants_i.add("task_variant A" + (char) i); <END> task_variants_i.add("task_variant B" + (char) i); task_variants_i.add("task_variant C" + (char) i); task_variants.put("dataset "+(char) i, task_variants_i); List<String> evaluator_i = new ArrayList<>(); evaluator_i.add("evaluator A" + (char) i); evaluator_i.add("evaluator B" + (char) i); evaluator_i.add("evaluator C" + (char) i); for (int j = 65; j < 65+3; j++) evaluators.put("task_variant "+(char)i+(char)j, evaluator_i); } viewModel.datasets = datasets; viewModel.task_variants = task_variants; viewModel.evaluators = evaluators; return ok(addConfiguration.render(viewModel)); }</code><technical_language>update task variant these? <LINK_0></technical_language>

Target:
public Result addConfiguration() { AddConfigurationViewModel viewModel = new AddConfigurationViewModel(); List<String> datasets = new ArrayList<>(); datasets.add("dataset A"); datasets.add("dataset B"); datasets.add("dataset C"); Map<String, List<String>> task_variants = new HashMap<>(); Map<String, List<String>> evaluators = new HashMap<>(); for (int i = 65; i < 65+3; i++) { List<String> task_variants_i = new ArrayList<>(); task_variants_i.add("SPAN_IDENTIFICATION"); task_variants_i.add("SPAN_TAGGING"); task_variants_i.add("PREDICATE_ARGUMENT_LABELING"); task_variants_i.add("SPAN_CLUSTERING"); task_variants_i.add("DEPENDENCY_PARSING"); task_variants_i.add("CONSTITUENCY_PARSING"); task_variants.put("dataset "+(char) i, task_variants_i); List<String> evaluator_i = new ArrayList<>(); evaluator_i.add("evaluator A" + (char) i); evaluator_i.add("evaluator B" + (char) i); evaluator_i.add("evaluator C" + (char) i); for (int j = 65; j < 65+3; j++) evaluators.put("task_variant "+(char)i+(char)j, evaluator_i); } viewModel.datasets = datasets; viewModel.task_variants = task_variants; viewModel.evaluators = evaluators; return ok(addConfiguration.render(viewModel)); }
Source:
<code>public JettyClientUpgradeRequest(WebSocketCoreClient coreClient, UpgradeRequest request, URI requestURI, JettyWebSocketFrameHandlerFactory frameHandlerFactory, Object websocketPojo) { super(coreClient, requestURI); if (request != null) { HttpFields.Mutable fields = getHeaders(); request.getHeaders().forEach(fields::put); List<HttpCookie> cookies = request.getCookies(); if (cookies != null) { <START> HttpFields.Mutable headers = getHeaders(); <END> for (HttpCookie cookie : cookies) { headers.add(HttpHeader.COOKIE, cookie.toString()); } } setSubProtocols(request.getSubProtocols()); setExtensions(request.getExtensions().stream() .map(c -> new ExtensionConfig(c.getName(), c.getParameters())) .collect(Collectors.toList())); if (request.getMethod() != null) method(request.getMethod()); if (request.getHttpVersion() != null) version(HttpVersion.fromString(request.getHttpVersion())); } handshakeRequest = new DelegatedJettyClientUpgradeRequest(this); frameHandler = frameHandlerFactory.newJettyFrameHandler(websocketPojo); }</code><technical_language>This is variable fields declared above, remove duplication</technical_language>

Target:
public JettyClientUpgradeRequest(WebSocketCoreClient coreClient, UpgradeRequest request, URI requestURI, JettyWebSocketFrameHandlerFactory frameHandlerFactory, Object websocketPojo) { super(coreClient, requestURI); if (request != null) { HttpFields.Mutable fields = getHeaders(); request.getHeaders().forEach(fields::put); List<HttpCookie> cookies = request.getCookies(); if (cookies != null) { for (HttpCookie cookie : cookies) { fields.add(HttpHeader.COOKIE, cookie.toString()); } } setSubProtocols(request.getSubProtocols()); setExtensions(request.getExtensions().stream() .map(c -> new ExtensionConfig(c.getName(), c.getParameters())) .collect(Collectors.toList())); if (request.getMethod() != null) method(request.getMethod()); if (request.getHttpVersion() != null) version(HttpVersion.fromString(request.getHttpVersion())); } handshakeRequest = new DelegatedJettyClientUpgradeRequest(this); frameHandler = frameHandlerFactory.newJettyFrameHandler(websocketPojo); }
Source:
<code>public void createFieldMethod(Class<?> prefFieldHelperClass, IJExpression keyExpression, String fieldName, String fieldHelperMethodName, IJExpression defaultValue, String docComment, String defaultValueStr) { JMethod fieldMethod = generatedClass.method(PUBLIC, prefFieldHelperClass, fieldName); if (defaultValueStr != null) { <START> boolean isStringPrefField = "stringField".equals(fieldHelperMethodName); <END> if (isStringPrefField) { fieldMethod.javadoc().append("<p><b>Defaults to</b>: \"" + defaultValueStr + "\"</p>\n"); } else { fieldMethod.javadoc().append("<p><b>Defaults to</b>: " + defaultValueStr + "</p>\n"); } } codeModelHelper.addTrimmedDocComment(fieldMethod, docComment); fieldMethod.body()._return(JExpr.invoke(fieldHelperMethodName).arg(keyExpression).arg(defaultValue)); }</code><technical_language>a bit nicer check prefFieldHelperClass == StringSetPrefField.class. do rely magic string constants</technical_language>

Target:
public void createFieldMethod(Class<?> prefFieldHelperClass, IJExpression keyExpression, String fieldName, String fieldHelperMethodName, IJExpression defaultValue, String docComment, String defaultValueStr) { JMethod fieldMethod = generatedClass.method(PUBLIC, prefFieldHelperClass, fieldName); if (defaultValueStr != null) { boolean isStringPrefField = StringPrefField.class == prefFieldHelperClass; final String defaultValueJavaDoc; if (isStringPrefField) { defaultValueJavaDoc = "\"" + defaultValueStr + "\""; } else { defaultValueJavaDoc = defaultValueStr; } fieldMethod.javadoc().append("<p><b>Defaults to</b>: " + defaultValueJavaDoc + "</p>\n"); } codeModelHelper.addTrimmedDocComment(fieldMethod, docComment); fieldMethod.body()._return(JExpr.invoke(fieldHelperMethodName).arg(keyExpression).arg(defaultValue)); }
Source:
<code>private static Configuration validateAndGetConfiguration(final Configuration configuration) { if (!ExecutionEnvironment.areExplicitEnvironmentsAllowed()) { throw new InvalidProgramException( "The LocalStreamEnvironment cannot be used when submitting a program through a client, " + "or running in a TestEnvironment context."); } final Configuration effectiveConfiguration = new Configuration(checkNotNull(configuration)); effectiveConfiguration.set(DeploymentOptions.TARGET, "local"); effectiveConfiguration.set(DeploymentOptions.ATTACHED, true); <START> if (!configuration.getOptional(CoreOptions.DEFAULT_PARALLELISM).isPresent()) { <END> configuration.set(CoreOptions.DEFAULT_PARALLELISM, 1); } return effectiveConfiguration; }</code><technical_language>is this needed</technical_language>

Target:
private static Configuration validateAndGetConfiguration(final Configuration configuration) { if (!ExecutionEnvironment.areExplicitEnvironmentsAllowed()) { throw new InvalidProgramException( "The LocalStreamEnvironment cannot be used when submitting a program through a client, " + "or running in a TestEnvironment context."); } final Configuration effectiveConfiguration = new Configuration(checkNotNull(configuration)); effectiveConfiguration.set(DeploymentOptions.TARGET, "local"); effectiveConfiguration.set(DeploymentOptions.ATTACHED, true); return effectiveConfiguration; }
Source:
<code>private boolean isValidUrl(String url) { <START> return url.startsWith("http://") || url.startsWith("https://"); <END> }</code><technical_language>Please URLUtil methods well</technical_language>

Target:
private boolean isValidUrl(String url) { return URLUtil.isHttpUrl(url) || URLUtil.isHttpsUrl(url); }
Source:
<code>public IncrementableEntryVersion increment(IncrementableEntryVersion initialVersion) { <START> if (initialVersion == NonExistingVersion.INSTANCE) { <END> return generateNew(); } else if (initialVersion instanceof NumericVersion) { NumericVersion old = (NumericVersion) initialVersion; long counter = old.getVersion() + 1; return createNumericVersion(counter); } throw log.unexpectedInitialVersion(initialVersion.getClass().getName()); }</code><technical_language>nicer a method IncrementableEntryVersion.incrementVersion()::IncrementableEntryVersion care of this. drop not-so-nice instanceof</technical_language>

Target:
public IncrementableEntryVersion increment(IncrementableEntryVersion initialVersion) { if (initialVersion instanceof NumericVersion) { NumericVersion old = (NumericVersion) initialVersion; long counter = old.getVersion() + 1; return createNumericVersion(counter); } throw log.unexpectedInitialVersion(initialVersion.getClass().getName()); }