auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testMultipleAcknowledges() throws Exception { MockChannel channel = new MockChannel(); assertNull(channel.getWriteObject()); Dispatcher disp = new Dispatcher(10); DummyHandler handler = new DummyHandler("dummy handler"); disp.addHandler(handler); disp.init(); int numEvents = 1000; for (int i = 0; i < numEvents; i++) { Timber.LogEvent event = Timber.LogEvent.newBuilder(createMessage("meh " + i)) .setConsistencyLevel(ConsistencyLevel.REPLICATED) .setId("" + i) .build(); disp.dispatch(event, channel); } disp.shutdown(); BitSet bits = new BitSet(1000); for (Object obj : channel.getObjects()) { Timber.AckEvent ackEvent = (Timber.AckEvent) obj; for (String id : ackEvent.getIdList()) { bits.set(Integer.parseInt(id)); } } <START> BitSet truth = new BitSet(1000); <END> truth.set(0,1000); assertEquals(truth, bits); }</code><technical_language>'truth' is dubious. If got, is 'truth' truth? ;) 'expected' is unambiguous</technical_language>

Target:
public void testMultipleAcknowledges() throws Exception { MockChannel channel = new MockChannel(); assertNull(channel.getWriteObject()); Dispatcher disp = new Dispatcher(10); DummyHandler handler = new DummyHandler("dummy handler"); disp.addHandler(handler); disp.init(); int numEvents = 1000; for (int i = 0; i < numEvents; i++) { Timber.LogEvent event = Timber.LogEvent.newBuilder(createMessage("meh " + i)) .setConsistencyLevel(ConsistencyLevel.REPLICATED) .setId("" + i) .build(); disp.dispatch(event, channel); } disp.shutdown(); BitSet bits = new BitSet(1000); for (Object obj : channel.getObjects()) { Timber.AckEvent ackEvent = (Timber.AckEvent) obj; for (String id : ackEvent.getIdList()) { bits.set(Integer.parseInt(id)); } } BitSet expected = new BitSet(1000); expected.set(0,1000); assertEquals(expected, bits); }
Source:
<code>public static void getDataCenterById(AsyncQuery aQuery, Guid dataCenterId) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { return source; } }; <START> Frontend.getInstance().runQuery(VdcQueryType.GetStoragePoolById, new IdQueryParameters(dataCenterId).withoutRefresh(), aQuery); <END> }</code><technical_language>'parameters.setForceRefresh(forceRefresh);' instead</technical_language>

Target:
public static void getDataCenterById(AsyncQuery aQuery, Guid dataCenterId) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { return source; } }; IdQueryParameters params = new IdQueryParameters(dataCenterId); params.setRefresh(false); Frontend.getInstance().runQuery(VdcQueryType.GetStoragePoolById, params, aQuery); }
Source:
<code>public Sequence<Cursor> makeCursors( @Nullable final Filter filter, @Nonnull final Interval interval, @Nonnull final VirtualColumns virtualColumns, @Nonnull final Granularity gran, final boolean descending, @Nullable final QueryMetrics<?> queryMetrics ) { final List<VirtualColumn> preJoinVirtualColumns = new ArrayList<>(); final List<VirtualColumn> postJoinVirtualColumns = new ArrayList<>(); <START> final Set<String> baseColumns = determineBaseColumnsWithPreAndPostJoinVirtualColumns( <END> virtualColumns, preJoinVirtualColumns, postJoinVirtualColumns ); JoinFilterSplit joinFilterSplit = JoinFilterAnalyzer.splitFilter(joinFilterPreAnalysis); preJoinVirtualColumns.addAll(joinFilterSplit.getPushDownVirtualColumns()); final Sequence<Cursor> baseCursorSequence = baseAdapter.makeCursors( joinFilterSplit.getBaseTableFilter().isPresent() ? joinFilterSplit.getBaseTableFilter().get() : null, interval, VirtualColumns.create(preJoinVirtualColumns), gran, descending, queryMetrics ); return Sequences.map( baseCursorSequence, cursor -> { Cursor retVal = cursor; for (JoinableClause clause : clauses) { retVal = HashJoinEngine.makeJoinCursor(retVal, clause); } return PostJoinCursor.wrap( retVal, VirtualColumns.create(postJoinVirtualColumns), joinFilterSplit.getJoinTableFilter().isPresent() ? joinFilterSplit.getJoinTableFilter().get() : null ); } ); }</code><technical_language>deletion below, CI (spotbugs intellij inspections) is flagging this unused</technical_language>

Target:
public Sequence<Cursor> makeCursors( @Nullable final Filter filter, @Nonnull final Interval interval, @Nonnull final VirtualColumns virtualColumns, @Nonnull final Granularity gran, final boolean descending, @Nullable final QueryMetrics<?> queryMetrics ) { final List<VirtualColumn> preJoinVirtualColumns = new ArrayList<>(); final List<VirtualColumn> postJoinVirtualColumns = new ArrayList<>(); determineBaseColumnsWithPreAndPostJoinVirtualColumns( virtualColumns, preJoinVirtualColumns, postJoinVirtualColumns ); JoinFilterSplit joinFilterSplit = JoinFilterAnalyzer.splitFilter(joinFilterPreAnalysis); preJoinVirtualColumns.addAll(joinFilterSplit.getPushDownVirtualColumns()); final Sequence<Cursor> baseCursorSequence = baseAdapter.makeCursors( joinFilterSplit.getBaseTableFilter().isPresent() ? joinFilterSplit.getBaseTableFilter().get() : null, interval, VirtualColumns.create(preJoinVirtualColumns), gran, descending, queryMetrics ); return Sequences.map( baseCursorSequence, cursor -> { Cursor retVal = cursor; for (JoinableClause clause : clauses) { retVal = HashJoinEngine.makeJoinCursor(retVal, clause); } return PostJoinCursor.wrap( retVal, VirtualColumns.create(postJoinVirtualColumns), joinFilterSplit.getJoinTableFilter().isPresent() ? joinFilterSplit.getJoinTableFilter().get() : null ); } ); }
Source:
<code>private void moveVdsToUp(VDS vds) { HostStoragePoolParametersBase tempVar = new HostStoragePoolParametersBase(vds); <START> Backend.getInstance().runInternalAction(VdcActionType.InitVdsOnUp, tempVar); <END> }</code><technical_language>Ofri, attested host, result is trusted, need move vds status up. involk InitVdsOnUp process, in this process attest host again. avoid reduplicate attestation</technical_language>

Target:
private void moveVdsToUp(VDS vds) { vds.setNonOperationalReason(null); DbFacade.getInstance().getVdsDynamicDao().update(vds.getDynamicData()); HostStoragePoolParametersBase tempVar = new HostStoragePoolParametersBase(vds); Backend.getInstance().runInternalAction(VdcActionType.InitVdsOnUp, tempVar); }
Source:
<code>private Object checkForCompositeRename(ExecutionEvent event) { ISelection sel= HandlerUtil.getCurrentSelection(event); if (sel instanceof IStructuredSelection) { IResource resource= getCurrentResource((IStructuredSelection) sel); if (resource != null) { String placeHolderFileName; if (resource.getFileExtension() != null) { <START> String newName= resource.getName().substring(0, resource.getName().lastIndexOf('.')) + 'a'; <END> placeHolderFileName= newName + '.' + resource.getFileExtension(); } else { placeHolderFileName= resource.getName() + 'a'; } RenameResourceWizard refactoringWizard= new RenameResourceWizard(resource, placeHolderFileName); Change change= getChange(refactoringWizard); return isCompositeChange(change); } } return null; }</code><technical_language>lastIndexOf(.)? hello.tar.gz hello.tara.gz</technical_language>

Target:
private Object checkForCompositeRename(ExecutionEvent event) { ISelection sel= HandlerUtil.getCurrentSelection(event); if (sel instanceof IStructuredSelection) { IResource resource= getCurrentResource((IStructuredSelection) sel); if (resource != null) { String placeHolderFileName; if (resource.getFileExtension() != null) { String newName= resource.getName().substring(0, resource.getName().indexOf('.')) + 'a'; placeHolderFileName= newName + '.' + resource.getFileExtension(); } else { placeHolderFileName= resource.getName() + 'a'; } RenameResourceWizard refactoringWizard= new RenameResourceWizard(resource, placeHolderFileName); Change change= getChange(refactoringWizard); return isCompositeChange(change); } } return null; }
Source:
<code>public ExpressionProjector(String name, String tableName, Expression expression, boolean isCaseSensitive) { this.name = name; this.expression = expression; this.tableName = tableName; this.isCaseSensitive = isCaseSensitive; <START> this.arrayIndex = -1; <END> }</code><technical_language>Remove this change please, necessary</technical_language>

Target:
public ExpressionProjector(String name, String tableName, Expression expression, boolean isCaseSensitive) { this.name = name; this.expression = expression; this.tableName = tableName; this.isCaseSensitive = isCaseSensitive; }
Source:
<code>private void postDescription(@NonNull String editToken) { descriptionEditCall = new DescriptionEditClient().request(wikiData, pageTitle, editView.getDescription(), editToken, new DescriptionEditClient.Callback() { @Override @SuppressWarnings("checkstyle:magicnumber") public void success(@NonNull Call<DescriptionEdit> call) { new Handler().postDelayed(successRunnable, TimeUnit.SECONDS.toMillis(4)); if (funnel != null) { funnel.logSaved(); } } <START> @Override public void abusefilter(@NonNull Call<DescriptionEdit> call, <END> String info) { editView.setSaveState(false); editView.setError(StringUtil.fromHtml(info)); } @Override public void failure(@NonNull Call<DescriptionEdit> call, @NonNull Throwable caught) { editFailed(caught); } }); }</code><technical_language>funnel a logAbuseFilterWarning() method here. Technically "warning" "error" variants, distinguishing for editing descriptions, "warning" variant for purposes in cases. funnel method expects a "code" string, want pass code this callback method (i.e. pass message name in addition message html)</technical_language>

Target:
private void postDescription(@NonNull String editToken) { descriptionEditCall = new DescriptionEditClient().request(wikiData, pageTitle, editView.getDescription(), editToken, new DescriptionEditClient.Callback() { @Override @SuppressWarnings("checkstyle:magicnumber") public void success(@NonNull Call<DescriptionEdit> call) { new Handler().postDelayed(successRunnable, TimeUnit.SECONDS.toMillis(4)); if (funnel != null) { funnel.logSaved(); } } @Override public void abusefilter(@NonNull Call<DescriptionEdit> call, @Nullable String code, @Nullable String info) { editView.setSaveState(false); if (info != null) { editView.setError(StringUtil.fromHtml(info)); } if (funnel != null) { funnel.logAbuseFilterWarning(code); } } @Override public void failure(@NonNull Call<DescriptionEdit> call, @NonNull Throwable caught) { editFailed(caught); if (funnel != null) { funnel.logError(caught.getMessage()); } } }); }
Source:
<code>private Optional<List<Image>> getAmiFromEC2Api(String account, String region, final String imageId) { try { AmazonEC2Client ec2Client = clientProvider.getClient( AmazonEC2Client.class, account, getRegion( fromName(region))); DescribeImagesRequest describeImagesRequest = new DescribeImagesRequest(); describeImagesRequest.setImageIds(newArrayList(imageId)); <START> return ofNullable(ec2Client.describeImages(describeImagesRequest).getImages().stream().collect(Collectors.toList())); <END> } catch (final AmazonClientException e) { log.warn("Could not describe image " + imageId, e); return empty(); } }</code><technical_language>getImages() returns a List. is need stream collect again. Consider this: Optional.of(ec2Client.describeImages(describeImagesRequest)).map(DescribeImagesResult::getImages)</technical_language>

Target:
private Optional<Image> getAmiFromEC2Api(String account, String region, final String imageId) { try { final AmazonEC2Client ec2Client = clientProvider.getClient( AmazonEC2Client.class, account, getRegion(fromName(region))); final DescribeImagesResult response = ec2Client.describeImages(new DescribeImagesRequest().withImageIds(imageId)); return ofNullable(response) .map(DescribeImagesResult::getImages) .map(List::stream) .flatMap(Stream::findFirst); } catch (final AmazonClientException e) { log.warn("Could not describe image " + imageId, e); return empty(); } }
Source:
<code>public int getPartitionedSplitCount() { if (taskStateMachine.getState().isDone()) { return 0; } synchronized (this) { int count = 0; <START> for (PlanNodeId partitionedSource : fragment.getTableScanSchedulingOrder()) { <END> Collection<Split> partitionedSplits = splits.get(partitionedSource); count += partitionedSplits.size(); } return count; } }</code><technical_language>tableScanPlanNodeId</technical_language>

Target:
public int getPartitionedSplitCount() { if (taskStateMachine.getState().isDone()) { return 0; } synchronized (this) { int count = 0; for (PlanNodeId tableScanPlanNodeId : fragment.getTableScanSchedulingOrder()) { Collection<Split> partitionedSplits = splits.get(tableScanPlanNodeId); count += partitionedSplits.size(); } return count; } }
Source:
<code>public void createPayment_responseWith400_whenAmountFieldIsNotAValidJsonField() throws IOException { String payload = "{" + " \"amount\" : { \"whatever\": 1 }," + " \"reference\" : \"Some reference\"," + " \"description\" : \"Some description\"," + " \"return_url\" : \"<LINK_0>\"" + "}"; <START> System.out.println("payload = " + payload); <END> InputStream body = postPaymentResponse(BEARER_TOKEN, payload) .statusCode(400) .contentType(JSON) .extract() .body().asInputStream(); JsonAssert.with(body) .assertThat("$.*", hasSize(2)) .assertThat("$.code", is("P0100")) .assertThat("$.description", is("Invalid attribute value: amount. Must be a valid numeric format")); }</code><technical_language>sysout ?</technical_language>

Target:
public void createPayment_responseWith400_whenAmountFieldIsNotAValidJsonField() throws IOException { String payload = "{" + " \"amount\" : { \"whatever\": 1 }," + " \"reference\" : \"Some reference\"," + " \"description\" : \"Some description\"," + " \"return_url\" : \"<LINK_0>\"" + "}"; InputStream body = postPaymentResponse(BEARER_TOKEN, payload) .statusCode(400) .contentType(JSON) .extract() .body().asInputStream(); JsonAssert.with(body) .assertThat("$.*", hasSize(2)) .assertThat("$.code", is("P0100")) .assertThat("$.description", is("Invalid attribute value: amount. Must be a valid numeric format")); }
Source:
<code>public LockRenewalOperation getAutoRenewSessionLock(String sessionId, Duration maxLockRenewalDuration) { if (isDisposed.get()) { throw logger.logThrowableAsError(new IllegalStateException( <START> String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "getAutoRenewSessionLock"))); <END> } else if (!receiverOptions.isSessionReceiver()) { throw logger.logThrowableAsError(new IllegalStateException( "Cannot renew session lock on a non-session receiver.")); } else if (maxLockRenewalDuration == null) { throw logger.logThrowableAsError(new NullPointerException("'maxLockRenewalDuration' cannot be null.")); } else if (maxLockRenewalDuration.isNegative()) { throw logger.logThrowableAsError(new IllegalArgumentException( "'maxLockRenewalDuration' cannot be negative.")); } return new LockRenewalOperation(sessionId, maxLockRenewalDuration, true, this::renewSessionLock); }</code><technical_language>check for empty null session id throw Exception needed</technical_language>

Target:
public LockRenewalOperation getAutoRenewSessionLock(String sessionId, Duration maxLockRenewalDuration) { if (isDisposed.get()) { throw logger.logExceptionAsError(new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "getAutoRenewSessionLock"))); } else if (!receiverOptions.isSessionReceiver()) { throw logger.logExceptionAsError(new IllegalStateException( "Cannot renew session lock on a non-session receiver.")); } else if (maxLockRenewalDuration == null) { throw logger.logExceptionAsError(new NullPointerException("'maxLockRenewalDuration' cannot be null.")); } else if (maxLockRenewalDuration.isNegative()) { throw logger.logExceptionAsError(new IllegalArgumentException( "'maxLockRenewalDuration' cannot be negative.")); } else if (Objects.isNull(sessionId)) { throw logger.logExceptionAsError(new NullPointerException("'sessionId' cannot be null.")); } else if (sessionId.isEmpty()) { throw logger.logExceptionAsError(new IllegalArgumentException("'sessionId' cannot be empty.")); } final LockRenewalOperation operation = new LockRenewalOperation(sessionId, maxLockRenewalDuration, true, this::renewSessionLock); renewalContainer.addOrUpdate(sessionId, Instant.now().plus(maxLockRenewalDuration), operation); return operation; }
Source:
<code>private void importProject(Intent data) { if (data == null) { setShowProgressBar(false); return; } boolean isImporting = false; try { isImporting = data.getExtras().getSerializable("IS_IMPORTING_FROM_IMPLICIT_INTENT") != null; } catch (NullPointerException e) { Log.e(TAG, "Null pointer exception", e); } try { <START> if (!data.getData().getScheme().equals("file") && !isImporting) { <END> throw new IllegalArgumentException("importProject has to be called with a file uri. (not a content uri"); } } catch (NullPointerException e) { Log.e(TAG, "Null pointer exception", e); } try { File cacheFile = new File(CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); if (cacheFile.exists()) { cacheFile.delete(); } File src = new File(data.getData().getPath()); if (src.isDirectory()) { new ProjectImportTask() .setListener(projectImportListener) .execute(src); } else { File projectFile = StorageOperations .copyUriToDir(getContext().getContentResolver(), data.getData(), CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); new ProjectUnzipAndImportTask() .setListener(projectUnzipAndImportListener) .execute(projectFile); } setShowProgressBar(true); } catch (IOException | NullPointerException e) { Log.e(TAG, "Cannot resolve project to import.", e); } }</code><technical_language>PLEASE-FIX: This check is unnecessary other import-use-case generates "file" URIs this use-case ignores it. => boolean-flag, check, try-catches obfuscate code. => delete Thanks</technical_language>

Target:
private void importProject(Intent data) { if (data == null || data.getData() == null) { setShowProgressBar(false); ToastUtil.showError(getContext(), R.string.error_import_project); return; } try { File cacheFile = new File(CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); if (cacheFile.exists()) { cacheFile.delete(); } File src = new File(data.getData().getPath()); if (src.isDirectory()) { new ProjectImportTask() .setListener(projectImportListener) .execute(src); } else { File projectFile = StorageOperations .copyUriToDir(getContext().getContentResolver(), data.getData(), CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); new ProjectUnzipAndImportTask() .setListener(projectUnzipAndImportListener) .execute(projectFile); } setShowProgressBar(true); } catch (IOException e) { Log.e(TAG, "Cannot resolve project to import.", e); } }
Source:
<code>private ValidationResult validateAndAddToStorageRequests(QuotaStorageConsumptionParameter param, Quota quota, String commandClassName, Map<Pair<Guid, Guid>, StorageRequest> requestMap) { if (param.getStorageDomainId() == null) { log.error("Quota storage parameters from command '{}' are missing storage domain id", commandClassName); return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID); } Pair<Guid, Guid> key = quota.isGlobalStorageQuota() ? new Pair<>(quota.getId(), null) : new Pair<>(quota.getId(), param.getStorageDomainId()); if (!requestMap.containsKey(key)) { QuotaStorage quotaStorage = quota.isGlobalStorageQuota() ? quota.getGlobalQuotaStorage() : quota.getQuotaStorages().stream() .filter(s -> s.getStorageId().equals(param.getStorageDomainId())) .findAny().orElse(null); if (quotaStorage == null) { log.error("Quota storage parameters from command '{}'. Storage domain does not match quota", commandClassName); return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_NO_QUOTA_SET_FOR_DOMAIN); } requestMap.put(key, new StorageRequest(quota, quotaStorage)); } double requestedStorage <START> = param.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.CONSUME ? param.getRequestedStorageGB() : -param.getRequestedStorageGB(); <END> StorageRequest request = requestMap.get(key); request.addStorage(requestedStorage); return ValidationResult.VALID; }</code><technical_language>I switch multiple else if sections for QuotaAction values</technical_language>

Target:
private ValidationResult validateAndAddToStorageRequests(QuotaStorageConsumptionParameter param, Quota quota, String commandClassName, Map<Pair<Guid, Guid>, StorageRequest> requestMap) { if (param.getStorageDomainId() == null) { log.error("Quota storage parameters from command '{}' are missing storage domain id", commandClassName); return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID); } Pair<Guid, Guid> key = quota.isGlobalStorageQuota() ? new Pair<>(quota.getId(), null) : new Pair<>(quota.getId(), param.getStorageDomainId()); if (!requestMap.containsKey(key)) { QuotaStorage quotaStorage = quota.isGlobalStorageQuota() ? quota.getGlobalQuotaStorage() : quota.getQuotaStorages().stream() .filter(s -> s.getStorageId().equals(param.getStorageDomainId())) .findAny().orElse(null); if (quotaStorage == null) { log.error("Quota storage parameters from command '{}'. Storage domain does not match quota", commandClassName); return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_NO_QUOTA_SET_FOR_DOMAIN); } requestMap.put(key, new StorageRequest(quota, quotaStorage)); } int quotaActionCoef = 1; if (param.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.RELEASE) { quotaActionCoef = -1; } StorageRequest request = requestMap.get(key); request.addStorage(quotaActionCoef * param.getRequestedStorageGB()); return ValidationResult.VALID; }
Source:
<code>static ICPPFunction[] instantiateForFunctionCall(ICPPFunction[] fns, ICPPTemplateArgument[] tmplArgs, List<IType> fnArgs, List<ValueCategory> argCats, boolean withImpliedObjectArg, IASTNode point) { boolean requireTemplate= tmplArgs != null; boolean haveTemplate= false; for (final ICPPFunction func : fns) { if (func instanceof ICPPConstructor || (func instanceof ICPPMethod && ((ICPPMethod) func).isDestructor())) requireTemplate= false; if (func instanceof ICPPFunctionTemplate) { ICPPFunctionTemplate template= (ICPPFunctionTemplate) func; try { if (containsDependentType(fnArgs)) return new ICPPFunction[] {CPPDeferredFunction.createForCandidates(fns)}; if (requireTemplate) { <START> if (hasDependentArgument(tmplArgs)) <END> return new ICPPFunction[] {CPPDeferredFunction.createForCandidates(fns)}; } } catch (DOMException e) { return NO_FUNCTIONS; } haveTemplate= true; break; } } if (!haveTemplate && !requireTemplate) return fns; final List<ICPPFunction> result= new ArrayList<ICPPFunction>(fns.length); for (ICPPFunction fn : fns) { if (fn != null) { if (fn instanceof ICPPFunctionTemplate) { ICPPFunctionTemplate fnTmpl= (ICPPFunctionTemplate) fn; ICPPFunction inst = instantiateForFunctionCall(fnTmpl, tmplArgs, fnArgs, argCats, withImpliedObjectArg, point); if (inst != null) result.add(inst); } else if (!requireTemplate || fn instanceof ICPPUnknownBinding) { result.add(fn); } } } return result.toArray(new ICPPFunction[result.size()]); }</code><technical_language>Please combine conditions</technical_language>

Target:
static ICPPFunction[] instantiateForFunctionCall(ICPPFunction[] fns, ICPPTemplateArgument[] tmplArgs, List<IType> fnArgs, List<ValueCategory> argCats, boolean withImpliedObjectArg, IASTNode point) { boolean requireTemplate= tmplArgs != null; boolean haveTemplate= false; for (final ICPPFunction func : fns) { if (func instanceof ICPPConstructor || (func instanceof ICPPMethod && ((ICPPMethod) func).isDestructor())) requireTemplate= false; if (func instanceof ICPPFunctionTemplate) { ICPPFunctionTemplate template= (ICPPFunctionTemplate) func; if (containsDependentType(fnArgs)) return new ICPPFunction[] {CPPDeferredFunction.createForCandidates(fns)}; if (requireTemplate && hasDependentArgument(tmplArgs)) return new ICPPFunction[] {CPPDeferredFunction.createForCandidates(fns)}; haveTemplate= true; break; } } if (!haveTemplate && !requireTemplate) return fns; final List<ICPPFunction> result= new ArrayList<ICPPFunction>(fns.length); for (ICPPFunction fn : fns) { if (fn != null) { if (fn instanceof ICPPFunctionTemplate) { ICPPFunctionTemplate fnTmpl= (ICPPFunctionTemplate) fn; ICPPFunction inst = instantiateForFunctionCall(fnTmpl, tmplArgs, fnArgs, argCats, withImpliedObjectArg, point); if (inst != null) result.add(inst); } else if (!requireTemplate || fn instanceof ICPPUnknownBinding) { result.add(fn); } } } return result.toArray(new ICPPFunction[result.size()]); }
Source:
<code>private Set<JoinPath> extractJoinPaths(Set<ColumnProjection> groupByDimensions, Table table) { return resolveProjectedDimensions(groupByDimensions, table).stream() .map(column -> referenceTable.getResolvedJoinPaths(table, column.getName())) <START> .map(Collection::stream) <END> .reduce(Stream.empty(), (s1, s2) -> Streams.concat(s1, s2)) .collect(Collectors.toCollection(LinkedHashSet::new)); }</code><technical_language>flatmap</technical_language>

Target:
private Set<JoinPath> extractJoinPaths(Set<ColumnProjection> groupByDimensions, Table table) { return resolveProjectedDimensions(groupByDimensions, table).stream() .map(column -> referenceTable.getResolvedJoinPaths(table, column.getName())) .flatMap(Collection::stream) .collect(Collectors.toCollection(LinkedHashSet::new)); }
Source:
<code>protected Query doBuild(LuceneSearchPredicateContext context) { if ( !ignoreAnalyzer && overrideAnalyzer == null ) { analyzerChecker.failIfNotCompatible(); } Analyzer analyzer = buildAnalyzer(); Map<String, Float> weights = new LinkedHashMap<>(); for ( String fieldName : fields.keySet() ) { LuceneSimpleQueryStringPredicateBuilderFieldState state = fields.get( fieldName ); Float boost = state.getBoost(); if ( boost == null ) { boost = 1f; } weights.put( fieldName, boost ); } <START> SimpleQueryParser queryParser = new SimpleQueryParser( analyzer, weights, -1 ); <END> queryParser.setDefaultOperator( defaultOperator ); return queryParser.parse( simpleQueryString ); }</code><technical_language>Fair enough. FieldContextSimpleQueryParser is longer used, please remove it</technical_language>

Target:
protected Query doBuild(LuceneSearchPredicateContext context) { if ( !ignoreAnalyzer && overrideAnalyzer == null ) { analyzerChecker.failIfNotCompatible(); } Analyzer analyzer = buildAnalyzer(); Map<String, Float> weights = new LinkedHashMap<>(); for ( Map.Entry<String, LuceneSimpleQueryStringPredicateBuilderFieldState> entry : fields.entrySet() ) { LuceneSimpleQueryStringPredicateBuilderFieldState state = entry.getValue(); Float boost = state.getBoost(); if ( boost == null ) { boost = 1f; } weights.put( entry.getKey(), boost ); } SimpleQueryParser queryParser = new SimpleQueryParser( analyzer, weights, -1 ); queryParser.setDefaultOperator( defaultOperator ); return queryParser.parse( simpleQueryString ); }
Source:
<code>private boolean _getAutoTeleportEnabled() { <START> return config.getBoolean("autoteleportenabled", false); <END> }</code><technical_language>a config key (though I appreciate this is based teleportenabled above) - "teleportauto"</technical_language>

Target:
private boolean _getAutoTeleportEnabled() { return config.getBoolean("teleportauto", false); }
Source:
<code>public List<ChangeData> queryChanges(final String queryString) throws OrmException, QueryParseException { final Predicate<ChangeData> visibleToMe = queryBuilder.is_visible(); Predicate<ChangeData> s = compileQuery(queryString, visibleToMe); List<ChangeData> results = new ArrayList<ChangeData>(); HashSet<Change.Id> want = new HashSet<Change.Id>(); for (ChangeData d : ((ChangeDataSource) s).read()) { if (d.hasChange()) { if (visibleToMe.match(d)) { results.add(d); } } else { want.add(d.getId()); } } if (!want.isEmpty()) { for (Change c : db.get().changes().get(want)) { ChangeData d = new ChangeData(c); if (visibleToMe.match(d)) { results.add(d); } } } Collections.sort(results, sortkeyAfter != null ? cmpAfter : cmpBefore); int limit = limit(s); if (results.size() > maxLimit) { moreResults = true; } if (limit < results.size()) { results = results.subList(0, limit); } if (sortkeyAfter != null) { Collections.reverse(results); } <START> queryBuilder.release(); <END> return results; }</code><technical_language>important is cached RevWalks released in case of exception? Put this in a finally block</technical_language>

Target:
public List<ChangeData> queryChanges(final String queryString) throws OrmException, QueryParseException { final Predicate<ChangeData> visibleToMe = queryBuilder.is_visible(); Predicate<ChangeData> s = compileQuery(queryString, visibleToMe); List<ChangeData> results = new ArrayList<ChangeData>(); HashSet<Change.Id> want = new HashSet<Change.Id>(); try { for (ChangeData d : ((ChangeDataSource) s).read()) { if (d.hasChange()) { if (visibleToMe.match(d)) { results.add(d); } } else { want.add(d.getId()); } } if (!want.isEmpty()) { for (Change c : db.get().changes().get(want)) { ChangeData d = new ChangeData(c); if (visibleToMe.match(d)) { results.add(d); } } } Collections.sort(results, sortkeyAfter != null ? cmpAfter : cmpBefore); int limit = limit(s); if (results.size() > maxLimit) { moreResults = true; } if (limit < results.size()) { results = results.subList(0, limit); } if (sortkeyAfter != null) { Collections.reverse(results); } } finally { queryBuilder.release(); } return results; }
Source:
<code>public SlackNotificationException(IOException e) { <START> super("Unable to send a notification to slack error:" + e.getMessage()); <END> }</code><technical_language>suggestion super("Unable send a notification slack:" + e.getMessage());</technical_language>

Target:
public SlackNotificationException(IOException e) { super("Unable to send a notification to slack:" + e.getMessage()); }
Source:
<code>private void processSwitchEvent(List<PilightBindingConfig> configs, Status status) { String type = status.getType(); State state = OnOffType.valueOf(status.getValues().get("state").toUpperCase()); if (type.equals(DeviceType.SWITCH)) { } else if (type.equals(DeviceType.DIMMER)) { BigDecimal dimLevel = BigDecimal.ZERO; if (status.getValues().get("dimlevel") != null) dimLevel = getPercentageFromDimLevel(status.getValues().get("dimlevel")); else { dimLevel = state.equals(OnOffType.ON) ? new BigDecimal("100") : BigDecimal.ZERO; } state = new PercentType(dimLevel); } <START> for (PilightBindingConfig config : configs) <END> eventPublisher.postUpdate(config.getItemName(), state); }</code><technical_language>please add curly braces</technical_language>

Target:
private void processSwitchEvent(List<PilightBindingConfig> configs, Status status) { String type = status.getType(); State state = OnOffType.valueOf(status.getValues().get("state").toUpperCase()); if (type.equals(DeviceType.SWITCH)) { } else if (type.equals(DeviceType.DIMMER)) { BigDecimal dimLevel = BigDecimal.ZERO; if (status.getValues().get("dimlevel") != null) dimLevel = getPercentageFromDimLevel(status.getValues().get("dimlevel")); else { dimLevel = state.equals(OnOffType.ON) ? new BigDecimal("100") : BigDecimal.ZERO; } state = new PercentType(dimLevel); } for (PilightBindingConfig config : configs) { eventPublisher.postUpdate(config.getItemName(), state); } }
Source:
<code>private String getKey(String liveEnvName) { if (interceptorManager.isPlaybackMode()) { return DUMMY_KEY; } <START> return System.getenv(liveEnvName); <END> }</code><technical_language>If is live mode, assert this is set</technical_language>

Target:
private String getKey(String liveEnvName) { if (interceptorManager.isPlaybackMode()) { return DUMMY_KEY; } String key = System.getenv(liveEnvName); assertNotNull(key, "System environment variable " + liveEnvName + "is null"); return key; }
Source:
<code>public ICubeGenerator createCubeGenerator() { if(!(this.worldObj.getWorldType() instanceof ICubicWorldType)){ <START> throw new IllegalStateException("Cubic world provider does not override creageCubeGenerator() and the world type is not ICubicWorldType!"); <END> } return ((ICubicWorldType) this.worldObj.getWorldType()) .createCubeGenerator(getCubicWorld()); }</code><technical_language>greage->create</technical_language>

Target:
public ICubeGenerator createCubeGenerator() { if(!(this.worldObj.getWorldType() instanceof ICubicWorldType)){ throw new IllegalStateException("Cubic world provider does not override createCubeGenerator() and the world type is not ICubicWorldType!"); } return ((ICubicWorldType) this.worldObj.getWorldType()) .createCubeGenerator(getCubicWorld()); }
Source:
<code>public String getCachedString() { final String rv; if (variableData.expression == null || variableData.expression.length() == 0) { <START> rv = "_"; <END> } else if (Double.isNaN(getCachedValue())) { rv = "*"; } else { rv = String.valueOf((int) getCachedValue()); } return rv; }</code><technical_language>move constant. rv, of course. ;)</technical_language>

Target:
private String getCachedString() { final String returnValue; if (variableData.expression == null || variableData.expression.length() == 0) { returnValue = getContext().getString(R.string.empty_equation_result); } else if (Double.isNaN(getCachedValue())) { returnValue = getContext().getString(R.string.equation_error_result); } else { returnValue = String.valueOf((int) getCachedValue()); } return returnValue; }
Source:
<code>public void testMapGenericExecuteMask() { final WinNT.GENERIC_MAPPING mapping = new WinNT.GENERIC_MAPPING(); mapping.genericRead = new DWORD(FILE_GENERIC_READ); mapping.genericWrite = new DWORD(FILE_GENERIC_WRITE); mapping.genericExecute = new DWORD(FILE_GENERIC_EXECUTE); mapping.genericAll = new DWORD(FILE_ALL_ACCESS); final DWORDByReference rights = new DWORDByReference(new DWORD(GENERIC_EXECUTE)); Advapi32.INSTANCE.MapGenericMask(rights, mapping); assertEquals(FILE_GENERIC_EXECUTE, rights.getValue().intValue()); <START> assertTrue(GENERIC_EXECUTE != (rights.getValue().intValue() & GENERIC_EXECUTE)); <END> }</code><technical_language>Extra space !=. a instances of this</technical_language>

Target:
public void testMapGenericExecuteMask() { final GENERIC_MAPPING mapping = new GENERIC_MAPPING(); mapping.genericRead = new DWORD(FILE_GENERIC_READ); mapping.genericWrite = new DWORD(FILE_GENERIC_WRITE); mapping.genericExecute = new DWORD(FILE_GENERIC_EXECUTE); mapping.genericAll = new DWORD(FILE_ALL_ACCESS); final DWORDByReference rights = new DWORDByReference(new DWORD(GENERIC_EXECUTE)); Advapi32.INSTANCE.MapGenericMask(rights, mapping); assertEquals(FILE_GENERIC_EXECUTE, rights.getValue().intValue()); assertTrue(GENERIC_EXECUTE != (rights.getValue().intValue() & GENERIC_EXECUTE)); }
Source:
<code><START> private boolean isCustomPage(HttpMessage msg, CustomPage.Type cpType) { <END> if (customPageMap == null) { customPageMap = new HashMap<CustomPage.Type, Boolean>(); } return customPageMap.computeIfAbsent( cpType, k -> customPageMap.put(cpType, context.isCustomPage(msg, cpType))); }</code><technical_language>Needs check (and return) if context is null</technical_language>

Target:
private boolean isCustomPage(HttpMessage msg, CustomPage.Type cpType) { if (context == null) { return false; } if (customPageMap == null) { customPageMap = new HashMap<CustomPage.Type, Boolean>(); } return customPageMap.computeIfAbsent( cpType, type -> context.isCustomPageWithFallback(msg, type)); }
Source:
<code>public Page getOutput() { if (!fragmentsBlocks.isEmpty()) { Block fragmentsBlock = fragmentsBlocks.poll(); systemMemoryContext.setBytes(getRetainedMemoryBytes()); return createFragmentsPage(fragmentsBlock); } if (!isBlocked().isDone()) { return null; } if (!statisticsAggregationOperator.isFinished()) { verify(statisticsAggregationOperator.isBlocked().isDone(), "aggregation operator should not be blocked"); OperationTimer timer = new OperationTimer(statisticsCpuTimerEnabled); Page page = statisticsAggregationOperator.getOutput(); timer.end(statisticsTiming); if (page == null) { return null; <START> } <END> return createStatisticsPage(types, page, getTableCommitContext(false)); } if (state != State.FINISHING) { return null; } state = State.FINISHED; Page finalPage = createFinalPage(); systemMemoryContext.setBytes(getRetainedMemoryBytes()); return finalPage; }</code><technical_language>Curious: Is scenario possible: - Some stats paged added - getOutput is called returns merged stats page - Some new stats pages added</technical_language>

Target:
public Page getOutput() { if (!fragmentsBlocks.isEmpty()) { Block fragmentsBlock = fragmentsBlocks.poll(); systemMemoryContext.setBytes(getRetainedMemoryBytes()); return createFragmentsPage(fragmentsBlock); } if (!isBlocked().isDone()) { return null; } if (!statisticsAggregationOperator.isFinished()) { verify(statisticsAggregationOperator.isBlocked().isDone(), "aggregation operator should not be blocked"); OperationTimer timer = new OperationTimer(statisticsCpuTimerEnabled); Page page = statisticsAggregationOperator.getOutput(); timer.end(statisticsTiming); if (page == null) { return null; } return createStatisticsPage(types, page, createTableCommitContext(false)); } if (state != State.FINISHING) { return null; } state = State.FINISHED; Page finalPage = createFinalPage(); systemMemoryContext.setBytes(getRetainedMemoryBytes()); return finalPage; }
Source:
<code>public void cleanupVmSnapshotJobs(){ List<AsyncJobVO> jobs = _jobMgr.findFailureAsyncJobs(VmWorkCreateVMSnapshot.class.getName(), VmWorkRevertToVMSnapshot.class.getName()); for (AsyncJobVO job : jobs) { try { if (job.getCmd().equalsIgnoreCase(VmWorkCreateVMSnapshot.class.getName())) { VmWorkCreateVMSnapshot work = VmWorkSerializer.deserialize(VmWorkCreateVMSnapshot.class, job.getCmdInfo()); cleanupVmSnapshotCreateFailure(work.getVmSnapshotId()); } else if(job.getCmd().equalsIgnoreCase(VmWorkRevertToVMSnapshot.class.getName())) { VmWorkRevertToVMSnapshot work = VmWorkSerializer.deserialize(VmWorkRevertToVMSnapshot.class, job.getCmdInfo()); cleanupVmSnapshotRevertFailure(work.getVmSnapshotId()); } <START> } catch (Exception e) { <END> s_logger.debug("clean up job failure, will continue", e); } } }</code><technical_language>exception do expect here? Is deserialization failure else? catch specific exceptions</technical_language>

Target:
public void cleanupVmSnapshotJobs(){ List<AsyncJobVO> jobs = _jobMgr.findFailureAsyncJobs(VmWorkCreateVMSnapshot.class.getName(), VmWorkRevertToVMSnapshot.class.getName()); for (AsyncJobVO job : jobs) { try { if (job.getCmd().equalsIgnoreCase(VmWorkCreateVMSnapshot.class.getName())) { VmWorkCreateVMSnapshot work = VmWorkSerializer.deserialize(VmWorkCreateVMSnapshot.class, job.getCmdInfo()); cleanupVmSnapshotCreateFailure(work.getVmSnapshotId()); } else if(job.getCmd().equalsIgnoreCase(VmWorkRevertToVMSnapshot.class.getName())) { VmWorkRevertToVMSnapshot work = VmWorkSerializer.deserialize(VmWorkRevertToVMSnapshot.class, job.getCmdInfo()); cleanupVmSnapshotRevertFailure(work.getVmSnapshotId()); } } catch (Exception e) { s_logger.error("clean up job failure, will continue", e); } } }
Source:
<code>protected void performCheck() throws Exception { <START> doCheck(videobridge); <END> }</code><technical_language>lazy expand file in diff...does doCheck get called multiple places? put logic here</technical_language>

Target:
protected void performCheck() throws Exception { Objects.requireNonNull(videobridge, "No Videobridge service available"); if (MappingCandidateHarvesters.stunDiscoveryFailed) { throw new Exception("Address discovery through STUN failed"); } if (!Harvesters.isHealthy()) { throw new Exception("Failed to bind single-port"); } checkXmppConnection(videobridge); Conference conference = videobridge.createConference(null, null, false, null); try { check(conference); } finally { videobridge.expireConference(conference); } }
Source:
<code>void replay() { synchronized (this) { if (emitting) { missed = true; return; } emitting = true; } Queue<Object> q = queue; for (;;) { Subscriber<? super T> s = subscriber.get(); boolean unlimited = false; if (s != null) { boolean d = done; boolean empty = q.isEmpty(); <START> if (checkTerminated(d, empty, delayError, s)) { <END> return; } long r = get(); unlimited = r == Long.MAX_VALUE; long e = 0L; while (r != 0) { d = done; Object v = q.poll(); empty = v == null; if (checkTerminated(d, empty, delayError, s)) { return; } if (empty) { break; } T value = NotificationLite.getValue(v); try { s.onNext(value); } catch (Throwable ex) { q.clear(); Exceptions.throwIfFatal(ex); s.onError(OnErrorThrowable.addValueAsLastCause(ex, value)); return; } r--; e++; } if (!unlimited && e != 0L) { addAndGet(-e); } } synchronized (this) { if (!missed) { if (unlimited && q.isEmpty()) { caughtUp = true; } emitting = false; return; } missed = false; } } }</code><technical_language>a local delayError field for this, re-reading flag emission unnecessary false sharing. java Queue<Object> q = queue; boolean delayError = this.delayError; // ..</technical_language>

Target:
void replay() { synchronized (this) { if (emitting) { missed = true; return; } emitting = true; } Queue<Object> q = queue; boolean delayError = this.delayError; for (;;) { Subscriber<? super T> s = subscriber.get(); boolean unlimited = false; if (s != null) { boolean d = done; boolean empty = q.isEmpty(); if (checkTerminated(d, empty, delayError, s)) { return; } long r = get(); unlimited = r == Long.MAX_VALUE; long e = 0L; while (r != 0) { d = done; Object v = q.poll(); empty = v == null; if (checkTerminated(d, empty, delayError, s)) { return; } if (empty) { break; } T value = NotificationLite.getValue(v); try { s.onNext(value); } catch (Throwable ex) { q.clear(); Exceptions.throwIfFatal(ex); s.onError(OnErrorThrowable.addValueAsLastCause(ex, value)); return; } r--; e++; } if (!unlimited && e != 0L) { addAndGet(-e); } } synchronized (this) { if (!missed) { if (unlimited && q.isEmpty()) { caughtUp = true; } emitting = false; return; } missed = false; } } }
Source:
<code>private StringConverter<Number> ratingLabelFormatter(final List<RatingHistoryDataPoint> dataPoints) { return new StringConverter<Number>() { @Override public String toString(Number object) { int number = object.intValue(); int numberOfDataPoints = dataPoints.size(); int dataPointIndex = number >= numberOfDataPoints ? numberOfDataPoints - 1 : number; <START> return dataPoints.get(dataPointIndex) == null ? "" : DATE_FORMATTER.format(dataPoints.get(dataPointIndex).getInstant()); <END> } @Override public Number fromString(String string) { return null; } }; }</code><technical_language>Actually, issue #794 is ArrayIndexOutOfBoundsException NullPointerException is caused dataPoints index dataPointIndex - exact code above. proper fix be: if(dataPointIndex >= dataPoints.size()) { return ""; } return dataPoints.get(dataPointIndex); Please adjust issue title commit message well</technical_language>

Target:
private StringConverter<Number> ratingLabelFormatter(final List<RatingHistoryDataPoint> dataPoints) { return new StringConverter<Number>() { @Override public String toString(Number object) { int number = object.intValue(); int numberOfDataPoints = dataPoints.size(); int dataPointIndex = number >= numberOfDataPoints ? numberOfDataPoints - 1 : number; if (dataPointIndex >= dataPoints.size() || dataPointIndex < 0) { return ""; } return DATE_FORMATTER.format(dataPoints.get(dataPointIndex).getInstant()); } @Override public Number fromString(String string) { return null; } }; }
Source:
<code><START> private static Map<String, String> extractMetadata(Map<Utf8, Utf8> metadata) { <END> if (metadata == null) { return Collections.EMPTY_MAP; } return metadata.entrySet() .stream() .collect(Collectors.toMap( entry -> entry.getKey().toString(), entry -> entry.getValue().toString() )); }</code><technical_language>express this as: return Optional.fromNullable(metadata).or(Collections.EMPTY_MAP).entrySet().stream().collect(...stuff...);</technical_language>

Target:
private Map<String, String> extractMetadata(Map<Utf8, Utf8> metadata) { return Optional.ofNullable(metadata).orElse(Collections.emptyMap()) .entrySet() .stream() .collect(Collectors.toMap( entry -> entry.getKey().toString(), entry -> entry.getValue().toString() )); }
Source:
<code>private Mutation createDelMutation(String path, String cf, String cq, String val) { Text row = <START> new Text(MetadataSchema.DeletesSection.getRowPrefix() + SortSkew.getCode(path) + path); <END> Mutation delFlag = new Mutation(row); delFlag.put(cf, cq, val); return delFlag; }</code><technical_language>pattern MetadataSchema.DeletesSection.getRowPrefix() + SortSkew.getCode(path) + path utility function, frequently. Perhaps: MetadataSchema.DeletesSection.encodeDeleteRow(path) similar</technical_language>

Target:
private Mutation createDelMutation(String path, String cf, String cq, String val) { Text row = new Text(MetadataSchema.DeletesSection.encodeRow(path)); Mutation delFlag = new Mutation(row); delFlag.put(cf, cq, val); return delFlag; }
Source:
<code>protected V failoverExecution(final Exception cause, long timeout, TimeUnit unit) throws Exception { final List<Address> executionCandidates = executionCandidates(getOwningTask()); FailoverContext fc = new FailoverContext() { @Override public <K> List<K> inputKeys() { return (List<K>) getInputKeys(); } @Override public Address executionFailureLocation() { return getExecutionTarget(); } @Override public List<Address> executionCandidates() { return executionCandidates; } @Override public Throwable cause() { return cause; } }; Address target = getOwningTask().getTaskFailoverPolicy().failover(fc); <START> log.warnf("Distributed task failed at %s due to %s and is failing over to be executed at %s", getExecutionTarget(), cause, target); <END> DistributedTaskPart<V> part = createDistributedTaskPart(owningTask, distCommand, getInputKeys(), target, failedOverCount); part.execute(); return part.get(timeout, unit); }</code><technical_language>INFO messages above, including WARN need explicitly. For core, done in org.infinispan.util.logging.Log find plenty of examples</technical_language>

Target:
protected V failoverExecution(final Exception cause, long timeout, TimeUnit unit) throws Exception { final List<Address> executionCandidates = executionCandidates(getOwningTask()); FailoverContext fc = new FailoverContext() { @Override public <K> List<K> inputKeys() { return (List<K>) getInputKeys(); } @Override public Address executionFailureLocation() { return getExecutionTarget(); } @Override public List<Address> executionCandidates() { return executionCandidates; } @Override public Throwable cause() { return cause; } }; Address failoverTarget = getOwningTask().getTaskFailoverPolicy().failover(fc); log.distributedTaskFailover(fc.executionFailureLocation(), failoverTarget, cause); DistributedTaskPart<V> part = createDistributedTaskPart(owningTask, distCommand, getInputKeys(), failoverTarget, failedOverCount); part.execute(); return part.get(timeout, unit); }
Source:
<code>public String getMessage() { if (this.getCause() == null) { return super.getMessage(); } else if (this.getCause() instanceof QueryInterruptedException){ <START> return this.getMessage(); <END> } else if (this.getCause() instanceof InterruptedException) { return QUERY_INTERRUPTED; } else if (this.getCause() instanceof CancellationException) { return QUERY_CANCELLED; } else if (this.getCause() instanceof TimeoutException) { return QUERY_TIMEOUT; } else { return UNKNOWN_EXCEPTION; } }</code><technical_language>loooooooop. getCause().getMessage()</technical_language>

Target:
public String getMessage() { if (this.getCause() == null) { return super.getMessage(); } else if (this.getCause() instanceof QueryInterruptedException) { return getCause().getMessage(); } else if (this.getCause() instanceof InterruptedException) { return QUERY_INTERRUPTED; } else if (this.getCause() instanceof CancellationException) { return QUERY_CANCELLED; } else if (this.getCause() instanceof TimeoutException) { return QUERY_TIMEOUT; } else { return UNKNOWN_EXCEPTION; } }
Source:
<code>public ResponseData build() { <START> final ResponseData rtuResponseData = new ResponseData(this.organisationIdentification, this.messageType, <END> this.deviceIdentification, this.correlationUid, this.resultType, this.messageData); return rtuResponseData; }</code><technical_language>cleaner name this responseData? (The build method return new response data immediately, instead of storing in a local variable.)</technical_language>

Target:
public ResponseData build() { return new ResponseData(this.organisationIdentification, this.messageType, this.deviceIdentification, this.correlationUid, this.resultType, this.messageData); }
Source:
<code>private boolean mkdir(Path path) throws IOException { String key = pathToKey(path); <START> adapter.createDirectory(key); <END> return true; }</code><technical_language>Lets return of apapter.createDirectory</technical_language>

Target:
private boolean mkdir(Path path) throws IOException { String key = pathToKey(path); return adapter.createDirectory(key); }