auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Response copy(Action action) { GlusterHookManageParameters params = new GlusterHookManageParameters(guid); if (action.getHost() != null) { validateParameters(action.getHost(),"host.id|name"); Guid hostId = getHostId(action); if (hostId == null) { return handleError(new EntityNotFoundException(action.getHost().getId() != null ? id : action.getHost().getName()), false); } params.setSourceServerId(hostId); } return doAction(VdcActionType.UpdateGlusterHook, params, action); }

Target:
private Response copy(Action action) { GlusterHookManageParameters params = new GlusterHookManageParameters(guid); if (action.isSetHost()) { validateParameters(action.getHost(),"host.id|name"); Guid hostId = getHostId(action); params.setSourceServerId(hostId); } return doAction(VdcActionType.UpdateGlusterHook, params, action); }
Source:
public void should_mark_unreachable_contact_points_as_local_and_schedule_reconnections() { BoundCluster boundCluster = simulacronRule.cluster(); boundCluster.node(0).rejectConnections(0, RejectScope.STOP); try (CqlSession session = SessionUtils.newSession(simulacronRule)) { Map<UUID, Node> nodes = session.getMetadata().getNodes(); Node node0 = nodes.get(boundCluster.node(0).getHostId()); assertThat(node0.getState()).isEqualTo(NodeState.DOWN); assertThat(node0.getDistance()).isEqualTo(NodeDistance.LOCAL); assertThat(node0.getOpenConnections()).isEqualTo(0); assertThat(node0.isReconnecting()).isTrue(); Node node1 = nodes.get(boundCluster.node(1).getHostId()); assertThat(node1.getState()).isEqualTo(NodeState.UP); assertThat(node1.getDistance()).isEqualTo(NodeDistance.LOCAL); assertThat(node1.getOpenConnections()).isEqualTo(2); assertThat(node1.isReconnecting()).isFalse(); } }

Target:
public void should_mark_unreachable_contact_points_as_local_and_schedule_reconnections() { BoundCluster boundCluster = simulacronRule.cluster(); boundCluster.node(0).rejectConnections(0, RejectScope.STOP); try (CqlSession session = SessionUtils.newSession(simulacronRule)) { Map<UUID, Node> nodes = session.getMetadata().getNodes(); ConditionChecker.checkThat( () -> { Node node0 = nodes.get(boundCluster.node(0).getHostId()); assertThat(node0.getState()).isEqualTo(NodeState.DOWN); assertThat(node0.getDistance()).isEqualTo(NodeDistance.LOCAL); assertThat(node0.getOpenConnections()).isEqualTo(0); assertThat(node0.isReconnecting()).isTrue(); Node node1 = nodes.get(boundCluster.node(1).getHostId()); assertThat(node1.getState()).isEqualTo(NodeState.UP); assertThat(node1.getDistance()).isEqualTo(NodeDistance.LOCAL); assertThat(node1.getOpenConnections()).isEqualTo(2); assertThat(node1.isReconnecting()).isFalse(); }) .becomesTrue(); } }
Source:
private void sendPack(PackStatistics.Accumulator accumulator, FetchRequest req, @Nullable Collection<Ref> allTags, List<ObjectId> unshallowCommits, List<ObjectId> deepenNots, PacketLineOut pckOut) throws IOException { Set<String> caps = req.getClientCapabilities(); boolean sideband = caps.contains(OPTION_SIDE_BAND) || caps.contains(OPTION_SIDE_BAND_64K); if (sideband) { errOut = new SideBandErrorWriter(); try { sendPack(true, req, accumulator, allTags, unshallowCommits, deepenNots, pckOut); } catch (ServiceMayNotContinueException err) { String message = err.getMessage(); if (message == null) { message = JGitText.get().internalServerError; } try { reportInternalServerErrorOverSideband(message); } catch (IOException e) { err.addSuppressed(e); throw err; } throw new UploadPackInternalServerErrorException(err); } catch (IOException | RuntimeException | Error err) { try { reportInternalServerErrorOverSideband( JGitText.get().internalServerError); } catch (IOException e) { err.addSuppressed(e); throw err; } throw new UploadPackInternalServerErrorException(err); } } else { sendPack(false, req, accumulator, allTags, unshallowCommits, deepenNots, pckOut); } }

Target:
private void sendPack(PackStatistics.Accumulator accumulator, FetchRequest req, @Nullable Collection<Ref> allTags, List<ObjectId> unshallowCommits, List<ObjectId> deepenNots, PacketLineOut pckOut) throws IOException { Set<String> caps = req.getClientCapabilities(); boolean sideband = caps.contains(OPTION_SIDE_BAND) || caps.contains(OPTION_SIDE_BAND_64K); if (sideband) { errOut = new SideBandErrorWriter(); try { sendPack(true, req, accumulator, allTags, unshallowCommits, deepenNots, pckOut); } catch (ServiceMayNotContinueException err) { String message = err.getMessage(); if (message == null) { message = JGitText.get().internalServerError; } try { errOut.writeError(message); } catch (IOException e) { err.addSuppressed(e); throw err; } throw new UploadPackInternalServerErrorException(err); } catch (IOException | RuntimeException | Error err) { try { errOut.writeError(JGitText.get().internalServerError); } catch (IOException e) { err.addSuppressed(e); throw err; } throw new UploadPackInternalServerErrorException(err); } } else { sendPack(false, req, accumulator, allTags, unshallowCommits, deepenNots, pckOut); } }
Source:
public void addPlugin(Class<? extends Plugin> plugin, PluginPriority priority) { switch (priority) { case LOW: lowPriorityPlugins.add(plugin); break; case HIGH: highPriorityPlugins.add(plugin); break; case NORMAL: default: normalPriorityPlugins.add(plugin); break; } SupportedOptions supportedOptionsAnnotation = plugin.getAnnotation(SupportedOptions.class); if (supportedOptionsAnnotation != null) { String[] options = supportedOptionsAnnotation.value(); if (options != null) { Collections.addAll(pluginSupportedOptions, options); } } }

Target:
private void addPlugin(Class<? extends Plugin> plugin, PluginPriority priority) { switch (priority) { case LOW: lowPriorityPlugins.add(plugin); break; case HIGH: highPriorityPlugins.add(plugin); break; case NORMAL: default: normalPriorityPlugins.add(plugin); break; } SupportedOptions supportedOptionsAnnotation = plugin.getAnnotation(SupportedOptions.class); if (supportedOptionsAnnotation != null) { String[] options = supportedOptionsAnnotation.value(); if (options != null) { Collections.addAll(pluginSupportedOptions, options); } } }
Source:
public void registerCipherInformation(final CipherInformation cipherInformation) { if (this.cipherInformation == null) { this.cipherInformation = cipherInformation; sensors.connectionsByCipher.increment(cipherInformation); } }

Target:
public void registerCipherInformation(final CipherInformation cipherInformation) { if (this.cipherInformation != null) { if (this.cipherInformation.equals(cipherInformation)) return; sensors.connectionsByCipher.decrement(this.cipherInformation); } this.cipherInformation = cipherInformation; sensors.connectionsByCipher.increment(cipherInformation); }
Source:
protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); container.setLayout(new GridLayout()); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container); browser = new Browser(container, SWT.BORDER); browser.setText("Loading"); Browser.clearSessions(); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(browser); final ProgressBar progressBar = new ProgressBar(container, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).applyTo(progressBar); ProgressListener progressListener = new ProgressListener() { @Override public void changed(ProgressEvent event) { if (event.total <= 0) return; int ratio = event.current * 100 / event.total; progressBar.setSelection(ratio); } @Override public void completed(ProgressEvent event) { progressBar.setSelection(0); System.out.println("URL=" + browser.getUrl()); info = processor.getRequestInfo(browser, browser.getUrl(), browser.getText()); if (null != info) { close(); } } }; browser.addProgressListener(progressListener); setURL(startURL); return container; }

Target:
protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); container.setLayout(new GridLayout()); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container); browser = new Browser(container, SWT.BORDER); browser.setText("Loading"); Browser.clearSessions(); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(browser); final ProgressBar progressBar = new ProgressBar(container, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).applyTo(progressBar); ProgressListener progressListener = new ProgressListener() { @Override public void changed(ProgressEvent event) { if (event.total <= 0) return; int ratio = event.current * 100 / event.total; progressBar.setSelection(ratio); } @Override public void completed(ProgressEvent event) { progressBar.setSelection(0); info = processor.getRequestInfo(browser, browser.getUrl(), browser.getText()); if (null != info) { close(); } } }; browser.addProgressListener(progressListener); setURL(startURL); return container; }
Source:
private List<Entry<Cell, byte[]>> getPostFilteredWithLocalWrites(final TableReference tableRef, final SortedMap<Cell, byte[]> postFiltered, final RangeRequest rangeRequest, List<RowResult<Value>> prePostFilter, final byte[] endRowExclusive) { Map<Cell, Value> prePostFilterCells = Cells.convertRowResultsToCells(prePostFilter); Collection<Entry<Cell, byte[]>> postFilteredCells = Collections2.filter( postFiltered.entrySet(), Predicates.compose( Predicates.in(prePostFilterCells.keySet()), MapEntries.getKeyFunction())); Collection<Entry<Cell, byte[]>> localWritesInRange = getLocalWritesForRange( tableRef, rangeRequest.getStartInclusive(), endRowExclusive).entrySet(); ImmutableList<Entry<Cell, byte[]>> result = ImmutableList.copyOf(mergeInLocalWrites( postFilteredCells.iterator(), localWritesInRange.iterator(), rangeRequest.isReverse())); getPostFilteredCellsMeter().mark(postFilteredCells.size() + localWritesInRange.size() - result.size()); return result; }

Target:
private List<Entry<Cell, byte[]>> getPostFilteredWithLocalWrites(final TableReference tableRef, final SortedMap<Cell, byte[]> postFiltered, final RangeRequest rangeRequest, List<RowResult<Value>> prePostFilter, final byte[] endRowExclusive) { Map<Cell, Value> prePostFilterCells = Cells.convertRowResultsToCells(prePostFilter); Collection<Entry<Cell, byte[]>> postFilteredCells = Collections2.filter( postFiltered.entrySet(), Predicates.compose( Predicates.in(prePostFilterCells.keySet()), MapEntries.getKeyFunction())); Collection<Entry<Cell, byte[]>> localWritesInRange = getLocalWritesForRange( tableRef, rangeRequest.getStartInclusive(), endRowExclusive).entrySet(); return mergeInLocalWrites( postFilteredCells.iterator(), localWritesInRange.iterator(), rangeRequest.isReverse()); }
Source:
public void setParent(IForestryCommand parent) { this.parent = parent; }

Target:
void setParent(IForestryCommand parent) { this.parent = parent; }
Source:
public IterativeLinearSolverNDArray(@Nonnull final GeneralLinearOperator<INDArray> linop, @Nonnull final INDArray b, @Nullable final GeneralLinearOperator<INDArray> precond, final double absTol, final double relTol, final int maxIters, @Nonnull final Function<INDArray, Double> normFunc, @Nonnull final BiFunction<INDArray, INDArray, Double> innerProductFunc, final boolean performDetailedChecks) { this.performDetailedChecks = performDetailedChecks; this.linop = linop; if (b.length() != linop.getColumnDimension()) { throw new IllegalArgumentException("The provided rhs vector has wrong dimensions"); } else { this.b = b; } this.precond = precond; if (precond != null) { if (linop.getColumnDimension() != precond.getColumnDimension() || linop.getRowDimension() != precond.getRowDimension()) { throw new IllegalArgumentException("The preconditioner and linear operators must have the same " + "row and column dimensions"); } } this.normFunc = normFunc; this.innerProductFunc = innerProductFunc; this.absTol = ParamUtils.isPositive(absTol, "Absolute error tolerance must be positive"); this.relTol = ParamUtils.isPositive(relTol, "Relative error tolerance must be pisitive"); this.maxIters = ParamUtils.isPositive(maxIters, "Maximum iterations must be positive"); }

Target:
public IterativeLinearSolverNDArray(@Nonnull final GeneralLinearOperator<INDArray> linop, @Nonnull final INDArray b, @Nullable final GeneralLinearOperator<INDArray> precond, final double absTol, final double relTol, final int maxIters, @Nonnull final Function<INDArray, Double> normFunc, @Nonnull final BiFunction<INDArray, INDArray, Double> innerProductFunc, final boolean performDetailedChecks) { Utils.nonNull(b, "The right hand side vector must be non-null"); Utils.nonNull(linop, "The linear operator must be non-null"); Utils.nonNull(normFunc, "The norm function must be non-null"); Utils.nonNull(innerProductFunc, "The inner product function must be non-null"); Utils.validateArg(b.length() == linop.getColumnDimension(), "The provided rhs vector has wrong dimensions"); Utils.validateArg(precond == null || (linop.getColumnDimension() == precond.getColumnDimension() && linop.getRowDimension() == precond.getRowDimension()), "The preconditioner and linear operators" + " must have the same row and column dimensions"); this.performDetailedChecks = performDetailedChecks; this.linop = linop; this.b = b; this.precond = precond; this.normFunc = normFunc; this.innerProductFunc = innerProductFunc; this.absTol = ParamUtils.isPositive(absTol, "Absolute error tolerance must be positive"); this.relTol = ParamUtils.isPositive(relTol, "Relative error tolerance must be positive"); this.maxIters = ParamUtils.isPositive(maxIters, "Maximum iterations must be positive"); }
Source:
void shouldNotFailOnDeleteByIdWithNullVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> { tx.run("CREATE (v:VersionedThingWithAssignedId {id:1})").consume(); return null; }); } repository.deleteById(1L); try (Session session = driver.session()) { long count = session.readTransaction(tx -> tx.run("MATCH (v:VersionedThingWithAssignedId) return count(v) as vCount").next() .get("vCount").asLong()); assertThat(count).isEqualTo(0); } }

Target:
void shouldNotFailOnDeleteByIdWithNullVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> tx.run("CREATE (v:VersionedThingWithAssignedId {id:1})").consume()); } repository.deleteById(1L); try (Session session = driver.session()) { long count = session.readTransaction(tx -> tx.run("MATCH (v:VersionedThingWithAssignedId) return count(v) as vCount").next() .get("vCount").asLong()); assertThat(count).isEqualTo(0); } }
Source:
static LifecycleComponentStack buildAutoRecoveryServer(BookieConfiguration conf) throws Exception { LifecycleComponentStack.Builder serverBuilder = LifecycleComponentStack.newBuilder() .withName("autorecovery-server"); StatsProviderService statsProviderService = new StatsProviderService(conf); StatsLogger rootStatsLogger = statsProviderService.getStatsProvider().getStatsLogger(""); serverBuilder.addComponent(statsProviderService); LOG.info("Load lifecycle component : {}", StatsProviderService.class.getName()); AutoRecoveryService autoRecoveryService = new AutoRecoveryService(conf, rootStatsLogger); serverBuilder.addComponent(autoRecoveryService); LOG.info("Load lifecycle component : {}", AutoRecoveryService.class.getName()); if (conf.getServerConf().isHttpServerEnabled()) { BKHttpServiceProvider provider = new BKHttpServiceProvider.Builder() .setAutoRecovery(autoRecoveryService.getAutoRecoveryServer()) .setServerConfiguration(conf.getServerConf()) .setStatsProvider(statsProviderService.getStatsProvider()).build(); HttpService httpService = new HttpService(provider, conf, rootStatsLogger); serverBuilder.addComponent(httpService); LOG.info("Load lifecycle component : {}", HttpService.class.getName()); } String[] extraComponents = conf.getServerConf().getExtraServerComponents(); if (null != extraComponents) { try { List<ServerLifecycleComponent> components = loadServerComponents(extraComponents, conf, rootStatsLogger); for (ServerLifecycleComponent component : components) { serverBuilder.addComponent(component); LOG.info("Load lifecycle component : {}", component.getClass().getName()); } } catch (Exception e) { if (conf.getServerConf().getIgnoreExtraServerComponentsStartupFailures()) { LOG.info("Failed to load extra components '{}' - {}. Continuing without those components.", StringUtils.join(extraComponents), e.getMessage()); } else { throw e; } } } return serverBuilder.build(); }

Target:
public static LifecycleComponentStack buildAutoRecoveryServer(BookieConfiguration conf) throws Exception { LifecycleComponentStack.Builder serverBuilder = LifecycleComponentStack.newBuilder() .withName("autorecovery-server"); StatsProviderService statsProviderService = new StatsProviderService(conf); StatsLogger rootStatsLogger = statsProviderService.getStatsProvider().getStatsLogger(""); serverBuilder.addComponent(statsProviderService); LOG.info("Load lifecycle component : {}", StatsProviderService.class.getName()); AutoRecoveryService autoRecoveryService = new AutoRecoveryService(conf, rootStatsLogger); serverBuilder.addComponent(autoRecoveryService); LOG.info("Load lifecycle component : {}", AutoRecoveryService.class.getName()); if (conf.getServerConf().isHttpServerEnabled()) { BKHttpServiceProvider provider = new BKHttpServiceProvider.Builder() .setAutoRecovery(autoRecoveryService.getAutoRecoveryServer()) .setServerConfiguration(conf.getServerConf()) .setStatsProvider(statsProviderService.getStatsProvider()).build(); HttpService httpService = new HttpService(provider, conf, rootStatsLogger); serverBuilder.addComponent(httpService); LOG.info("Load lifecycle component : {}", HttpService.class.getName()); } return serverBuilder.build(); }
Source:
public void select(final String... items) { log.debug(MessageFormat.format("Set selection {0} to items [{1}]", this, StringUtils.join(items, ", "))); waitForEnabled(); if (items.length > 1) assertMultiSelect("multiple selections"); for(String item : items) { assertIsLegalIndex(item); } asyncExec(new VoidResult() { public void run() { widget.setSelection(items); } }); notifySelect(items.length); }

Target:
public void select(final String... items) { log.debug(MessageFormat.format("Set selection {0} to items [{1}]", this, StringUtils.join(items, ", "))); waitForEnabled(); if (items.length > 1) assertMultiSelect("multiple selections"); final int[] indices = new int[items.length]; for (int i=0; i<items.length; i++) { indices[i] = indexOfChecked(items[i]); } select(indices); }
Source:
private void MoveVdssToGoingToMaintenanceMode() { List<VDS> nonSpms = new LinkedList<>(); List<VDS> spms = new LinkedList<>(); for(VDS vds : vdssToMaintenance.values()) { if (vds.getSpmStatus() == VdsSpmStatus.SPM) { spms.add(0, vds); } else { nonSpms.add(0, vds); } } setVdssStatusToPrepareForMaintenance(nonSpms); setVdssStatusToPrepareForMaintenance(spms); cancelIncommingMigrations(); freeLock(); }

Target:
private void MoveVdssToGoingToMaintenanceMode() { List<VDS> nonSpms = new LinkedList<>(); List<VDS> spms = new LinkedList<>(); for(VDS vds : vdssToMaintenance.values()) { if (vds.getSpmStatus() == VdsSpmStatus.SPM) { spms.add(0, vds); } else { nonSpms.add(0, vds); } } setVdsStatusToPrepareForMaintenance(nonSpms); setVdsStatusToPrepareForMaintenance(spms); cancelIncommingMigrations(); freeLock(); }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getParameters().getClusterId() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if ( Guid.isNullOrEmpty(getParameters().getHookId())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED); return false; } List<Guid> upServerIds = getUpServerIds(); if (upServerIds == null || upServerIds.isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND); return false; } return true; }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getParameters().getClusterId() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if (Guid.isNullOrEmpty(getParameters().getHookId())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED); return false; } return true; }
Source:
public TextRange getRangeInElement() { PsiElement nameElement = getReferenceNameElement(); if (nameElement != null) { int startOffset = nameElement.getStartOffsetInParent(); return new TextRange(startOffset, startOffset + nameElement.getTextLength()); } PsiElement dot = getLastChild(); if (Objects.equals(dot.getText(), ".")) { int index = dot.getStartOffsetInParent() + dot.getTextLength(); return new TextRange(index, index); } return new TextRange(0, getTextLength()); }

Target:
public TextRange getRangeInElement() { PsiElement nameElement = getReferenceNameElement(); if (nameElement != null) { int startOffset = nameElement.getStartOffsetInParent(); return new TextRange(startOffset, startOffset + nameElement.getTextLength()); } PsiElement dot = getLastChild(); if (DOT.equals(dot.getText())) { int index = dot.getStartOffsetInParent() + dot.getTextLength(); return new TextRange(index, index); } return new TextRange(0, getTextLength()); }
Source:
protected void executeCommand() { List<VM> vms = runInternalQuery(VdcQueryType.GetVmsByStorageDomain, new IdQueryParameters(getStorageDomain().getId())) .getReturnValue(); Map<Guid, Guid> createdSnapshotVMMap = new HashMap<>(); for (VM vm : vms) { CreateAllSnapshotsFromVmParameters param = new CreateAllSnapshotsFromVmParameters(vm.getId(), vm.getName() + "-TMPDR", false, vm.getDiskList()); Guid createdSnapshotId = runInternalAction(VdcActionType.CreateAllSnapshotsFromVm, param).getActionReturnValue(); createdSnapshotVMMap.put(createdSnapshotId, vm.getId()); } getParameters().setSnapshotIdVmIds(createdSnapshotVMMap); persistCommand(getParameters().getParentCommand(), true); if (getSession().getStatus() != GeoRepSessionStatus.ACTIVE ) { Future<VdcReturnValueBase> geoRepCmd = CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.StartGlusterVolumeGeoRep, new GlusterVolumeGeoRepSessionParameters(getSession().getMasterVolumeId(), getSession().getId()), cloneContext()); VdcReturnValueBase result; try { result = geoRepCmd.get(); if (!result.getSucceeded()) { propagateFailure(result); return; } } catch (InterruptedException | ExecutionException e) { log.error("Exception", e); return; } } GlusterVolumeGeoRepSessionConfigParameters configParams = new GlusterVolumeGeoRepSessionConfigParameters(getSession().getMasterVolumeId(), getSession().getId(), "checkpoint", "now"); runInternalAction(VdcActionType.SetGeoRepConfig, configParams); }

Target:
protected void executeCommand() { List<VM> vms = runInternalQuery(VdcQueryType.GetVmsByStorageDomain, new IdQueryParameters(getStorageDomain().getId())) .getReturnValue(); Map<Guid, Guid> vmSnapshotIdMap = new HashMap<>(); for (VM vm : vms) { CreateAllSnapshotsFromVmParameters param = new CreateAllSnapshotsFromVmParameters(vm.getId(), vm.getName() + "-TMPDR", false, vm.getDiskList()); Guid createdSnapshotId = runInternalAction(VdcActionType.CreateAllSnapshotsFromVm, param).getActionReturnValue(); vmSnapshotIdMap.put(vm.getId(), createdSnapshotId); } getParameters().setSnapshotIdVmIds(vmSnapshotIdMap); persistCommandIfNeeded(); if (getSession().getStatus() != GeoRepSessionStatus.ACTIVE ) { Future<VdcReturnValueBase> geoRepCmd = CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.StartGlusterVolumeGeoRep, new GlusterVolumeGeoRepSessionParameters(getSession().getMasterVolumeId(), getSession().getId()), cloneContext()); VdcReturnValueBase result; try { result = geoRepCmd.get(); if (!result.getSucceeded()) { propagateFailure(result); return; } } catch (InterruptedException | ExecutionException e) { log.error("Exception", e); return; } } GlusterVolumeGeoRepSessionConfigParameters configParams = new GlusterVolumeGeoRepSessionConfigParameters(getSession().getMasterVolumeId(), getSession().getId(), "checkpoint", "now"); runInternalAction(VdcActionType.SetGeoRepConfig, configParams); }
Source:
private boolean isContentsAllowMissingJavadoc(DetailAST ast) { return (ast.getType() == TokenTypes.METHOD_DEF || ast.getType() == TokenTypes.CTOR_DEF) && ( getMethodsNumberOfLine(ast) <= minLineCount || AnnotationUtil.hasAllowedAnnotations(ast, allowedAnnotations) ); }

Target:
private boolean isContentsAllowMissingJavadoc(DetailAST ast) { return (ast.getType() == TokenTypes.METHOD_DEF || ast.getType() == TokenTypes.CTOR_DEF) && (getMethodsNumberOfLine(ast) <= minLineCount || AnnotationUtil.containsAnnotation(ast, allowedAnnotations)); }
Source:
public java.util.Optional<RuleMetadataDto> selectMetadataByKey(DbSession session, RuleKey key, OrganizationDto organization) { return java.util.Optional.ofNullable(mapper(session).selectMetadataByKey(key, organization.getUuid())); }

Target:
public Optional<RuleMetadataDto> selectMetadataByKey(DbSession session, RuleKey key, OrganizationDto organization) { return ofNullable(mapper(session).selectMetadataByKey(key, organization.getUuid())); }
Source:
public int getDPSearchStepNumber() { if (this.dpSearchStepNumber == null) { this.dpSearchStepNumber = 100; } return this.dpSearchStepNumber; }

Target:
public int getDPSearchStepNumber() { if (this.dpSearchStepNumber == null) { this.dpSearchStepNumber = 300; } return this.dpSearchStepNumber; }
Source:
private boolean updateGlusterHosts() { for (VDS vds : allForCluster) { HostStoragePoolParametersBase parameters = new HostStoragePoolParametersBase(vds); VdcReturnValueBase result = runInternalAction( VdcActionType.InitVdsOnUp, parameters, cloneContextAndDetachFromParent()); if (!result.getSucceeded()) { getReturnValue().setFault(result.getFault()); return false; } } return true; }

Target:
private void updateGlusterHosts() { for (VDS vds : allForCluster) { HostStoragePoolParametersBase parameters = new HostStoragePoolParametersBase(vds); runInternalAction( VdcActionType.InitVdsOnUp, parameters, cloneContextAndDetachFromParent()); } }
Source:
public ConfigPersistenceService getPersistence() { return OpenEngSBCoreServices .getConfigPersistenceService("WORKFLOW"); }

Target:
private ConfigPersistenceService getPersistence() { return OpenEngSBCoreServices .getConfigPersistenceService("WORKFLOW"); }
Source:
public Subscriber getSubscriber() { GitSynchronizeDataSet set = new GitSynchronizeDataSet(); return new GitResourceVariantTreeSubscriber(set); }

Target:
public Subscriber getSubscriber() { GitSynchronizeDataSet set = new GitSynchronizeDataSet(); try { Repository[] repositories = Activator.getDefault().getRepositoryCache().getAllRepositories(); for (int i = 0; i < repositories.length; i++) { GitSynchronizeData data = new GitSynchronizeData(repositories[i], Constants.HEAD, Constants.HEAD, true); set.add(data); } } catch (IOException e) { } return new GitResourceVariantTreeSubscriber(set); }
Source:
@Test public void checkForHostnameWithDoubleAsterisk() throws Exception { CertificatePinner certificatePinner = new CertificatePinner.Builder() .add("**.example.co.uk", certA1Sha256Pin) .build(); try { certificatePinner.check("foo.example.co.uk", certB1.certificate()); fail(); } catch (SSLPeerUnverifiedException expected) try { certificatePinner.check("foo.bar.example.co.uk", certB1.certificate()); fail(); } catch (SSLPeerUnverifiedException expected) try { certificatePinner.check("foo.bar.baz.example.co.uk", certB1.certificate()); fail(); } catch (SSLPeerUnverifiedException expected) certificatePinner.check("uk", certB1.certificate()); certificatePinner.check("co.uk", certB1.certificate()); certificatePinner.check("example.co.uk", certB1.certificate()); certificatePinner.check("anotherexample.co.uk", certB1.certificate()); }

Target:
@Test public void checkForHostnameWithDoubleAsterisk() throws Exception { CertificatePinner certificatePinner = new CertificatePinner.Builder() .add("**.example.co.uk", certA1Sha256Pin) .build(); try { certificatePinner.check("example.co.uk", certB1.certificate()); fail(); } catch (SSLPeerUnverifiedException expected) try { certificatePinner.check("foo.example.co.uk", certB1.certificate()); fail(); } catch (SSLPeerUnverifiedException expected) try { certificatePinner.check("foo.bar.example.co.uk", certB1.certificate()); fail(); } catch (SSLPeerUnverifiedException expected) try { certificatePinner.check("foo.bar.baz.example.co.uk", certB1.certificate()); fail(); } catch (SSLPeerUnverifiedException expected) certificatePinner.check("uk", certB1.certificate()); certificatePinner.check("co.uk", certB1.certificate()); certificatePinner.check("anotherexample.co.uk", certB1.certificate()); certificatePinner.check("foo.anotherexample.co.uk", certB1.certificate()); }
Source:
private GraphStore getResourceTriples(final String path) throws URISyntaxException, ClientProtocolException, IOException { final FcrepoHttpClientBuilder b = new FcrepoHttpClientBuilder(null, null, client.getRepositoryUrl()); final CloseableHttpClient c = b.build(); final HttpMethods method = HttpMethods.GET; final URI uri = new URI(client.getRepositoryUrl() + path); final HttpRequestBase request = method.createRequest(uri); final HttpResponse response = c.execute(request); return parseTriples(response.getEntity()); }

Target:
private GraphStore getResourceTriples(final String path) throws URISyntaxException, ClientProtocolException, IOException { final FcrepoHttpClientBuilder b = new FcrepoHttpClientBuilder(null, null, client.getRepositoryUrl()); try (final CloseableHttpClient c = b.build()) { final HttpMethods method = HttpMethods.GET; final URI uri = new URI(client.getRepositoryUrl() + path); final HttpRequestBase request = method.createRequest(uri); try (final CloseableHttpResponse response = c.execute(request)) { return parseTriples(response.getEntity()); } } }
Source:
private void showAddViaUrlDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle(R.string.add_podcast_by_url); View content = View.inflate(getContext(), R.layout.edit_text_dialog, null); EditText editText = content.findViewById(R.id.text); editText.setHint(R.string.add_podcast_by_url_hint); ClipboardManager clipboard = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE); String clipboardContent = clipboard.getPrimaryClip() != null ? clipboard.getPrimaryClip().toString() : ""; if (clipboardContent.trim().startsWith("http")) { editText.setText(clipboardContent.trim()); } builder.setView(content); builder.setPositiveButton(R.string.confirm_label, (dialog, which) -> addUrl(editText.getText().toString())); builder.setNegativeButton(R.string.cancel_label, null); builder.show(); }

Target:
private void showAddViaUrlDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle(R.string.add_podcast_by_url); View content = View.inflate(getContext(), R.layout.edit_text_dialog, null); EditText editText = content.findViewById(R.id.text); editText.setHint(R.string.add_podcast_by_url_hint); ClipboardManager clipboard = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE); String clipboardContent = clipboard.getText() != null ? clipboard.getText().toString() : ""; if (clipboardContent.trim().startsWith("http")) { editText.setText(clipboardContent.trim()); } builder.setView(content); builder.setPositiveButton(R.string.confirm_label, (dialog, which) -> addUrl(editText.getText().toString())); builder.setNegativeButton(R.string.cancel_label, null); builder.show(); }
Source:
protected void addGuideStar(GuideProbe probe) { TargetEnvironment env = getTargetEnvironment(); GuideGroup grp = env.getPrimaryGuideGroup(); if (grp.isAutomatic()) { grp = GuideGroup.create("Manual Group"); env = env.setGuideEnvironment(env.getGuideEnvironment().setOptions(env.getGroups().append(grp))).setPrimaryGuideGroup(grp); } setTargetEnvironment(env.putPrimaryGuideProbeTargets(GuideProbeTargets.create(probe, new SPTarget()))); }

Target:
protected void addGuideStar(GuideProbe probe) { TargetEnvironment env = getTargetEnvironment(); GuideGroup grp = env.getPrimaryGuideGroup(); if (grp.isAutomatic()) { grp = GuideGroup.create(GuideGroup.ManualGroupDefaultName()); env = env.setGuideEnvironment(env.getGuideEnvironment().setOptions(env.getGroups().append(grp))).setPrimaryGuideGroup(grp); } setTargetEnvironment(env.putPrimaryGuideProbeTargets(GuideProbeTargets.create(probe, new SPTarget()))); }
Source:
public void cacheManagerStarted(GlobalComponentRegistry gcr) { final EmbeddedCacheManager cacheManager = gcr.getComponent(EmbeddedCacheManager.class); if (!cacheManager.getCacheConfigurationNames().contains(CounterManager.COUNTER_CACHE_NAME)) { cacheManager.defineConfiguration(CounterManager.COUNTER_CACHE_NAME, createConfiguration()); } CounterManager.registerCounterManager(cacheManager); new Thread(() -> cacheManager.getCache(CounterManager.COUNTER_CACHE_NAME)).start(); }

Target:
public void cacheManagerStarted(GlobalComponentRegistry gcr) { final EmbeddedCacheManager cacheManager = gcr.getComponent(EmbeddedCacheManager.class); final InternalCacheRegistry internalCacheRegistry = gcr.getComponent(InternalCacheRegistry.class); final CounterManagerConfiguration counterManagerConfiguration = extractConfiguration(gcr); registerCounterCache(internalCacheRegistry, counterManagerConfiguration); registerConfigurationCache(internalCacheRegistry); CompletableFuture<CacheHolder> future = startCaches(cacheManager, counterManagerConfiguration.counters()); registerCounterManager(gcr, future); }
Source:
private Future<Void> write( Object msg, boolean flush ) { if ( disposed ) { throw new IllegalStateException( "sending on disposed channel" ); } if ( channel.isActive() ) { if ( flush ) { return channel.writeAndFlush( msg ); } else { return channel.write( msg ); } } else { Promise<Void> promise = eventLoop.newPromise(); BiConsumer<io.netty.channel.Channel,Object> writer; if ( flush ) { writer = ( channel, message ) -> channel.writeAndFlush( msg ).addListener( x -> promise.setSuccess( null ) ); } else { writer = ( channel, mmessage ) -> channel.write( msg ).addListener( x -> promise.setSuccess( null ) ); } deferredWrite( msg, fChannel, promise, true, writer ); return promise; } }

Target:
private Future<Void> write( Object msg, boolean flush ) { if ( disposed ) { throw new IllegalStateException( "sending on disposed channel" ); } if ( channel.isActive() ) { if ( flush ) { return channel.writeAndFlush( msg ); } else { return channel.write( msg ); } } else { Promise<Void> promise = eventLoop.newPromise(); BiConsumer<io.netty.channel.Channel,Object> writer; if ( flush ) { writer = ( channel, message ) -> chain( channel.writeAndFlush( msg ), promise ); } else { writer = ( channel, mmessage ) -> chain( channel.write( msg ), promise ); } deferredWrite( msg, fChannel, promise, true, writer ); return promise; } }
Source:
public SchemaOperationWorker(GridKernalContext ctx, GridQueryProcessor qryProc, IgniteUuid depId, SchemaAbstractOperation op, boolean nop, @Nullable SchemaOperationException err, boolean cacheRegistered, @Nullable QueryTypeDescriptorImpl type) { super(ctx.igniteInstanceName(), workerName(op), ctx.log(SchemaOperationWorker.class)); this.qryProc = qryProc; this.depId = depId; this.op = op; this.nop = nop; this.cacheRegistered = cacheRegistered; this.type = type; fut = new GridFutureAdapter(); if (err != null) fut.onDone(err); else if (nop || !(cacheRegistered || op instanceof SchemaAddQueryEntityOperation)) fut.onDone(); pubFut = publicFuture(fut); }

Target:
public SchemaOperationWorker(GridKernalContext ctx, GridQueryProcessor qryProc, IgniteUuid depId, SchemaAbstractOperation op, boolean nop, @Nullable SchemaOperationException err, boolean cacheRegistered, @Nullable QueryTypeDescriptorImpl type) { super(ctx.igniteInstanceName(), workerName(op), ctx.log(SchemaOperationWorker.class)); this.qryProc = qryProc; this.depId = depId; this.op = op; this.nop = nop; this.cacheRegistered = cacheRegistered; this.type = type; fut = new GridFutureAdapter(); if (err != null) fut.onDone(err); else if (nop || (!cacheRegistered && !(op instanceof SchemaAddQueryEntityOperation))) fut.onDone(); pubFut = publicFuture(fut); }
Source:
public Map<Long, List<Group>> getGroupsForSecrets(Set<Long> secretIdList) { List<Group> groups = dslContext.select().from(GROUPS) .join(ACCESSGRANTS).on(ACCESSGRANTS.GROUPID.eq(GROUPS.ID)) .join(SECRETS).on(ACCESSGRANTS.SECRETID.eq(SECRETS.ID)) .where(SECRETS.ID.in(secretIdList)) .groupBy(GROUPS.ID) .fetchInto(GROUPS).map(groupMapper).stream().collect(toList()); Map<Long, Group> groupMap = groups.stream().collect(Collectors.toMap(Group::getId, g -> g)); Map<Long, List<Long>> secretsIdGroupsIdMap = dslContext.select().from(GROUPS) .join(ACCESSGRANTS).on(ACCESSGRANTS.GROUPID.eq(GROUPS.ID)) .join(SECRETS).on(ACCESSGRANTS.SECRETID.eq(SECRETS.ID)) .where(SECRETS.ID.in(secretIdList)) .fetch().intoGroups(SECRETS.ID, GROUPS.ID); ImmutableMap.Builder<Long, List<Group>> builder = ImmutableMap.builder(); for (Map.Entry<Long, List<Long>> entry : secretsIdGroupsIdMap.entrySet()) { List<Group> groupList = entry.getValue().stream().map(groupMap::get).collect(toList()); builder.put(entry.getKey(), groupList); } return builder.build(); }

Target:
public Map<Long, List<Group>> getGroupsForSecrets(Set<Long> secretIdList) { Map<Long, Group> groupMap = dslContext.select().from(GROUPS) .join(ACCESSGRANTS).on(ACCESSGRANTS.GROUPID.eq(GROUPS.ID)) .join(SECRETS).on(ACCESSGRANTS.SECRETID.eq(SECRETS.ID)) .where(SECRETS.ID.in(secretIdList)) .fetchInto(GROUPS).map(groupMapper).stream().collect(Collectors.toMap(Group::getId, g -> g, (g1, g2) -> g1)); Map<Long, List<Long>> secretsIdGroupsIdMap = dslContext.select().from(GROUPS) .join(ACCESSGRANTS).on(ACCESSGRANTS.GROUPID.eq(GROUPS.ID)) .join(SECRETS).on(ACCESSGRANTS.SECRETID.eq(SECRETS.ID)) .where(SECRETS.ID.in(secretIdList)) .fetch().intoGroups(SECRETS.ID, GROUPS.ID); ImmutableMap.Builder<Long, List<Group>> builder = ImmutableMap.builder(); for (Map.Entry<Long, List<Long>> entry : secretsIdGroupsIdMap.entrySet()) { List<Group> groupList = entry.getValue().stream().map(groupMap::get).collect(toList()); builder.put(entry.getKey(), groupList); } return builder.build(); }
Source:
public EvaluationResult evaluate(CriteriaContext context) { Collection<INode> ruleNodes = context.getDependencyGraph().getRuleNodes(); for (INode ruleNode : ruleNodes) { RuleInfo ruleInfo = context.getRuleInfos().get(ruleNode.getTransformationRule()); if (!ruleInfo.isEnabled()) { for (IEdge edge : ruleNode.getInTriggerEdges()) { INode node = edge.getFromNode(); RuleInfo ruleInfo2 = context.getRuleInfos().get(node.getTransformationRule()); if (ruleInfo2.getRemainingApp() > 0) { return EvaluationResult.NONE; } } } } return EvaluationResult.CUT_OFF; }

Target:
public EvaluationResult evaluate(CriteriaContext context) { Collection<INode> ruleNodes = context.getDependencyGraph().getRuleNodes(); for (INode ruleNode : ruleNodes) { RuleInfo ruleInfo = context.getRuleInfos().get(ruleNode.getTransformationRule()); if (!ruleInfo.isEnabled()) { for (IEdge edge : ruleNode.getInTriggerEdges()) { INode node = edge.getFromNode(); RuleInfo precedingRuleInfo = context.getRuleInfos().get(node.getTransformationRule()); if (precedingRuleInfo.getRemainingApp() > 0) { return EvaluationResult.NONE; } } } } return EvaluationResult.CUT_OFF; }
Source:
public ParquetValueScheme() { this(new Config.Builder().build()); }

Target:
public ParquetValueScheme() { this(new Config()); }
Source:
public void handleSetPushSetupAlarmResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleSetPushSetupAlarmResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Set Push Setup Alarm Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleSetPushSetupAlarmResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleSetPushSetupAlarmResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Set Push Setup Alarm Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
public void connectRemote() { this.serverConnection = ApiConnection.REMOTE; if (!isServerRouteLoaded()) { return; } this.serverAddress = serverRoute.getRemoteAddress(); this.serverApi = buildServerApi(); BusProvider.getBus().post(new ServerConnectionDetectedEvent(serverRoute.getRemoteAddress())); }

Target:
public void connectRemote() { this.serverConnection = ApiConnection.REMOTE; if (!isServerRouteLoaded()) { return; } this.serverAddress = serverRoute.getRemoteAddress(); this.serverApi = buildServerApi(); finishServerConnectionDetection(); }
Source:
public View getView(final int position, View convertView, ViewGroup parent) { Value value = (Value) getItem(position); TableRow rowView = (TableRow) this.lInflater.inflate(getRecordLayout(), parent, false); ReviewFragmentStrategy reviewFragmentStrategy = new ReviewFragmentStrategy(new ReviewScreenAdapter.onClickListener() { @Override public void onClickOnValue(String UId) { onClickListener.onClickOnValue(UId); } }); return reviewFragmentStrategy.createViewRow(rowView, value); }

Target:
public View getView(final int position, View convertView, ViewGroup parent) { Value value = (Value) getItem(position); TableRow rowView = (TableRow) this.lInflater.inflate(getRecordLayout(), parent, false); ReviewScreenAdapterStrategy reviewFragmentStrategy = new ReviewScreenAdapterStrategy(new ReviewScreenAdapter.onClickListener() { @Override public void onClickOnValue(String UId) { onClickListener.onClickOnValue(UId); } }); return reviewFragmentStrategy.createViewRow(rowView, value); }
Source:
public <T> void set(PreparedStatement stmt, Path<?> path, int i, T value) throws SQLException { if (Null.class.isInstance(value)) { Integer sqlType = path != null && !path.getMetadata().isRoot() ? ColumnMetadata.getColumnMetadata(path).getJdbcType() : null; if (sqlType != null) { stmt.setNull(i, sqlType); } else { stmt.setNull(i, Types.NULL); } } else { getType(path, (Class) value.getClass()).setValue(stmt, i, value); } }

Target:
public <T> void set(PreparedStatement stmt, Path<?> path, int i, T value) throws SQLException { if (Null.class.isInstance(value)) { Integer sqlType = null; if (path != null) { ColumnMetadata columnMetadata = ColumnMetadata.getColumnMetadata(path); if (columnMetadata.hasJdbcType()) { sqlType = columnMetadata.getJdbcType(); } } if (sqlType != null) { stmt.setNull(i, sqlType); } else { stmt.setNull(i, Types.NULL); } } else { getType(path, (Class) value.getClass()).setValue(stmt, i, value); } }
Source:
private Image getIncomingChangesImage(TaskReview reviewContainer) { if (reviewContainer.getIncoming()) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING); } return null; }

Target:
private Image getIncomingChangesImage(TaskReview reviewContainer) { if (reviewContainer.getIncoming()) { if (reviewContainer.getSyncState() == SynchronizationState.INCOMING) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING); } else { if (reviewContainer.getSyncState() == SynchronizationState.INCOMING_NEW) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING_NEW); } } } return null; }
Source:
public void testSetClasspath() { final CheckstyleAntTask antTask = new CheckstyleAntTask(); final Project project = new Project(); final Path classpath1 = new Path(project, "/"); final Path classpath2 = new Path(project, "/checkstyle"); final Path classpathExpected = new Path(project, "/"); classpathExpected.append(classpath2); antTask.setClasspath(classpath1); antTask.setClasspath(classpath2); assertEquals(classpathExpected.toString(), classpath1.toString()); antTask.setClasspathRef(new Reference()); }

Target:
public void testSetClasspath() { final CheckstyleAntTask antTask = new CheckstyleAntTask(); final Project project = new Project(); antTask.setClasspath(new Path(project, "/")); antTask.setClasspath(new Path(project, "/checkstyle")); antTask.setClasspathRef(new Reference()); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.trophies); setTitle(R.string.trophies_view_name); LinearLayout lView = (LinearLayout) findViewById(R.id.trophies_list); Person user = new Person(); user.put("points", 0); user.put("levelAt", 1); user.put("stateAt", 0); user.put("puzzleID", 101); user.put("currentItem", "coffee"); user.put("currentIngredient", "water"); ArrayList<String> items = new ArrayList<String>(Arrays.asList("one", "two", "three", "four")); user.put("itemsCollected", items); user.saveInBackground(); ArrayList<String> itemsCollected = user.getCollectedItems(); for (int i = 0; i < itemsCollected.size(); i++){ currentItem = new TextView(this); currentItem.setText(itemsCollected.get(i)); lView.addView(currentItem); } addListenerOnMainMenuButton(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.trophies); setTitle(R.string.trophies_view_name); LinearLayout lView = (LinearLayout) findViewById(R.id.trophies_list); ParseUser currentUser = ParseUser.getCurrentUser(); ArrayList<String> itemsCollected = null; if (currentUser != null) { itemsCollected = (ArrayList<String>) currentUser.get("itemsCollected"); } else { Intent i = new Intent(this, SignUpOrLogInActivity.class); startActivity(i); } for (int i = 0; i < itemsCollected.size(); i++){ currentItem = new TextView(this); currentItem.setText(itemsCollected.get(i)); lView.addView(currentItem); } addListenerOnMainMenuButton(); addListenerOnPhotosButton(); }
Source:
public GCModel read() throws IOException { getLogger().info("Reading Shenandoah format..."); GCModel model = new GCModel(); model.setFormat(GCModel.Format.RED_HAT_SHENANDOAH_GC); Stream<String> lines = new BufferedReader(in).lines(); lines.filter(this::lineNotInExcludedStrings) .map(this::parseShenandoahEvent) .filter(Objects::nonNull) .forEach(model::add); return model; }

Target:
public GCModel read() throws IOException { getLogger().info("Reading Shenandoah format..."); GCModel model = new GCModel(); model.setFormat(GCModel.Format.RED_HAT_SHENANDOAH_GC); Stream<String> lines = in.lines(); lines.filter(this::lineNotInExcludedStrings) .map(this::parseShenandoahEvent) .filter(Objects::nonNull) .forEach(model::add); return model; }