auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>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); <START> assertThat(node0.isReconnecting()).isTrue(); <END> 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(); } }</code><technical_language>wrapped ConditionChecker wait for for some time? (I works in async way)</technical_language>

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:
<code>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) { <START> errOut = new SideBandErrorWriter(); <END> 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); } }</code><technical_language>This is a confusing noop reportInternalServerErrorOverSideband() it. complete change replace reportInternalServerErrorOverSideband() errOut.write()</technical_language>

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:
<code><START> public void addPlugin(Class<? extends Plugin> plugin, PluginPriority priority) { <END> 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); } } }</code><technical_language>this private discussed</technical_language>

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:
<code><START> public void registerCipherInformation(final CipherInformation cipherInformation) { <END> if (this.cipherInformation == null) { this.cipherInformation = cipherInformation; sensors.connectionsByCipher.increment(cipherInformation); } }</code><technical_language>good this consistent registerClientInformation making re-register cipher information if (and if new information is different). Question for @rajinisivaram: SSL cipher of a connection change SSL handshake is done established SSL connection</technical_language>

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:
<code>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); <START> System.out.println("URL=" + browser.getUrl()); <END> info = processor.getRequestInfo(browser, browser.getUrl(), browser.getText()); if (null != info) { close(); } } }; browser.addProgressListener(progressListener); setURL(startURL); return container; }</code><technical_language>I log OpenShiftIOUIActivator</technical_language>

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:
<code>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())); <START> getPostFilteredCellsMeter().mark(postFilteredCells.size() + localWritesInRange.size() - result.size()); <END> return result; }</code><technical_language>i this collection contains set of results return client, interested in number of cells filtered out (I guess postFilteredCells is kind of ambiguous name here)</technical_language>

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:
<code><START> public void setParent(IForestryCommand parent) { <END> this.parent = parent; }</code><technical_language>This public..</technical_language>

Target:
void setParent(IForestryCommand parent) { this.parent = parent; }
Source:
<code>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()) { <START> throw new IllegalArgumentException("The provided rhs vector has wrong dimensions"); <END> } 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"); }</code><technical_language>Utils.validateArg</technical_language>

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:
<code>void shouldNotFailOnDeleteByIdWithNullVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> { <START> tx.run("CREATE (v:VersionedThingWithAssignedId {id:1})").consume(); return null; <END> }); } 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); } }</code><technical_language>suggestion return tx.run("CREATE (v:VersionedThingWithAssignedId {id:1})").consume();</technical_language>

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:
<code>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"); <START> for(String <END> item : items) { assertIsLegalIndex(item); } asyncExec(new VoidResult() { public void run() { widget.setSelection(items); } }); notifySelect(items.length); }</code><technical_language>space</technical_language>

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:
<code>private void MoveVdssToGoingToMaintenanceMode() { <START> List<VDS> nonSpms = new LinkedList<>(); <END> 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(); }</code><technical_language>this refactor related solved bug..please separate this patch solve bug</technical_language>

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:
<code>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; } <START> <END> List<Guid> upServerIds = getUpServerIds(); if (upServerIds == null || upServerIds.isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND); return false; } return true; }</code><technical_language>server check is done in superclass. remove here</technical_language>

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:
<code>public TextRange getRangeInElement() { PsiElement nameElement = getReferenceNameElement(); if (nameElement != null) { int startOffset = nameElement.getStartOffsetInParent(); return new TextRange(startOffset, startOffset + nameElement.getTextLength()); } PsiElement dot = getLastChild(); <START> if (Objects.equals(dot.getText(), ".")) { <END> int index = dot.getStartOffsetInParent() + dot.getTextLength(); return new TextRange(index, index); } return new TextRange(0, getTextLength()); }</code><technical_language>if (".".equals(dot.getText()) is more readable reaching out Objects class</technical_language>

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:
<code>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 = <START> runInternalAction(VdcActionType.CreateAllSnapshotsFromVm, <END> 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); }</code><technical_language>'runInternalMultipleActions'</technical_language>

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:
<code>private boolean isContentsAllowMissingJavadoc(DetailAST ast) { return (ast.getType() == TokenTypes.METHOD_DEF || ast.getType() == TokenTypes.CTOR_DEF) && ( getMethodsNumberOfLine(ast) <= minLineCount || AnnotationUtil.hasAllowedAnnotations(ast, allowedAnnotations) <START> ); <END> }</code><technical_language>This formatting weird imo. @romani Whats opinion</technical_language>

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:
<code>public java.util.Optional<RuleMetadataDto> selectMetadataByKey(DbSession session, RuleKey key, OrganizationDto organization) { <START> return java.util.Optional.ofNullable(mapper(session).selectMetadataByKey(key, organization.getUuid())); <END> }</code><technical_language>I suppose this is FP Guava Optional is imported. In case a message rules dogfood group</technical_language>

Target:
public Optional<RuleMetadataDto> selectMetadataByKey(DbSession session, RuleKey key, OrganizationDto organization) { return ofNullable(mapper(session).selectMetadataByKey(key, organization.getUuid())); }
Source:
<code>public int getDPSearchStepNumber() { if (this.dpSearchStepNumber == null) { <START> this.dpSearchStepNumber = 100; <END> } return this.dpSearchStepNumber; }</code><technical_language>300 recommended default parameterization in SafePub paper</technical_language>

Target:
public int getDPSearchStepNumber() { if (this.dpSearchStepNumber == null) { this.dpSearchStepNumber = 300; } return this.dpSearchStepNumber; }
Source:
<code>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()); <START> return false; <END> } } return true; }</code><technical_language>If host fails update stop updating other hosts well</technical_language>

Target:
private void updateGlusterHosts() { for (VDS vds : allForCluster) { HostStoragePoolParametersBase parameters = new HostStoragePoolParametersBase(vds); runInternalAction( VdcActionType.InitVdsOnUp, parameters, cloneContextAndDetachFromParent()); } }
Source:
<code><START> public ConfigPersistenceService getPersistence() { <END> return OpenEngSBCoreServices .getConfigPersistenceService("WORKFLOW"); }</code><technical_language>do want this public</technical_language>

Target:
private ConfigPersistenceService getPersistence() { return OpenEngSBCoreServices .getConfigPersistenceService("WORKFLOW"); }
Source:
<code>public Subscriber getSubscriber() { GitSynchronizeDataSet set = new GitSynchronizeDataSet(); <START> return new GitResourceVariantTreeSubscriber(set); <END> }</code><technical_language>GitResourceVariantTreeSubscriber relay data added GitSynchronizeDateSet. data contains repository, destination source rev's determinate differences in file. Passing empty GitSynchronizeDataSet NPE in members() getSyncInfo methods. In case of git is tricky obtain subscriber main repository. Of consider in this case comparing HEAD HEAD (or origin/HEAD origin/master (?)) default behavior :|</technical_language>

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:
<code>@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()); <START> certificatePinner.check("example.co.uk", certB1.certificate()); <END> certificatePinner.check("anotherexample.co.uk", certB1.certificate()); }</code><technical_language>Is worth discussing this case for **</technical_language>

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:
<code>private GraphStore getResourceTriples(final String path) throws URISyntaxException, ClientProtocolException, IOException { final FcrepoHttpClientBuilder b = new FcrepoHttpClientBuilder(null, null, client.getRepositoryUrl()); <START> final CloseableHttpClient c = b.build(); <END> 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()); }</code><technical_language>client response try-with-resource</technical_language>

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:
<code>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); <START> String clipboardContent = clipboard.getPrimaryClip() != null ? clipboard.getPrimaryClip().toString() : ""; <END> 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(); }</code><technical_language>This work. returns ClipData{...}</technical_language>

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:
<code>protected void addGuideStar(GuideProbe probe) { TargetEnvironment env = getTargetEnvironment(); GuideGroup grp = env.getPrimaryGuideGroup(); if (grp.isAutomatic()) { <START> grp = GuideGroup.create("Manual Group"); <END> env = env.setGuideEnvironment(env.getGuideEnvironment().setOptions(env.getGroups().append(grp))).setPrimaryGuideGroup(grp); } setTargetEnvironment(env.putPrimaryGuideProbeTargets(GuideProbeTargets.create(probe, new SPTarget()))); }</code><technical_language>a tiny detail, upstream renamed "Manual" GuideGroup.ManualGroupDefaultName</technical_language>

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:
<code>public void cacheManagerStarted(GlobalComponentRegistry gcr) { final EmbeddedCacheManager cacheManager = gcr.getComponent(EmbeddedCacheManager.class); if (!cacheManager.getCacheConfigurationNames().contains(CounterManager.COUNTER_CACHE_NAME)) { <START> cacheManager.defineConfiguration(CounterManager.COUNTER_CACHE_NAME, createConfiguration()); <END> } CounterManager.registerCounterManager(cacheManager); new Thread(() -> cacheManager.getCache(CounterManager.COUNTER_CACHE_NAME)).start(); }</code><technical_language>This InternalCacheRegistry approach instead</technical_language>

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:
<code>private Future<Void> write( Object msg, boolean flush ) { if ( disposed ) { throw new IllegalStateException( "sending on disposed channel" ); <START> } <END> 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; } }</code><technical_language>Is this a Java Future? is powerful a CompletableFuture a NettyFuture</technical_language>

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:
<code>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); <START> else if (nop || !(cacheRegistered || op instanceof SchemaAddQueryEntityOperation)) <END> fut.onDone(); pubFut = publicFuture(fut); }</code><technical_language>rewrite this statement more readable: (nop || (!cacheRegistered && !(op instanceof SchemaAddQueryEntityOperation))) want here: Complete future if 1. is operation 2. Cache registered operation is SchemaAddQueryEntityOperation</technical_language>

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:
<code>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) <START> .fetchInto(GROUPS).map(groupMapper).stream().collect(toList()); <END> 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(); }</code><technical_language>silly collect a list, stream() right again. combine collects</technical_language>

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:
<code>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(); <START> RuleInfo ruleInfo2 = context.getRuleInfos().get(node.getTransformationRule()); <END> if (ruleInfo2.getRemainingApp() > 0) { return EvaluationResult.NONE; } } } } return EvaluationResult.CUT_OFF; }</code><technical_language>rename ruleInfo2</technical_language>

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:
<code>public ParquetValueScheme() { <START> this(new Config.Builder().build()); <END> }</code><technical_language>add a static method: Config.builder() do new Config.Builder()</technical_language>

Target:
public ParquetValueScheme() { this(new Config()); }
Source:
<code>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; } <START> this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() <END> .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }</code><technical_language>Extract building of ResponseMessage variable (in eclipse, select text, right-click > refactor > extract local variable / select code + shift+alt+L). This code a bit more readable, especially passing in other besides ResponseMessage</technical_language>

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:
<code>public void connectRemote() { this.serverConnection = ApiConnection.REMOTE; if (!isServerRouteLoaded()) { return; } this.serverAddress = serverRoute.getRemoteAddress(); this.serverApi = buildServerApi(); <START> BusProvider.getBus().post(new ServerConnectionDetectedEvent(serverRoute.getRemoteAddress())); <END> }</code><technical_language>Is this (ServerConnectionDetectedEvent) post required? This basically repeats lines finally calls finishServerConnectionDetection(). call finishServerConnectionDetection() method instead of this</technical_language>

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

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:
<code>public <T> void set(PreparedStatement stmt, Path<?> path, int i, T value) throws SQLException { if (Null.class.isInstance(value)) { <START> Integer sqlType = path != null && !path.getMetadata().isRoot() ? ColumnMetadata.getColumnMetadata(path).getJdbcType() : null; <END> if (sqlType != null) { stmt.setNull(i, sqlType); } else { stmt.setNull(i, Types.NULL); } } else { getType(path, (Class) value.getClass()).setValue(stmt, i, value); } }</code><technical_language>test case is ok, fix this differently, root path usage is case this breaks. Integer sqlType = null; if (path != null) { ColumnMetadata metadata = ColumnMetadata.getColumnMetadata(path); if (metadata.hasJdbcType()) { jdbcType = metadata.getJdbcType(); } }</technical_language>

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:
<code>private Image getIncomingChangesImage(TaskReview reviewContainer) { if (reviewContainer.getIncoming()) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING); <START> } <END> return null; }</code><technical_language>return OVERLAY_SYNC_INCOMMING OVERLAY_SYNC_INCOMMING_NEW depending ITask Sync state</technical_language>

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:
<code>public void testSetClasspath() { final CheckstyleAntTask antTask = new CheckstyleAntTask(); final Project project = new Project(); final Path classpath1 = new Path(project, "/"); <START> final Path classpath2 = new Path(project, "/checkstyle"); <END> final Path classpathExpected = new Path(project, "/"); classpathExpected.append(classpath2); antTask.setClasspath(classpath1); antTask.setClasspath(classpath2); assertEquals(classpathExpected.toString(), classpath1.toString()); antTask.setClasspathRef(new Reference()); }</code><technical_language>assertEquals(classpathExpected, classpath1);</technical_language>

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:
<code>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(); <START> user.put("points", 0); <END> 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(); }</code><technical_language>Again, repeated put statements</technical_language>

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