auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private Boolean handleCancelResponse(String chargeExternalId, GatewayResponse<BaseCancelResponse> cancelResponse) { <END> return cancelResponse.getBaseResponse() .map(r -> BaseCancelResponse.CancelStatus.CANCELLED.equals(r.cancelStatus()) || BaseCancelResponse.CancelStatus.SUBMITTED.equals(r.cancelStatus())) .orElseGet(() -> { cancelResponse.getGatewayError().ifPresent( e -> logger.info("Could not cancel charge {}. Gateway error {}", chargeExternalId, e.getMessage())); return false; }); }</code><technical_language>[minor] (slightly) naming - hasCancellationSucceeded (more standard naming). handle is a bit generic for in this case method determines successful not</technical_language>

Target:
private Boolean handleCancelResponse(String chargeExternalId, GatewayResponse<BaseCancelResponse> cancelResponse) { return cancelResponse.getBaseResponse() .map(r -> { if (BaseCancelResponse.CancelStatus.ERROR.equals(r.cancelStatus())) { logger.info("Could not cancel charge {}. Gateway returned error", chargeExternalId); return false; } else { return true; } }) .orElseGet(() -> { cancelResponse.getGatewayError().ifPresent( e -> logger.info("Could not cancel charge {}. Gateway error {}", chargeExternalId, e.getMessage())); return false; }); }
Source:
<code><START> public boolean error(Throwable error) { <END> return true; }</code><technical_language>consider this a completeExceptionally case. need return anything</technical_language>

Target:
public void error(Throwable error) { }
Source:
<code><START> protected BaseFileSystem(FileSystemContext fsContext) { <END> mFsContext = fsContext; mBlockStore = AlluxioBlockStore.create(fsContext); mCloser.register(mFsContext); }</code><technical_language>@apc999 This needs public reflection work</technical_language>

Target:
public BaseFileSystem(FileSystemContext fsContext) { mFsContext = fsContext; mBlockStore = AlluxioBlockStore.create(fsContext); mCloser.register(mFsContext); }
Source:
<code>public SearchRequestBuilder buildScrollSearchRequest() { StringBuilder shardBuilder = new StringBuilder("_shards:"); shardBuilder.append(shard); <START> SearchRequestBuilder searchRequestBuilder = client.prepareSearch(index != null && !index.isEmpty() ? index : "_all").setTypes(type).setSearchType(SearchType.QUERY_AND_FETCH).setScroll(new TimeValue(scrollTime)).setQuery(buildSearchQuery()).setPreference(shardBuilder.toString()).setSize(scrollSize); <END> log.info("ElasticSearch Request: " + searchRequestBuilder.toString()); return searchRequestBuilder; }</code><technical_language>String indices = index != null && !index.isEmpty() ? index : "_all"; SearchRequestBuilder searchRequestBuilder = client.prepareSearch(indices) .setTypes(type) .setSearchType(SearchType.QUERY_AND_FETCH) .setScroll(new TimeValue(scrollTime)) .setQuery(buildSearchQuery()) .setPreference(shardBuilder.toString()) .setSize(scrollSize);</technical_language>

Target:
public SearchRequestBuilder buildScrollSearchRequest() { String indices = index != null && !index.isEmpty() ? index : "_all"; SearchRequestBuilder searchRequestBuilder = client.prepareSearch(indices) .setTypes(type) .setSearchType(SearchType.QUERY_THEN_FETCH) .setScroll(new TimeValue(scrollTimeout.toMillis())) .setQuery(buildSearchQuery()) .setPreference("_shards:" + shard) .setSize(scrollSize); log.debug("ElasticSearch Request: " + searchRequestBuilder.toString()); return searchRequestBuilder; }
Source:
<code>private void processItemSets(File formMediaDir) { String relativeCsvFilePath = formMediaDir.getName() + File.separator + ITEMSETS_CSV; final File csv = new File(formMediaDir.getAbsolutePath() + "/" + ITEMSETS_CSV); String csvmd5 = null; if (csv.exists()) { csvmd5 = FileUtils.getMd5Hash(csv); boolean readFile = false; final ItemsetDbAdapter ida = new ItemsetDbAdapter(); ida.open(); <START> final Cursor c = ida.getItemsets(relativeCsvFilePath); <END> if (c != null) { if (c.getCount() == 1) { c.moveToFirst(); final String oldmd5 = c.getString(c.getColumnIndex("hash")); if (oldmd5.equals(csvmd5)) { } else { ida.dropTable(ItemsetDbAdapter.getMd5FromString(csv.getAbsolutePath()), relativeCsvFilePath); readFile = true; } } else { readFile = true; } c.close(); } ida.close(); if (readFile) { readCSV(csv, csvmd5, ItemsetDbAdapter.getMd5FromString(csv.getAbsolutePath()), relativeCsvFilePath); } } }</code><technical_language>This behavior before. If this is based path, expect needing getFormFilePath (the method builds database paths based scoped storage is used)</technical_language>

Target:
private void processItemSets(File formMediaDir) { final File csv = new File(formMediaDir.getAbsolutePath() + "/" + ITEMSETS_CSV); String csvmd5 = null; if (csv.exists()) { csvmd5 = FileUtils.getMd5Hash(csv); boolean readFile = false; final ItemsetDbAdapter ida = new ItemsetDbAdapter(); ida.open(); final Cursor c = ida.getItemsets(csv.getAbsolutePath()); if (c != null) { if (c.getCount() == 1) { c.moveToFirst(); final String oldmd5 = c.getString(c.getColumnIndex("hash")); if (oldmd5.equals(csvmd5)) { } else { ida.dropTable(ItemsetDbAdapter.getMd5FromString(csv.getAbsolutePath()), csv.getAbsolutePath()); readFile = true; } } else { readFile = true; } c.close(); } ida.close(); if (readFile) { readCSV(csv, csvmd5, ItemsetDbAdapter.getMd5FromString(csv.getAbsolutePath())); } } }
Source:
<code>public InputStream getGenericThumbnailInputStream(String fallback) throws IOException { String thumb = fallback; if (format != null && format.getIcon() != null) { thumb = format.getIcon(); } InputStream is; if (thumb != null && isCodeValid(this)) { if (new File(thumb).exists()) { return new FileInputStream(thumb); } if ((is = getResourceInputStream(thumb)) != null) { return is; } try { return downloadAndSend(thumb, true); } catch (Exception e) } if (media != null) { BufferedImage bi; if (media.isAudio()) { bi = PMS.getGenericAudioIcon(); } else if (media.isImage()) { bi = PMS.getGenericImageIcon(); } else if (media.isVideo()) { bi = PMS.getGenericVideoIcon(); } else { bi = PMS.getGenericUnknownIcon(); } is = ImagesUtil.addFormatLabelToImage(bi, media.getContainer(), defaultRenderer != null && defaultRenderer.isForceJPGThumbnails() ? "jpeg" : "png"); if (is != null) { <START> LOGGER.trace("Created default thumbnail/icon for the media: {}", getName()); <END> return is; } } String defaultThumbnailImage = "images/thumbnail-video-256.png"; if (isFolder()) { defaultThumbnailImage = "images/thumbnail-folder-256.png"; if (defaultRenderer != null && defaultRenderer.isForceJPGThumbnails()) { defaultThumbnailImage = "images/thumbnail-folder-120.jpg"; } } else if (defaultRenderer != null && defaultRenderer.isForceJPGThumbnails()) { defaultThumbnailImage = "images/thumbnail-video-120.jpg"; } LOGGER.debug("use def thumb " + defaultThumbnailImage); return getResourceInputStream(defaultThumbnailImage); }</code><technical_language>work expected this message is displayed, is type of media</technical_language>

Target:
public final DLNAThumbnailInputStream getGenericThumbnailInputStream(String fallback) throws IOException { DLNAThumbnailInputStream inputStream = getGenericThumbnailInputStreamInternal(fallback); thumbnailImageInfo = inputStream.getImageInfo(); return inputStream; }
Source:
<code>public SegmentMetadataQueryTest() { testQuery = Druids.newSegmentMetadataQueryBuilder() .dataSource("testing") .intervals("2013/2014") .toInclude(new ListColumnIncluderator(Arrays.asList("placement"))) .merge(true) .build(); expectedSegmentAnalysis = new SegmentAnalysis( "testSegment", ImmutableList.of( new Interval("2011-01-12T00:00:00.000Z/2011-04-15T00:00:00.001Z") ), ImmutableMap.of( "placement", new ColumnAnalysis( ValueType.STRING.toString(), 10881, 2, null ) <START> ), 73191 <END> ); }</code><technical_language>explain this change</technical_language>

Target:
public SegmentMetadataQueryTest() { testQuery = Druids.newSegmentMetadataQueryBuilder() .dataSource("testing") .intervals("2013/2014") .toInclude(new ListColumnIncluderator(Arrays.asList("placement"))) .analysisTypes(null) .merge(true) .build(); expectedSegmentAnalysis = new SegmentAnalysis( "testSegment", ImmutableList.of( new Interval("2011-01-12T00:00:00.000Z/2011-04-15T00:00:00.001Z") ), ImmutableMap.of( "placement", new ColumnAnalysis( ValueType.STRING.toString(), 10881, 2, null ) ), 71982, 1209 ); }
Source:
<code>public <T> Optional<T> showChoiceDialogAndWait(String title, String content, String okButtonLabel, T defaultChoice, Collection<T> choices) { ChoiceDialog<T> choiceDialog = new ChoiceDialog<>(defaultChoice, choices); ((Stage) choiceDialog.getDialogPane().getScene().getWindow()).getIcons().add(IconTheme.getJabRefImageFX()); ButtonType okButtonType = new ButtonType(okButtonLabel, ButtonBar.ButtonData.OK_DONE); choiceDialog.getDialogPane().getButtonTypes().setAll(ButtonType.CANCEL, okButtonType); choiceDialog.setHeaderText(title); choiceDialog.setTitle(title); choiceDialog.setContentText(content); <START> Globals.getThemeLoader().installCss(choiceDialog.getDialogPane().getScene(), Globals.prefs); <END> return choiceDialog.showAndWait(); }</code><technical_language>remove Globals class (in long term). facilitate this, please extract themeLoader preferences, initialize passing global objects dependencies constructor (i.e. move Globals this class caller)</technical_language>

Target:
public <T> Optional<T> showChoiceDialogAndWait(String title, String content, String okButtonLabel, T defaultChoice, Collection<T> choices) { ChoiceDialog<T> choiceDialog = new ChoiceDialog<>(defaultChoice, choices); ((Stage) choiceDialog.getDialogPane().getScene().getWindow()).getIcons().add(IconTheme.getJabRefImageFX()); ButtonType okButtonType = new ButtonType(okButtonLabel, ButtonBar.ButtonData.OK_DONE); choiceDialog.getDialogPane().getButtonTypes().setAll(ButtonType.CANCEL, okButtonType); choiceDialog.setHeaderText(title); choiceDialog.setTitle(title); choiceDialog.setContentText(content); themeLoader.installCss(choiceDialog.getDialogPane().getScene(), preferences); return choiceDialog.showAndWait(); }
Source:
<code>TDigestGenerateSketchSqlAggFunction() { super( NAME, null, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(SqlTypeName.OTHER), null, <START> OperandTypes.and( <END> OperandTypes.sequence(SIGNATURE2, OperandTypes.ANY, OperandTypes.LITERAL), OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC) ), SqlFunctionCategory.USER_DEFINED_FUNCTION, false, false ); }</code><technical_language>agg function adjusted support optional compression param in quantile version</technical_language>

Target:
TDigestGenerateSketchSqlAggFunction() { super( NAME, null, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(SqlTypeName.OTHER), null, OperandTypes.or( OperandTypes.ANY, OperandTypes.and( OperandTypes.sequence(SIGNATURE_WITH_COMPRESSION, OperandTypes.ANY, OperandTypes.LITERAL), OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC) ) ), SqlFunctionCategory.USER_DEFINED_FUNCTION, false, false ); }
Source:
<code>private boolean isManagementNetworkChanged(){ String mgmtNetworkName = managementNetworkUtil.getManagementNetwork(getVds().getVdsGroupId()).getName(); for (HostNetwork network : getNetworksToConfigure()) { if (mgmtNetworkName.equals(network.getNetworkName())){ return true; } } <START> for (Bond bond : getParameters().getBonds()) { <END> if (mgmtNetworkName.equals(bond.getNetworkName())){ return true; } } return false; }</code><technical_language>rely of 'networkName' in 'getParameters().getBonds()'. This property of bond is validated command. In future plan stop Bond parameter a class needed properties</technical_language>

Target:
private boolean isManagementNetworkChanged(){ List<NetworkAttachment> newAttachments = getParameters().getNetworkAttachments(); List<NetworkAttachment> existingAttachments = this.existingAttachments; String mgmtNetworkName = managementNetworkUtil.getManagementNetwork(getVds().getVdsGroupId()).getName(); for (HostNetwork network : getNetworksToConfigure()) { if (mgmtNetworkName.equals(network.getNetworkName())){ return true; } } for (Bond bond : getParameters().getBonds()) { VdsNetworkInterface bondNic = existingNicsBusinessEntityMap.get(bond.getId()); if (bondNic != null && mgmtNetworkName.equals(bondNic.getNetworkName())) { return true; } } return false; }
Source:
<code>public synchronized V remove(Object key) { if (!super.containsKey(key)) { return null; } Integer currentCount = this.updateReference(key, -1); if (currentCount == 0) { <START> counterMap.remove(key); <END> V value = super.remove(key); if (cleanerCallback != null) { cleanerCallback.call(value); } return value; } else { return super.get(key); } }</code><technical_language>consider moving this updateReference. I nice counterMap interactions</technical_language>

Target:
public synchronized V remove(Object key) { if (!super.containsKey(key)) { return null; } Integer currentCount = this.updateReference(key, -1); if (currentCount <= 0) { V value = super.remove(key); if (cleanerCallback != null) { cleanerCallback.call(value); } return value; } else { return super.get(key); } }
Source:
<code>public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, this::verifyContentType); <START> before("", mimeType, this.apiAuthenticationHelper::checkUserAnd403); <END> before("/*", mimeType, this.apiAuthenticationHelper::checkUserAnd403); get("", mimeType, this::index); }); }</code><technical_language>this accessed user? this restricted users permission access pipeline</technical_language>

Target:
public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, this::verifyContentType); before("", mimeType, this.apiAuthenticationHelper::checkPipelineViewPermissionsAnd403); before("/*", mimeType, this.apiAuthenticationHelper::checkPipelineViewPermissionsAnd403); get("", mimeType, this::index); }); }
Source:
<code><START> public static TreeMap<String, String> convertToCaseInsensitiveMap(Map<String, String> hashMap) { <END> return hashMap.entrySet().stream() .collect(toMap( Map.Entry::getKey, Map.Entry::getValue, (oldVal, newVal) -> newVal, () -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER) )); }</code><technical_language>introduced dependency WebClient RestTemplate - why? do depend other? making this method public means part of a contract changed. proverb says: "A copying is a dependency."</technical_language>

Target:
private TreeMap<String, String> convertToCaseInsensitiveMap(Map<String, String> hashMap) { return hashMap.entrySet().stream() .collect(toMap( Map.Entry::getKey, Map.Entry::getValue, (oldVal, newVal) -> newVal, () -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER) )); }
Source:
<code>public String urlForImageWith(ImageOption... options) { if (options == null || options.length == 0) { throw new IllegalArgumentException("Do not use empty options argument. " + "If you want to manipulate the url by hand, please use `CDAAsset.url()` instead."); } final String mimeType = mimeType(); if (mimeType == null || !mimeType.startsWith("image")) { <START> throw new IllegalStateException("Asset has not image mime type. Please make sure it is " + <END> "of jpg, png, or webp format."); } final Map<String, ImageOption> mappedOptions = new LinkedHashMap<String, ImageOption>(options.length); for (final ImageOption option : options) { mappedOptions.put(option.getOperation(), option); } String url = url(); for (final ImageOption option : mappedOptions.values()) { url = option.apply(url); } return url; }</code><technical_language>This error message reads a bit strange. I propose alternative: Asset image mime type</technical_language>

Target:
public String urlForImageWith(ImageOption... options) { if (options == null || options.length == 0) { throw new IllegalArgumentException("Do not use empty options argument. " + "If you want to manipulate the url by hand, please use `CDAAsset.url()` instead."); } final String mimeType = mimeType(); if (mimeType == null || !mimeType.startsWith("image")) { throw new IllegalStateException("Asset does not have an image mime type."); } final Map<String, ImageOption> mappedOptions = new LinkedHashMap<String, ImageOption>(options.length); for (final ImageOption option : options) { mappedOptions.put(option.getOperation(), option); } String url = url(); for (final ImageOption option : mappedOptions.values()) { url = option.apply(url); } return url; }
Source:
<code>private HeartbeatResponse heartbeat(final Lock lock) { <START> Id lockHeartbeat = heartbeatId.withTag("lockName", lock.getName().toLowerCase()); <END> Lock extendedLock = lock; try { extendedLock = tryUpdateLock(lock, lock.nextVersion()); registry.counter(lockHeartbeat.withTag("status", "SUCCESS")).increment(); return new HeartbeatResponse(extendedLock, LockStatus.ACQUIRED); } catch (Exception e) { if (e instanceof LockExpiredException) { registry.counter(lockHeartbeat.withTag("status", "EXPIRED")).increment(); return new HeartbeatResponse(extendedLock, LockStatus.EXPIRED); } log.error("Heartbeat failed for lock {}", extendedLock, e); registry.counter(lockHeartbeat.withTag("status", "ERROR")).increment(); return new HeartbeatResponse(extendedLock, LockStatus.ERROR); } }</code><technical_language>case though</technical_language>

Target:
private HeartbeatResponse heartbeat(final Lock lock) { Id lockHeartbeat = heartbeatId.withTag("lockName", lock.getName()); Lock extendedLock = lock; try { extendedLock = tryUpdateLock(lock, lock.nextVersion()); registry.counter(lockHeartbeat.withTag("status", LockStatus.ACQUIRED.toString())).increment(); return new HeartbeatResponse(extendedLock, LockStatus.ACQUIRED); } catch (Exception e) { if (e instanceof LockExpiredException) { registry.counter(lockHeartbeat.withTag("status", LockStatus.EXPIRED.toString())).increment(); return new HeartbeatResponse(extendedLock, LockStatus.EXPIRED); } log.error("Heartbeat failed for lock {}", extendedLock, e); registry.counter(lockHeartbeat.withTag("status", LockStatus.ERROR.toString())).increment(); return new HeartbeatResponse(extendedLock, LockStatus.ERROR); } }
Source:
<code>public synchronized void recordSent(final Operator operator, final int numTuples, final int destWorkerId) throws DbException { SubQueryId sq = operator.getSubQueryId(); <START> events.putLong(0, sq.getQueryId()); <END> events.putInt(1, (int) sq.getSubqueryId()); sent.putInt(2, operator.getFragmentId()); sent.putLong(3, getTime(operator)); sent.putLong(4, numTuples); sent.putInt(5, destWorkerId); flush(MyriaConstants.SENT_PROFILING_RELATION, sent.popFilled()); }</code><technical_language>this sent, right</technical_language>

Target:
public synchronized void recordSent(final Operator operator, final int numTuples, final int destWorkerId) throws DbException { SubQueryId sq = operator.getSubQueryId(); sent.putLong(0, sq.getQueryId()); sent.putInt(1, (int) sq.getSubqueryId()); sent.putInt(2, operator.getFragmentId()); sent.putLong(3, getTime(operator)); sent.putLong(4, numTuples); sent.putInt(5, destWorkerId); flush(MyriaConstants.SENT_PROFILING_RELATION, sent.popFilled()); }
Source:
<code>public Map<Cell, byte[]> get(TableReference tableRef, Set<Cell> cells) { if (cells.isEmpty()) { if (log.isTraceEnabled()) { <START> log.trace(String.format("Attempted get on %s table with empty cells argument", tableRef), new Exception()); <END> } else if (log.isDebugEnabled()) { log.debug("Attempted get on '{}' table with empty cells argument", tableRef); } return ImmutableMap.of(); } Set<Cell> toLoad = Sets.newHashSet(); Map<Cell, byte[]> cacheHit = Maps.newHashMapWithExpectedSize(cells.size()); for (Cell cell : cells) { byte[] val = getCachedCellIfPresent(tableRef, cell); if (val != null) { if (val.length > 0) { cacheHit.put(cell, val); } } else { toLoad.add(cell); } } final Map<Cell, byte[]> loaded = super.get(tableRef, toLoad); cacheLoadedCells(tableRef, toLoad, loaded); cacheHit.putAll(loaded); return cacheHit; }</code><technical_language>String.format necessary, logger do params + throwable: log.trace("Attempted get table empty cells argument", tableRef, new Exception())</technical_language>

Target:
public Map<Cell, byte[]> get(TableReference tableRef, Set<Cell> cells) { if (cells.isEmpty()) { return ImmutableMap.of(); } Set<Cell> toLoad = Sets.newHashSet(); Map<Cell, byte[]> cacheHit = Maps.newHashMapWithExpectedSize(cells.size()); for (Cell cell : cells) { byte[] val = getCachedCellIfPresent(tableRef, cell); if (val != null) { if (val.length > 0) { cacheHit.put(cell, val); } } else { toLoad.add(cell); } } final Map<Cell, byte[]> loaded = super.get(tableRef, toLoad); cacheLoadedCells(tableRef, toLoad, loaded); cacheHit.putAll(loaded); return cacheHit; }
Source:
<code>public SecurityGroupDefinition allowingPublicPorts(int port1, int port2, int ...ports) { <START> allowing(IpPermissions.permit(IpProtocol.TCP).port(port1)); <END> allowing(IpPermissions.permit(IpProtocol.TCP).port(port2)); for (int port: ports) allowing(IpPermissions.permit(IpProtocol.TCP).port(port).originatingFromCidrBlock(Cidr.UNIVERSAL.toString())); return this; }</code><technical_language>missing originatingFromCidrBlock</technical_language>

Target:
public SecurityGroupDefinition allowingPublicPorts(int port1, int port2, int ...ports) { allowing(IpPermissions.permit(IpProtocol.TCP).port(port1).originatingFromCidrBlock(Cidr.UNIVERSAL.toString())); allowing(IpPermissions.permit(IpProtocol.TCP).port(port2).originatingFromCidrBlock(Cidr.UNIVERSAL.toString())); for (int port: ports) allowing(IpPermissions.permit(IpProtocol.TCP).port(port).originatingFromCidrBlock(Cidr.UNIVERSAL.toString())); return this; }
Source:
<code>public void close() { logger.debug("close(): Closing TCP Connection"); super.cleanup(); try { if (tcpSocket != null) { tcpSocket.close(); } } catch (IOException ioException) { <START> logger.debug("close(): Closing connection error: {}", ioException.getMessage()); <END> } catch (Exception exception) { logger.debug("close(): Closing connection error: {}", exception.getMessage()); } tcpSocket = null; setConnected(false); }</code><technical_language>need catch block, IOException subclass of Exception messages same</technical_language>

Target:
public void close() { logger.debug("close(): Closing TCP Connection"); super.cleanup(); try { if (tcpSocket != null) { tcpSocket.close(); } } catch (IOException ioException) { logger.debug("close(): Closing connection error: {}", ioException.getMessage()); } tcpSocket = null; setConnected(false); }
Source:
<code>private List<VMImage> listImagesByLocation(String location) { final List<VMImage> osImages = Lists.newArrayList(); getImagesFromPublisher("Microsoft.WindowsAzure.Compute", osImages, location); getImagesFromPublisher("MicrosoftWindowsServer", osImages, location); <START> getImagesFromPublisher("Canonical", osImages, location); <END> return osImages; }</code><technical_language>Avoid hardcoding this, configure a comma-separated property instead, users customize publishers? values preconfigured a default in azure api metadata</technical_language>

Target:
private List<VMImage> listImagesByLocation(String location) { final List<VMImage> osImages = Lists.newArrayList(); Iterable<String> publishers = Splitter.on(',').trimResults().omitEmptyStrings().split(this.azureComputeConstants.azureImagePublishers()); for (String publisher : publishers) { getImagesFromPublisher(publisher, osImages, location); } return osImages; }
Source:
<code>private void testValidEmailWithFeedbackSessionsInRecentSixMonths() { <START> ______TS("Valid Email Address, user with email has feedback sessions in recent six month"); <END> requestResendAccessLinksPage.fillEmailAddress(studentEmailAddress); requestResendAccessLinksPage.clickSubmitButton(); requestResendAccessLinksPage.waitForTextsForAllStatusMessagesToUserEquals( Const.StatusMessages.FEEDBACK_SESSION_ACCESS_LINKS_RESENT); }</code><technical_language>months</technical_language>

Target:
private void testValidEmailWithFeedbackSessionsInRecentSixMonths() throws IOException { ______TS("Valid Email Address, user with email has feedback sessions over the recent six months"); AdminHomePage accountHomePage = loginAdmin(); accountHomePage.verifyHtml("/adminHomePage.html"); requestResendAccessLinksPage = getHomePage().clickRequestResendLink(); requestResendAccessLinksPage.fillEmailAddress(studentEmailAddress); requestResendAccessLinksPage.clickSubmitButton(); requestResendAccessLinksPage.waitForTextsForAllStatusMessagesToUserEquals( Const.StatusMessages.FEEDBACK_SESSION_ACCESS_LINKS_RESENT); loginAdmin(); logout(); }
Source:
<code>public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion(CompletionParams completionParams) { List<CompletionItem> completions = new ArrayList<>(); try { String uri = completionParams.getTextDocument().getUri(); String input = fFiltersInputs.get(uri); if (input == null) { return CompletableFuture.completedFuture(Either.forLeft(completions)); } Position cursor = completionParams.getPosition(); List<String> suggestions = AutoCompletion.autoCompletion(input, cursor); for (int i = 0; i < suggestions.size(); i++) { Position start = new Position(0, 0); Position end = new Position(0, input.length()); CompletionItem item = new CompletionItem(); TextEdit textEdit = new TextEdit(new Range(start, end), suggestions.get(i)); item.setTextEdit(textEdit); completions.add(item); } <START> } catch (RecognitionException error) { <END> Activator.getInstance().logError(error.getMessage()); } catch (IOException error) { Activator.getInstance().logError(error.getMessage()); } return CompletableFuture.completedFuture(Either.forLeft(completions)); }</code><technical_language>multi-catch (RecognitionException | IOException e)</technical_language>

Target:
public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion(CompletionParams completionParams) { List<CompletionItem> completions = new ArrayList<>(); try { String uri = completionParams.getTextDocument().getUri(); String input = fFiltersInputs.get(uri); if (input == null) { return CompletableFuture.completedFuture(Either.forLeft(completions)); } Position cursor = completionParams.getPosition(); List<String> suggestions = AutoCompletion.autoCompletion(input, cursor); for (int i = 0; i < suggestions.size(); i++) { Position start = new Position(0, 0); Position end = new Position(0, input.length()); CompletionItem item = new CompletionItem(); TextEdit textEdit = new TextEdit(new Range(start, end), suggestions.get(i)); item.setTextEdit(textEdit); completions.add(item); } } catch (RecognitionException | IOException error) { Activator.getInstance().logError(error.getMessage()); } return CompletableFuture.completedFuture(Either.forLeft(completions)); }
Source:
<code><START> public static AbsoluteIborFutureTemplate of(YearMonth yearMonth, IborFutureConvention convention) { <END> return AbsoluteIborFutureTemplate.of(yearMonth, convention); }</code><technical_language>I return type IborFutureTemplate AbsoluteIborFutureTemplate is package-private</technical_language>

Target:
public static IborFutureTemplate of(YearMonth yearMonth, IborFutureConvention convention) { return AbsoluteIborFutureTemplate.of(yearMonth, convention); }
Source:
<code>public void replacesTypeWithXml() throws Exception { MatcherAssert.assertThat( new RsPrint( <START> new RsWithType.XML(new RsWithType(new RsEmpty(), TYPE_HTML)) <END> ).print(), Matchers.equalTo( Joiner.on(CRLF).join( HTTP_OK, String.format(CONTENT_TYPE, TYPE_XML), "", "" ) ) ); MatcherAssert.assertThat( new RsPrint( new RsWithType.XML( new RsWithType(new RsEmpty(), TYPE_HTML), StandardCharsets.ISO_8859_1 ) ).print(), Matchers.equalTo( Joiner.on(CRLF).join( HTTP_OK, String.format( CONTENT_TYPE_WITH_CHARSET, TYPE_XML, StandardCharsets.ISO_8859_1 ), "", "" ) ) ); }</code><technical_language>@essobedo similar question - HTML in XML test</technical_language>

Target:
public void replacesTypeWithXml() throws Exception { MatcherAssert.assertThat( new RsPrint( new RsWithType.XML( new RsWithType(new RsEmpty(), RsWithTypeTest.TYPE_HTML) ) ).print(), Matchers.equalTo( Joiner.on(RsWithTypeTest.CRLF).join( RsWithTypeTest.HTTP_OK, String.format( RsWithTypeTest.CONTENT_TYPE, RsWithTypeTest.TYPE_XML ), "", "" ) ) ); MatcherAssert.assertThat( new RsPrint( new RsWithType.XML( new RsWithType(new RsEmpty(), RsWithTypeTest.TYPE_HTML), StandardCharsets.ISO_8859_1 ) ).print(), Matchers.equalTo( Joiner.on(RsWithTypeTest.CRLF).join( RsWithTypeTest.HTTP_OK, String.format( RsWithTypeTest.TYPE_WITH_CHARSET, RsWithTypeTest.TYPE_XML, StandardCharsets.ISO_8859_1 ), "", "" ) ) ); }
Source:
<code>public void getConceptNameTagByName_shouldReturnNullIfNoConceptNameTagIsFound() { <START> assertNull(conceptService.getConceptNameTagByName(null)); <END> }</code><technical_language>do ensure requesting .getConceptNameTagByName(null) for return null if concept nameTag is found</technical_language>

Target:
public void getConceptNameTagByName_shouldReturnNullIfNoConceptNameTagIsFound() { assertNull(conceptService.getConceptNameTagByName("random-tag")); }
Source:
<code>public void getObjects() throws IOException, SignatureException, URISyntaxException, XmlProcessingException { final String bucketName = "test_get_objs"; try { client.putBucket(new PutBucketRequest(bucketName)); Util.loadBookTestData(client, bucketName); <START> HeadObjectResponse headResponse = client.headObject(new HeadObjectRequest( <END> bucketName, "beowulf.txt")); assertThat(headResponse.getStatus(), is(HeadObjectResponse.Status.EXISTS)); final GetObjectsResponse response = client .getObjects(new GetObjectsRequest().withBucket("test_get_objs")); assertFalse(response.getS3ObjectList().getObjects().isEmpty()); assertThat(response.getS3ObjectList().getObjects().size(), is(4)); assertTrue(s3ObjectExists(response.getS3ObjectList().getObjects(), "beowulf.txt")); } finally { Util.deleteAllContents(client,bucketName); } }</code><technical_language>I this final</technical_language>

Target:
public void getObjects() throws IOException, SignatureException, URISyntaxException, XmlProcessingException { final String bucketName = "test_get_objs"; try { client.putBucket(new PutBucketRequest(bucketName)); Util.loadBookTestData(client, bucketName); final HeadObjectResponse headResponse = client.headObject(new HeadObjectRequest( bucketName, "beowulf.txt")); assertThat(headResponse.getStatus(), is(HeadObjectResponse.Status.EXISTS)); final GetObjectsResponse response = client .getObjects(new GetObjectsRequest().withBucket("test_get_objs")); assertFalse(response.getS3ObjectList().getObjects().isEmpty()); assertThat(response.getS3ObjectList().getObjects().size(), is(4)); assertTrue(s3ObjectExists(response.getS3ObjectList().getObjects(), "beowulf.txt")); } finally { Util.deleteAllContents(client,bucketName); } }
Source:
<code>public static void setValue( CodeBlock cqlName, PropertyType type, CodeBlock valueExtractor, String targetName, MethodSpec.Builder methodBuilder, BindableHandlingSharedCode enclosingClass) { setValue( cqlName, type, valueExtractor, targetName, methodBuilder, enclosingClass, <START> CodeBlock.of("$T.$L", NullSavingStrategy.class, NullSavingStrategy.SET_TO_NULL)); <END> }</code><technical_language>interesting decision point fields initialized some non-null in default constructors. However, conceptually, I is right here. If is unset in C*, effectively null in entity itself</technical_language>

Target:
public static void setValue( CodeBlock cqlName, PropertyType type, CodeBlock valueExtractor, String targetName, MethodSpec.Builder methodBuilder, BindableHandlingSharedCode enclosingClass) { setValue(cqlName, type, valueExtractor, targetName, methodBuilder, enclosingClass, false); }
Source:
<code>public void onConnected(@Nullable Bundle bundle) { if (mEmail == null) { Log.e(TAG, "Unable to save null credential!"); <START> mActivity.finish(RESULT_OK, mActivity.getIntent()); <END> return; } Credential.Builder builder = new Credential.Builder(mEmail); builder.setPassword(mPassword); if (mPassword == null) { if (mProvider != null) { String translatedProvider = null; if (mProvider.equals(GoogleAuthProvider.PROVIDER_ID)) { translatedProvider = IdentityProviders.GOOGLE; } else if (mProvider.equals(FacebookAuthProvider.PROVIDER_ID)) { translatedProvider = IdentityProviders.FACEBOOK; } if (translatedProvider != null) { builder.setAccountType(translatedProvider); } } } if (mName != null) { builder.setName(mName); } if (mProfilePictureUri != null) { builder.setProfilePictureUri(Uri.parse(mProfilePictureUri)); } Auth.CredentialsApi .save(mCredentialsApiClient, builder.build()) .setResultCallback(this); }</code><technical_language>Is a reason changed this RESULT_OK here</technical_language>

Target:
public void onConnected(@Nullable Bundle bundle) { if (mEmail == null) { Log.e(TAG, "Unable to save null credential!"); finish(RESULT_CANCELED); return; } Credential.Builder builder = new Credential.Builder(mEmail); builder.setPassword(mPassword); if (mPassword == null) { if (mProvider != null) { String translatedProvider = null; switch (mProvider) { case GoogleAuthProvider.PROVIDER_ID: translatedProvider = IdentityProviders.GOOGLE; break; case FacebookAuthProvider.PROVIDER_ID: translatedProvider = IdentityProviders.FACEBOOK; break; case TwitterAuthProvider.PROVIDER_ID: translatedProvider = IdentityProviders.TWITTER; break; default: Log.e(TAG, "Unable to save null credential!"); finish(RESULT_CANCELED); return; } builder.setAccountType(translatedProvider); } } if (mName != null) { builder.setName(mName); } if (mProfilePictureUri != null) { builder.setProfilePictureUri(Uri.parse(mProfilePictureUri)); } mActivityHelper.getCredentialsApi() .save(mCredentialsApiClient, builder.build()) .setResultCallback(this); }
Source:
<code>private boolean updateStateEntries(ITmfStateSystem ss, List<ITmfStateInterval> fullState, TmfTreeViewerEntry parent, int parentQuark, long timestamp) { boolean changed = false; try { for (int quark : ss.getSubAttributes(parentQuark, false)) { if (quark >= fullState.size()) { <START> continue; <END> } ITmfStateInterval interval = fullState.get(quark); StateEntry stateEntry = findStateEntry(parent, quark); if (stateEntry == null) { stateEntry = new StateEntry(ss.getAttributeName(quark), quark, ss.getFullAttributePath(quark), interval.getStateValue(), new TmfTimestamp(interval.getStartTime(), ITmfTimestamp.NANOSECOND_SCALE), new TmfTimestamp(interval.getEndTime(), ITmfTimestamp.NANOSECOND_SCALE), interval.getStartTime() == timestamp); updateStateEntries(ss, fullState, stateEntry, quark, timestamp); if (!fFilterStatus || stateEntry.hasChildren() || interval.getStartTime() == timestamp) { parent.addChild(stateEntry); changed = true; } } else { stateEntry.update(interval.getStateValue(), new TmfTimestamp(interval.getStartTime(), ITmfTimestamp.NANOSECOND_SCALE), new TmfTimestamp(interval.getEndTime(), ITmfTimestamp.NANOSECOND_SCALE)); updateStateEntries(ss, fullState, stateEntry, quark, timestamp); } } } catch (AttributeNotFoundException e) { } return changed; }</code><technical_language>changed set true here</technical_language>

Target:
private boolean updateStateEntries(ITmfStateSystem ss, List<ITmfStateInterval> fullState, TmfTreeViewerEntry parent, int parentQuark, long timestamp) { boolean changed = false; try { for (int quark : ss.getSubAttributes(parentQuark, false)) { if (quark >= fullState.size()) { continue; } ITmfStateInterval interval = fullState.get(quark); StateEntry stateEntry = findStateEntry(parent, quark); if (stateEntry == null) { boolean modified = fFilterStatus ? interval.getStartTime() == timestamp : !interval.getStateValue().isNull(); stateEntry = new StateEntry(ss.getAttributeName(quark), quark, ss.getFullAttributePath(quark), interval.getStateValue(), new TmfTimestamp(interval.getStartTime(), ITmfTimestamp.NANOSECOND_SCALE), new TmfTimestamp(interval.getEndTime(), ITmfTimestamp.NANOSECOND_SCALE), modified); updateStateEntries(ss, fullState, stateEntry, quark, timestamp); if (!fFilterStatus || stateEntry.hasChildren() || interval.getStartTime() == timestamp) { parent.addChild(stateEntry); changed = true; } } else { stateEntry.update(interval.getStateValue(), new TmfTimestamp(interval.getStartTime(), ITmfTimestamp.NANOSECOND_SCALE), new TmfTimestamp(interval.getEndTime(), ITmfTimestamp.NANOSECOND_SCALE)); updateStateEntries(ss, fullState, stateEntry, quark, timestamp); } } } catch (AttributeNotFoundException e) { } return changed; }
Source:
<code>public void loadComplete(FMLLoadCompleteEvent event) { BlockState state = Fluids.WATER.getDefaultState().getBlockState(); BlockState state2 = Fluids.WATER.getAttributes().getBlock(null,null,Fluids.WATER.getDefaultState()); <START> assert state.getBlock() == Blocks.WATER && state2 == state; <END> ItemStack stack = Fluids.WATER.getAttributes().getBucket(new FluidStack(Fluids.WATER, 1)); assert stack.getItem() == Fluids.WATER.getFilledBucket(); }</code><technical_language>Please Validate.isTrue instead of assert, enables assertions</technical_language>

Target:
public void loadComplete(FMLLoadCompleteEvent event) { BlockState state = Fluids.WATER.getDefaultState().getBlockState(); BlockState state2 = Fluids.WATER.getAttributes().getBlock(null,null,Fluids.WATER.getDefaultState()); Validate.isTrue(state.getBlock() == Blocks.WATER && state2 == state); ItemStack stack = Fluids.WATER.getAttributes().getBucket(new FluidStack(Fluids.WATER, 1)); Validate.isTrue(stack.getItem() == Fluids.WATER.getFilledBucket()); }
Source:
<code>private boolean isANewPerspective(LayoutTemplate layoutTemplate) { <START> final IOCBeanDef<Activity> activity = activityBeansCache.getActivity(layoutTemplate.getName()); return activity == null; <END> }</code><technical_language>suggestion return activityBeansCache.getActivity(layoutTemplate.getName()) == null;</technical_language>

Target:
private boolean isANewPerspective(LayoutTemplate layoutTemplate) { return activityBeansCache.getActivity(layoutTemplate.getName()) == null; }
Source:
<code>public final void rightClickBlock(GlowPlayer player, GlowBlock against, BlockFace face, ItemStack holding, Vector clickedLoc) { GlowBlock target = against.getRelative(face); GlowBlockState newState = target.getState(); if (against.getType() == Material.LONG_GRASS) { target = against; } else if (!target.isEmpty() && !target.isLiquid()) { return; } if (!EventFactory.onBlockCanBuild(target, getId(), face).isBuildable()) { return; } placeBlock(player, newState, face, holding, clickedLoc); BlockPlaceEvent event = EventFactory.onBlockPlace(target, newState, against, player); if (event.isCancelled() || !event.canBuild()) { return; } newState.update(true); <START> getPlaceSound().play(target.getLocation()); <END> afterPlace(player, target, holding); if (player.getGameMode() != GameMode.CREATIVE) { holding.setAmount(holding.getAmount() - 1); } }</code><technical_language>if added a playSound(Location, GlowSound) method world instead of a .play(Location) method GlowSound</technical_language>

Target:
public final void rightClickBlock(GlowPlayer player, GlowBlock against, BlockFace face, ItemStack holding, Vector clickedLoc) { GlowBlock target = against.getRelative(face); BlockType againstType = ItemTable.instance().getBlock(against.getTypeId()); if (againstType.canAbsorb(against, face, holding)) { target = against; } else if (!target.isEmpty()) { BlockType targetType = ItemTable.instance().getBlock(target.getTypeId()); if (!targetType.canOverride(target, face, holding)) { return; } } GlowBlockState newState = target.getState(); if (!EventFactory.onBlockCanBuild(target, getId(), face).isBuildable()) { return; } placeBlock(player, newState, face, holding, clickedLoc); BlockPlaceEvent event = EventFactory.onBlockPlace(target, newState, against, player); if (event.isCancelled() || !event.canBuild()) { return; } newState.update(true); getPlaceSound().play(target.getLocation()); afterPlace(player, target, holding); if (player.getGameMode() != GameMode.CREATIVE) { holding.setAmount(holding.getAmount() - 1); } }
Source:
<code>protected File getLogFile() { <START> return new File(Jenkins.getInstance().getRootDir(),"logs/tasks/"+name+".log"); <END> }</code><technical_language>+Long.MAX_LONG for cluttering JENKINS_HOME anymore</technical_language>

Target:
protected File getLogFile() { return new File(Jenkins.getActiveInstance().getRootDir(),"logs/tasks/"+name+".log"); }
Source:
<code><START> boolean validateSingleHostAttachedToLocalStorage() { <END> boolean retrunValue = true; storage_pool storagePool = DbFacade.getInstance().getStoragePoolDao().getForVdsGroup( getParameters().getVdsStaticData().getVdsGroupId()); if (storagePool != null && storagePool.getstorage_pool_type() == StorageType.LOCALFS) { if (!DbFacade.getInstance() .getVdsStaticDao() .getAllForVdsGroup(getParameters().getVdsStaticData().getVdsGroupId()) .isEmpty()) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE); retrunValue = false; } } return retrunValue; }</code><technical_language>please set a modifier - protected suitable</technical_language>

Target:
protected boolean validateSingleHostAttachedToLocalStorage() { boolean retrunValue = true; storage_pool storagePool = DbFacade.getInstance().getStoragePoolDao().getForVdsGroup( getParameters().getVdsStaticData().getVdsGroupId()); if (storagePool != null && storagePool.getstorage_pool_type() == StorageType.LOCALFS) { if (!DbFacade.getInstance() .getVdsStaticDao() .getAllForVdsGroup(getParameters().getVdsStaticData().getVdsGroupId()) .isEmpty()) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE); retrunValue = false; } } return retrunValue; }
Source:
<code>public ImageTemplate buildImageTemplateFromNode(String name, String id) { DataCenterAndId datacenterAndId = DataCenterAndId.fromSlashEncoded(id); Server server = client.serverApi().getServer(datacenterAndId.getDataCenter(), datacenterAndId.getId()); if (server == null) { <START> throw new NoSuchElementException("Cannot find server with id: " + id); <END> } CloneImageTemplate template = new ImageTemplateBuilder.CloneImageTemplateBuilder().nodeId(id).name(name).build(); return template; }</code><technical_language>throw IllegalArgumentException</technical_language>

Target:
public ImageTemplate buildImageTemplateFromNode(String name, String id) { DataCenterAndId datacenterAndId = DataCenterAndId.fromSlashEncoded(id); Server server = client.serverApi().getServer(datacenterAndId.getDataCenter(), datacenterAndId.getId()); if (server == null) { throw new IllegalArgumentException("Cannot find server with id: " + id); } CloneImageTemplate template = new ImageTemplateBuilder.CloneImageTemplateBuilder().nodeId(id).name(name).build(); return template; }
Source:
<code>protected XWikiRepositorySystemSession createRepositorySystemSession() throws ResolveException { XWikiRepositorySystemSession session; try { session = this.repositoryFactory.createRepositorySystemSession(); } catch (IOException e) { throw new ResolveException("Failed to create the repository system session", e); } Map<String, String> sessionHttpHeaders = new HashMap<>(); for (Map.Entry<String, String> property : getDescriptor().getProperties().entrySet()) { <START> if (StringUtils.startsWith(property.getKey(), "httpHeaders.")) { <END> String headerName = StringUtils.split(property.getKey(), ".", 2)[1]; sessionHttpHeaders.put(headerName, property.getValue()); } } session.addConfigurationProperties(Collections.singletonMap(ConfigurationProperties.HTTP_HEADERS, sessionHttpHeaders)); session.addConfigurationProperties(getDescriptor().getProperties()); return session; }</code><technical_language>I "http.headers." prefix other http related properties in future</technical_language>

Target:
protected XWikiRepositorySystemSession createRepositorySystemSession() throws ResolveException { XWikiRepositorySystemSession session; try { session = this.repositoryFactory.createRepositorySystemSession(); } catch (IOException e) { throw new ResolveException("Failed to create the repository system session", e); } Map<String, String> sessionHttpHeaders = new HashMap<>(); for (Map.Entry<String, String> property : getDescriptor().getProperties().entrySet()) { if (StringUtils.startsWith(property.getKey(), "http.headers.")) { String headerName = StringUtils.split(property.getKey(), ".", 3)[2]; sessionHttpHeaders.put(headerName, property.getValue()); } } session.addConfigurationProperties(Collections.singletonMap(ConfigurationProperties.HTTP_HEADERS, sessionHttpHeaders)); session.addConfigurationProperties(getDescriptor().getProperties()); return session; }
Source:
<code>private static Timer timer(final MetricRegistry metricRegistry, final String... keys) { final String timerMetricName = JOINER.join("killbill-service", "kb_plugin_latency", JOINER.join(keys)); return metricRegistry.timer(timerMetricName); <START> } <END></code><technical_language>_only_ create timer (per plugin/api need instrument)</technical_language>

Target:
private static Timer timer(final MetricRegistry metricRegistry, final String... keys) { final String timerMetricName = DOT_JOINER.join("killbill-service", "kb_plugin_latency", DOT_JOINER.join(keys)); return metricRegistry.timer(timerMetricName); }
Source:
<code>WebAppBaseImpl<FluentT, FluentImplT> withNewHostNameSslBinding( final HostNameSslBindingImpl<FluentT, FluentImplT> hostNameSslBinding) { <START> hostNameSslBinding.newCertificate(); <END> sslBindingsToCreate.put(hostNameSslBinding.name(), hostNameSslBinding); return this; }</code><technical_language>I mono run. need a block()</technical_language>

Target:
WebAppBaseImpl<FluentT, FluentImplT> withNewHostNameSslBinding( final HostNameSslBindingImpl<FluentT, FluentImplT> hostNameSslBinding) { sslBindingsToCreate.put(hostNameSslBinding.name(), hostNameSslBinding); return this; }
Source:
<code>public Collection<JType> getTypes() { return <START> Collections.unmodifiableCollection(types.values()); <END> }</code><technical_language>Jack utilities here, UnmodifableCollections</technical_language>

Target:
public Collection<JType> getTypes() { return Jack.getUnmodifiableCollections().getUnmodifiableCollection(types.values()); }
Source:
<code>public void returnsUserFriendlyMessage() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:4"; final User user = base.user(new URN(urn)); user.aliases().add("alias4"); final Alias alias = user.aliases().iterate().iterator().next(); alias.email("old@example.com!new4@example.com"); try { new TkEmVerify(base).act( <START> new RqRegex.Fake(PATTERN, "x") <END> ); } catch (final RsForward ex) { final Iterator<String> response = ex.head().iterator(); response.next(); final String space = " "; final String[] cookie = response .next().split(space)[1].split("./")[0].split("="); MatcherAssert.assertThat( cookie[1].replace("+", space), Matchers.equalTo("verification link not valid") ); } }</code><technical_language>@kujtimiihoxha indentation, 4 spaces</technical_language>

Target:
public void returnsUserFriendlyMessage() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:4"; final User user = base.user(new URN(urn)); user.aliases().add("alias4"); final Alias alias = user.aliases().iterate().iterator().next(); alias.email("old@example.com!new4@example.com"); try { new TkEmVerify(base).act( new RqRegex.Fake(TkEmVerifyTest.PATTERN, "x") ); } catch (final RsForward ex) { MatcherAssert.assertThat( ex, Matchers.not(Matchers.instanceOf(RsFailure.class)) ); final Iterator<String> response = ex.head().iterator(); response.next(); final String space = " "; final String[] cookie = response .next().split(space)[1].split("./")[0].split("="); MatcherAssert.assertThat( cookie[1].replace("+", space), Matchers.equalTo("verification link not valid") ); } }
Source:
<code>public String getQpidHome() { qpidPath = System.getProperty(QPID_CONF); <START> if(qpidPath != null){ <END> QPID_CONF_DIR = Paths.get(qpidPath).toString(); } return System.getProperty(ServerConstants.CARBON_HOME) + QPID_CONF_DIR; }</code><technical_language>Needs format</technical_language>

Target:
public String getQpidHome() { String qpidPath = System.getProperty(QPID_CONF); if (qpidPath != null) { QPID_CONF_DIR = Paths.get(qpidPath).toString(); } return System.getProperty(ServerConstants.CARBON_HOME) + QPID_CONF_DIR; }