auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Map<?, ?> getSearchFilters(ArticleSearchQuery query, Multimap<String, String> urlParams) throws IOException { ArticleSearchQuery.Builder journalFacetQuery = ArticleSearchQuery.builder() .setFacet(JOURNAL_FACET_FIELD) .setCommonQueryParams(query); Map<?, ?> journalFacetResults = solrSearchService.search(journalFacetQuery.build()); SearchFilter journalFilter = searchFilterFactory .createSearchFilter(journalFacetResults, JOURNAL, urlParams); ArticleSearchQuery.Builder subjectAreaFacetQuery = ArticleSearchQuery.builder() .setFacet(SUBJECT_AREA_FACET_FIELD) <START> .setCommonQueryParams(query); <END> Map<?, ?> subjectAreaFacetResults = solrSearchService.search(subjectAreaFacetQuery.build()); SearchFilter subjectAreaFilter = searchFilterFactory .createSearchFilter(subjectAreaFacetResults, SUBJECT_AREA, urlParams); Map<String, SearchFilter> filters = new HashMap<>(); filters.put(JOURNAL, journalFilter); filters.put(SUBJECT_AREA, subjectAreaFilter); return filters; }</code><technical_language>perform filtering subject faceted search subject, setCommonQueryParams method considers subject area passed in query. In fact, extract set methods in another method, changed for filter. Also, captured journal info</technical_language>

Target:
public Map<?, ?> getSearchFilters(ArticleSearchQuery query, Multimap<String, String> urlParams) throws IOException { ArticleSearchQuery.Builder journalFacetQuery = ArticleSearchQuery.builder() .setFacet(JOURNAL_FACET_FIELD) .setQuery(query.getQuery().orNull()) .setSimple(query.isSimple()) .setArticleTypes(query.getArticleTypes()) .setSubjects(query.getSubjects()) .setDateRange(query.getDateRange().orNull()); Map<?, ?> journalFacetResults = solrSearchService.search(journalFacetQuery.build()); SearchFilter journalFilter = searchFilterFactory .createSearchFilter(journalFacetResults, JOURNAL, urlParams); ArticleSearchQuery.Builder subjectAreaFacetQuery = ArticleSearchQuery.builder() .setFacet(SUBJECT_AREA_FACET_FIELD) .setQuery(query.getQuery().orNull()) .setSimple(query.isSimple()) .setArticleTypes(query.getArticleTypes()) .setDateRange(query.getDateRange().orNull()) .setJournalKeys(query.getJournalKeys()); Map<?, ?> subjectAreaFacetResults = solrSearchService.search(subjectAreaFacetQuery.build()); SearchFilter subjectAreaFilter = searchFilterFactory .createSearchFilter(subjectAreaFacetResults, SUBJECT_AREA, urlParams); Map<String, SearchFilter> filters = new HashMap<>(); filters.put(JOURNAL, journalFilter); filters.put(SUBJECT_AREA, subjectAreaFilter); return filters; }
Source:
<code>public PageWithPosition getPage() { if (currentPage != null && !currentPage.isFinished()) { return currentPage; } if (blocked == null) { return null; } if (!isBlocked().isDone()) { return null; } <START> if (pageSupplier.isFinished()) { <END> return null; } Page page = requireNonNull(pageSupplier.pollPage(), "page is null"); currentPage = new PageWithPosition(page); return currentPage; }</code><technical_language>mark @Nullable</technical_language>

Target:
public PageWithPosition getPage() { if (currentPage != null && !currentPage.isFinished()) { return currentPage; } if (blocked == null) { return null; } if (!isBlocked().isDone()) { return null; } if (pageSupplier.isFinished()) { localMemoryContext.setBytes(0); return null; } Page page = requireNonNull(pageSupplier.pollPage(), "page is null"); currentPage = new PageWithPosition(streamIndex, page); localMemoryContext.setBytes(currentPage.getPage().getRetainedSizeInBytes()); return currentPage; }
Source:
<code>private boolean isDeduplicateObjects(Class<?> rootType) { Boolean dedup = config.isDeduplicateObjects(); if (dedup == null) { Mappings.TypeMapping classMapping = mappings.findOrCreateTypeMapping(rootType); <START> if (classMapping != null && MappingType.CLASSMAPPING.equals(classMapping.getType())) { <END> dedup = ClassMapping.class.cast(classMapping).isDeduplicateObjects(); } } return dedup != null ? dedup : false; }</code><technical_language>a style add in TypeMapping a as(Class<T>) able do typeMapping.as(ClassMapping.class) avoids put cast pattern if (type == xxx) tm.as(X.class) more natural IMHO</technical_language>

Target:
private boolean isDeduplicateObjects(Class<?> rootType) { Boolean dedup = config.isDeduplicateObjects(); if (dedup == null) { if (!deduplicateMap.containsKey(rootType)){ JohnzonDeduplicateObjects jdo = rootType.getAnnotation(JohnzonDeduplicateObjects.class); if (Objects.nonNull(jdo)){ deduplicateMap.put(rootType, jdo.value()); } else { deduplicateMap.put(rootType, Boolean.FALSE); } } dedup = deduplicateMap.get(rootType); } return dedup != null ? dedup : false; }
Source:
<code>String getPrompt() { if(lineBuffer != null) { return "> "; } StringBuilder buffer = new StringBuilder(); if (promptConnectPart == null) { buffer.append('['); String controllerHost = getControllerHost(); if (client != null) { if (domainMode) { buffer.append("domain@"); } else { buffer.append("standalone@"); } if (controllerHost != null) { buffer.append(controllerHost).append(':').append(getControllerPort()).append(' '); } else { buffer.append("embedded "); } promptConnectPart = buffer.toString(); } else { buffer.append("disconnected "); } } else { buffer.append(promptConnectPart); } if (getConfig().isColorOutput()) { Util.formatPrompt(buffer); } if (prefix.isEmpty()) { buffer.append('/'); } else { buffer.append(prefix.getNodeType()); final String nodeName = prefix.getNodeName(); if (nodeName != null) { buffer.append('=').append(nodeName); } } if (isBatchMode()) { String batchPrompt = " #"; if (getConfig().isColorOutput()) { batchPrompt = batchPrompt + "] "; batchPrompt = Util.formatBatchPrompt(batchPrompt); return buffer.append(batchPrompt).toString(); } } if (isWorkflowMode()) { <START> String workflowPrompt = " ..."; <END> if (getConfig().isColorOutput()) { workflowPrompt = workflowPrompt + "] "; workflowPrompt = Util.formatBatchPrompt(workflowPrompt); return buffer.append(workflowPrompt).toString(); } } buffer.append("] "); return buffer.toString(); }</code><technical_language>If color output is enabled, # is added prompt. Adding of # prompt dependent color-output property</technical_language>

Target:
String getPrompt() { if(lineBuffer != null) { return "> "; } StringBuilder buffer = new StringBuilder(); if (promptConnectPart == null) { buffer.append('['); String controllerHost = getControllerHost(); if (client != null) { if (domainMode) { buffer.append("domain@"); } else { buffer.append("standalone@"); } if (controllerHost != null) { buffer.append(controllerHost).append(':').append(getControllerPort()).append(' '); } else { buffer.append("embedded "); } promptConnectPart = buffer.toString(); } else { buffer.append("disconnected "); } } else { buffer.append(promptConnectPart); } if (isColorOutput()) { Util.formatPrompt(buffer); } if (prefix.isEmpty()) { buffer.append('/'); } else { buffer.append(prefix.getNodeType()); final String nodeName = prefix.getNodeName(); if (nodeName != null) { buffer.append('=').append(nodeName); } } if (isBatchMode()) { if (isColorOutput()) { buffer.append(Util.formatWorkflowPrompt(" #")); } else { buffer.append(" #"); } } if (isWorkflowMode()) { if (isColorOutput()) { buffer.append(Util.formatWorkflowPrompt(" ...")); } else { buffer.append(" ..."); } } buffer.append("] "); return buffer.toString(); }
Source:
<code>public static void addDiskImageWithNoVmDevice(DiskImage image) { addDiskImageWithNoVmDevice(image, image.getActive(), new image_storage_domain_map(image.getImageId(), image.getStorageIds().get(0), image.getQuotaId(), <START> image.getDiskProfileIds().get(0))); <END> }</code><technical_language>in current code disk disk profile, lead NPE/IndexOutOfBounds exception here</technical_language>

Target:
public static void addDiskImageWithNoVmDevice(DiskImage image) { addDiskImageWithNoVmDevice(image, image.getActive(), new image_storage_domain_map(image.getImageId(), image.getStorageIds().get(0), image.getQuotaId(), image.getDiskProfileId())); }
Source:
<code>public void testGroupByRequireIntegerCoercion() { <START> assertQuery("SELECT partkey, COUNT(DISTINCT shipdate), SUM(linenumber) FROM lineitem GROUP BY partkeyTestHivePushdownDistributedQuer"); <END> }</code><technical_language>accidental change</technical_language>

Target:
public void testGroupByRequireIntegerCoercion() { assertQuery("SELECT partkey, COUNT(DISTINCT shipdate), SUM(linenumber) FROM lineitem GROUP BY partkey"); }
Source:
<code>public String getTemplateName() { <START> return "templates/generators/" + templateFileName; <END> }</code><technical_language>leave code is move this path private static field</technical_language>

Target:
public String getTemplateName() { return TEMPLATE_BASE_PATH + templateFileName; }
Source:
<code>public void initialize() { <START> if (this.applicationDefinitions == null || this.applicationDefinitions.isEmpty()) { <END> this.applicationDefinitions = getAppDefinitions(this.name, this.dslText); } }</code><technical_language>Consider CollectionUtils.isEmpty(this.applicationDefinitions) instead</technical_language>

Target:
public void initialize() { if (CollectionUtils.isEmpty(this.applicationDefinitions)) { this.applicationDefinitions = getAppDefinitions(this.name, this.dslText); } }
Source:
<code>protected BlockStateContainer createBlockState() { <START> return new ExtendedBlockState(this, PROPERTIES, UNLISTED_PROPERTIES); <END> }</code><technical_language>Eww builder</technical_language>

Target:
protected BlockStateContainer createBlockState() { return new BlockStateContainer.Builder(this).add(PROPERTY_TICKING).add(PROPERTY_MULTIPART_CONTAINER).build(); }
Source:
<code>public boolean matchEvents() { if (!(fTraces.size() > 0)) { return false; } initMatching(); Job job = new Job(Messages.TmfEventMatching_MatchingEvents) { @Override protected IStatus run(final IProgressMonitor monitor) { for (ITmfTrace trace : fTraces) { <START> monitor.beginTask(NLS.bind(Messages.TmfEventMatching_LookingEventsFrom, trace.getName()), IProgressMonitor.UNKNOWN); <END> setName(NLS.bind(Messages.TmfEventMatching_RequestingEventsFrom, trace.getName())); EventMatchingBuildRequest request = new EventMatchingBuildRequest(TmfEventMatching.this, trace, monitor); trace.sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { Activator.logInfo(e.getMessage()); } } return Status.OK_STATUS; } }; job.schedule(); try { job.join(); } catch (InterruptedException e) { } finalizeMatching(); return true; }</code><technical_language>submonitor.beginTask(NLS.bind(Messages.TmfEventMatching_RequestingEventsFrom, trace.getName())</technical_language>

Target:
public boolean matchEvents() { if (!(fTraces.size() > 0)) { return false; } initMatching(); Job job = new Job(Messages.TmfEventMatching_MatchingEvents) { @Override protected IStatus run(final IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, fTraces.size()); for (ITmfTrace trace : fTraces) { subMonitor.beginTask(NLS.bind(Messages.TmfEventMatching_LookingEventsFrom, trace.getName()), IProgressMonitor.UNKNOWN); SubMonitor childMonitor = subMonitor.newChild(1); EventMatchingBuildRequest request = new EventMatchingBuildRequest(TmfEventMatching.this, trace, childMonitor); trace.sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { Activator.logInfo(e.getMessage()); } if (childMonitor.isCanceled()) { return Status.CANCEL_STATUS; } } return Status.OK_STATUS; } }; job.schedule(); try { job.join(); } catch (InterruptedException e) { } finalizeMatching(); return true; }
Source:
<code><START> public List<? extends PartitionId> getWritablePartitionIds() { <END> List<Partition> partitions = partitionLayout.getWritablePartitions(); List<Partition> healthyPartitions = new ArrayList<Partition>(); for (Partition partition : partitions) { boolean up = true; for (Replica replica : partition.getReplicas()) { if (!replica.isUp()) { up = false; break; } } if (up) { healthyPartitions.add(partition); } } return healthyPartitions.isEmpty() ? partitions : healthyPartitions; }</code><technical_language>reason return List<? extends PartitionId> instead of "List<PartitionId>"</technical_language>

Target:
public List<PartitionId> getWritablePartitionIds() { return partitionLayout.getWritablePartitions(); }
Source:
<code>public String toString() { Method m = getMethod(); String cls = m.getDeclaringClass().getName(); <START> StringBuilder result = new StringBuilder(cls + "." + m.getName() + "("); <END> int i = 0; for (Class<?> p : m.getParameterTypes()) { if (i++ > 0) { result.append(", "); } result.append(p.getName()); } result.append(")"); return result.toString(); }</code><technical_language>I usage of String concatenation is issue. fix it</technical_language>

Target:
public String toString() { Method m = getMethod(); String cls = m.getDeclaringClass().getName(); StringBuffer result = new StringBuffer(cls + "." + m.getName() + "("); int i = 0; for (Class<?> p : m.getParameterTypes()) { if (i++ > 0) { result.append(", "); } result.append(p.getName()); } result.append(")"); return result.toString(); }
Source:
<code>private static void checkGeometryToBingTilesLimits(OGCGeometry geometry, boolean pointOrRectangle, long tileCount) { if (pointOrRectangle) { checkCondition(tileCount <= 1_000_000, "The number of input tiles is too large (more than 1M) to compute a set of covering bing tiles."); } else { <START> checkCondition((int) tileCount == tileCount, "The zoom level is too high to compute a set of covering bing tiles."); <END> long complexity = tileCount * getPointCount(geometry.getEsriGeometry()); checkCondition(complexity <= 25_000_000, "The zoom level is too high or the geometry is too complex to compute a set of covering bing tiles. " + "Please use a lower zoom level or convert the geometry to its bounding box using the ST_Envelope function."); } }</code><technical_language>is this check needed? check cover it? In fact, for complexity < 25M, tilecount larger that</technical_language>

Target:
private static void checkGeometryToBingTilesLimits(OGCGeometry geometry, boolean pointOrRectangle, long tileCount) { if (pointOrRectangle) { checkCondition(tileCount <= 1_000_000, "The number of input tiles is too large (more than 1M) to compute a set of covering Bing tiles."); } else { checkCondition((int) tileCount == tileCount, "The zoom level is too high to compute a set of covering Bing tiles."); long complexity = 0; try { complexity = Math.multiplyExact(tileCount, getPointCount(geometry.getEsriGeometry())); } catch (ArithmeticException e) { checkCondition(false, "The zoom level is too high or the geometry is too complex to compute a set of covering Bing tiles. " + "Please use a lower zoom level or convert the geometry to its bounding box using the ST_Envelope function."); } checkCondition(complexity <= 25_000_000, "The zoom level is too high or the geometry is too complex to compute a set of covering Bing tiles. " + "Please use a lower zoom level or convert the geometry to its bounding box using the ST_Envelope function."); } }
Source:
<code>void shutdown() { <START> cosmosAsyncContainer.delete().block(); <END> logger.info("Deleted test container {}" , this.configuration.getCollectionId()); cosmosClient.close(); }</code><technical_language>In testing subscriptions create a collection 1M throughput upfront. workaround is create a collection 100K throughput scale up. this auto deleting collection means do this manual process everytime. want delete collection. a config option called autoCollectionCreateEnabled present attempt 1. create collection if exist 2. delete collection autoCollectionCreateEnabled=false attempt create delete collection, if collection exist fail</technical_language>

Target:
void shutdown() { if (this.databaseCreated) { cosmosAsyncDatabase.delete().block(); logger.info("Deleted temporary database created for this test", this.configuration.getDatabaseId()); } else if (this.collectionCreated) { cosmosAsyncContainer.delete().block(); logger.info("Deleted temporary collection created for this test", this.configuration.getCollectionId()); } cosmosClient.close(); }
Source:
<code>public void testMaxAnticipationLimit() throws PagarMeException{ <START> Limit limit = defaultRecipient.getMaxAnticipationLimit(new DateTime().plusDays(7), Timeframe.START); <END> Assert.assertEquals((Integer)0, limit.getAmount()); Assert.assertEquals((Integer)0, limit.getAnticipationFee()); Assert.assertEquals((Integer)0, limit.getFee()); }</code><technical_language>point of this change? If fixes test case, it</technical_language>

Target:
public void testMaxAnticipationLimit() throws PagarMeException, Exception { Limit limit = defaultRecipient.getMaxAnticipationLimit(PagarmeCalendar.getValidWeekday() , Timeframe.START); Assert.assertEquals((Integer)0, limit.getAmount()); Assert.assertEquals((Integer)0, limit.getAnticipationFee()); Assert.assertEquals((Integer)0, limit.getFee()); }
Source:
<code>void stop() { try { send("quit"); } catch (NodeJsDebuggerException ignored) { } outputReader.interrupt(); process.destroy(); try { if (!process.waitFor(1, TimeUnit.MINUTES)) { LOG.error("NodeJs failed to stop"); } } catch (InterruptedException ignored) { <START> } <END> try { processWriter.close(); } catch (IOException e) { LOG.warn("Failed to close NodeJs process output stream", e); } observers.clear(); }</code><technical_language>log</technical_language>

Target:
void stop() { try { send("quit"); } catch (NodeJsDebuggerException e) { LOG.warn(e.getMessage()); } executor.shutdown(); try { if (!executor.awaitTermination(10, TimeUnit.SECONDS)) { executor.shutdownNow(); if (!executor.awaitTermination(10, TimeUnit.SECONDS)) { LOG.warn("Unable to terminate main pool"); } } } catch (InterruptedException e) { LOG.warn(e.getMessage()); } process.destroy(); try { if (!process.waitFor(10, TimeUnit.SECONDS)) { LOG.error("Unable to terminate NodeJs"); } } catch (InterruptedException e) { LOG.warn(e.getMessage()); } try { processWriter.close(); } catch (IOException e) { LOG.warn("Failed to close NodeJs process output stream", e); } observers.clear(); }
Source:
<code>private static void addCriteriaForSnmpParm(OnmsCriteria criteria, String snmpParm, String snmpParmValue, String snmpParmMatchType) { criteria.createAlias("node.ipInterfaces", "ipInterface"); criteria.add(Restrictions.ne("ipInterface.isManaged", "D")); criteria.createAlias("node.snmpInterfaces", "snmpInterface"); criteria.add(Restrictions.ne("snmpInterface.collect", "D")); if(snmpParmMatchType.equals("contains")) { criteria.add(Restrictions.ilike("snmpInterface.".concat(snmpParm), snmpParmValue, MatchMode.ANYWHERE)); } else if(snmpParmMatchType.equals("equals")) { <START> final List<String> acceptedParamNames = Lists.newArrayList( <END> "snmpphysaddr", "snmpifindex", "snmpifdescr", "snmpiftype", "snmpifname", "snmpifspeed", "snmpifadminstatus", "snmpifoperstatus", "snmpifalias", "snmpcollect", "snmplastcapsdpoll", "snmppoll", "snmplastsnmppoll"); final String snmpParameterName = ("snmp" + snmpParm).toLowerCase(); if (!acceptedParamNames.contains(snmpParameterName)) { throw new IllegalArgumentException("Provided parameter '" + snmpParm + "' is not supported"); } snmpParmValue = snmpParmValue.toLowerCase(); criteria.add(Restrictions.sqlRestriction("{alias}.nodeid in (select nodeid from snmpinterface where snmpcollect != 'D' and " + snmpParameterName + " = ?)", snmpParmValue, new StringType())); } }</code><technical_language>a Set instead of a list more efficient for lookups. move a static constant defining in function here</technical_language>

Target:
private static void addCriteriaForSnmpParm(OnmsCriteria criteria, String snmpParm, String snmpParmValue, String snmpParmMatchType) { criteria.createAlias("node.ipInterfaces", "ipInterface"); criteria.add(Restrictions.ne("ipInterface.isManaged", "D")); criteria.createAlias("node.snmpInterfaces", "snmpInterface"); criteria.add(Restrictions.ne("snmpInterface.collect", "D")); if(snmpParmMatchType.equals("contains")) { criteria.add(Restrictions.ilike("snmpInterface.".concat(snmpParm), snmpParmValue, MatchMode.ANYWHERE)); } else if(snmpParmMatchType.equals("equals")) { final String snmpParameterName = ("snmp" + snmpParm).toLowerCase(); if (!ACCEPTED_SNMP_PARAM_NAMES.contains(snmpParameterName)) { throw new IllegalArgumentException("Provided parameter '" + snmpParm + "' is not supported"); } snmpParmValue = snmpParmValue.toLowerCase(); criteria.add(Restrictions.sqlRestriction("{alias}.nodeid in (select nodeid from snmpinterface where snmpcollect != 'D' and " + snmpParameterName + " = ?)", snmpParmValue, new StringType())); } }
Source:
<code>public void fetchContributions() { Timber.d("fetch Contributions"); LiveData<List<Contribution>> liveDataContributions = repository.fetchContributions(); if(null!=lifeCycleOwner) { liveDataContributions.observe(lifeCycleOwner, this::showContributions); } if (NetworkUtils.isInternetConnectionEstablished(CommonsApplication.getInstance()) && shouldFetchContributions()) { Timber.d("fetching contributions: "); view.showProgress(true); this.user = sessionManager.getUserName(); view.showContributions(Collections.emptyList()); compositeDisposable.add(userClient.logEvents(user) .subscribeOn(ioThreadScheduler) .observeOn(mainThreadScheduler) .doOnNext(mwQueryLogEvent -> Timber.d("Received image %s", mwQueryLogEvent.title())) .filter(mwQueryLogEvent -> !mwQueryLogEvent.isDeleted()).doOnNext(mwQueryLogEvent -> Timber.d("Image %s passed filters", mwQueryLogEvent.title())) .map(image -> { Contribution contribution = new Contribution(null, null, image.title(), <START> "", -1, image.date(), image.date(), user, user, <END> "", "", STATE_COMPLETED); return contribution; }) .toList() .subscribe(this::saveContributionsToDB, error -> { Timber.e("Failed to fetch contributions: %s", error.getMessage()); })); } }</code><technical_language>this wrong in light of other constructor set creator/user values null, null, sessionManager.getAuthorName(), sessionManager.getUserName(),</technical_language>

Target:
public void fetchContributions() { Timber.d("fetch Contributions"); LiveData<List<Contribution>> liveDataContributions = repository.fetchContributions(); if(null!=lifeCycleOwner) { liveDataContributions.observe(lifeCycleOwner, this::showContributions); } if (NetworkUtils.isInternetConnectionEstablished(CommonsApplication.getInstance()) && shouldFetchContributions()) { Timber.d("fetching contributions: "); view.showProgress(true); this.user = sessionManager.getUserName(); view.showContributions(Collections.emptyList()); compositeDisposable.add(userClient.logEvents(user) .subscribeOn(ioThreadScheduler) .observeOn(mainThreadScheduler) .doOnNext(mwQueryLogEvent -> Timber.d("Received image %s", mwQueryLogEvent.title())) .filter(mwQueryLogEvent -> !mwQueryLogEvent.isDeleted()).doOnNext(mwQueryLogEvent -> Timber.d("Image %s passed filters", mwQueryLogEvent.title())) .map(image -> { Contribution contribution = new Contribution(null, null, image.title(), "", -1, image.date(), image.date(), sessionManager.getAuthorName(), user, "", "", STATE_COMPLETED); return contribution; }) .toList() .subscribe(this::saveContributionsToDB, error -> { Timber.e("Failed to fetch contributions: %s", error.getMessage()); })); } }
Source:
<code>public void testBuildImageIdWithBuildargs() throws Exception { requireDockerApiVersionAtLeast("1.21", "build args"); <START> final String dockerDirectory = <END> Paths.get(Resources.getResource("dockerDirectoryWithBuildargs").toURI()).toString(); final String buildargs = "{\"testargument\":\"22-12-2015\"}"; final BuildParam buildParam = BuildParam.create("buildargs", URLEncoder.encode(buildargs, "UTF-8")); sut.build( Paths.get(dockerDirectory), "test-buildargs", buildParam ); }</code><technical_language>tests failing Windows machines</technical_language>

Target:
public void testBuildImageIdWithBuildargs() throws Exception { requireDockerApiVersionAtLeast("1.21", "build args"); final Path dockerDirectory = getResource("dockerDirectoryWithBuildargs"); final String buildargs = "{\"testargument\":\"22-12-2015\"}"; final BuildParam buildParam = BuildParam.create("buildargs", URLEncoder.encode(buildargs, "UTF-8")); sut.build(dockerDirectory, "test-buildargs", buildParam); }
Source:
<code>private static SliceHeader internalRead(int major, InputStream inputStream) throws IOException { final int sequenceId = ITF8.readUnsignedITF8(inputStream); final int alignmentStart = ITF8.readUnsignedITF8(inputStream); final int alignmentSpan = ITF8.readUnsignedITF8(inputStream); final int recordCount = ITF8.readUnsignedITF8(inputStream); final long globalRecordCounter = LTF8.readUnsignedLTF8(inputStream); final int blockCount = ITF8.readUnsignedITF8(inputStream); final int[] contentIDs = CramIntArray.array(inputStream); final int embeddedRefBlockContentID = ITF8.readUnsignedITF8(inputStream); <START> final byte[] referenceMD5s = new byte[MD5_LEN]; <END> InputStreamUtils.readFully(inputStream, referenceMD5s, 0, MD5_LEN); final byte[] tagBytes = InputStreamUtils.readFully(inputStream); final SAMBinaryTagAndValue tags = (major >= CramVersions.CRAM_v3.major) ? BinaryTagCodec.readTags(tagBytes, 0, tagBytes.length, ValidationStringency.DEFAULT_STRINGENCY) : null; return new SliceHeader(sequenceId, alignmentStart, alignmentSpan, recordCount, globalRecordCounter, blockCount, contentIDs, embeddedRefBlockContentID, referenceMD5s, tags); }</code><technical_language>Nit: this is MD5 need plural</technical_language>

Target:
private static SliceHeader internalRead(int major, InputStream inputStream) throws IOException { final int sequenceId = ITF8.readUnsignedITF8(inputStream); final int alignmentStart = ITF8.readUnsignedITF8(inputStream); final int alignmentSpan = ITF8.readUnsignedITF8(inputStream); final int recordCount = ITF8.readUnsignedITF8(inputStream); final long globalRecordCounter = LTF8.readUnsignedLTF8(inputStream); final int blockCount = ITF8.readUnsignedITF8(inputStream); final int[] contentIDs = CramIntArray.array(inputStream); final int embeddedRefBlockContentID = ITF8.readUnsignedITF8(inputStream); final byte[] referenceMD5 = new byte[MD5_LEN]; InputStreamUtils.readFully(inputStream, referenceMD5, 0, MD5_LEN); final byte[] tagBytes = InputStreamUtils.readFully(inputStream); final SAMBinaryTagAndValue sliceHeaderTags = (major >= CramVersions.CRAM_v3.major) ? BinaryTagCodec.readTags(tagBytes, 0, tagBytes.length, ValidationStringency.DEFAULT_STRINGENCY) : null; return new SliceHeader(sequenceId, alignmentStart, alignmentSpan, recordCount, globalRecordCounter, blockCount, contentIDs, embeddedRefBlockContentID, referenceMD5, sliceHeaderTags); }
Source:
<code><START> public void init() throws Exception { <END> initDataSource(); CertificateManagementDAOFactory.init(this.getDataSource()); }</code><technical_language>do beforeClass</technical_language>

Target:
public void init() throws Exception { initDataSource(); CertificateManagementDAOFactory.init(this.getDataSource()); Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); managementService = CertificateManagementServiceImpl.getInstance(); Assert.assertNotNull(managementService); log.info("getInstance Test Successful"); }
Source:
<code>protected boolean canDoAction() { if (getVm() == null) { <START> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); <END> return false; } if (getVm().getstatus() != VMStatus.MigratingFrom) { addCanDoActionMessage(VdcBllMessages.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING); return false; } return true; }</code><technical_language>missing set action type</technical_language>

Target:
protected boolean canDoAction() { if (getVm() == null) { addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM.toString()); addCanDoActionMessage(VdcBllMessages.VAR__ACTION__MIGRATE.toString()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); return false; } if (getVm().getstatus() != VMStatus.MigratingFrom) { addCanDoActionMessage(VdcBllMessages.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING); return false; } return true; }
Source:
<code>public TouchScreen getTouch() { <START> return new RemoteTouchScreen(this.getExecuteMethod()); <END> }</code><technical_language>store a local private variable (like locationContext / webStorage) inialize construction. fix indentation</technical_language>

Target:
public TouchScreen getTouch() { return touchScreen; }
Source:
<code>public Resource minify(Resource originalResource, String filename) { if (!getEnabled()) { LOG.trace(MINIFICATION_IS_DISABLED_RETURNING_ORIGINAL_RESOURCE); return originalResource; } String type = getFileType(originalResource, filename); if (type == null) { LOG.info("Unsupported minification resource: " + filename); return originalResource; } Integer filenameLength = originalResource.getFilename().length(); if (filenameLength >= JS_MIN.length()) { String lastSevenCharacters = originalResource.getFilename().substring(filenameLength-JS_MIN.length()); if (lastSevenCharacters.equals(JS_MIN)) { LOG.info("Minification already have done for this resource: " + filename); return originalResource; } <START> <END> } try (BufferedReader in = new BufferedReader(new InputStreamReader(originalResource.getInputStream(), "utf-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(baos, "utf-8"));) { minify(in, out, filename, type); out.flush(); return new GeneratedResource(baos.toByteArray(), filename); } catch (Exception e) { LOG.warn(COULD_NOT_MINIFY_RESOURCES_RETURNED_UNMINIFIED_BYTES, e); return originalResource; } }</code><technical_language>this logic in method if a client wants determine is a minified file do easily. Additionally this replaced if (StringUtils.endsWith(filename, JS_MIN)) { // Info log return resource } Typically apache commons StringUtils method for String operations. This for Collections, Integers, Longs, Arrays, etc. a good habit check if apache commons method instead reinvent wheel. If a feeling a library of static class ask in Slack channel "developers" able help</technical_language>

Target:
public Resource minify(Resource originalResource, String filename) { if (!getEnabled()) { LOG.trace(MINIFICATION_IS_DISABLED_RETURNING_ORIGINAL_RESOURCE); return originalResource; } String type = getFileType(originalResource, filename); if (type == null) { LOG.info("Unsupported minification resource: " + filename); return originalResource; } if (isPreviouslyMinifiedFile(originalResource)) { LOG.info("Minification has already be done for this resource: " + filename); return originalResource; } try (BufferedReader in = new BufferedReader(new InputStreamReader(originalResource.getInputStream(), "utf-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(baos, "utf-8"));) { minify(in, out, filename, type); out.flush(); return new GeneratedResource(baos.toByteArray(), filename); } catch (Exception e) { LOG.warn(COULD_NOT_MINIFY_RESOURCES_RETURNED_UNMINIFIED_BYTES, e); return originalResource; } }
Source:
<code><START> public void shouldNotDeleteThePipelineForUnauthorizedUsers() throws Exception { <END> assertThat(goConfigService.getAllPipelineConfigs().size(), is(1)); assertTrue(goConfigService.hasPipelineNamed(pipelineConfig.name())); pipelineConfigService.deletePipelineConfig(new Username(new CaseInsensitiveString("unauthorized-user")), pipelineConfig.name().toString(), result); assertFalse(result.isSuccessful()); assertThat(result.toString(), result.toString().contains("UNAUTHORIZED_TO_DELETE_PIPELINE"), is(true)); assertThat(result.httpCode(), is(401)); assertThat(goConfigService.getAllPipelineConfigs().size(), is(1)); assertTrue(goConfigService.hasPipelineNamed(pipelineConfig.name())); }</code><technical_language>This test check is made. In DeletePipelineConfigCommand</technical_language>

Target:
public void shouldNotDeleteThePipelineForUnauthorizedUsers() throws Exception { assertThat(goConfigService.getAllPipelineConfigs().size(), is(1)); assertTrue(goConfigService.hasPipelineNamed(pipelineConfig.name())); pipelineConfigService.deletePipelineConfig(new Username(new CaseInsensitiveString("unauthorized-user")), pipelineConfig, result); assertFalse(result.isSuccessful()); assertThat(result.toString(), result.toString().contains("UNAUTHORIZED_TO_DELETE_PIPELINE"), is(true)); assertThat(result.httpCode(), is(401)); assertThat(goConfigService.getAllPipelineConfigs().size(), is(1)); assertTrue(goConfigService.hasPipelineNamed(pipelineConfig.name())); }
Source:
<code>private static String findPath(IAdaptable adaptable) { String result = null; final IResourceVariant variant = (IResourceVariant)adaptable.getAdapter(IResourceVariant.class); if (variant != null) { try { final IStorage storage = variant.getStorage(new NullProgressMonitor()); <START> final Object adapter = Platform.getAdapterManager().loadAdapter(storage, <END> IStoragePathProvider.class.getName()); if (adapter instanceof IStoragePathProvider) { final IPath fixedPath = ((IStoragePathProvider)adapter).computeFixedPath(storage); result = fixedPath.toString(); } else if (variant instanceof CachedResourceVariant) { result = ((CachedResourceVariant)variant).getDisplayPath().toString(); } else if (storage instanceof IFile) { result = storage.getFullPath().toString(); } } catch (TeamException e) { } } return result; }</code><technical_language>wondering test for storage null. check please, know? (Does loadAdapter support a null param, is variant.getStorage(...) returns null</technical_language>

Target:
private static String findPath(IAdaptable adaptable) { String result = null; final IResourceVariant variant = (IResourceVariant)adaptable.getAdapter(IResourceVariant.class); if (variant != null) { try { final IStorage storage = variant.getStorage(new NullProgressMonitor()); if (storage != null) { final Object adapter = Platform.getAdapterManager().loadAdapter(storage, IStoragePathProvider.class.getName()); if (adapter instanceof IStoragePathProvider) { final IPath fixedPath = ((IStoragePathProvider)adapter).computeFixedPath(storage); result = fixedPath.toString(); } else if (storage instanceof IFile) { result = storage.getFullPath().toString(); } } else if (variant instanceof CachedResourceVariant) { result = ((CachedResourceVariant)variant).getDisplayPath().toString(); } } catch (TeamException e) { } } return result; }
Source:
<code>public void testSortDue() { DateRange today = TaskActivityUtil.getCurrentWeek().getToday(); DateRange tomorrow = TaskActivityUtil.getCurrentWeek().getToday().next(); DateRange yesterday = TaskActivityUtil.getCurrentWeek().getToday().previous(); task1.setDueDate(new Date(today.getStartDate().toInstant().toEpochMilli())); assertEquals(-1, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(1, sorter.compare(new EmptyViewer(), task2, task1)); task2.setDueDate(new Date(tomorrow.getStartDate().toInstant().toEpochMilli())); assertEquals(-1, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(1, sorter.compare(new EmptyViewer(), task2, task1)); <START> task2.setDueDate(new Date(yesterday.getStartDate().toInstant().toEpochMilli())); <END> assertEquals(0, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(0, sorter.compare(new EmptyViewer(), task2, task1)); }</code><technical_language>Is a reason for Calendar.getTimeInMillis()</technical_language>

Target:
public void testSortDue() { DateRange today = TaskActivityUtil.getCurrentWeek().getToday(); DateRange tomorrow = TaskActivityUtil.getCurrentWeek().getToday().next(); DateRange yesterday = TaskActivityUtil.getCurrentWeek().getToday().previous(); task1.setDueDate(new Date(today.getStartDate().getTimeInMillis())); assertEquals(-1, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(1, sorter.compare(new EmptyViewer(), task2, task1)); task2.setDueDate(new Date(tomorrow.getStartDate().getTimeInMillis())); assertEquals(-1, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(1, sorter.compare(new EmptyViewer(), task2, task1)); task2.setDueDate(new Date(yesterday.getStartDate().getTimeInMillis())); assertEquals(0, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(0, sorter.compare(new EmptyViewer(), task2, task1)); }
Source:
<code>public void removeAllPrivateWorkerKeys(String topologyId) { for (WorkerTokenServiceType type : WorkerTokenServiceType.values()) { String path = ClusterUtils.secretKeysPath(type, topologyId); try { <START> LOG.debug("Removing worker keys under {}", path); <END> stateStorage.delete_node(path); } catch (RuntimeException e) { if (!Utils.exceptionCauseIsInstanceOf(KeeperException.NoNodeException.class, e)) { throw e; } } } }</code><technical_language>If this hit often, I vote for making this info</technical_language>

Target:
public void removeAllPrivateWorkerKeys(String topologyId) { for (WorkerTokenServiceType type : WorkerTokenServiceType.values()) { String path = ClusterUtils.secretKeysPath(type, topologyId); try { LOG.info("Removing worker keys under {}", path); stateStorage.delete_node(path); } catch (RuntimeException e) { if (!Utils.exceptionCauseIsInstanceOf(KeeperException.NoNodeException.class, e)) { throw e; } } } }
Source:
<code>public void setDisabledAdministrativeMonitors(Set<String> disabledAdministrativeMonitors){ <START> this.disabledAdministrativeMonitors = disabledAdministrativeMonitors; <END> }</code><technical_language>cloned instead of a reference external object</technical_language>

Target:
public void setDisabledAdministrativeMonitors(Set<String> disabledAdministrativeMonitors) { synchronized (this.disabledAdministrativeMonitors) { this.disabledAdministrativeMonitors.clear(); this.disabledAdministrativeMonitors.addAll(disabledAdministrativeMonitors); } }
Source:
<code><START> public void rename() throws InterruptedException { <END> try { if (!hasOnlyOneSelection()) { return; } List<Integer> folderIds = getMainController().getPortalSession().getSelectedFolderIds(); if (folderIds.size() == 0) { renameLogOrProcess(); } else { renameFolder(); } } catch (DialogException e) { Messagebox.show(e.getMessage(), "Attention", Messagebox.OK, Messagebox.ERROR); } }</code><technical_language>is a slight beter do write this. do</technical_language>

Target:
public void rename() throws InterruptedException { try { if (!isSingleFileSelected()) { Notification.error("Please select single file or folder to rename"); return; } List<Integer> folderIds = getMainController().getPortalSession().getSelectedFolderIds(); if (folderIds.size() == 0) { renameLogOrProcess(); } else { renameFolder(); } } catch (DialogException e) { Messagebox.show(e.getMessage(), "Attention", Messagebox.OK, Messagebox.ERROR); } }
Source:
<code>public Set<Role> getRoles(final Project project) { notNull(project, "project"); final Roles roles = restTemplate.getForObject(Roles.URI, Roles.class, project.getId()); <START> final HashSet<Role> result = new HashSet<>(); <END> for (String roleUri : roles.getRoles()) { final Role role = restTemplate.getForObject(roleUri, Role.class); role.setUri(roleUri); result.add(role); } return result; }</code><technical_language>Set interface</technical_language>

Target:
public Set<Role> getRoles(final Project project) { notNull(project, "project"); final Roles roles = restTemplate.getForObject(Roles.URI, Roles.class, project.getId()); final Set<Role> result = new HashSet<>(); for (String roleUri : roles.getRoles()) { final Role role = restTemplate.getForObject(roleUri, Role.class); role.setUri(roleUri); result.add(role); } return result; }
Source:
<code>public void testTransformXDRResponseToCheckPolicy() throws Exception { XDRResponseEventType eventA = new XDRResponseEventType(); HomeCommunityType hct = new HomeCommunityType(); hct.setHomeCommunityId(TEST_HC_VAL); hct.setName("bcd"); hct.setDescription("jkl"); <START> AssertionType assertionTypeTest = new AssertionType(); <END> assertionTypeTest.setMessageId(MESSAGE_ID); SlotType1 slotType1 = new SlotType1(); slotType1.setName("$XDSDocumentEntryPatientId"); ValueListType valueListType = new ValueListType(); valueListType.getValue().add("1111.4444^^^&amp;26.489.22&amp;ISO"); slotType1.setValueList(valueListType); PersonNameType pnt = new PersonNameType(); pnt.setFullName("abc"); assertionTypeTest.setPersonName(pnt); SlotListType rsl = new SlotListType(); rsl.getSlot().add(slotType1); SubmitObjectsRequest sor = new SubmitObjectsRequest(); sor.setId("100"); sor.setRequestSlotList(rsl); RegistryResponseType prdsrt = new RegistryResponseType(); prdsrt.setResponseSlotList(rsl); prdsrt.setRequestId("1235"); RegistryObjectListType rolt = new RegistryObjectListType(); sor.setRegistryObjectList(rolt); XDRResponseMessageType xmt = new XDRResponseMessageType(); eventA.setMessage(xmt); xmt.setAssertion(assertionTypeTest); xmt.setRegistryResponse(prdsrt); assertionTypeTest.setHomeCommunity(hct); assertionTypeTest.setSSN("170112756"); eventA.setSendingHomeCommunity(hct); String direction = "inbound"; eventA.setDirection(direction); eventA.getMessage().setAssertion(assertionTypeTest); RequestType request = new RequestType(); SubjectHelper subjHelp = new SubjectHelper(); SubjectType subject = subjHelp.subjectFactory(hct, assertionTypeTest); request.getSubject().add(subject); CheckPolicyRequestType result = xdrTransformHelper.transformXDRResponseToCheckPolicy(eventA); verifycheckPolicy_Request(result, direction); }</code><technical_language>suggest rename assertionType instead of assertionTypeTest</technical_language>

Target:
public void testTransformXDRResponseToCheckPolicy() throws Exception { XDRResponseEventType eventA = new XDRResponseEventType(); assertionType.setMessageId(MESSAGE_ID); pnt.setFullName("Minh"); assertionType.setPersonName(pnt); rsl.getSlot().add(slotType1); sor.setId("100"); sor.setRequestSlotList(rsl); RegistryResponseType prdsrt = new RegistryResponseType(); prdsrt.setResponseSlotList(rsl); prdsrt.setRequestId("1235"); sor.setRegistryObjectList(rolt); XDRResponseMessageType xmt = new XDRResponseMessageType(); eventA.setMessage(xmt); xmt.setAssertion(assertionType); xmt.setRegistryResponse(prdsrt); assertionType.setHomeCommunity(hct); assertionType.setSSN("170112756"); eventA.setSendingHomeCommunity(hct); String direction = "inbound"; eventA.setDirection(direction); eventA.getMessage().setAssertion(assertionType); RequestType request = new RequestType(); SubjectHelper subjHelp = new SubjectHelper(); SubjectType subject = subjHelp.subjectFactory(hct, assertionType); request.getSubject().add(subject); CheckPolicyRequestType result = xdrTransformHelper.transformXDRResponseToCheckPolicy(eventA); verifycheckPolicy_Request(result); }
Source:
<code>public void testResourceListPropertyDirectory() throws Exception { PherfConstants constants = PherfConstants.create(); assertNotNull(constants.getProperty("pherf.default.dataloader.threadpool")); assertNotNull(constants.getProperty("pherf.default.results.dir")); <START> assertNotNull(constants.getProperty("pherf.default.log_per_nrows")); <END> }</code><technical_language>constant for string</technical_language>

Target:
public void testResourceListPropertyDirectory() throws Exception { PherfConstants constants = PherfConstants.create(); assertNotNull(constants.getProperty("pherf.default.dataloader.threadpool")); assertNotNull(constants.getProperty("pherf.default.results.dir")); assertNotNull(constants.getProperty(PherfConstants.LOG_PER_NROWS_NAME)); }
Source:
<code>protected Object doExecute() throws Exception { <START> checkNotNull(template, "You must choose a template for the image you are trying to create."); <END> Provisionr service = getService(); final Pool pool = createPoolOfOne(service); final String processInstanceId = service.startPoolManagementProcess("j-" + UUID.randomUUID().toString(), pool); return String.format("Pool management process started (id: %s)", processInstanceId); }</code><technical_language>I a template mandatory. list of packages command line</technical_language>

Target:
protected Object doExecute() throws Exception { Provisionr service = getService(); final Pool pool = createPoolOfOne(service); return null; }
Source:
<code>public void testExpandValueSetInMemoryRespectsMaxSize() { createCodeSystem(); CustomTerminologySet additions = new CustomTerminologySet(); for (int i = 0; i < 100; i++) { additions.addRootConcept("CODE" + i, "Display " + i); } myTermCodeSystemStorageSvc.applyDeltaCodeSystemsAdd(CS_URL, additions); myDaoConfig.setMaximumExpansionSize(50); ValueSet vs = new ValueSet(); ValueSet.ConceptSetComponent include = vs.getCompose().addInclude(); include.setSystem(CS_URL); try { ValueSet expansion = myTermSvc.expandValueSet(null, vs); <START> fail("Expanded to " + expansion.getExpansion().getContains().size() + " but mas was " + myDaoConfig.getMaximumExpansionSize()); <END> } catch (InternalErrorException e) { assertEquals("Expansion of ValueSet produced too many codes (maximum 50) - Operation aborted!", e.getMessage()); } myDaoConfig.setMaximumExpansionSize(150); vs = new ValueSet(); include = vs.getCompose().addInclude(); include.setSystem(CS_URL); ValueSet outcome = myTermSvc.expandValueSet(null, vs); assertEquals(109, outcome.getExpansion().getContains().size()); }</code><technical_language>Typo. suggestion fail("Expanded " + expansion.getExpansion().getContains().size() + " max " + myDaoConfig.getMaximumExpansionSize());</technical_language>

Target:
public void testExpandValueSetInMemoryRespectsMaxSize() { createCodeSystem(); CustomTerminologySet additions = new CustomTerminologySet(); for (int i = 0; i < 100; i++) { additions.addRootConcept("CODE" + i, "Display " + i); } myTermCodeSystemStorageSvc.applyDeltaCodeSystemsAdd(CS_URL, additions); myDaoConfig.setMaximumExpansionSize(50); ValueSet vs = new ValueSet(); ValueSet.ConceptSetComponent include = vs.getCompose().addInclude(); include.setSystem(CS_URL); try { ValueSet expansion = myTermSvc.expandValueSet(null, vs); fail("Expanded to " + expansion.getExpansion().getContains().size() + " but max was " + myDaoConfig.getMaximumExpansionSize()); } catch (InternalErrorException e) { assertEquals("Expansion of ValueSet produced too many codes (maximum 50) - Operation aborted!", e.getMessage()); } myDaoConfig.setMaximumExpansionSize(150); vs = new ValueSet(); include = vs.getCompose().addInclude(); include.setSystem(CS_URL); ValueSet outcome = myTermSvc.expandValueSet(null, vs); assertEquals(109, outcome.getExpansion().getContains().size()); }
Source:
<code><START> public String createGroupName(Object[] childrenGroup) { <END> final String baseName = NAME_NEW_VARIABLE_GROUP; String name = baseName; int index = 1; while (!checkNameSubgroup(name, childrenGroup)) name = baseName + "_" + Integer.toString(index++); return name + NAME_ROOT_GROUP; }</code><technical_language>check helpers, some static</technical_language>

Target:
public String createGroupName(Object[] childrenGroup) { final String baseName = NAME_NEW_VARIABLE_GROUP; String name = baseName; int index = 1; while (!checkNameSubgroup(name, childrenGroup)) name = baseName + " " + Integer.toString(index++); return name + Path.ROOT.toString(); }
Source:
<code>public VmLeaseParameters(Guid storagePoolId, Guid storageDomainId, Guid vmId) { this.storagePoolId = storagePoolId; this.storageDomainId = storageDomainId; this.vmId = vmId; <START> this.vmName = null; <END> }</code><technical_language>call new ctr here, move initializations it. i.e.: public VmLeaseParameters(Guid storagePoolId, Guid storageDomainId, Guid vmId) { this(storagePoolId, storageDomainId,vmId, null); } public VmLeaseParameters(Guid storagePoolId, Guid storageDomainId, Guid vmId, String vmName) { this.storagePoolId = storagePoolId; this.storageDomainId = storageDomainId; this.vmId = vmId; this.vmName = vmName; }</technical_language>

Target:
public VmLeaseParameters(Guid storagePoolId, Guid storageDomainId, Guid vmId) { this.storagePoolId = storagePoolId; this.storageDomainId = storageDomainId; this.vmId = vmId; }
Source:
<code><START> public boolean supports(CredentialItem... items) { <END> for (CredentialItem i : items) { if (i instanceof CredentialItem.Username) continue; else if (i instanceof CredentialItem.Password) continue; else if (i instanceof CredentialItem.YesNoType) continue; else return false; } return true; }</code><technical_language>Indentation is spaces tabs</technical_language>

Target:
public boolean supports(CredentialItem... items) { for (CredentialItem i : items) { if (i instanceof CredentialItem.Password) continue; if (i instanceof CredentialItem.StringType) continue; if (i instanceof CredentialItem.Username) continue; if (i instanceof CredentialItem.YesNoType) continue; return false; } return true; }