auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<ITestResult> call() { List<ITestResult> tmpResults = Lists.newArrayList(); long start = System.currentTimeMillis(); XmlSuite suite = m_testContext.getSuite().getXmlSuite(); final Invoker.FailureContext failure = new Invoker.FailureContext(); failure.count = m_failureCount; try { tmpResults.add( m_invoker.invokeTestMethod( m_instance, m_testMethod, m_parameterValues, m_parameterIndex, suite, m_parameters, m_testClass, m_beforeMethods, m_afterMethods, m_groupMethods, failure)); } finally { m_failureCount = failure.count; if (failure.instances.isEmpty()) { m_testResults.addAll(tmpResults); } else { for (Object instance : failure.instances) { List<ITestResult> retryResults = Lists.newArrayList(); m_failureCount = m_invoker.retryFailed( instance, m_testMethod, m_parameterValues, m_testClass, m_beforeMethods, m_afterMethods, m_groupMethods, retryResults, m_failureCount, m_testContext, m_parameters, m_parameterIndex) .count; m_testResults.addAll(retryResults); } } if (!m_skipFailedInvocationCounts) { m_skipFailedInvocationCounts = m_testMethod.skipFailedInvocations(); } if (m_failureCount > 0 && m_skipFailedInvocationCounts) { while (m_invocationCount-- > 0) { ITestResult r = <START> TestResult.newEndTimeAwareTestResult(m_testMethod, null, start, m_testContext); <END> r.setStatus(TestResult.SKIP); m_testResults.add(r); m_invoker.runTestListeners(r); m_notifier.addSkippedTest(m_testMethod, r); } } } m_parameterIndex++; return m_testResults; }</code><technical_language>Instead of null, a custom Exception TooMuchInvoicationCountException</technical_language>

Target:
public List<ITestResult> call() { List<ITestResult> tmpResults = Lists.newArrayList(); long start = System.currentTimeMillis(); XmlSuite suite = m_testContext.getSuite().getXmlSuite(); final Invoker.FailureContext failure = new Invoker.FailureContext(); failure.count = m_failureCount; try { tmpResults.add( m_invoker.invokeTestMethod( m_instance, m_testMethod, m_parameterValues, m_parameterIndex, suite, m_parameters, m_testClass, m_beforeMethods, m_afterMethods, m_groupMethods, failure)); } finally { m_failureCount = failure.count; if (failure.instances.isEmpty()) { m_testResults.addAll(tmpResults); } else { for (Object instance : failure.instances) { List<ITestResult> retryResults = Lists.newArrayList(); m_failureCount = m_invoker.retryFailed( instance, m_testMethod, m_parameterValues, m_testClass, m_beforeMethods, m_afterMethods, m_groupMethods, retryResults, m_failureCount, m_testContext, m_parameters, m_parameterIndex) .count; m_testResults.addAll(retryResults); } } if (!m_skipFailedInvocationCounts) { m_skipFailedInvocationCounts = m_testMethod.skipFailedInvocations(); } if (m_failureCount > 0 && m_skipFailedInvocationCounts) { while (m_invocationCount-- > 0) { ITestResult r = TestResult.newEndTimeAwareTestResult(m_testMethod, m_testContext, null, start); r.setStatus(TestResult.SKIP); m_testResults.add(r); m_invoker.runTestResultListener(r); m_notifier.addSkippedTest(m_testMethod, r); } } } m_parameterIndex++; return m_testResults; }
Source:
<code>public void setup() { EntityDictionary dictionary = new EntityDictionary(new HashMap<>()); dictionary.bindEntity(NoopBean.class); requestScope = mock(RequestScope.class); JsonApiMapper mapper = mock(JsonApiMapper.class); when(requestScope.getDictionary()).thenReturn(dictionary); when(requestScope.getObjectEntityCache()).thenReturn(new ObjectEntityCache()); <START> when(requestScope.getObjectEntityCache()).thenReturn(new ObjectEntityCache()); <END> when(requestScope.getMapper()).thenReturn(mapper); when(mapper.getObjectMapper()).thenReturn(new ObjectMapper()); }</code><technical_language>This line a duplicate</technical_language>

Target:
public void setup() { EntityDictionary dictionary = new EntityDictionary(new HashMap<>()); dictionary.bindEntity(NoopBean.class); requestScope = mock(RequestScope.class); JsonApiMapper mapper = mock(JsonApiMapper.class); when(requestScope.getDictionary()).thenReturn(dictionary); when(requestScope.getObjectEntityCache()).thenReturn(new ObjectEntityCache()); when(requestScope.getMapper()).thenReturn(mapper); when(mapper.getObjectMapper()).thenReturn(new ObjectMapper()); }
Source:
<code>public Response renameSecret(@Auth User user, @PathParam("secretId") LongParam secretId, @PathParam("secretName") String secretName) { Optional<Secret> secret = secretController.getSecretByName(secretName); if (secret.isPresent()) { logger.info("User '{}' tried renaming a secret, but another secret with that name " + "already exists (name={})", user, secretId.get()); <START> throw new NotAllowedException("That name is already taken by another secret"); END> } logger.info("User '{}' renamed secret id={} to name='{}'", user, secretId, secretName); secretDAOReadWrite.renameSecretById(secretId.get(), secretName); Map<String, String> extraInfo = new HashMap<>(); auditLog.recordEvent( new Event(Instant.now(), EventTag.SECRET_RENAME, user.getName(), secretName, extraInfo)); return Response.noContent().build(); }</code><technical_language>a ConflictException, this UI throws create a secret name exists, sense :)</technical_language>

Target:
public Response renameSecret(@Auth User user, @PathParam("secretId") LongParam secretId, @PathParam("secretName") String secretName) { Optional<Secret> secret = secretController.getSecretByName(secretName); if (secret.isPresent()) { logger.info("User '{}' tried renaming a secret, but another secret with that name " + "already exists (name={})", user, secretId.get()); throw new ConflictException("That name is already taken by another secret"); } logger.info("User '{}' renamed secret id={} to name='{}'", user, secretId, secretName); secretDAOReadWrite.renameSecretById(secretId.get(), secretName, user.getName()); Map<String, String> extraInfo = new HashMap<>(); auditLog.recordEvent( new Event(Instant.now(), EventTag.SECRET_RENAME, user.getName(), secretName, extraInfo)); return Response.noContent().build(); }
Source:
<code>public void check(@Nullable GoSignature o, @NotNull ProblemsHolder holder) { <START> super.check(o, holder); <END> if (o == null) return; Set<String> names = getParamNames(o); GoResult result = o.getResult(); if (result == null) return; GoParameters parameters = result.getParameters(); if (parameters == null) return; checkParameters(holder, parameters, names); }</code><technical_language>sure? o.getParamters checked checked if GoDuplicateArgumentInspection is disabled</technical_language>

Target:
public void check(@Nullable GoSignature o, @NotNull ProblemsHolder holder) { if (o == null) return; Set<String> names = getParamNames(o); GoResult result = o.getResult(); if (result == null) return; GoParameters parameters = result.getParameters(); if (parameters == null) return; checkParameters(holder, parameters, names); }
Source:
<code>protected void closeFile(InputStream is) throws IOException { String fileName = super.currentFile; <START> super.closeFile(is); <END> if (avroDataStream != null) { avroDataStream.close(); } if (completedFilesPort.isConnected()) { completedFilesPort.emit(fileName); } offset = 0; }</code><technical_language>suport.closeFile done avroDataStream.close() first? This is avroStream is created super.inputStream</technical_language>

Target:
protected void closeFile(InputStream is) throws IOException { String fileName = super.currentFile; if (avroDataStream != null) { avroDataStream.close(); } super.closeFile(is); if (completedFilesPort.isConnected()) { completedFilesPort.emit(fileName); } offset = 0; }
Source:
<code>public String titleFor(Content content) { if (!(content instanceof Episode) || content.getTitle() == null) { return content.getTitle(); } Episode episode = (Episode) content; String episodeTitle = episode.getTitle(); if (episodeTitle == null || episode.getEpisodeNumber() == null <START> || DATE_PATTERN.matcher(episodeTitle).find(0) <END> || EPISODE_NUMBER_PATTERN.matcher(episodeTitle).matches()) { return episodeTitle; } else { return String.format("%d. %s", episode.getEpisodeNumber(), episodeTitle); } }</code><technical_language>why</technical_language>

Target:
public String titleFor(Content content) { if (!(content instanceof Episode) || content.getTitle() == null) { return content.getTitle(); } Episode episode = (Episode) content; String episodeTitle = episode.getTitle(); if (episodeTitle == null || episode.getEpisodeNumber() == null || DATE_PATTERN.matcher(episodeTitle).find(START_OF_STRING) || EPISODE_NUMBER_PATTERN.matcher(episodeTitle).find(START_OF_STRING)) { return episodeTitle; } else { return String.format("%d. %s", episode.getEpisodeNumber(), episodeTitle); } }
Source:
<code>public void testTraceIdGeneration() throws Exception { <START> assertThat(Tracers.longToPaddedHex(0)).isEqualTo("0000000000000000"); <END> assertThat(Tracers.longToPaddedHex(42)).isEqualTo("000000000000002a"); assertThat(Tracers.longToPaddedHex(-42)).isEqualTo("ffffffffffffffd6"); assertThat(Tracers.longToPaddedHex(123456789L)).isEqualTo("00000000075bcd15"); }</code><technical_language>want this</technical_language>

Target:
public void testTraceIdGeneration() throws Exception { assertThat(Tracers.randomId()).hasSize(16); assertThat(Tracers.longToPaddedHex(0)).isEqualTo("0000000000000000"); assertThat(Tracers.longToPaddedHex(42)).isEqualTo("000000000000002a"); assertThat(Tracers.longToPaddedHex(-42)).isEqualTo("ffffffffffffffd6"); assertThat(Tracers.longToPaddedHex(123456789L)).isEqualTo("00000000075bcd15"); }
Source:
<code>public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { if (!intercept) { return; } final IExecutable roll = new IExecutable() { private static final long serialVersionUID = 6579019987019614374L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { dice = DiceRoll.airBattle(attackingUnits, false, attacker, bridge, "Attackers Fire, "); } }; final IExecutable calculateCasualties = new IExecutable() { private static final long serialVersionUID = 4556409970663527142L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { details = CasualtySelector.selectCasualties( defender, defendingUnits, defendingUnits, attackingUnits, false, <START> battleSite, <END> null, bridge, ATTACKERS_FIRE, dice, true, battleId, false, dice.getHits(), true); defendingWaitingToDie.addAll(details.getKilled()); markDamaged(details.getDamaged(), bridge); } }; final IExecutable notifyCasualties = new IExecutable() { private static final long serialVersionUID = 4224354422817922451L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { notifyCasualties(battleId, bridge, ATTACKERS_FIRE, dice, defender, attacker, details); } }; stack.push(notifyCasualties); stack.push(calculateCasualties); stack.push(roll); }</code><technical_language>list need modifiable? If not, List.of() is conventional preference for empty lists</technical_language>

Target:
public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { if (!intercept) { return; } final IExecutable roll = new IExecutable() { private static final long serialVersionUID = 6579019987019614374L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { dice = DiceRoll.airBattle(attackingUnits, false, attacker, bridge, "Attackers Fire, "); } }; final IExecutable calculateCasualties = new IExecutable() { private static final long serialVersionUID = 4556409970663527142L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { details = CasualtySelector.selectCasualties( defender, defendingUnits, defendingUnits, attackingUnits, battleSite, null, bridge, ATTACKERS_FIRE, dice, true, battleId, false, dice.getHits(), true); defendingWaitingToDie.addAll(details.getKilled()); markDamaged(details.getDamaged(), bridge); } }; final IExecutable notifyCasualties = new IExecutable() { private static final long serialVersionUID = 4224354422817922451L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { notifyCasualties(battleId, bridge, ATTACKERS_FIRE, dice, defender, attacker, details); } }; stack.push(notifyCasualties); stack.push(calculateCasualties); stack.push(roll); }
Source:
<code>private void updateStyleToMatchStatus(TurboIssue issue){ if (!issue.isOpen()){ if (!getStyleClass().contains("issue-cell-closed")) { getStyleClass().add("issue-cell-closed"); } } else { if (getStyleClass().contains("issue-cell-closed")) { getStyleClass().remove("issue-cell-closed"); } } <START> } <END></code><technical_language>Do suggested changes @lejolly review</technical_language>

Target:
private void updateStyleToMatchStatus(TurboIssue issue){ final String closedStyle = "issue-cell-closed"; boolean isCurrentStyleClosed = getStyleClass().contains(closedStyle); if (!issue.isOpen()){ if (!isCurrentStyleClosed) { getStyleClass().add(closedStyle); } } else { if (isCurrentStyleClosed) { getStyleClass().remove(closedStyle); } } }
Source:
<code><START> String toDisplayValue(final String dmnValue) { <END> final YearsMonthsValue yearsMonthsValue = fromDMNString(dmnValue); return toDisplayValue(yearsMonthsValue); }</code><technical_language>this public rest private</technical_language>

Target:
public String toDisplayValue(final String dmnValue) { final YearsMonthsValue yearsMonthsValue = fromDMNString(dmnValue); return toDisplayValue(yearsMonthsValue); }
Source:
<code>public Response healthCheck() { SortedMap<String, HealthCheck.Result> results = environment.healthChecks().runHealthChecks(); Map<String, Map<String, Object>> response = results.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, healthCheck -> ImmutableMap.of( "healthy", healthCheck.getValue().isHealthy(), "message", defaultString(healthCheck.getValue().getMessage(), "Healthy")) ) ); <START> boolean allHealthy = results.values().stream().allMatch(HealthCheck.Result::isHealthy); <END> Response.ResponseBuilder res = allHealthy ? Response.ok() : status(503); return res.entity(response).build(); }</code><technical_language>This a private function in-line creating a local boolean variable e.g. Response.ResponseBuilder res = allHealthy(results) ? Response.ok() : status(503); private boolean allHealthy(Map<String, HealthCheck.Result> results) { return results.values().stream().allMatch(HealthCheck.Result::isHealthy); } stop Oz reviewed rest. This mandatory, works sense as-is</technical_language>

Target:
public Response healthCheck() { SortedMap<String, HealthCheck.Result> results = environment.healthChecks().runHealthChecks(); Map<String, Map<String, Object>> response = results.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, healthCheck -> ImmutableMap.of( "healthy", healthCheck.getValue().isHealthy(), "message", defaultString(healthCheck.getValue().getMessage(), "Healthy")) ) ); Response.ResponseBuilder res = allHealthy(results.values()) ? Response.ok() : status(503); return res.entity(response).build(); }
Source:
<code><START> public IFileRevision[] getTargets(final IFileRevision ifr) { <END> String path = null; RevCommit commit = null; if (ifr instanceof CommitFileRevision) { final CommitFileRevision rev = (CommitFileRevision) ifr; path = rev.getGitPath(); commit = rev.getRevCommit(); } else if (ifr instanceof IAdaptable) { final IResourceVariant variant = (IResourceVariant) ((IAdaptable) ifr) .getAdapter(IResourceVariant.class); if (variant instanceof GitRemoteResource) { final GitRemoteResource gitVariant = (GitRemoteResource) variant; path = gitVariant.getPath(); try { commit = walk.parseCommit(gitVariant.getCommitId()); } catch (IOException e) { } } } if (path != null && commit instanceof KidCommit) { final KidCommit c = (KidCommit) commit; final IFileRevision[] r = new IFileRevision[c.children.length]; for (int i = 0; i < r.length; i++) r[i] = new CommitFileRevision(db, c.children[i], path); return r; } return NO_REVISIONS; }</code><technical_language>implementation of this method identical copy of getContributors(IFileRevision) this factored out</technical_language>

Target:
public IFileRevision[] getTargets(final IFileRevision ifr) { String path = getGitPath(ifr); RevCommit commit = getRevCommit(ifr); if (path != null && commit instanceof KidCommit) { final KidCommit c = (KidCommit) commit; final IFileRevision[] r = new IFileRevision[c.children.length]; for (int i = 0; i < r.length; i++) r[i] = new CommitFileRevision(db, c.children[i], path); return r; } return NO_REVISIONS; }
Source:
<code>private boolean contentCheck(DirCacheEntry entry) { if (getEntryObjectId().equals(entry.getObjectId())) { try { <START> entry.setLength((int) getEntryLength()); <END> } catch (UnsupportedOperationException e) { } return false; } else { return true; } }</code><technical_language>I add a method isModifiable() avoid handling this exception (doesn't this is exceptional this a performance penalty)</technical_language>

Target:
private boolean contentCheck(DirCacheEntry entry) { if (getEntryObjectId().equals(entry.getObjectId())) { if (!(entry instanceof UnmodifiableDirCacheEntry)) entry.setLength((int) getEntryLength()); return false; } else { return true; } }
Source:
<code>public String getRemoteHost() { <START> return null; <END> }</code><technical_language>implement 2 methods</technical_language>

Target:
public String getRemoteHost() { return hostName; }
Source:
<code>public void increment(long inc) { if (value == null) { <START> throw new IllegalArgumentException("Attempt to increment a null valued MutableRealmInteger"); <END> } value = Long.valueOf(value + inc); }</code><technical_language>IllegalState</technical_language>

Target:
public void increment(long inc) { if (value == null) { throw new IllegalStateException("Attempt to increment a null valued MutableRealmInteger"); } value = Long.valueOf(value + inc); }
Source:
<code>private boolean checkAndFetchQuota(QuotaConsumptionParametersWrapper parameters, QuotaConsumptionParameter param) { <START> if(param.getQuotaGuid() == null || Guid.Empty.equals(param.getQuotaGuid())) { <END> parameters.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NO_LONGER_AVAILABLE_IN_SYSTEM.toString()); log.errorFormat("No Quota id passed from command: {0}",parameters.getAuditLogable().getClass().getName()); return false; } Quota quota = fetchQuotaFromDB(param.getQuotaGuid()); if (quota == null) { parameters.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NO_LONGER_AVAILABLE_IN_SYSTEM.toString()); log.errorFormat("The quota id {0} is not found in backend and DB.", param.getQuotaGuid().toString()); return false; } else { param.setQuota(quota); } return true; }</code><technical_language>is a ugly of work, crated wrapper, passed parameters passing a list of canDoMessages a code in order fill it. approach is wrong (I is code, do smart), return value</technical_language>

Target:
private boolean checkAndFetchQuota(QuotaConsumptionParametersWrapper parameters, QuotaConsumptionParameter param) { if(param.getQuotaGuid() == null || Guid.Empty.equals(param.getQuotaGuid())) { parameters.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NO_LONGER_AVAILABLE_IN_SYSTEM.toString()); log.errorFormat("No Quota id passed from command: {0}",parameters.getAuditLogable().getClass().getName()); return false; } Quota quota = fetchQuotaFromDB(param.getQuotaGuid()); if (quota == null) { parameters.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NO_LONGER_AVAILABLE_IN_SYSTEM.toString()); log.errorFormat("The quota id {0} is not found in backend and DB.", param.getQuotaGuid().toString()); return false; } else { param.setQuota(quota); } if (!quota.getStoragePoolId().equals(parameters.getStoragePoolGuid())) { throw new InvalidQuotaParametersException("The Quota storage pool id does not match the passed storage pool"); } return true; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { AndroidInjection.inject(this); super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.settings_preferences); mPreferenceThumbnailSize = (ListPreference) getPreferenceScreen().findPreference(PreferencesRepository.KEY_PREF_THUMBNAIL_SIZE); mPreferencePhotosPerRow = (ListPreference) getPreferenceScreen().findPreference(PreferencesRepository.KEY_PREF_PHOTOS_PER_ROW); String photosPerRowValue = preferencesRepository.getStringPreference(PreferencesRepository.KEY_PREF_PHOTOS_PER_ROW, "4"); <START> String thumbnailSizeValue = preferencesRepository.getStringPreference(PreferencesRepository.KEY_PREF_THUMBNAIL_SIZE, "medium"); <END> mPreferenceThumbnailSize.setSummary(thumbnailSizeValue); mPreferencePhotosPerRow.setSummary(photosPerRowValue); mPreferencePhotosPerRow.setOnPreferenceChangeListener((preference, value) -> { mPreferencePhotosPerRow.setSummary(value.toString()); return true; }); mPreferenceThumbnailSize.setOnPreferenceChangeListener((preference, value) -> { mPreferenceThumbnailSize.setSummary(value.toString()); return true; }); }</code><technical_language>of moving "default" for option preferenceRepository? I some benefit in case preference in locations, if is set, SettingsActivity need show something. I currently a case for defaults in cases. Yes, SharedPreferences stuff Android is approach, is different, class is control...</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings); setSupportActionBar(findViewById(R.id.toolbar)); ActionBar bar = getSupportActionBar(); if (bar != null) bar.setDisplayHomeAsUpEnabled(true); getSupportFragmentManager() .beginTransaction() .replace(R.id.settings_container, new SettingsFragment()) .commit(); }
Source:
<code>public void testSLSBInvocation() { Assert.assertEquals("echo system property exists", System.getProperty("echo"), null); Affinity expectedStrongAffinity = Affinity.NONE; final StatelessEJBLocator<Echo> statelessEJBLocator = StatelessEJBLocator.create(Echo.class, STATELESS_IDENTIFIER, expectedStrongAffinity); Echo proxy = EJBClient.createProxy(statelessEJBLocator); Assert.assertNotNull("Received a null proxy", proxy); logger.info("Invoking on proxy..."); final String message = "hello!"; try { proxy.echo(message); } catch (RuntimeException e) { } Assert.assertEquals("method echo not in error message", System.getProperty("echo"), "true"); <START> } <END></code><technical_language>order of params (expected, actual) inverted in of assertEquals method</technical_language>

Target:
public void testSLSBInvocation() { Assert.assertEquals("echo system property exists", null, System.getProperty("echo")); Affinity expectedStrongAffinity = Affinity.NONE; final StatelessEJBLocator<Echo> statelessEJBLocator = StatelessEJBLocator.create(Echo.class, STATELESS_IDENTIFIER, expectedStrongAffinity); Echo proxy = EJBClient.createProxy(statelessEJBLocator); Assert.assertNotNull("Received a null proxy", proxy); logger.info("Invoking on proxy..."); final String message = "hello!"; try { proxy.echo(message); } catch (RuntimeException e) { } Assert.assertEquals("method echo not in error message", "true", System.getProperty("echo")); }
Source:
<code>BytesConverter getByteConverterForAvroDelegate(Schema schema, Properties tbl) { String avroBytesConverterProperty = tbl.getProperty(AvroSerdeUtils .AvroTableProperties.AVRO_SERDE_TYPE .getPropName(), BytesConverterType.NONE.toString()); BytesConverterType avroByteConverterType = BytesConverterType.fromString(avroBytesConverterProperty); <START> Integer avroSkipBytes = Integer.getInteger(tbl.getProperty(AvroSerdeUtils.AvroTableProperties.AVRO_SERDE_SKIP_BYTES <END> .getPropName())); switch (avroByteConverterType) { case CONFLUENT: return new AvroSkipBytesConverter(schema, 5); case SKIP: return new AvroSkipBytesConverter(schema, avroSkipBytes); default: return new AvroBytesConverter(schema); } }</code><technical_language>read this ? implementation of Integer.getInteger i is reading form system properties, this is work. Aha... Java naming</technical_language>

Target:
BytesConverter getByteConverterForAvroDelegate(Schema schema, Properties tbl) throws SerDeException { String avroBytesConverterPropertyName = AvroSerdeUtils.AvroTableProperties.AVRO_SERDE_TYPE.getPropName(); String avroBytesConverterProperty = tbl.getProperty(avroBytesConverterPropertyName, BytesConverterType.NONE.toString()); BytesConverterType avroByteConverterType = BytesConverterType.fromString(avroBytesConverterProperty); switch (avroByteConverterType) { case SKIP: String avroSkipBytesPropertyName = AvroSerdeUtils.AvroTableProperties.AVRO_SERDE_SKIP_BYTES.getPropName(); Integer avroSkipBytes = 0; try { avroSkipBytes = Integer.parseInt(tbl.getProperty(avroSkipBytesPropertyName)); } catch (NumberFormatException e) { String message = "Value of " + avroSkipBytesPropertyName + " could not be parsed into an integer properly."; throw new SerDeException(message, e); } return new AvroSkipBytesConverter(schema, avroSkipBytes); case NONE: return new AvroBytesConverter(schema); default: throw new SerDeException("Value of " + avroBytesConverterPropertyName + " was invalid."); } }
Source:
<code>private void inlineSheet(final String namespaceURI, String s) throws Exception { InputStream inputStream = null; String withoutExtension = s.substring(0, s.indexOf(LibraryType.CSS.extension)); HtmlLibrary library = htmlLibraryManager.getLibrary(LibraryType.CSS, withoutExtension); if (library != null) { inputStream = library.getInputStream(); } else { Resource resource = slingRequest.getResourceResolver().getResource(s); if (resource != null) { inputStream = resource.adaptTo(InputStream.class); } } if (inputStream != null) { InputStreamReader isr = new InputStreamReader(inputStream); CharArrayWriter caw = new CharArrayWriter(inputStream.available()); caw.write(NEWLINE); int read = -1; while ((read = isr.read()) > -1) { caw.write(read); } getContentHandler().startElement(namespaceURI, STYLE, null, new AttributesImpl()); getContentHandler().characters(caw.toCharArray(), 0, caw.size()); <START> super.endElement(namespaceURI, STYLE, null); <END> } }</code><technical_language>minor - for consistency, please this getContentHandler().endElement()</technical_language>

Target:
private void inlineSheet(final String namespaceURI, String s) throws Exception { InputStream inputStream = null; String withoutExtension = s.substring(0, s.indexOf(LibraryType.CSS.extension)); HtmlLibrary library = htmlLibraryManager.getLibrary(LibraryType.CSS, withoutExtension); if (library != null) { inputStream = library.getInputStream(); } else { Resource resource = slingRequest.getResourceResolver().getResource(s); if (resource != null) { inputStream = resource.adaptTo(InputStream.class); } } if (inputStream != null) { char[] chars = IOUtils.toCharArray(inputStream); getContentHandler().startElement(namespaceURI, STYLE, null, new AttributesImpl()); getContentHandler().characters(NEWLINE, 0, 1); getContentHandler().characters(chars, 0, chars.length); getContentHandler().endElement(namespaceURI, STYLE, null); } }
Source:
<code>public String fetchContent(String fileName) throws IOException { URI fileUrl = devfileLocation.resolve(fileName); try { return urlFetcher.fetch(fileUrl.toString()); } catch (IOException e) { throw new IOException( format( "Failed to fetch a file %s as relative to devfile %s from URL %s. Make sure the" + " location of the devfile points to the raw content of it (e.g. on Github or other" + " git repository make sure to use a link to the raw content of the devfile, not" + " a link to the webpage showing it). If obtaining such URL is not possible, make" + " sure you have installed a factory resolver plugin for given repository type" + " to your Che server instance.", <START> fileName, devfileLocation, fileUrl), <END> e); } }</code><technical_language>I useful original error message well, show 403 token absence a user understand a cause. WDYT</technical_language>

Target:
public String fetchContent(String fileName) throws IOException { URI fileUrl = devfileLocation.resolve(fileName); try { return urlFetcher.fetch(fileUrl.toString()); } catch (IOException e) { throw new IOException( format( "Failed to fetch a file %s as relative to devfile %s from URL %s. Make sure the URL" + " of the devfile points to the raw content of it (e.g. not to the webpage" + " showing it but really just its contents). Additionally, make sure the" + " referenced files are actually stored relative to the devfile on the same" + " host. If none of that is possible, try to host your devfile on some other" + " location together with the referenced files in such a way that resolving the" + " \"local\" name of a tool as a relative path against the devfile location" + " gives a true downloadable URL for that file. The current attempt to download" + " the file failed with the following error message: %s", fileName, devfileLocation, fileUrl, e.getMessage()), e); } }
Source:
<code>public void registerBeanDefinitions(BeanDefinitionRegistry registry) { ClassLoader pluginClassLoader = getClass().getClassLoader(); BeanDefinition springLoaderBeanDefinition = BeanDefinitionBuilder.genericBeanDefinition(SpringLoader.class) .setScope(BeanDefinition.SCOPE_SINGLETON) .setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_NO) .addConstructorArgValue(pluginContext) .addConstructorArgValue(pluginClassLoader) .addConstructorArgValue(getPackagesToScan()) .addConstructorArgValue(getClassesToRegister()) .getBeanDefinition(); try { registerBean(springLoaderBeanDefinition, registry); } catch (ClassNotFoundException e) { throw new IllegalStateException(e); } registry .getBeanDefinition("requestMappingHandlerMapping") <START> .setDependsOn("com.netflix.spinnaker.kork.plugins.api.spring.SpringLoader"); <END> }</code><technical_language>this work multiple plugins? Line 59, register SpringLoader bean next plugin try do same. in event works, I imagine wait for package scan of loaders. instead register bean a unique name (e.g. this.getClass().getName())</technical_language>

Target:
public void registerBeanDefinitions(BeanDefinitionRegistry registry) { final String springLoaderBeanName = wrapper.getPluginId() + "." + SpringLoader.class.getName(); ClassLoader pluginClassLoader = getClass().getClassLoader(); BeanDefinition springLoaderBeanDefinition = BeanDefinitionBuilder.genericBeanDefinition(SpringLoader.class) .setScope(BeanDefinition.SCOPE_SINGLETON) .setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_NO) .addConstructorArgValue(pluginContext) .addConstructorArgValue(pluginClassLoader) .addConstructorArgValue(getPackagesToScan()) .addConstructorArgValue(getClassesToRegister()) .getBeanDefinition(); registry.registerBeanDefinition(springLoaderBeanName, springLoaderBeanDefinition); final BeanDefinition requestMappingHandlerMapping = registry.getBeanDefinition("requestMappingHandlerMapping"); final String[] mappingDependsOnArray = requestMappingHandlerMapping.getDependsOn(); final List<String> mappingDependsOn; if (mappingDependsOnArray == null) { mappingDependsOn = new ArrayList<>(); } else { mappingDependsOn = new ArrayList<>(Arrays.asList(mappingDependsOnArray)); } mappingDependsOn.add(springLoaderBeanName); requestMappingHandlerMapping.setDependsOn( mappingDependsOn.toArray(new String[mappingDependsOn.size()])); }
Source:
<code>public FullyQualifiedInfo getQualifiedInfo() { <START> return null; <END> }</code><technical_language>this throw UnimplementedException somesuch? I wanting get/parse qualified info of, say, a constant. Of course, calculate that..</technical_language>

Target:
public FullyQualifiedInfo getQualifiedInfo() { if (getDeclaringClass() != null && isStatic() && isPublic()) { FullyQualifiedInfo containerInfo = getDeclaringClass().getQualifiedInfo(); if (containerInfo != null) { return new FullyQualifiedInfo(containerInfo.packagePath, containerInfo.fileName, containerInfo.className, getName()); } } return null; }
Source:
<code>public DefaultMapperReference(Type type, TypeFactory typeFactory) { this.type = type; isAnnotatedMapper = type.isAnnotatedMapper(); importTypes = Collections.asSet( type ); if ( isAnnotatedMapper() ) { <START> importTypes.add( typeFactory.getType( Mappers.class ) ); <END> } }</code><technical_language>Currently, mapstruct-processor strict dependency mapstruct-core, reference types directly. prefer if set-up of annotation processor simple possible. is overloaded version of getType() takes a class name</technical_language>

Target:
public DefaultMapperReference(Type type, TypeFactory typeFactory) { this.type = type; isAnnotatedMapper = type.isAnnotatedWith( "org.mapstruct.ap.model.Mapper" ); importTypes = Collections.asSet( type ); if ( isAnnotatedMapper() ) { importTypes.add( typeFactory.getType( "org.mapstruct.factory.Mappers" ) ); } }
Source:
<code>public void finishCell() { if (!Objects.equals(this.family, this.previousFamily)) { previousFamily = this.family; <START> currentFamilyCells = new TreeSet<>(compareCells()); <END> cells.put(this.family, this.currentFamilyCells); } FlatRow.Cell cell = new FlatRow.Cell(this.family, this.qualifier, this.timestamp, this.value, this.labels); this.currentFamilyCells.add(cell); totalCellCount++; }</code><technical_language>This a List, a TreeSet</technical_language>

Target:
public void finishCell() { if (!Objects.equals(this.family, this.previousFamily)) { previousFamily = this.family; currentFamilyCells = new ArrayList<>(); cells.put(this.family, this.currentFamilyCells); } FlatRow.Cell cell = new FlatRow.Cell(this.family, this.qualifier, this.timestamp, this.value, this.labels); this.currentFamilyCells.add(cell); totalCellCount++; }
Source:
<code>public SalesforceSession(SalesforceHttpClient httpClient, long timeout, SalesforceLoginConfig config) { ObjectHelper.notNull(httpClient, "httpClient"); ObjectHelper.notNull(config, "SalesforceLoginConfig"); ObjectHelper.notNull(config.getLoginUrl(), "loginUrl"); ObjectHelper.notNull(config.getClientId(), "clientId"); ObjectHelper.notNull(config.getClientSecret(), "clientSecret"); <START> if (config.getRefreshToken() == null) { <END> ObjectHelper.notNull(config.getUserName(), "userName"); ObjectHelper.notNull(config.getPassword(), "password"); } else { ObjectHelper.notNull(config.getRefreshToken(), "refreshToken"); } this.httpClient = httpClient; this.timeout = timeout; this.config = config; String loginUrl = config.getLoginUrl(); config.setLoginUrl(loginUrl.endsWith("/") ? loginUrl.substring(0, loginUrl.length() - 1) : loginUrl); this.objectMapper = JsonUtils.createObjectMapper(); this.listeners = new CopyOnWriteArraySet<SalesforceSessionListener>(); }</code><technical_language>ObjectHelper.isEmpty(config.getRefreshToken() here</technical_language>

Target:
public SalesforceSession(SalesforceHttpClient httpClient, long timeout, SalesforceLoginConfig config) { ObjectHelper.notNull(httpClient, "httpClient"); ObjectHelper.notNull(config, "SalesforceLoginConfig"); ObjectHelper.notNull(config.getLoginUrl(), "loginUrl"); ObjectHelper.notNull(config.getClientId(), "clientId"); ObjectHelper.notNull(config.getClientSecret(), "clientSecret"); if (ObjectHelper.isEmpty(config.getRefreshToken())) { ObjectHelper.notNull(config.getUserName(), "userName"); ObjectHelper.notNull(config.getPassword(), "password"); } else { ObjectHelper.notNull(config.getRefreshToken(), "refreshToken"); } this.httpClient = httpClient; this.timeout = timeout; this.config = config; String loginUrl = config.getLoginUrl(); config.setLoginUrl(loginUrl.endsWith("/") ? loginUrl.substring(0, loginUrl.length() - 1) : loginUrl); this.objectMapper = JsonUtils.createObjectMapper(); this.listeners = new CopyOnWriteArraySet<SalesforceSessionListener>(); }
Source:
<code>protected void handleReceive(final Context context, final Intent data) { <START> try { <END> if (data != null && data.getAction() != null) { switch (data.getAction()) { case DownloadManager.ACTION_DOWNLOAD_COMPLETE: handleDownloadCompleteIntent(context, data); break; case DownloadManager.ACTION_NOTIFICATION_CLICKED: handleDownloadNotificationClickIntent(context, data); break; } } } catch(Exception ex) { logger.error(ex); } }</code><technical_language>This try-catch removed</technical_language>

Target:
protected void handleReceive(final Context context, final Intent data) { if (data != null && data.getAction() != null) { switch (data.getAction()) { case DownloadManager.ACTION_DOWNLOAD_COMPLETE: handleDownloadCompleteIntent(data); break; case DownloadManager.ACTION_NOTIFICATION_CLICKED: environment.getRouter().showDownloads(context); break; } } }
Source:
<code>private void initStreamLogDirectory() { try { <START> FileStore fs = Files.getFileStore(Paths.get(logDir.getParent().toString())); <END> if (fs.isReadOnly()) { throw new UnrecoverableCorfuError("Cannot start Corfu on a read-only filesystem"); } } catch (IOException e) { throw new UnrecoverableCorfuError("Unable to retrieve Corfu Filesystem permissions"); } File corfuDir = new File(logDir.getParent().toString()); if (!corfuDir.canWrite()) { throw new UnrecoverableCorfuError("Corfu directory is not writable"); } if (logDir.toFile().exists()) { File logDirectory = new File(logDir.toString()); if (!logDirectory.canWrite()) { throw new UnrecoverableCorfuError("Stream log directory is not writable"); } log.info("Log directory already exists: {}", logDir); return; } try { Files.createDirectories(logDir); } catch (IOException e) { throw new UnrecoverableCorfuError("Can't create stream log directory", e); } }</code><technical_language>if directory exist</technical_language>

Target:
private void initStreamLogDirectory() { if (logDir.toFile().exists()) { String corfuDir = logDir.getParent().toString(); try { FileStore fs = Files.getFileStore(Paths.get(corfuDir)); if (fs.isReadOnly()) { throw new UnrecoverableCorfuError("Cannot start Corfu on a read-only filesystem:" +corfuDir); } } catch (IOException e) { throw new UnrecoverableCorfuError("Unable to retrieve Corfu Filesystem permissions"+ corfuDir); } File corfuDirFile = new File(corfuDir); if (!corfuDirFile.canWrite()) { throw new UnrecoverableCorfuError("Corfu directory is not writable "+corfuDir); } File logDirectory = new File(logDir.toString()); if (!logDirectory.canWrite()) { throw new UnrecoverableCorfuError("Stream log directory not writable in "+corfuDir); } log.info("Log directory already exists: {}", logDir); return; } try { Files.createDirectories(logDir); } catch (IOException e) { throw new UnrecoverableCorfuError("Can't create stream log directory", e); } }
Source:
<code>public void convertProfileGenericDataRequest() { final ProfileGenericDataRequest req1 = this.makeRequest(); final Object obj1 = this.mapper.map(req1, com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest.class); <START> assertTrue((obj1 != null) <END> && (obj1 instanceof com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest)); final Object obj2 = this.mapper.map(obj1, ProfileGenericDataRequest.class); assertTrue((obj2 != null) && (obj2 instanceof ProfileGenericDataRequest)); final ProfileGenericDataRequest req2 = (ProfileGenericDataRequest) obj2; assertTrue(req1.getDeviceIdentification().equals(req2.getDeviceIdentification())); }</code><technical_language>use: import static org.hamcrest.CoreMatchers.instanceOf; ... assertNotNull(result); assertThat(result, instanceOf(ClassName.class));</technical_language>

Target:
public void convertProfileGenericDataRequest() { final ProfileGenericDataRequest source = this.makeRequest(); final Object result = this.mapper.map(source, com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest.class); assertNotNull("mapping ProfileGenericDataRequest should not return null", result); assertThat("mapping ProfileGenericDataRequest should return correct type", result, instanceOf(com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest.class)); final com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest target = (com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest) result; assertEquals(source.getDeviceIdentification(), target.getDeviceIdentification()); assertEquals(source.getObisCode().getA(), target.getObisCode().getA()); assertEquals(source.getObisCode().getF(), target.getObisCode().getF()); final DateTime targetEndDate = new DateTime(target.getEndDate().getTime()); assertEquals(source.getBeginDate().getYear(), targetEndDate.getYear()); }
Source:
<code>private void searchGoogleMaps(final String query){ final AQuery aq = new AQuery(this); UserLocation loc = MainApplication.user.getLocation(); Double lon = loc.getLon(); Double lat = loc.getLat(); <START> String url = GOOGLE_MAPS_API_URL+ query +"&location="+lat+","+lon+"&radius="+radius+"&key="+ API_Key; <END> Log.e(TAG, "Query sent to Google Maps: " + url); AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>(){ @Override public void callback(String url, JSONObject json, AjaxStatus status) { if (status.getError() != null){ Log.e(TAG, "Error accessing Google Maps API: " + status.getError()); return; } try { JSONArray results = json.getJSONArray("results"); if (results.length() > 0) for (int i = 0; i < results.length(); i++){ resultList.add(parseGoogleMapsResult(results.getJSONObject(i))); } } catch (JSONException e){ Log.e(TAG, "Error parsing Google Maps JSON: " + e); } Log.d(TAG, "Geocoding result: " + json.toString()); adapter.notifyDataSetChanged(); setHeader(query); } }; aq.ajax(url, JSONObject.class, cb); }</code><technical_language>Please provide consist spaces in url + sign</technical_language>

Target:
private void searchGoogleMaps(final String query){ final AQuery aq = new AQuery(this); UserLocation loc = MainApplication.user.getLocation(); Double lon = loc.getLon(); Double lat = loc.getLat(); String url = GOOGLE_MAPS_API_URL + query + "&location=" + lat + "," + lon + "&radius=" + radius + "&key=" + getString(R.string.Server_API_Key); Log.e(TAG, "Query sent to Google Maps: " + url); AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>(){ @Override public void callback(String url, JSONObject json, AjaxStatus status) { if (status.getError() != null){ Log.e(TAG, "Error accessing Google Maps API: " + status.getError()); return; } try { JSONArray results = json.getJSONArray("results"); if (results.length() > 0) for (int i = 0; i < results.length(); i++){ resultList.add(parseGoogleMapsResult(results.getJSONObject(i))); } } catch (JSONException e){ Log.e(TAG, "Error parsing Google Maps JSON: " + e); } Log.d(TAG, "Geocoding result: " + json.toString()); adapter.notifyDataSetChanged(); setHeader(query); } }; aq.ajax(url, JSONObject.class, cb); }
Source:
<code>public static Map<String, Long> getTermCounts(IndexReader reader, String termStr) throws IOException, ParseException { <START> EnglishAnalyzer ea = new EnglishAnalyzer(CharArraySet.EMPTY_SET); <END> return getTermCounts(reader, termStr, ea); }</code><technical_language>hey, while it, refactor new of creating analyzer instances</technical_language>

Target:
public static Map<String, Long> getTermCounts(IndexReader reader, String termStr) throws IOException, ParseException { DefaultEnglishAnalyzer ea = DefaultEnglishAnalyzer.newDefaultInstance(); return getTermCountsWithAnalyzer(reader, termStr, ea); }
Source:
<code>public EnrichedEvent poll(long timeout, TimeUnit unit) throws StageException { try { <START> EnrichedEvent event = queue.poll(timeout, unit); <END> return event; } catch (InterruptedException e) { LOG.error(Errors.MYSQL_001.getMessage(), e.toString(), e); Thread.currentThread().interrupt(); throw new StageException(Errors.MYSQL_001, e.toString(), e); } }</code><technical_language>a single line return queue.poll(timeout, unit)</technical_language>

Target:
public EnrichedEvent poll(long timeout, TimeUnit unit) throws StageException { try { return queue.poll(timeout, unit); } catch (InterruptedException e) { LOG.error(Errors.MYSQL_001.getMessage(), e.toString(), e); Thread.currentThread().interrupt(); throw new StageException(Errors.MYSQL_001, e.toString(), e); } }
Source:
<code>protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> vanillaValues = super.api$getVanillaValues(); <START> if (this.getTargetedEntity() != null) { <END> this.beamTarget().map(Value::asImmutable).ifPresent(vanillaValues::add); } return vanillaValues; }</code><technical_language>Remove if</technical_language>

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); this.beamTarget().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
<code>String toJavaScript() { StringBuffer buffer = new StringBuffer(); if (convertUrls != null) buffer.append(",\n\t").append("convert_urls : ") .append(convertUrls); if (relativeUrls != null) buffer.append(",\n\t").append("relative_urls : ").append( relativeUrls); if (removeScriptHost != null) buffer.append(",\n\t").append("remove_script_host : ").append( removeScriptHost); <START> if (autoResize) <END> buffer.append(",\n\tauto_resize : true"); if (readOnly) buffer.append(",\n\treadonly : true"); if (contentCss != null) buffer.append(",\n\t").append("content_css : \"").append( RequestCycle.get().urlFor(contentCss)).append("\""); if (documentBaseUrl != null) buffer.append(",\n\t").append("document_base_url : \"").append( documentBaseUrl).append("\""); if (entityEncoding != null) buffer.append(",\n\t").append("entity_encoding : \"").append( entityEncoding).append("\""); if (Theme.advanced.equals(theme)) appendAdvancedSettings(buffer); appendPluginSettings(buffer); appendCustomSettings(buffer); return buffer.toString(); }</code><technical_language>this conflict AutoResizePlugin</technical_language>

Target:
String toJavaScript() { StringBuffer buffer = new StringBuffer(); if (convertUrls != null) buffer.append(",\n\t").append("convert_urls : ") .append(convertUrls); if (relativeUrls != null) buffer.append(",\n\t").append("relative_urls : ").append( relativeUrls); if (removeScriptHost != null) buffer.append(",\n\t").append("remove_script_host : ").append( removeScriptHost); if (readOnly) buffer.append(",\n\treadonly : true"); if (contentCss != null) buffer.append(",\n\t").append("content_css : \"").append( RequestCycle.get().urlFor(contentCss)).append("\""); if (documentBaseUrl != null) buffer.append(",\n\t").append("document_base_url : \"").append( documentBaseUrl).append("\""); if (entityEncoding != null) buffer.append(",\n\t").append("entity_encoding : \"").append( entityEncoding).append("\""); if (Theme.advanced.equals(theme)) appendAdvancedSettings(buffer); appendPluginSettings(buffer); appendCustomSettings(buffer); return buffer.toString(); }
Source:
<code>public List<RolloutTask> plan(final Map<String, HostStatus> hostsAndStatuses) { final List<String> hosts = Lists.newArrayList(); for (final Map.Entry<String, HostStatus> entry : hostsAndStatuses.entrySet()) { if (entry.getValue().getStatus().equals(HostStatus.Status.UP)) { hosts.add(entry.getKey()); } <START> } <END> final List<RolloutTask> rolloutTasks = Lists.newArrayList(); final int parallelism = deploymentGroup.getRolloutOptions() != null ? deploymentGroup.getRolloutOptions().getParallelism() : 1; Lists.partition(hosts, parallelism) .forEach(partition -> rolloutTasks.addAll(rolloutTasks(partition))); return ImmutableList.copyOf(rolloutTasks); }</code><technical_language>YMMV this is more readable, this java final List<String> hosts = hostsAndStatuses.entrySet().stream() // care hosts .filter(entry -> entry.getValue.getStatus() == HostStatus.Status.UP) .map(entry -> entry.getKey()) .collect(Collectors.toList());</technical_language>

Target:
public List<RolloutTask> plan(final Map<String, HostStatus> hostsAndStatuses) { final List<String> hosts = hostsAndStatuses.entrySet() .stream() .filter(entry -> entry.getValue().getStatus().equals(HostStatus.Status.UP)) .map(entry -> entry.getKey()) .collect(Collectors.toList()); final List<RolloutTask> rolloutTasks = Lists.newArrayList(); final int parallelism = deploymentGroup.getRolloutOptions() != null ? deploymentGroup.getRolloutOptions().getParallelism() : 1; Lists.partition(hosts, parallelism) .forEach(partition -> rolloutTasks.addAll(rolloutTasks(partition))); return ImmutableList.copyOf(rolloutTasks); }