auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void initRecyclerView() { if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { rvContributionsList.setLayoutManager(new GridLayoutManager(getContext(),SPAN_COUNT)); } else { rvContributionsList.setLayoutManager(new LinearLayoutManager(getContext())); } rvContributionsList.setAdapter(adapter); <START> rvContributionsList.setItemViewCacheSize(0); <END> adapter.setContributions(contributions); }</code><technical_language>View recycling is kind of point of a Recyclerview. I hesitant approve this</technical_language>

Target:
private void initRecyclerView() { if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { rvContributionsList.setLayoutManager(new GridLayoutManager(getContext(),SPAN_COUNT)); } else { rvContributionsList.setLayoutManager(new LinearLayoutManager(getContext())); } rvContributionsList.setAdapter(adapter); adapter.setContributions(contributions); }
Source:
<code>protected boolean handlePreloadPackage(String packagePath, String libsPath) { ClassLoader loader = <START> ApplicationLoaders.getDefault().getClassLoader(packagePath, <END> Build.VERSION.SDK_INT, false, libsPath, null, null); try { Class providerClass = Class.forName(WebViewFactory.CHROMIUM_WEBVIEW_FACTORY, true, loader); Object result = providerClass.getMethod("preloadInZygote").invoke(null); if (!((Boolean)result).booleanValue()) { Log.e(TAG, "preloadInZygote returned false"); } } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException e) { Log.e(TAG, "Exception while preloading package", e); } return false; }</code><technical_language>do need ApplicationLoaders.getClassLoader ? do need ? (In other words, a PathClassLoader ?)</technical_language>

Target:
protected boolean handlePreloadPackage(String packagePath, String libsPath) { ClassLoader loader = ApplicationLoaders.getDefault().createWebViewClassLoaderForZygote( packagePath, libsPath); try { Class providerClass = Class.forName(WebViewFactory.CHROMIUM_WEBVIEW_FACTORY, true, loader); Object result = providerClass.getMethod("preloadInZygote").invoke(null); if (!((Boolean)result).booleanValue()) { Log.e(TAG, "preloadInZygote returned false"); } } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException e) { Log.e(TAG, "Exception while preloading package", e); } return false; }
Source:
<code>private void initDb() throws SQLException { Statement stat = null; try { synchronized (server) { boolean tableFound; String pgCatalog = "PG_CATALOG", pgVersion = "PG_VERSION"; if (((JdbcConnection) conn).getSession().getStaticSettings().databaseToLower) { pgCatalog = pgCatalog.toLowerCase(); <START> pgVersion = pgVersion.toLowerCase(); <END> } try (ResultSet rs = conn.getMetaData().getTables(null, pgCatalog, pgVersion, null)) { tableFound = rs.next(); } stat = conn.createStatement(); if (!tableFound) { installPgCatalog(stat); } try (ResultSet rs = stat.executeQuery("select * from pg_catalog.pg_version")) { if (!rs.next() || rs.getInt(1) < 2) { installPgCatalog(stat); } else { int versionRead = rs.getInt(2); if (versionRead > 2) { throw DbException.throwInternalError("Incompatible PG_VERSION"); } } } } stat.execute("set search_path = PUBLIC, pg_catalog"); HashSet<Integer> typeSet = server.getTypeSet(); if (typeSet.isEmpty()) { try (ResultSet rs = stat.executeQuery("select oid from pg_catalog.pg_type")) { while (rs.next()) { typeSet.add(rs.getInt(1)); } } } } finally { JdbcUtils.closeSilently(stat); } }</code><technical_language>call StringUtils.toLowerEnglish this do weird stuff in other locales</technical_language>

Target:
private void initDb() throws SQLException { Statement stat = null; try { synchronized (server) { boolean tableFound; String pgCatalog = "PG_CATALOG", pgVersion = "PG_VERSION"; if (((JdbcConnection) conn).getSession().getStaticSettings().databaseToLower) { pgCatalog = StringUtils.toLowerEnglish(pgCatalog); pgVersion = StringUtils.toLowerEnglish(pgVersion); } try (ResultSet rs = conn.getMetaData().getTables(null, pgCatalog, pgVersion, null)) { tableFound = rs.next(); } stat = conn.createStatement(); if (!tableFound) { installPgCatalog(stat); } try (ResultSet rs = stat.executeQuery("select * from pg_catalog.pg_version")) { if (!rs.next() || rs.getInt(1) < 2) { installPgCatalog(stat); } else { int versionRead = rs.getInt(2); if (versionRead > 2) { throw DbException.throwInternalError("Incompatible PG_VERSION"); } } } } stat.execute("set search_path = PUBLIC, pg_catalog"); HashSet<Integer> typeSet = server.getTypeSet(); if (typeSet.isEmpty()) { try (ResultSet rs = stat.executeQuery("select oid from pg_catalog.pg_type")) { while (rs.next()) { typeSet.add(rs.getInt(1)); } } } } finally { JdbcUtils.closeSilently(stat); } }
Source:
<code><START> public List<String> getNodesExceptHost(List<String> hostNames) <END> { List<String> nodesList = new ArrayList<String>(); for (String host : nodeReportMap.keySet()) { String[] parts = host.split(":"); if (parts.length > 0) { if (hostNames.contains(parts[0]) || hostNames.contains(host)) { continue; } nodesList.add(parts[0]); } } return nodesList; }</code><technical_language>hostNames element? contains operation is expensive..</technical_language>

Target:
public List<String> getNodesExceptHost(List<String> hostNames) { List<String> nodesList = new ArrayList<String>(); Set<String> hostNameSet = Sets.newHashSet(); hostNameSet.addAll(hostNames); for (String host : nodeReportMap.keySet()) { String[] parts = host.split(":"); if (parts.length > 0) { if (hostNameSet.contains(parts[0]) || hostNameSet.contains(host)) { continue; } nodesList.add(parts[0]); } } return nodesList; }
Source:
<code>public void test6() { String def = "" + "module TEST " + "syntax Exp ::= Exp \"+\" Exp [klabel('Plus)] " + "| r\"[0-9]+\" [token] " + "endmodule"; Module test = ParserUtils.parseMainModuleOuterSyntax(def, "TEST"); ParseInModule parser = gen.getRuleGrammar(test); Tuple2<Either<Set<ParseFailedException>, Term>, Set<ParseFailedException>> rule = parser.parseString("1+2+3", startSymbol); Assert.assertEquals("Expected 1 warning: ", 1, rule._2().size()); Assert.assertTrue("Expected no errors here: ", rule._1().isRight()); <START> printout(rule); <END> }</code><technical_language>a lot of code duplication in this file. code for test copy-pasted extracted instead in a separate method</technical_language>

Target:
public void test6() { String def = "" + "module TEST " + "syntax Exp ::= Exp \"+\" Exp [klabel('Plus)] " + "| r\"[0-9]+\" [token] " + "endmodule"; Tuple2<Either<Set<ParseFailedException>, Term>, Set<ParseFailedException>> rule = parseRule(def, "1+2+3"); Assert.assertEquals("Expected 1 warning: ", 1, rule._2().size()); Assert.assertTrue("Expected no errors here: ", rule._1().isRight()); printout(rule); }
Source:
<code>default void addCharge(Location l, int charge) { Validate.isTrue(charge > 0, "You can only add a positive charge!"); int capacity = getCapacity(); <START> if (capacity > 0) { <END> int currentCharge = getCharge(l); if (currentCharge < capacity) { int newCharge = Math.min(capacity, currentCharge + charge); BlockStorage.addBlockInfo(l, "energy-charge", String.valueOf(newCharge), false); if (getEnergyComponentType() == EnergyNetComponentType.CAPACITOR) { SlimefunUtils.updateCapacitorTexture(l, charge, capacity); } } } }</code><technical_language>Again, isChargeable</technical_language>

Target:
default void addCharge(Location l, int charge) { Validate.notNull(l, "Location was null!"); Validate.isTrue(charge > 0, "You can only add a positive charge!"); int capacity = getCapacity(); if (capacity > 0) { int currentCharge = getCharge(l); if (currentCharge < capacity) { int newCharge = Math.min(capacity, currentCharge + charge); BlockStorage.addBlockInfo(l, "energy-charge", String.valueOf(newCharge), false); if (getEnergyComponentType() == EnergyNetComponentType.CAPACITOR) { SlimefunUtils.updateCapacitorTexture(l, charge, capacity); } } } }
Source:
<code>public String getMetricsJson(String url) throws IOException { <START> String responseJson; <END> responseJson = HttpUtils.get(url, COLLECT_METRICS_TIMEOUT); return String.format("Url: %s%nResponse: %s", url, responseJson); }</code><technical_language>is this lines</technical_language>

Target:
public String getMetricsJson(String url) throws IOException { String responseJson = HttpUtils.get(url, COLLECT_METRICS_TIMEOUT); return String.format("Url: %s%nResponse: %s", url, responseJson); }
Source:
<code>public void shutdown() { long shutdownBeginTime = System.currentTimeMillis(); isUp = false; try { if (securityService != null) { securityService.close(); securityService = null; } if (idConverter != null) { idConverter.close(); idConverter = null; } <START> if (accountService != null) { <END> accountService.close(); } logger.info("AmbryBlobStorageService shutdown complete"); } catch (IOException e) { logger.error("Downstream service close failed", e); } finally { frontendMetrics.blobStorageServiceShutdownTimeInMs.update(System.currentTimeMillis() - shutdownBeginTime); } }</code><technical_language>if accountservice is non-null this check needed</technical_language>

Target:
public void shutdown() { long shutdownBeginTime = System.currentTimeMillis(); isUp = false; try { if (securityService != null) { securityService.close(); securityService = null; } if (idConverter != null) { idConverter.close(); idConverter = null; } accountService.close(); logger.info("AmbryBlobStorageService shutdown complete"); } catch (IOException e) { logger.error("Downstream service close failed", e); } finally { frontendMetrics.blobStorageServiceShutdownTimeInMs.update(System.currentTimeMillis() - shutdownBeginTime); } }
Source:
<code>void collectStats(final StatsCollector collector) { <START> collector.record("compaction.count", complex_compactions); <END> collector.record("compaction.duplicates", duplicates_same, "values=same"); collector.record("compaction.duplicates", duplicates_different, "values=different"); if (!tsdb.config.enable_compactions()) { return; } collector.record("compaction.queue.size", size); collector.record("compaction.errors", handle_read_error.errors, "rpc=read"); collector.record("compaction.errors", handle_write_error.errors, "rpc=put"); collector.record("compaction.errors", handle_delete_error.errors, "rpc=delete"); collector.record("compaction.writes", written_cells); collector.record("compaction.deletes", deleted_cells); }</code><technical_language>fine drop rename "complex_compactions" "compactions"</technical_language>

Target:
void collectStats(final StatsCollector collector) { collector.record("compaction.count", compaction_count); collector.record("compaction.duplicates", duplicates_same, "type=identical"); collector.record("compaction.duplicates", duplicates_different, "type=variant"); if (!tsdb.config.enable_compactions()) { return; } collector.record("compaction.queue.size", size); collector.record("compaction.errors", handle_read_error.errors, "rpc=read"); collector.record("compaction.errors", handle_write_error.errors, "rpc=put"); collector.record("compaction.errors", handle_delete_error.errors, "rpc=delete"); collector.record("compaction.writes", written_cells); collector.record("compaction.deletes", deleted_cells); }
Source:
<code>private void startEditExpenseClaimActivity(int position) { Intent editIntent = new Intent(this, ExpenseClaimDetailActivity.class); <START> if(checkFilteredTags()) { <END> editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM, filteredListModel.getItems().get(position)); position = listModel.getItems().indexOf(filteredListModel.getItems().get(position)); } else { editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM, listModel.getItems().get(position)); } editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_INDEX, position); editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_USER, userManager.getActiveUser()); startActivityForResult(editIntent, EDIT_EXPENSE_CLAIM_REQUEST); }</code><technical_language>Style inconsistency: space if</technical_language>

Target:
private void startEditExpenseClaimActivity(int position) { Intent editIntent = new Intent(this, ExpenseClaimDetailActivity.class); if (!filteredTagsList.isEmpty()) { editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM, filteredListModel.getItems().get(position)); position = listModel.getItems().indexOf(filteredListModel.getItems().get(position)); } else { editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM, listModel.getItems().get(position)); } editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_INDEX, position); editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_USER, userManager.getActiveUser()); startActivityForResult(editIntent, EDIT_EXPENSE_CLAIM_REQUEST); }
Source:
<code><START> public ResponseEntity<?> getPaymentStatusForUser() { <END> PaymentType paymentTypeEnum = PaymentType.USER_LICENSE; ChargeDTO resultDTO; try { resultDTO = paymentService.getPaymentStatus(paymentTypeEnum); } catch (ServiceException e) { LOG.log(Level.SEVERE, e.getMessage()); throw new BadRequestException(e.getMessage()); } return new ResponseEntity<>(resultDTO, HttpStatus.OK); }</code><technical_language>type ChargeDTO in return responseEntity instead of</technical_language>

Target:
public ResponseEntity<ChargeDTO> getPaymentStatusForUser() { PaymentType paymentTypeEnum = PaymentType.USER_LICENSE; ChargeDTO resultDTO; try { resultDTO = paymentService.getPaymentStatus(paymentTypeEnum); } catch (ServiceException e) { LOG.log(Level.SEVERE, e.getMessage()); throw new BadRequestException(e.getMessage()); } return new ResponseEntity<>(resultDTO, HttpStatus.OK); }
Source:
<code>public void setUp() { <START> solrLoader.setConfigurationPath("some/path"); <END> solrLoader.setCopyConfiguration(true); solrLoader.setIndexesConfiguration(Lists.newArrayList(firstIndexConfiguration, secondIndexConfiguration)); solrLoader.setIndexConfigurationCopier(indexConfigurationCopier); solrLoader.setIndexReloader(indexReloader); }</code><technical_language>I move "some/path" const</technical_language>

Target:
public void setUp() { solrLoader.setConfigurationPath(CONFIGURATION_PATH); solrLoader.setCopyConfiguration(true); solrLoader.setIndexesConfiguration(Lists.newArrayList(firstIndexConfiguration, secondIndexConfiguration)); solrLoader.setIndexConfigurationCopier(indexConfigurationCopier); solrLoader.setIndexReloader(indexReloader); }
Source:
<code>public static boolean updateFromStorage(IJavaProject eclipseProject, IProgressMonitor monitor) throws JavaModelException { PersistentModel model = CorePlugin.modelPersistence().loadModel(eclipseProject.getProject()); <START> if (model.isEmptyModel()) { <END> return false; } else { setClasspathContainer(eclipseProject, model.getClasspath(), monitor); return true; } }</code><technical_language>null here. Alternatively empty model throw exceptions getters. empty model silently return defaults, hide programming errors</technical_language>

Target:
public static boolean updateFromStorage(IJavaProject eclipseProject, IProgressMonitor monitor) throws JavaModelException { PersistentModel model = CorePlugin.modelPersistence().loadModel(eclipseProject.getProject()); if (model.isPresent()) { setClasspathContainer(eclipseProject, model.getClasspath(), monitor); return true; } else { return false; } }
Source:
<code>public void testFilterVariableValueToEObjectVariableValueMigration() { copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, REPRESENTATIONS_FILE_PATH, REPRESENTATIONS_FILE_NAME, MODEL_FILE_NAME, MODELER_FILE_NAME); ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; try { analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + REPRESENTATIONS_FILE_NAME, true), set); } catch (IOException e) { fail("Pb when loading the resource : " + e.getMessage()); <START> } <END> assertNotNull("Analysis is not retrieved.", analysis); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); try { analysis.eResource().save(Collections.emptyMap()); } catch (IOException e) { fail("Pb when saving the resource : " + e.getMessage()); } version = analysis.getVersion(); assertFalse("The version tag should now be set telling that the migration was done.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); checkRepMigrationEffect(analysis); }</code><technical_language>Useless try/catch, JUnit do already</technical_language>

Target:
public void testFilterVariableValueToEObjectVariableValueMigration() throws IOException { copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, REPRESENTATIONS_FILE_PATH, REPRESENTATIONS_FILE_NAME, MODEL_FILE_NAME, MODELER_FILE_NAME); ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + REPRESENTATIONS_FILE_NAME, true), set); assertNotNull("Analysis is not retrieved.", analysis); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); analysis.eResource().save(Collections.emptyMap()); version = analysis.getVersion(); assertFalse("The version tag should now be set telling that the migration was done.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); checkRepMigrationEffect(analysis); }
Source:
<code>private static String pathWithTimestamp(ServletContext context, HttpServletRequest request, String path) { if (context != null) { try { URL resource = CodeUtils.getResource(context, path); if (resource != null) { URLConnection resourceConnection = resource.openConnection(); InputStream resourceInput = resourceConnection.getInputStream(); try { return StringUtils.addQueryParameters( <START> request.getContextPath() + StringUtils.ensureStart(path, "/"), <END> "_", resourceConnection.getLastModified()); } finally { resourceInput.close(); } } } catch (IOException error) { } } return path; }</code><technical_language>@hyoolim Null check for request</technical_language>

Target:
private static String pathWithTimestamp(ServletContext context, HttpServletRequest request, String path) { if (context != null) { try { URL resource = CodeUtils.getResource(context, path); if (resource != null) { URLConnection resourceConnection = resource.openConnection(); InputStream resourceInput = resourceConnection.getInputStream(); try { String contextPath = request != null ? request.getContextPath() : ""; return StringUtils.addQueryParameters( contextPath + StringUtils.ensureStart(path, "/"), "_", resourceConnection.getLastModified()); } finally { resourceInput.close(); } } } catch (IOException error) { } } return path; }
Source:
<code>public JdbcFilterDao() { getIpListTimer = metricRegistry.timer("getIPAddressList"); <START> jmxReporter = JmxReporter.forRegistry(metricRegistry).inDomain("org.opennms.netmgt.config").build(); <END> jmxReporter.start(); }</code><technical_language>register reporter bean is initialized (see org.springframework.beans.factory.InitializingBean) remove bean is destroyed (see org.springframework.beans.factory.DisposableBean) instead if registering constructor</technical_language>

Target:
public JdbcFilterDao() { getIpListTimer = metricRegistry.timer("getIPAddressListForFilter"); }
Source:
<code>public InternalThreadExecutor(ThreadFactory threadFactory) { super(Config.<Integer> getValue(ConfigValues.DefaultMinThreadPoolSize), <START> Config.<Integer> getValue(ConfigValues.DefaultMaxThreadPoolSize), <END> 60L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(Config.<Integer>getValue(ConfigValues.DefaultMaxThreadWaitQueueSize)), threadFactory); }</code><technical_language>need get rid of DefaultMinThreadPoolSize DefaultMaxThreadPoolSize define JMX properties ovirt-engine.xml.in</technical_language>

Target:
public InternalThreadExecutor(ThreadFactory threadFactory) { super(Integer.parseInt(System.getProperty("org.ovirt.engine.core.utils.threadpool.minSize")), Integer.parseInt(System.getProperty("org.ovirt.engine.core.utils.threadpool.maxSize")), 60L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(Integer.parseInt( System.getProperty("org.ovirt.engine.core.utils.threadpool.maxWaitQueueSize"))), threadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); }
Source:
<code>public void openmrsDateFormat_shouldNotAllowDatesWithInvalidDaysOrMonths() throws Exception { try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "GB")); sdf.parse("1/13/2001"); <START> fail("Date with invalid month should throw exception."); <END> } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "GB")); sdf.parse("32/1/2001"); fail("Date with invalid day should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "US")); sdf.parse("13/1/2001"); fail("Date with invalid month should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "US")); sdf.parse("1/32/2001"); fail("Date with invalid day should throw exception."); } catch (ParseException e) }</code><technical_language>Is switching Assert.fail fail part of changes required for ticket? change accidentally? :)</technical_language>

Target:
public void openmrsDateFormat_shouldNotAllowDatesWithInvalidDaysOrMonths() throws Exception { try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "GB")); sdf.parse("1/13/2001"); Assert.fail("Date with invalid month should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "GB")); sdf.parse("32/1/2001"); Assert.fail("Date with invalid day should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "US")); sdf.parse("13/1/2001"); Assert.fail("Date with invalid month should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "US")); sdf.parse("1/32/2001"); Assert.fail("Date with invalid day should throw exception."); } catch (ParseException e) }
Source:
<code>private List<ColumnOrder> getColumnOrders(MessageType schema) { List<ColumnOrder> columnOrders = new ArrayList<>(); for (int i = 0, n = schema.getPaths().size(); i < n; ++i) { ColumnOrder columnOrder = new ColumnOrder(); <START> columnOrder.setTYPE_ORDER(new TypeDefinedOrder()); <END> columnOrders.add(columnOrder); } return columnOrders; }</code><technical_language>TypeDefinedOrder a constant</technical_language>

Target:
private List<ColumnOrder> getColumnOrders(MessageType schema) { List<ColumnOrder> columnOrders = new ArrayList<>(); for (int i = 0, n = schema.getPaths().size(); i < n; ++i) { ColumnOrder columnOrder = new ColumnOrder(); columnOrder.setTYPE_ORDER(TYPE_DEFINED_ORDER); columnOrders.add(columnOrder); } return columnOrders; }
Source:
<code>public CompletableSource apply(Completable upstream) { <START> return Completable.amb( <END> Arrays.asList( upstream, takeUntilCorrespondingEvent(sharedLifecycle, correspondingEvents) .flatMap(Functions.CANCEL_COMPLETABLE) .ignoreElements() ) ); }</code><technical_language>consider Completable.ambArray</technical_language>

Target:
public CompletableSource apply(Completable upstream) { return Completable.ambArray( upstream, takeUntilCorrespondingEvent(sharedLifecycle, correspondingEvents) .flatMap(Functions.CANCEL_COMPLETABLE) .ignoreElements() ); }
Source:
<code>public void cancelSchedule(ScheduleToken scheduleToken) { shutdownLatch.ifShuttingDown("Cannot dispatch new events as this scheduler is being shutdown"); Assert.isTrue(scheduleToken instanceof SimpleScheduleToken, () -> "Invalid tracking token type. Must be SimpleScheduleToken."); String token = ((SimpleScheduleToken) scheduleToken).getTokenId(); <START> Channel channel = axonServerConnectionManager.getChannel(axonServerConfiguration.getContext()); <END> EventSchedulerGrpc.EventSchedulerFutureStub scheduleStub = EventSchedulerGrpc.newFutureStub(channel); try { InstructionAck instructionAck = scheduleStub.cancelScheduledEvent(CancelScheduledEventRequest.newBuilder() .setToken( token) .build()) .get(); if (!instructionAck.getSuccess()) { throw ErrorCode.getFromCode(instructionAck.getError().getErrorCode()).convert(instructionAck .getError()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw GrpcExceptionParser.parse(e); } catch (ExecutionException e) { throw GrpcExceptionParser.parse(e.getCause()); } }</code><technical_language>Curious: do close channels/stubs usage</technical_language>

Target:
public void cancelSchedule(ScheduleToken scheduleToken) { Assert.isTrue(started.get(), () -> "Scheduler is being shutdown"); Assert.isTrue(scheduleToken instanceof SimpleScheduleToken, () -> "Invalid tracking token type. Must be SimpleScheduleToken."); String token = ((SimpleScheduleToken) scheduleToken).getTokenId(); try { InstructionAck instructionAck = eventSchedulerStub().cancelScheduledEvent(CancelScheduledEventRequest .newBuilder() .setToken( token) .build()) .get(); if (!instructionAck.getSuccess()) { throw ErrorCode.getFromCode(instructionAck.getError().getErrorCode()).convert(instructionAck .getError()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw GrpcExceptionParser.parse(e); } catch (ExecutionException e) { throw GrpcExceptionParser.parse(e.getCause()); } }
Source:
<code>private void pushLaunchPopup() { <START> Config config = context.get(Config.class); <END> TelemetryConfig telemetryConfig = config.getTelemetryConfig(); LaunchPopupConfig launchPopupConfig = config.getLaunchPopupConfig(); TranslationSystem translationSystem = context.get(TranslationSystem.class); TelemetryLogstashAppender appender = TelemetryUtils.fetchTelemetryLogstashAppender(); if (!launchPopupConfig.isLaunchPopupDisabled()) { String telemetryTitle = translationSystem.translate("${engine:menu#telemetry-launch-popup-title}"); String telemetryMessage = translationSystem.translate("${engine:menu#telemetry-launch-popup-text}"); LaunchPopup telemetryConfirmPopup = nuiManager.pushScreen(LaunchPopup.ASSET_URI, LaunchPopup.class); telemetryConfirmPopup.setMessage(telemetryTitle, telemetryMessage); telemetryConfirmPopup.setYesHandler(() -> { telemetryConfig.setAllEnabled(true); appender.start(); }); telemetryConfirmPopup.setNoHandler(() -> { telemetryConfig.setAllEnabled(false); appender.stop(); }); telemetryConfirmPopup.setOptionButtonText(translationSystem.translate("${engine:menu#telemetry-button}")); telemetryConfirmPopup.setOptionHandler(()-> { nuiManager.pushScreen(TelemetryScreen.ASSET_URI,TelemetryScreen.class); }); } }</code><technical_language>spaces class name & instance name here. avoid this autoformatting in editor IDE (ideally this is IDEA ;) )</technical_language>

Target:
private void pushLaunchPopup() { Config config = context.get(Config.class); TelemetryConfig telemetryConfig = config.getTelemetryConfig(); TranslationSystem translationSystem = context.get(TranslationSystem.class); TelemetryLogstashAppender appender = TelemetryUtils.fetchTelemetryLogstashAppender(); if (!telemetryConfig.isLaunchPopupDisabled()) { String telemetryTitle = translationSystem.translate("${engine:menu#telemetry-launch-popup-title}"); String telemetryMessage = translationSystem.translate("${engine:menu#telemetry-launch-popup-text}"); LaunchPopup telemetryConfirmPopup = nuiManager.pushScreen(LaunchPopup.ASSET_URI, LaunchPopup.class); telemetryConfirmPopup.setMessage(telemetryTitle, telemetryMessage); telemetryConfirmPopup.setYesHandler(() -> { telemetryConfig.setTelemetryAndErrorReportingEnable(true); appender.start(); }); telemetryConfirmPopup.setNoHandler(() -> { telemetryConfig.setTelemetryAndErrorReportingEnable(false); appender.stop(); }); telemetryConfirmPopup.setOptionButtonText(translationSystem.translate("${engine:menu#telemetry-button}")); telemetryConfirmPopup.setOptionHandler(()-> { nuiManager.pushScreen(TelemetryScreen.ASSET_URI, TelemetryScreen.class); }); } }
Source:
<code>public T get(final int index) { try { return this.origin.get(index); } catch (final IndexOutOfBoundsException ex) { <START> throw new IllegalArgumentException(this.message, ex); <END> } }</code><technical_language>@Happy-Neko here, IndexOutOfBoundsException custom message</technical_language>

Target:
public T get(final int index) { try { return this.origin.get(index); } catch (final IndexOutOfBoundsException ex) { throw this.wrapException(ex); } }
Source:
<code>Mono<Response<Map<String, String>>> getTagsWithResponse(Context context) { return this.azureBlobStorage.blobs().getTagsWithRestResponseAsync(null, null, null, null, snapshot, <START> null , context) <END> .map(response -> { Map<String, String> tags = new HashMap<>(); for(BlobTag tag : response.getValue().getBlobTagSet()) { tags.put(tag.getKey(), tag.getValue()); } return new SimpleResponse<>(response, tags); }); }</code><technical_language>this work versionID? in stg73 branch</technical_language>

Target:
Mono<Response<Map<String, String>>> getTagsWithResponse(Context context) { return this.azureBlobStorage.blobs().getTagsWithRestResponseAsync(null, null, null, null, snapshot, versionId, context) .map(response -> { Map<String, String> tags = new HashMap<>(); for (BlobTag tag : response.getValue().getBlobTagSet()) { tags.put(tag.getKey(), tag.getValue()); } return new SimpleResponse<>(response, tags); }); }
Source:
<code>public TextView addTitleBar(String title) { LinearLayout field = (LinearLayout) mInflater.inflate(R.layout.openmrs_title_view_field, null); TextView textView = (TextView) field.findViewById(R.id.openmrsTitleView); if (mCustomDialogBundle.hasProgressDialog() || mCustomDialogBundle.hasLoadingBar()) { mFieldsLayout.setOrientation(LinearLayout.HORIZONTAL); <START> LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT); <END> p.weight = 2; field.setLayoutParams(p); field.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white)); textView.setGravity(Gravity.CENTER); textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15); textView.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white)); textView.setTextColor(ContextCompat.getColor(getContext(), R.color.black)); } textView.setText(title); textView.setSingleLine(true); mFieldsLayout.addView(field); return textView; }</code><technical_language>Give self-explanatory name instead of p</technical_language>

Target:
public TextView addTitleBar(String title) { LinearLayout field = (LinearLayout) mInflater.inflate(R.layout.openmrs_title_view_field, null); TextView textView = (TextView) field.findViewById(R.id.openmrsTitleView); if (mCustomDialogBundle.hasProgressDialog() || mCustomDialogBundle.hasLoadingBar()) { mFieldsLayout.setOrientation(LinearLayout.HORIZONTAL); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT); params.weight = 2; field.setLayoutParams(params); field.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white)); textView.setGravity(Gravity.CENTER); textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15); textView.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white)); textView.setTextColor(ContextCompat.getColor(getContext(), R.color.black)); } textView.setText(title); textView.setSingleLine(true); mFieldsLayout.addView(field); return textView; }
Source:
<code>public void addRequest(HttpServletRequest req, String category) { AtomicLong val = requestCategories.get(category); if (val == null) { <START> val = new AtomicLong(0); <END> } val.incrementAndGet(); requestCategories.put(category, val); }</code><technical_language>this work. If 2 threads racing for this code while val is null, read val null create new instance 1 count lost of update map possibly synchronized for cases this is needed</technical_language>

Target:
synchronized public void addRequest(HttpServletRequest req, String category) { Long val = requestCategories.get(category); if (val == null) { val = new Long(0); } val += 1; requestCategories.put(category, val); }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder("Project{"); sb.append("name='").append(name).append('\''); sb.append(", identifiers=").append(identifiers); sb.append(", description='").append(description).append('\''); sb.append(", imageUrl='").append(imageUrl).append('\''); sb.append(", startsAt=").append(startsAt); sb.append(", endsAt=").append(endsAt); <START> sb.append(", type=").append(type); <END> sb.append('}'); return sb.toString(); }</code><technical_language>campain in tostring</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder("Project{"); sb.append("name='").append(name).append('\''); sb.append(", identifiers=").append(identifiers); sb.append(", description='").append(description).append('\''); sb.append(", imageUrl='").append(imageUrl).append('\''); sb.append(", startsAt=").append(startsAt); sb.append(", endsAt=").append(endsAt); sb.append(", type=").append(type); sb.append(", campaign=").append(campaign); sb.append('}'); return sb.toString(); }
Source:
<code>Optional<BufferAndAvailability> getNextBuffer() throws IOException { checkError(); ResultSubpartitionView subpartitionView = this.subpartitionView; if (subpartitionView == null) { if (isReleased) { return Optional.empty(); } subpartitionView = checkAndWaitForSubpartitionView(); } BufferAndBacklog next = subpartitionView.getNextBuffer(); if (next == null) { if (subpartitionView.isReleased()) { throw new CancelTaskException("Consumed partition " + subpartitionView + " has been released."); } else { return Optional.empty(); } } Buffer buffer = next.buffer(); numBytesIn.inc(buffer.getSize()); numBuffersIn.inc(); if (buffer.isBuffer()) { for (final long barrierId : pendingCheckpointBarriers) { <START> channelStateWriter.addInputData( barrierId, getChannelInfo(), ChannelStateWriter.SEQUENCE_NUMBER_UNKNOWN, CloseableIterator.ofElement(buffer.retainBuffer(), Buffer::recycleBuffer)); <END> } } else if (buffer.getDataType().hasPriority()) { final AbstractEvent priorityEvent = parsePriorityEvent(buffer); if (priorityEvent instanceof CheckpointBarrier) { final long barrierId = ((CheckpointBarrier) priorityEvent).getId(); seenCheckpointBarriers.add(barrierId); pendingCheckpointBarriers.remove(barrierId); } } return Optional.of(new BufferAndAvailability(buffer, next.getNextDataType(), next.buffersInBacklog())); }</code><technical_language>spilling polling buffer? (I RemoteInputChannel is working in this regard)</technical_language>

Target:
Optional<BufferAndAvailability> getNextBuffer() throws IOException { checkError(); ResultSubpartitionView subpartitionView = this.subpartitionView; if (subpartitionView == null) { if (isReleased) { return Optional.empty(); } subpartitionView = checkAndWaitForSubpartitionView(); } BufferAndBacklog next = subpartitionView.getNextBuffer(); if (next == null) { if (subpartitionView.isReleased()) { throw new CancelTaskException("Consumed partition " + subpartitionView + " has been released."); } else { return Optional.empty(); } } Buffer buffer = next.buffer(); numBytesIn.inc(buffer.getSize()); numBuffersIn.inc(); if (buffer.getDataType().hasPriority()) { channelStatePersister.checkForBarrier(buffer); } else { channelStatePersister.maybePersist(buffer); } return Optional.of(new BufferAndAvailability( buffer, next.getNextDataType(), next.buffersInBacklog(), next.getSequenceNumber())); }
Source:
<code>public void testAll() { ______TS("Typical case: Log in with filled profile values"); AppUrl url = createUrl(Const.WebPageURIs.STUDENT_PROFILE_PAGE).withUserId("SProfUiT.student"); loginAdminToPage(url, StudentHomePage.class); StudentProfilePage profilePage = AppPage.getNewPageInstance(browser, url, StudentProfilePage.class); profilePage.ensureProfileContains("Ben", "i.m.benny@gmail.tmt", "TEAMMATES Test Institute 4", "Singaporean", StudentProfileAttributes.Gender.MALE, "I am just another student :P"); ______TS("Typical case: picture upload and edit"); profilePage.fillProfilePic("src/test/resources/images/profile_pic.png"); profilePage.uploadPicture(); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_PICTURE_SAVED); profilePage.showPictureEditor(); profilePage.waitForUploadEditModalVisible(); profilePage.editProfilePhoto(); profilePage.verifyPhotoSize("220px", "220px"); <START> ______TS("Typical case: no picture"); <END> profilePage.editProfileThroughUi("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.ensureProfileContains("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_EDITED); }</code><technical_language>is called picture (The picture is edited in previous step)</technical_language>

Target:
public void testAll() { ______TS("Typical case: Log in with filled profile values"); AppUrl url = createUrl(Const.WebPageURIs.STUDENT_PROFILE_PAGE).withUserId("SProfUiT.student"); loginAdminToPage(url, StudentHomePage.class); StudentProfilePage profilePage = AppPage.getNewPageInstance(browser, url, StudentProfilePage.class); profilePage.ensureProfileContains("Ben", "i.m.benny@gmail.tmt", "TEAMMATES Test Institute 4", "Singaporean", StudentProfileAttributes.Gender.MALE, "I am just another student :P"); ______TS("Typical case: picture upload and edit"); profilePage.fillProfilePic("src/test/resources/images/profile_pic.png"); profilePage.uploadPicture(); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_PICTURE_SAVED); profilePage.showPictureEditor(); profilePage.waitForUploadEditModalVisible(); profilePage.editProfilePhoto(); profilePage.verifyPhotoSize("220px", "220px"); ______TS("Typical case: edit profile page"); profilePage.editProfileThroughUi("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.ensureProfileContains("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_EDITED); }
Source:
<code><START> private void terminate(){ <END> terminatePrcs(launchListener.getNodeJSLaunch().getProcesses()); ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); manager.removeLaunchListener(launchListener); }</code><technical_language>@please consider making this "@after" method. if some test fails processes terminated. If put @after dont forget more robust (ie getNodeJSLaunch null, launchListener null etc)</technical_language>

Target:
public void terminate(){ if(launchListener != null){ ILaunch launch = launchListener.getNodeJSLaunch(); if(launch != null){ terminatePrcs(launch.getProcesses()); } ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); manager.removeLaunchListener(launchListener); } }
Source:
<code>public Boolean LogIn(String username, String password) throws InvalidCredentialsException { <START> List obj = Select(getUser) <END> .setParameter("username", username) .list(); if (!obj.isEmpty()) { final UserEmployee userEmployee = (UserEmployee) obj.get(0); if (userEmployee.getPassword().equals(password)) { SID = new Session(Boolean.TRUE, userEmployee); return Boolean.TRUE; } else { return Boolean.FALSE; } } else { return Boolean.FALSE; } }</code><technical_language>[CC] getUser? Is a user object property</technical_language>

Target:
public Boolean LogIn(String username, String password) throws InvalidCredentialsException { List obj = Select(userLogin) .setParameter("username", username) .list(); if (!obj.isEmpty()) { final UserEmployee userEmployee = (UserEmployee) obj.get(0); if (userEmployee.getPassword().equals(password)) { SID = new Session(Boolean.TRUE, userEmployee); return Boolean.TRUE; } else { return Boolean.FALSE; } } else { return Boolean.FALSE; } }
Source:
<code>HierarchicalElement getBaseFolder(final String url) throws RepositoryException { HierarchicalElement baseHierarchicalElement; if (url.toLowerCase().startsWith("sftp://")) { try { baseHierarchicalElement = new SftpHierarchicalElement(url); <START> ((SftpHierarchicalElement) baseHierarchicalElement).retrieveDetails(); <END> } catch (URISyntaxException | UnsupportedEncodingException ex) { throw new RepositoryException("Unable to process URL!",ex); } catch (JSchException | SftpException ex) { throw new RepositoryException(ex.getMessage(),ex); } } else { File base = new File(url); if (!base.exists()) { throw new RepositoryException("Source folder does not exist!"); } baseHierarchicalElement = new FileHierarchicalElement(base); } return baseHierarchicalElement; }</code><technical_language>log this properly too, I think</technical_language>

Target:
HierarchicalElement getBaseFolder(final String url) throws RepositoryException { HierarchicalElement baseHierarchicalElement; if (url.toLowerCase().startsWith("sftp://")) { try { baseHierarchicalElement = new SftpHierarchicalElement(url); ((SftpHierarchicalElement) baseHierarchicalElement).retrieveDetails(); } catch (URISyntaxException | UnsupportedEncodingException ex) { String msg = String.format("Unable to process URL %s", url); LOG.error(msg, ex); throw new RepositoryException(msg,ex); } catch (JSchException | SftpException ex) { LOG.error(ex.getMessage(),ex); throw new RepositoryException(ex.getMessage(),ex); } } else { File base = new File(url); if (!base.exists()) { throw new RepositoryException("Source folder does not exist!"); } baseHierarchicalElement = new FileHierarchicalElement(base); } return baseHierarchicalElement; }
Source:
<code>public ExtensionsTool(ExtensionsToolArguments args, ExtensionsManager extensionsManager) { this.extensionsManager = extensionsManager; try { switch (args.getAction()) { case ExtensionsToolArguments.ACTION_AUTH_SEQUENCE: <START> doAuthSequence(args); <END> break; case ExtensionsToolArguments.ACTION_QUERY_BY_IDS: doQueryByIds(args); break; case ExtensionsToolArguments.ACTION_QUERY_BY_NAME: doQueryByName(args); break; } } catch (Exception ex) { log.error(ex.getMessage()); if (log.isDebugEnabled()) { log.debug("", ex); } } }</code><technical_language>args member, split constructor run() perform actual logic</technical_language>

Target:
public ExtensionsTool(ExtensionsToolArguments args, ExtensionsManager extensionsManager) { this.args = args; this.extensionsManager = extensionsManager; }
Source:
<code>private AuthenticationResult tryMRRT() throws AuthenticationException { if (mMrrtTokenCacheItem == null) { mMrrtTokenCacheItem = mTokenCacheAccessor.getMRRTItem(mAuthRequest.getClientId(), getUser()); } if (mMrrtTokenCacheItem == null) { <START> if (lookUpCachedTokenWithNoUserForADFS()) { <END> mMrrtTokenCacheItem = mTokenCacheAccessor.getMRRTItem(mAuthRequest.getClientId(), null); if (mMrrtTokenCacheItem == null) { return null; } } else { Logger.v(TAG, "MRRT token does not exist, try with FRT"); return tryFRT(AuthenticationConstants.MS_FAMILY_ID, null); } } if (!StringExtensions.IsNullOrBlank(mMrrtTokenCacheItem.getFamilyClientId()) && !mAttemptedWithFRT) { Logger.v(TAG, "MRRT item exists but it's also a FRT, try with FRT."); return tryFRT(mMrrtTokenCacheItem.getFamilyClientId(), null); } Logger.v(TAG, "Send request to use MRRT for new AT."); AuthenticationResult mrrtResult = acquireTokenWithCachedItem(mMrrtTokenCacheItem); if (containOauthError(mrrtResult)) { final String familyClientId = StringExtensions.IsNullOrBlank(mMrrtTokenCacheItem.getFamilyClientId()) ? AuthenticationConstants.MS_FAMILY_ID : mMrrtTokenCacheItem.getFamilyClientId(); mMrrtTokenCacheItem = null; mrrtResult = tryFRT(familyClientId, mrrtResult); } return mrrtResult; }</code><technical_language>need do this</technical_language>

Target:
private AuthenticationResult tryMRRT() throws AuthenticationException { mMrrtTokenCacheItem = mTokenCacheAccessor.getMRRTItem(mAuthRequest.getClientId(), mAuthRequest.getUserFromRequest()); if (mMrrtTokenCacheItem == null) { Logger.v(TAG, "MRRT token does not exist, try with FRT"); return tryFRT(AuthenticationConstants.MS_FAMILY_ID, null); } if (mMrrtTokenCacheItem.isFamilyToken()) { Logger.v(TAG, "MRRT item exists but it's also a FRT, try with FRT."); return tryFRT(mMrrtTokenCacheItem.getFamilyClientId(), null); } AuthenticationResult mrrtResult = useMRRT(); if (isTokenRequestFailed(mrrtResult)) { final String familyClientId = StringExtensions.IsNullOrBlank(mMrrtTokenCacheItem.getFamilyClientId()) ? AuthenticationConstants.MS_FAMILY_ID : mMrrtTokenCacheItem.getFamilyClientId(); mrrtResult = tryFRT(familyClientId, mrrtResult); } return mrrtResult; }
Source:
<code>public static ColumnarRow toColumnarRow(Block block) { requireNonNull(block, "block is null"); if (block instanceof DictionaryBlock) { return toColumnarRow((DictionaryBlock) block); } if (block instanceof RunLengthEncodedBlock) { return toColumnarRow((RunLengthEncodedBlock) block); } if (!(block instanceof AbstractRowBlock)) { throw new IllegalArgumentException("Invalid row block"); } AbstractRowBlock rowBlock = (AbstractRowBlock) block; int firstRowPosition = rowBlock.getColumnBlockOffset(0); int totalRowCount = rowBlock.getColumnBlockOffset(block.getPositionCount()) - firstRowPosition; Block[] fieldBlocks = new Block[rowBlock.numColumns]; for (int i = 0; i < fieldBlocks.length; i++) { fieldBlocks[i] = rowBlock.getColumnBlock(i).getRegion(firstRowPosition, totalRowCount); } <START> return new ColumnarRow(block, fieldBlocks); <END> }</code><technical_language>intend switch once. This is ok. I want check this is actual intention</technical_language>

Target:
public static ColumnarRow toColumnarRow(Block block) { requireNonNull(block, "block is null"); if (block instanceof DictionaryBlock) { return toColumnarRow((DictionaryBlock) block); } if (block instanceof RunLengthEncodedBlock) { return toColumnarRow((RunLengthEncodedBlock) block); } if (!(block instanceof AbstractRowBlock)) { throw new IllegalArgumentException("Invalid row block"); } AbstractRowBlock rowBlock = (AbstractRowBlock) block; int firstRowPosition = rowBlock.getFieldBlockOffset(0); int totalRowCount = rowBlock.getFieldBlockOffset(block.getPositionCount()) - firstRowPosition; Block[] fieldBlocks = new Block[rowBlock.numFields]; for (int i = 0; i < fieldBlocks.length; i++) { fieldBlocks[i] = rowBlock.getFieldBlocks()[i].getRegion(firstRowPosition, totalRowCount); } return new ColumnarRow(block, fieldBlocks); }
Source:
<code>public ClasspathShortener(String os, String javaVersion, ILaunch launch, String[] cmdLine, int lastJavaArgumentIndex, File workingDir, String[] envp) { <START> this.os = os; <END> this.javaVersion = javaVersion; this.launch = launch; this.cmdLine = new ArrayList<>(Arrays.asList(cmdLine)); this.lastJavaArgumentIndex = lastJavaArgumentIndex; this.envp = envp == null ? null : Arrays.copyOf(envp, envp.length); this.processTempFilesDir = workingDir != null ? workingDir : new File(".").getAbsoluteFile(); }</code><technical_language>If this method stay public, I add Assert.isNotNull() for null arguments</technical_language>

Target:
protected ClasspathShortener(String os, String javaVersion, ILaunch launch, String[] cmdLine, int lastJavaArgumentIndex, File workingDir, String[] envp) { this.os = os; this.javaVersion = javaVersion; this.launch = launch; this.cmdLine = new ArrayList<>(Arrays.asList(cmdLine)); this.lastJavaArgumentIndex = lastJavaArgumentIndex; this.envp = envp == null ? null : Arrays.copyOf(envp, envp.length); this.processTempFilesDir = workingDir != null ? workingDir : Paths.get(".").toAbsolutePath().normalize().toFile(); }