auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void handleFinalizingSuccess(final StateContext context) { log.info("Finalizing successful transfer for {}", getTransferDescription()); if (stopImageTransferSession(context.entity)) { if (getParameters().getTransferType() == TransferType.Download) { unLockImage(); updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); <START> return; <END> } Guid transferingVdsId = context.entity.getVdsId(); if (verifyImage(transferingVdsId)) { setVolumeLegalityInStorage(LEGAL_IMAGE); if (getImage().getVolumeFormat().equals(VolumeFormat.COW)) { setQcowCompat(getImage().getImage(), getStoragePool().getId(), getImage().getImage().getDiskId(), getImage().getImageId(), getStorageDomainId(), transferingVdsId); imageDao.update(getImage().getImage()); } unLockImage(); updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); } else { setImageStatus(ImageStatus.ILLEGAL); updateEntityPhase(ImageTransferPhase.FINALIZING_FAILURE); } tearDownImage(context.entity.getVdsId()); } }</code><technical_language>want tear down. a straight-forward if-else</technical_language>

Target:
private void handleFinalizingSuccess(final StateContext context) { log.info("Finalizing successful transfer for {}", getTransferDescription()); if (stopImageTransferSession(context.entity)) { Guid transferingVdsId = context.entity.getVdsId(); if (getParameters().getTransferType() == TransferType.Download) { unLockImage(); updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); } else if (verifyImage(transferingVdsId)) { setVolumeLegalityInStorage(LEGAL_IMAGE); if (getImage().getVolumeFormat().equals(VolumeFormat.COW)) { setQcowCompat(getImage().getImage(), getStoragePool().getId(), getImage().getImage().getDiskId(), getImage().getImageId(), getStorageDomainId(), transferingVdsId); imageDao.update(getImage().getImage()); } unLockImage(); updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); } else { setImageStatus(ImageStatus.ILLEGAL); updateEntityPhase(ImageTransferPhase.FINALIZING_FAILURE); } tearDownImage(context.entity.getVdsId()); } }
Source:
<code>public void labelOverUnboundSubject() throws QueryEvaluationException { TupleQueryResult result = lookupLabel(null, "en", "?s", "rdfs:label"); <START> BlazegraphAssertions.assertThat(result.next()).doesNotBinds("sLabel"); <END> assertFalse(result.hasNext()); }</code><technical_language>rename doesNotBind? itchy time I read :)</technical_language>

Target:
public void labelOverUnboundSubject() throws QueryEvaluationException { TupleQueryResult result = lookupLabel(null, "en", "?s", "rdfs:label"); BlazegraphAssertions.assertThat(result.next()).doesNotBind("sLabel"); assertFalse(result.hasNext()); }
Source:
<code>public CodeWriter unindent(int levels) { <START> checkState(indentLevel - levels >= 0); <END> indentLevel -= levels; return this; }</code><technical_language>checkArgument w/message of some sort</technical_language>

Target:
public CodeWriter unindent(int levels) { checkArgument(indentLevel - levels >= 0); indentLevel -= levels; return this; }
Source:
<code>public Matrix get(final int[] indices) { if (indices == null) { throw new RuntimeException("Array of indices cannot be null"); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; <START> for (final int index : indices) { <END> if (index < min) { min = index; } if (index > max) { max = index; } } final FloatPointer hostPtr = new FloatPointer(max - min + 1); if (!JavaCuda.d2hMemcpy(hostPtr, devPtr.position(FLOAT_SIZE * min), FLOAT_SIZE * (max - min + 1))) { devPtr.position(0); throw new RuntimeException("Failed to copy memory from GPU."); } devPtr.position(0); final MatrixCudaImpl newMatrix = new MatrixCudaImpl(indices.length, 1); for (int i = 0; i < indices.length; i++) { newMatrix.put(i, hostPtr.get(indices[i] - min)); } return newMatrix; }</code><technical_language>happen if indices.length is 0</technical_language>

Target:
public Matrix get(final int[] indices) { if (indices == null || indices.length == 0) { throw new IllegalArgumentException("Array of indices cannot be null or zero-size"); } final MatrixCudaImpl newMatrix = new MatrixCudaImpl(indices.length, 1); for (int i = 0; i < indices.length; i++) { if (!JavaCuda.d2dMemcpy(newMatrix.devPtr.position(i * FLOAT_SIZE), devPtr.position(FLOAT_SIZE * indices[i]), FLOAT_SIZE)) { devPtr.position(0); newMatrix.free(); throw new RuntimeException("Failed to copy memory from GPU."); } } newMatrix.devPtr.position(0); devPtr.position(0); return newMatrix; }
Source:
<code>private OAuthAuthenticator getAuthenticator(String oauthProviderName) { OAuthAuthenticator oauth = providers.getAuthenticator(oauthProviderName); if (oauth == null) { <START> LOG.error("Unsupported OAuth provider ", oauthProviderName); <END> throw new WebApplicationException(Response.status(400).entity("Unsupported OAuth provider " + oauthProviderName).type(MediaType.TEXT_PLAIN) .build()); } return oauth; }</code><technical_language>this ERROR</technical_language>

Target:
private OAuthAuthenticator getAuthenticator(String oauthProviderName) throws BadRequestException { OAuthAuthenticator oauth = providers.getAuthenticator(oauthProviderName); if (oauth == null) { LOG.warn(format(UNSUPPORTED_OAUTH_PROVIDER_ERROR, oauthProviderName)); throw new BadRequestException(format(UNSUPPORTED_OAUTH_PROVIDER_ERROR, oauthProviderName)); } return oauth; }
Source:
<code>public Map<String, Map<Integer, LagInfo>> allLocalStorePartitionLags() { final Map<String, Map<Integer, LagInfo>> localStorePartitionLags = new TreeMap<>(); final Collection<TopicPartition> allPartitions = new LinkedList<>(); final Map<TopicPartition, Long> allChangelogPositions = new HashMap<>(); for (final StreamThread streamThread : threads) { for (final Task task : streamThread.allTasks().values()) { allPartitions.addAll(task.changelogPartitions()); allChangelogPositions.putAll(task.changelogOffsets()); } } log.debug("Current changelog positions: {}", allChangelogPositions); final Map<TopicPartition, ListOffsetsResultInfo> allEndOffsets = fetchEndOffsets( allPartitions, adminClient, <START> getAdminDefaultApiTimeoutMs(config) <END> ); log.debug("Current end offsets :{}", allEndOffsets); for (final Map.Entry<TopicPartition, ListOffsetsResultInfo> entry : allEndOffsets.entrySet()) { final long earliestOffset = 0L; final long changelogPosition = allChangelogPositions.getOrDefault(entry.getKey(), earliestOffset); final long latestOffset = entry.getValue().offset(); final LagInfo lagInfo = new LagInfo(changelogPosition == Task.LATEST_OFFSET ? latestOffset : changelogPosition, latestOffset); final String storeName = streamsMetadataState.getStoreForChangelogTopic(entry.getKey().topic()); localStorePartitionLags.computeIfAbsent(storeName, ignored -> new TreeMap<>()) .put(entry.getKey().partition(), lagInfo); } return Collections.unmodifiableMap(localStorePartitionLags); }</code><technical_language>admin configs is built in KafkaStreams construction. reuse it? scala adminClient = clientSupplier.getAdmin(config.getAdminConfigs(ClientUtils.getSharedAdminClientId(clientId)));</technical_language>

Target:
public Map<String, Map<Integer, LagInfo>> allLocalStorePartitionLags() { final Map<String, Map<Integer, LagInfo>> localStorePartitionLags = new TreeMap<>(); final Collection<TopicPartition> allPartitions = new LinkedList<>(); final Map<TopicPartition, Long> allChangelogPositions = new HashMap<>(); for (final StreamThread streamThread : threads) { for (final Task task : streamThread.allTasks().values()) { allPartitions.addAll(task.changelogPartitions()); allChangelogPositions.putAll(task.changelogOffsets()); } } log.debug("Current changelog positions: {}", allChangelogPositions); final Map<TopicPartition, ListOffsetsResultInfo> allEndOffsets = fetchEndOffsets(allPartitions, adminClient); log.debug("Current end offsets :{}", allEndOffsets); for (final Map.Entry<TopicPartition, ListOffsetsResultInfo> entry : allEndOffsets.entrySet()) { final long earliestOffset = 0L; final long changelogPosition = allChangelogPositions.getOrDefault(entry.getKey(), earliestOffset); final long latestOffset = entry.getValue().offset(); final LagInfo lagInfo = new LagInfo(changelogPosition == Task.LATEST_OFFSET ? latestOffset : changelogPosition, latestOffset); final String storeName = streamsMetadataState.getStoreForChangelogTopic(entry.getKey().topic()); localStorePartitionLags.computeIfAbsent(storeName, ignored -> new TreeMap<>()) .put(entry.getKey().partition(), lagInfo); } return Collections.unmodifiableMap(localStorePartitionLags); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { boolean retval = true; switch (item.getItemId()) { case R.id.action_create_dir: CreateFolderDialogFragment dialog = CreateFolderDialogFragment.newInstance(mFile); dialog.show( getSupportFragmentManager(), CreateFolderDialogFragment.CREATE_FOLDER_FRAGMENT); break; case android.R.id.home: if ((mParents.size() > 1)) { onBackPressed(); } break; case R.id.action_sort_descending: item.setChecked(!item.isChecked()); boolean isAscending = !item.isChecked(); <START> com.owncloud.android.db.PreferenceManager.setSortAscending(isAscending,this,FileStorageUtils.FILE_DISPLAY_SORT); <END> switch(com.owncloud.android.db.PreferenceManager.getSortOrder(this,FileStorageUtils.FILE_DISPLAY_SORT)) { case FileStorageUtils.SORT_NAME: sortByName(isAscending); break; case FileStorageUtils.SORT_SIZE: sortBySize(isAscending); break; case FileStorageUtils.SORT_DATE: sortByDate(isAscending); break; } break; case R.id.action_sort_by_name: item.setChecked(true); sortByName(com.owncloud.android.db.PreferenceManager.getSortAscending(this,FileStorageUtils.FILE_DISPLAY_SORT)); break; case R.id.action_sort_by_size: item.setChecked(true); sortBySize(com.owncloud.android.db.PreferenceManager.getSortAscending(this,FileStorageUtils.FILE_DISPLAY_SORT)); break; case R.id.action_sort_by_date: item.setChecked(true); sortByDate(com.owncloud.android.db.PreferenceManager.getSortAscending(this,FileStorageUtils.FILE_DISPLAY_SORT)); break; default: retval = super.onOptionsItemSelected(item); } return retval; }</code><technical_language>com.owncloud.android.db is needed, call PreferenceManager properly imported top of class. Check class in more places</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { boolean retval = true; switch (item.getItemId()) { case R.id.action_create_dir: CreateFolderDialogFragment dialog = CreateFolderDialogFragment.newInstance(mFile); dialog.show( getSupportFragmentManager(), CreateFolderDialogFragment.CREATE_FOLDER_FRAGMENT); break; case android.R.id.home: if ((mParents.size() > 1)) { onBackPressed(); } break; case R.id.action_sort_descending: item.setChecked(!item.isChecked()); boolean isAscending = !item.isChecked(); PreferenceManager.setSortAscending(isAscending, this, FileStorageUtils.FILE_DISPLAY_SORT); switch (PreferenceManager.getSortOrder(this, FileStorageUtils.FILE_DISPLAY_SORT)) { case FileStorageUtils.SORT_NAME: sortByName(isAscending); break; case FileStorageUtils.SORT_SIZE: sortBySize(isAscending); break; case FileStorageUtils.SORT_DATE: sortByDate(isAscending); break; } break; case R.id.action_sort_by_name: item.setChecked(true); sortByName(PreferenceManager.getSortAscending(this, FileStorageUtils.FILE_DISPLAY_SORT)); break; case R.id.action_sort_by_size: item.setChecked(true); sortBySize(PreferenceManager.getSortAscending(this, FileStorageUtils.FILE_DISPLAY_SORT)); break; case R.id.action_sort_by_date: item.setChecked(true); sortByDate(PreferenceManager.getSortAscending(this, FileStorageUtils.FILE_DISPLAY_SORT)); break; default: retval = super.onOptionsItemSelected(item); } return retval; }
Source:
<code>public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object s1 = args[0]; Object s2 = args[1]; <START> if (s1 != null && s2 != null && s1 instanceof String && (s2 instanceof String || s2 instanceof Pattern)) { <END> String s = (String) s1; Pattern pattern = (s2 instanceof String) ? Pattern.compile((String) s2) : (Pattern) s2; Matcher matcher = pattern.matcher(s); if (matcher.find()) { return true; }else return false; } } return null; }</code><technical_language>Do a distinction String Pattern, in [replace() method](<LINK_0></technical_language>

Target:
public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object s1 = args[0]; Object s2 = args[1]; if (s1 != null && s2 != null && s1 instanceof String && s2 instanceof String) { return ((String) s1).indexOf((String) s2) > -1; } else if (s1 != null && s2 != null && s1 instanceof String && s2 instanceof Pattern){ String s = (String) s1; Pattern pattern = (Pattern) s2; Matcher matcher = pattern.matcher(s); if (matcher.find()) { return true; }else return false; } } return null; }
Source:
<code><START> public void simpleTestAES192() throws Exception { <END> KeyPair caPair = KeyPairGenerator.getInstance("RSA").generateKeyPair(); X509Certificate ca = X509Certificates.createEphemeral( new X500Principal("CN=CA"), caPair); KeyPair clientPair = KeyPairGenerator.getInstance("RSA") .generateKeyPair(); X509Certificate client = X509Certificates.createEphemeral( new X500Principal("CN=Client"), clientPair); PkcsPkiEnvelopeEncoder envEncoder = new PkcsPkiEnvelopeEncoder(ca, "AES_192"); PkiMessageEncoder encoder = new PkiMessageEncoder( clientPair.getPrivate(), client, envEncoder); PkcsPkiEnvelopeDecoder envDecoder = new PkcsPkiEnvelopeDecoder(ca, caPair.getPrivate()); PkiMessageDecoder decoder = new PkiMessageDecoder(client, envDecoder); PkiMessage<?> actual = decoder.decode(encoder.encode(message)); assertEquals(message, actual); }</code><technical_language>refactor tests parameterised cipher</technical_language>

Target:
public void simpleTestAES192() throws Exception { PkiMessage<?> actual = encodeAndDecodeEnvelope("AES_192"); assertEquals(message, actual); }
Source:
<code>public HSearchEntityContext(IndexedTypeIdentifier entityType, ExtendedSearchIntegrator factory) { indexBoundType = getIndexBoundType( entityType, factory ); if ( indexBoundType == null ) { IndexedTypesSet configuredSubTypes = factory.getConfiguredTypesPolymorphic( new Class<?>[] { entityType.getPojoType() } ); if ( configuredSubTypes.isEmpty() ) { throw log.cantQueryUnconfiguredType( entityType.getName() ); } else { <START> throw log.cantQueryUnindexedType( entityType.getName()); <END> } } originalAnalyzerReference = factory.getAnalyzerReference( indexBoundType.getPojoType() ); queryAnalyzerReferenceBuilder = factory.getAnalyzerReference( indexBoundType.getPojoType() ).startCopy(); IndexManagerType indexManagerType = factory.getIndexBinding( indexBoundType.getPojoType() ).getIndexManagerType(); analyzerRegistry = factory.getIntegration( indexManagerType ).getAnalyzerRegistry(); }</code><technical_language>Missing space getName()</technical_language>

Target:
public HSearchEntityContext(IndexedTypeIdentifier entityType, ExtendedSearchIntegrator factory) { indexBoundType = getIndexBoundType( entityType, factory ); if ( indexBoundType == null ) { IndexedTypeSet configuredSubTypes = factory.getConfiguredTypesPolymorphic( entityType.asTypeSet() ); if ( configuredSubTypes.isEmpty() ) { throw log.cantQueryUnconfiguredType( entityType.getName() ); } else { throw log.cantQueryUnindexedType( entityType.getName() ); } } originalAnalyzerReference = factory.getAnalyzerReference( indexBoundType ); queryAnalyzerReferenceBuilder = factory.getAnalyzerReference( indexBoundType ).startCopy(); IndexManagerType indexManagerType = factory.getIndexBinding( indexBoundType ).getIndexManagerType(); analyzerRegistry = factory.getIntegration( indexManagerType ).getAnalyzerRegistry(); }
Source:
<code>public AccessTokenResponse getAccessTokenResponse() throws OAuthException, IOException, OAuthError { <START> checkNotNull(handle, "handle must not be null"); <END> AccessTokenResponse lastAccessToken = storeHandler.loadAccessTokenResponse(handle); if (lastAccessToken == null) { return null; } if (lastAccessToken.isExpired(new Date(), tokenExpiresIn_Buffer) && lastAccessToken.getRefreshToken() != null) { return refreshToken(); } return lastAccessToken; }</code><technical_language>invariant is good for parameter validation. this method param, add a null if check. java if (handle == null) { return null; }</technical_language>

Target:
public @Nullable AccessTokenResponse getAccessTokenResponse() throws OAuthException, IOException, OAuthResponseException { if (isClosed()) { throw new OAuthException(EXCEPTION_MESSAGE_CLOSED); } AccessTokenResponse lastAccessToken; try { lastAccessToken = storeHandler.loadAccessTokenResponse(handle); } catch (GeneralSecurityException e) { throw new OAuthException("Cannot decrypt access token from store", e); } if (lastAccessToken == null) { return null; } if (lastAccessToken.isExpired(LocalDateTime.now(), tokenExpiresInBuffer) && lastAccessToken.getRefreshToken() != null) { return refreshToken(); } return lastAccessToken; }
Source:
<code>static void checkForMerge(String tableId, Iterator<KeyExtent> lmi, TabletIterFactory tabletIterFactory) throws Exception { KeyExtent currRange = lmi.next(); Text startRow = currRange.getPrevEndRow(); Iterator<KeyExtent> tabletIter = tabletIterFactory.newTabletIter(startRow); KeyExtent currTablet = tabletIter.next(); if (!tabletIter.hasNext() && equals(KeyExtent::getPrevEndRow, currTablet, currRange) && equals(KeyExtent::getEndRow, currTablet, currRange)) currRange = null; while (tabletIter.hasNext()) { if (currRange == null) { if (!lmi.hasNext()) { break; } currRange = lmi.next(); } while (!equals(KeyExtent::getPrevEndRow, currTablet, currRange) && tabletIter.hasNext()) { currTablet = tabletIter.next(); } boolean matchedPrevRow = equals(KeyExtent::getPrevEndRow, currTablet, currRange); while (!equals(KeyExtent::getEndRow, currTablet, currRange) && tabletIter.hasNext()) { currTablet = tabletIter.next(); } if (!matchedPrevRow || !equals(KeyExtent::getEndRow, currTablet, currRange)) { break; } currRange = null; } if (currRange != null || lmi.hasNext()) { throw new AcceptableThriftTableOperationException(tableId, null, TableOperation.BULK_IMPORT, <START> TableOperationExceptionType.OTHER, Constants.BULK_CONCURRENT_MERGE_MSG); <END> } }</code><technical_language>rely "OTHER" a specific message, add a new enum type TableOperationExceptionType for this case</technical_language>

Target:
static void checkForMerge(String tableId, Iterator<KeyExtent> lmi, TabletIterFactory tabletIterFactory) throws Exception { KeyExtent currRange = lmi.next(); Text startRow = currRange.getPrevEndRow(); Iterator<KeyExtent> tabletIter = tabletIterFactory.newTabletIter(startRow); KeyExtent currTablet = tabletIter.next(); if (!tabletIter.hasNext() && equals(KeyExtent::getPrevEndRow, currTablet, currRange) && equals(KeyExtent::getEndRow, currTablet, currRange)) currRange = null; while (tabletIter.hasNext()) { if (currRange == null) { if (!lmi.hasNext()) { break; } currRange = lmi.next(); } while (!equals(KeyExtent::getPrevEndRow, currTablet, currRange) && tabletIter.hasNext()) { currTablet = tabletIter.next(); } boolean matchedPrevRow = equals(KeyExtent::getPrevEndRow, currTablet, currRange); while (!equals(KeyExtent::getEndRow, currTablet, currRange) && tabletIter.hasNext()) { currTablet = tabletIter.next(); } if (!matchedPrevRow || !equals(KeyExtent::getEndRow, currTablet, currRange)) { break; } currRange = null; } if (currRange != null || lmi.hasNext()) { throw new AcceptableThriftTableOperationException(tableId, null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_CONCURRENT_MERGE, "Concurrent merge happened"); } }
Source:
<code><START> public synchronized void removeSegmentDir(File segmentDir, DataSegment segment) <END> { if (files.remove(segmentDir)) { currSize -= segment.getSize(); } else { log.warn("SegmentDir[%s] is not found under this location[%s]", segmentDir, path); } }</code><technical_language>thinking a bit, beneficial for StorageLocation aware of DataSegment SegmentId, DataSegment is a shorthand get size SegmentId, SegmentId is for logging. reworking this implementation of StorageLocation a bit more simple allow IntermediaryDataManager SegmentLoaderLocalCacheManager reserve remove methods. I consider this optional however, if want investigate</technical_language>

Target:
public synchronized void removeSegmentDir(File segmentDir, DataSegment segment) { if (files.remove(segmentDir)) { currSizeBytes -= segment.getSize(); } else { log.warn("SegmentDir[%s] is not found under this location[%s]", segmentDir, path); } }
Source:
<code>public List<CourseComponentSession> getComponentSessions() { if (componentSessions == null) { componentSessions = new ArrayList<CourseComponentSession>(); for(CourseComponentSessionDAO session: dao.getComponentSessions()) { componentSessions.add(new CourseComponentSessionImpl(session)); } } <START> Collections.sort(componentSessions, new Comparator<CourseComponentSession>() { <END> public int compare(CourseComponentSession c1,CourseComponentSession c2) { if (null != c1.getSessionStart() && null != c2.getSessionStart()) { return c1.getSessionStart().compareTo(c2.getSessionStart()); } return c1.getSessionId().compareTo(c2.getSessionId()); } }); return componentSessions; }</code><technical_language>If comparator is same, instance suffice? In case avoid a lot of instanciations</technical_language>

Target:
public List<CourseComponentSession> getComponentSessions() { if (componentSessions == null) { componentSessions = new ArrayList<CourseComponentSession>(); for(CourseComponentSessionDAO session: dao.getComponentSessions()) { componentSessions.add(new CourseComponentSessionImpl(session)); } } Collections.sort(componentSessions); return componentSessions; }
Source:
<code><START> public void shouldPublishAndConsumeMessageWithTraceAndSpanHeaders() { <END> String message = "{\"id\": 101}"; String traceId = UUID.randomUUID().toString(); String spanId = UUID.randomUUID().toString(); String parentSpanId = UUID.randomUUID().toString(); String sampled = "1"; String reported = "0"; Topic topic = operations.buildTopic("traceSendAndReceiveGroup", "topic"); operations.createSubscription(topic, "subscription", HTTP_ENDPOINT_URL); remoteService.expectMessages(message); WebTarget client = ClientBuilder.newClient().target(FRONTEND_URL).path("topics").path(topic.getQualifiedName()); Response response = client .request() .header("Trace-Id", traceId) .header("Span-Id", spanId) .header("Parent-Span-Id", parentSpanId) .header("Trace-Sampled", sampled) .header("Trace-Reported", reported) .post(Entity.entity(message, MediaType.APPLICATION_JSON)); assertThat(response).hasStatus(Response.Status.CREATED); LoggedRequest lastRequest = remoteService.waitAndGetLastRequest(); assertThat(lastRequest).hasHeaderValue("Trace-Id", traceId); assertThat(lastRequest).hasHeaderValue("Span-Id", spanId); assertThat(lastRequest).hasHeaderValue("Parent-Span-Id", parentSpanId); assertThat(lastRequest).hasHeaderValue("Trace-Sampled", sampled); assertThat(lastRequest).hasHeaderValue("Trace-Reported", reported); }</code><technical_language>This test is similar JmsConsumingTest.shouldPublishAndConsumeJmsMessageWithTraceHeaders. If nice test cases more concise duplication obvious. If share some code tests..</technical_language>

Target:
public void shouldPublishAndConsumeMessageWithTraceAndSpanHeaders() { String message = "{\"id\": 101}"; TraceContext trace = TraceContext.random(); Topic topic = operations.buildTopic("traceSendAndReceiveGroup", "topic"); operations.createSubscription(topic, "subscription", HTTP_ENDPOINT_URL); remoteService.expectMessages(message); Invocation.Builder request = createRequestWithTraceHeaders(FRONTEND_URL, topic.getQualifiedName(), trace); Response response = request.post(Entity.entity(message, MediaType.APPLICATION_JSON)); assertThat(response).hasStatus(Response.Status.CREATED); assertThat(remoteService.waitAndGetLastRequest()).containsAllHeaders(trace.asMap()); }
Source:
<code>public Collection<BodyPart> getAll() { <START> return ImmutableList.copyOf(this.bodyPartMap.values()); <END> }</code><technical_language>This ImmutableSet</technical_language>

Target:
public Collection<BodyPart> getAll() { return ImmutableSet.copyOf(this.bodyPartMap.values()); }
Source:
<code>public void afterActionPerformed(AnAction anAction, DataContext dataContext, AnActionEvent anActionEvent) { if (anAction instanceof StepIntoAction || anAction instanceof ForceStepIntoAction) { <START> eventManager.addEvent(new DebugEventBase(EventType.STEP_INTO, new Date())); <END> } else if (anAction instanceof StepOverAction || anAction instanceof ForceStepOverAction) { eventManager.addEvent(new DebugEventBase(EventType.STEP_OVER, new Date())); } else if (anAction instanceof StepOutAction) { eventManager.addEvent(new DebugEventBase(EventType.STEP_OUT, new Date())); } else if (anAction instanceof XInspectAction) { eventManager.addEvent(new DebugEventBase(EventType.INSPECT_VARIABLE, new Date())); } else if (anAction.getClass().getSimpleName().equals("XAddToWatchesAction")) { eventManager.addEvent(new DebugEventBase(EventType.DEFINE_WATCH, new Date())); } else if (anAction.getClass().getSimpleName().equals("EvaluateAction")) { eventManager.addEvent(new DebugEventBase(EventType.EVALUATE_EXPRESSION, new Date())); } else if (anAction instanceof XSetValueAction) { eventManager.addEvent(new DebugEventBase(EventType.MODIFY_VARIABLE_VALUE, new Date())); } }</code><technical_language>Is extract a method for this line, i.e. createEvent(x) -> eventManager.addEvent(new DebugEventBase(EventType.X, new Date()));</technical_language>

Target:
public void afterActionPerformed(AnAction anAction, DataContext dataContext, AnActionEvent anActionEvent) { if (anAction instanceof StepIntoAction || anAction instanceof ForceStepIntoAction) { createEvent(DebugEventType.STEP_INTO); } else if (anAction instanceof StepOverAction || anAction instanceof ForceStepOverAction) { createEvent(DebugEventType.STEP_OVER); } else if (anAction instanceof StepOutAction) { createEvent(DebugEventType.STEP_OUT); } else if (anAction instanceof XInspectAction) { createEvent(DebugEventType.INSPECT_VARIABLE); } else if (anAction.getClass().getSimpleName().equals("XAddToWatchesAction")) { createEvent(DebugEventType.DEFINE_WATCH); } else if (anAction.getClass().getSimpleName().equals("EvaluateAction")) { createEvent(DebugEventType.EVALUATE_EXPRESSION); } else if (anAction instanceof XSetValueAction) { createEvent(DebugEventType.MODIFY_VARIABLE_VALUE); } }
Source:
<code>public BinaryResult apply(ChangeResource rsrc) throws AuthException, IOException, <START> InvalidChangeOperationException, OrmException, <END> NoSuchChangeException { Optional<ChangeEdit> edit = editUtil.byChange(rsrc.getChange()); String m = edit.isPresent() ? edit.get().getEditCommit().getFullMessage() : changeUtil.getMessage(rsrc.getChange()); return BinaryResult.create(m).base64(); }</code><technical_language>thrown</technical_language>

Target:
public BinaryResult apply(ChangeResource rsrc) throws AuthException, IOException, OrmException, NoSuchChangeException { Optional<ChangeEdit> edit = editUtil.byChange(rsrc.getChange()); String m = edit.isPresent() ? edit.get().getEditCommit().getFullMessage() : changeUtil.getMessage(rsrc.getChange()); return BinaryResult.create(m).base64(); }
Source:
<code>public void queryFrozenRealmAcrossThreads() throws InterruptedException { final Realm frozenRealm = createDataForFrozenRealm(DATA_SIZE); Thread t = new Thread(() -> { RealmResults<AllTypes> results = frozenRealm.where(AllTypes.class).findAll(); assertEquals(DATA_SIZE, results.size()); }); t.start(); t.join(); <START> frozenRealm.close(); <END> }</code><technical_language>closing in tearDown</technical_language>

Target:
public void queryFrozenRealmAcrossThreads() throws InterruptedException { final Realm frozenRealm = createDataForFrozenRealm(DATA_SIZE); Thread t = new Thread(() -> { RealmResults<AllTypes> results = frozenRealm.where(AllTypes.class).findAll(); assertEquals(DATA_SIZE, results.size()); }); t.start(); t.join(); }
Source:
<code>public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @RequestBody final List<Cursor> cursors, final NativeWebRequest request) { <START> if (!featureToggleService.isFeatureEnabled("high_level_api")) { <END> return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } try { final Subscription subscription = subscriptionRepository.getSubscription(subscriptionId); final String eventType = subscription.getEventTypes().iterator().next(); topicRepository.validateCommitCursors(eventType, cursors); boolean allCommitted = true; for (final Cursor cursor : cursors) { allCommitted = allCommitted && cursorsCommitService.commitCursor(subscriptionId, eventType, cursor); } return allCommitted ? ok().build() : noContent().build(); } catch (final NoSuchSubscriptionException | ServiceUnavailableException e) { return create(e.asProblem(), request); } catch (InvalidCursorException e) { return create(Problem.valueOf(UNPROCESSABLE_ENTITY, e.getMessage()), request); } }</code><technical_language>time create constant</technical_language>

Target:
public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @RequestBody final List<Cursor> cursors, final NativeWebRequest request) { if (!featureToggleService.isFeatureEnabled(FEATURE_HIGH_LEVEL_API)) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } try { boolean allCommitted = cursorsCommitService.commitCursors(subscriptionId, cursors); return allCommitted ? ok().build() : noContent().build(); } catch (final NoSuchSubscriptionException | ServiceUnavailableException e) { return create(e.asProblem(), request); } catch (InvalidCursorException e) { return create(Problem.valueOf(UNPROCESSABLE_ENTITY, e.getMessage()), request); } }
Source:
<code>public static void setUp() throws Exception { client = ManagementClientProvider.createOnlineManagementClient(); <START> client.apply(snapshotBackup.backup()); <END> administration.reloadIfRequired(); }</code><technical_language>This is necessary, client is created in parent</technical_language>

Target:
public static void setUp() throws Exception { client.apply(snapshotBackup.backup()); administration.reloadIfRequired(); }
Source:
<code>public SqlScript(ExpressionRuntime expressionRuntime, ScriptEngine<SqlEngine> scriptEngine, ValuesConverter<StreamlineEvent> valuesConverter) { super(expressionRuntime.asString(), scriptEngine); this.valuesConverter = valuesConverter; stormSqlFields = ((StormSqlExpression) expressionRuntime).getStormSqlFields(); <START> if (stormSqlFields.isEmpty()) { <END> ((StormSqlExpression) expressionRuntime).addStormSqlField(DUMMY_FIELD); stormSqlFields.add(DUMMY_FIELD); } if (!stormSqlFields.isEmpty()) { SqlEngine sqlEngine = (SqlEngine) scriptEngine; sqlEngine.compileQuery(createQuery((StormSqlExpression) expressionRuntime)); } projectedFields = ((StormSqlExpression) expressionRuntime).getProjectedFields(); outputFields = ((StormSqlExpression) expressionRuntime).getOutputFields(); }</code><technical_language>change this if - else</technical_language>

Target:
public SqlScript(ExpressionRuntime expressionRuntime, ScriptEngine<SqlEngine> scriptEngine, ValuesConverter<StreamlineEvent> valuesConverter) { super(expressionRuntime.asString(), scriptEngine); this.valuesConverter = valuesConverter; stormSqlFields = ((StormSqlExpression) expressionRuntime).getStormSqlFields(); if (stormSqlFields.isEmpty()) { ((StormSqlExpression) expressionRuntime).addStormSqlField(DUMMY_FIELD); stormSqlFields.add(DUMMY_FIELD); } SqlEngine sqlEngine = (SqlEngine) scriptEngine; sqlEngine.compileQuery(createQuery((StormSqlExpression) expressionRuntime)); projectedFields = ((StormSqlExpression) expressionRuntime).getProjectedFields(); outputFields = ((StormSqlExpression) expressionRuntime).getOutputFields(); }
Source:
<code>private void niceSyncthing() { new Thread() { public void run() { Process niceST = null; <START> DataOutputStream niceSTOut = null; <END> int ret = 1; try { Thread.sleep(1000); niceST = Runtime.getRuntime().exec("sh"); niceSTOut = new DataOutputStream(niceST.getOutputStream()); niceSTOut.writeBytes("set `ps |grep libsyncthing.so`\n"); niceSTOut.writeBytes("ionice $2 be 7\n"); niceSTOut.writeBytes("exit\n"); log(niceST.getInputStream(), Log.INFO); log(niceST.getErrorStream(), Log.WARN); niceSTOut.flush(); ret = niceST.waitFor(); Log.i(TAG, "ionice performed on libsyncthing.so"); } catch (IOException | InterruptedException e) { Log.e(TAG, "Failed to execute ionice binary", e); } finally { try { if (niceSTOut != null) { niceSTOut.close(); } } catch (IOException e) { Log.w(TAG, "Failed to close shell stream", e); } if (niceST != null) { niceST.destroy(); } if (ret != 0) { Log.e(TAG_NATIVE, "Failed to set ionice " + Integer.toString(ret)); } } } }.start(); }</code><technical_language>niceSTOut kinda sucks for a camelCase var name, niceStOut niceOut</technical_language>

Target:
private void niceSyncthing() { new Thread() { public void run() { Process nice = null; DataOutputStream niceOut = null; int ret = 1; try { Thread.sleep(1000); nice = Runtime.getRuntime().exec("sh"); niceOut = new DataOutputStream(nice.getOutputStream()); niceOut.writeBytes("set `ps |grep libsyncthing.so`\n"); niceOut.writeBytes("ionice $2 be 7\n"); niceOut.writeBytes("exit\n"); log(nice.getErrorStream(), Log.WARN); niceOut.flush(); ret = nice.waitFor(); Log.i(TAG_IONICE, "ionice performed on libsyncthing.so"); } catch (IOException | InterruptedException e) { Log.e(TAG_IONICE, "Failed to execute ionice binary", e); } finally { try { if (niceOut != null) { niceOut.close(); } } catch (IOException e) { Log.w(TAG_IONICE, "Failed to close shell stream", e); } if (nice != null) { nice.destroy(); } if (ret != 0) { Log.e(TAG_IONICE, "Failed to set ionice " + Integer.toString(ret)); } } } }.start(); }
Source:
<code>public IpUtil() { trustedProxiesCache = new HashSet<IpAddressMatcher>(); labsSubnetsCache = new HashSet<IpAddressMatcher>(); for (String proxyIp : trustedProxies) { String trimmedProxyIp = proxyIp.trim(); try { IpAddressMatcher matcher = new IpAddressMatcher(trimmedProxyIp); trustedProxiesCache.add(matcher); } catch (IllegalArgumentException e) { throw new RuntimeException("Invalid entry '" + proxyIp + "' " + "found in the default trusted proxies list", e); } } for (String labsSubnet: labsSubnets) { try { IpAddressMatcher matcher = new IpAddressMatcher(labsSubnet); labsSubnetsCache.add(matcher); <START> } catch (IllegalArgumentException e) { <END> throw new RuntimeException("Invalid entry '" + labsSubnet + "' found in the default labs subnet list", e); } } }</code><technical_language>Is this correct? strange exception catch</technical_language>

Target:
public IpUtil() { trustedProxiesCache = new HashSet<IpAddressMatcher>(); labsSubnetsCache = new HashSet<IpAddressMatcher>(); for (String proxyIp : trustedProxies) { String trimmedProxyIp = proxyIp.trim(); try { IpAddressMatcher matcher = new IpAddressMatcher(trimmedProxyIp); trustedProxiesCache.add(matcher); } catch (IllegalArgumentException e) { throw new RuntimeException("Invalid entry '" + proxyIp + "' " + "found in the default trusted proxies list", e); } } for (String labsSubnet: labsSubnets) { IpAddressMatcher matcher = new IpAddressMatcher(labsSubnet); labsSubnetsCache.add(matcher); } }
Source:
<code>public void vuapResolvedStateIsNotMute(Page page, String slot, String videoIframeSelector) { AdsBaseObject ads = openPageWithVideoInLocalStorage(page, VuapVideos.PORVATA_VAST, VuapVideos.VAST_VIDEO); final AutoplayVuap vuap = new AutoplayVuap(driver, slot, videoIframeSelector); ads.refreshPage(); vuap.replay(); <START> vuap.clickOnSoundButton(); <END> VuapAssertions.verifyVideoUnmuteAndMute(vuap); }</code><technical_language>muting/unmuting video here</technical_language>

Target:
public void vuapResolvedStateIsNotMute(Page page, String slot, String videoIframeSelector) { AdsBaseObject ads = openPageWithVideoInLocalStorage(page); final AutoplayVuap vuap = new AutoplayVuap(driver, slot, videoIframeSelector); ads.refreshPage(); vuap.replay(); vuap.mute(); VuapAssertions.verifyVideoUnmuteAndMute(vuap); }
Source:
<code>public JsonObject asJson() { <START> $lock.readLock().lock(); <END> JsonObject json = new JsonObject(); if (text != null) { json.addProperty("text", text); } if (translate != null) { json.addProperty("translate", translate); JsonArray array = new JsonArray(); with.forEach(array::add); json.add("with", array); } if (scoreUsername != null && scoreObjective != null) { JsonObject score = new JsonObject(); score.addProperty("name", scoreUsername); score.addProperty("objective", scoreObjective); json.add("score", score); } if (selector != null) { json.addProperty("selector", selector); } if (!extra.isEmpty()) { JsonArray extra = new JsonArray(); this.extra.forEach(e -> extra.add(e.asJson())); json.add("extra", extra); } if (bold != null) { json.addProperty("bold", bold.get()); } if (italic != null) { json.addProperty("italic", italic.get()); } if (underlined != null) { json.addProperty("underlined", underlined.get()); } if (strikethrough != null) { json.addProperty("strikethrough", strikethrough.get()); } if (obfuscated != null) { json.addProperty("obfuscated", obfuscated.get()); } if (color != null) { json.addProperty("color", color.name().toLowerCase()); } if (clickEvent != null) { json.add("clickEvent", this.clickEvent.asJson()); } if (hoverEvent != null) { json.add("hoverEvent", this.hoverEvent.asJson()); } if (insertion != null) { json.addProperty("insertion", insertion); } $lock.readLock().unlock(); return json; }</code><technical_language>THREAD-SAFETY long rest of class is thread safe, aggregating modification finished need lock fields correctly updated order</technical_language>

Target:
public JsonObject asJson() { JsonObject json = new JsonObject(); if (text != null) { json.addProperty("text", text); } if (translate != null) { json.addProperty("translate", translate); JsonArray array = new JsonArray(); with.forEach(array::add); json.add("with", array); } if (scoreUsername != null && scoreObjective != null) { JsonObject score = new JsonObject(); score.addProperty("name", scoreUsername); score.addProperty("objective", scoreObjective); json.add("score", score); } if (selector != null) { json.addProperty("selector", selector); } if (!extra.isEmpty()) { JsonArray extra = new JsonArray(); this.extra.forEach(e -> extra.add(e.asJson())); json.add("extra", extra); } if (bold != null) { json.addProperty("bold", bold.get()); } if (italic != null) { json.addProperty("italic", italic.get()); } if (underlined != null) { json.addProperty("underlined", underlined.get()); } if (strikethrough != null) { json.addProperty("strikethrough", strikethrough.get()); } if (obfuscated != null) { json.addProperty("obfuscated", obfuscated.get()); } if (color != null) { json.addProperty("color", color.name().toLowerCase()); } if (clickEvent != null) { json.add("clickEvent", this.clickEvent.asJson()); } if (hoverEvent != null) { json.add("hoverEvent", this.hoverEvent.asJson()); } if (insertion != null) { json.addProperty("insertion", insertion); } return json; }
Source:
<code>public void testPropertyIsEqualToFloat() throws JAXBException, SAXException, IOException { <START> mockProps.add(MOCK_PROPERTY); <END> when(featureMetacardType.getProperties()).thenReturn(mockProps); when(featureMetacardType.isQueryable(MOCK_PROPERTY)).thenReturn(true); WfsFilterDelegate delegate = createDelegate(); FilterType filter = delegate.propertyIsEqualTo(MOCK_PROPERTY, 1.0F); assertXMLEqual(propertyIsEqualToXmlDecimal, marshal(filter)); }</code><technical_language>this whenProperties()? L579</technical_language>

Target:
public void testPropertyIsEqualToFloat() throws JAXBException, SAXException, IOException { WfsFilterDelegate delegate = createSinglePropertyDelegate(); FilterType filter = delegate.propertyIsEqualTo(MOCK_PROPERTY, 1.0F); assertXMLEqual(propertyIsEqualToXmlDecimal, marshal(filter)); }
Source:
<code>protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); ProgressBar progressBar = findViewById(R.id.progressBar); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { Drawable wrapDrawable = DrawableCompat.wrap(progressBar.getIndeterminateDrawable()); DrawableCompat.setTint(wrapDrawable, 0xffffffff); progressBar.setIndeterminateDrawable(DrawableCompat.unwrap(wrapDrawable)); } else { progressBar.getIndeterminateDrawable().setColorFilter(0xffffffff, PorterDuff.Mode.SRC_IN); } Completable.create(subscriber -> { PodDBAdapter.getInstance().open(); PodDBAdapter.getInstance().close(); subscriber.onComplete(); }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(() -> { Intent intent = new Intent(SplashActivity.this, MainActivity.class); finish(); <START> startActivity(intent); <END> }); }</code><technical_language>I agree this line swap. This splash screen useless. splash screen added prevent "non-ready" MainActivity. If splash is closed showing MainActivity, splash in cases. is flash screen blue for a milliseconds. that, MainActivity adding splash</technical_language>

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); ProgressBar progressBar = findViewById(R.id.progressBar); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { Drawable wrapDrawable = DrawableCompat.wrap(progressBar.getIndeterminateDrawable()); DrawableCompat.setTint(wrapDrawable, 0xffffffff); progressBar.setIndeterminateDrawable(DrawableCompat.unwrap(wrapDrawable)); } else { progressBar.getIndeterminateDrawable().setColorFilter(0xffffffff, PorterDuff.Mode.SRC_IN); } Completable.create(subscriber -> { PodDBAdapter.getInstance().open(); PodDBAdapter.getInstance().close(); subscriber.onComplete(); }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(() -> { Intent intent = new Intent(SplashActivity.this, MainActivity.class); startActivity(intent); finish(); }); }
Source:
<code>public T getEventValue(@NonNull final IEvent event) { Map<String, ?> map = sharedPreferences.getAll(); for (Map.Entry<String, ?> entry : map.entrySet()) { if (entry.getKey().equals(event.getTrackingKey())) { return (T) entry.getValue(); } } <START> return null; <END> }</code><technical_language>Throw exception if event is found</technical_language>

Target:
public T getEventValue(@NonNull final IEvent event) { Map<String, ?> map = sharedPreferences.getAll(); for (Map.Entry<String, ?> entry : map.entrySet()) { if (entry.getKey().equals(event.getTrackingKey())) { return (T) entry.getValue(); } } logger.e("No event value for " + event); return null; }
Source:
<code>public static BuildDirLocator create() { String buildTool = ConfigurationHolder.instance().getProperty(CliOption.BUILD_TOOL); if (BuildTool.MAVEN.getName().equals(buildTool)) { return new MavenBuildDirLocator(); <START> } else if (BuildTool.GRADLE.getName().equals(buildTool)) { <END> return new GradleBuildFileLocator(); } throw new GeneralOptionNotSupportedException("Build tool " + buildTool + " not supported"); }</code><technical_language>else needed</technical_language>

Target:
public static BuildDirLocator create() { String buildTool = ConfigurationHolder.instance().getProperty(GeneralOption.BUILD_TOOL); notBlank(buildTool); switch (BuildTool.valueOf(buildTool.toUpperCase())) { case MAVEN: return new MavenBuildDirLocator(); case GRADLE: return new GradleBuildFileLocator(); default: log.warn("Build tool " + buildTool + " not supported, using maven"); return new MavenBuildDirLocator(); } }
Source:
<code>private static AccountDiffPreference initAccountDiffPreferences( AccountDiffPreference a, DiffPreferencesInfo i, Account.Id id) { if (a == null) { a = AccountDiffPreference.createDefault(id); } int context = i.context == null ? DiffPreferencesInfo.DEFAULT_CONTEXT : i.context; a.setContext((short)context); a.setExpandAllComments(b(i.expandAllComments)); a.setHideLineNumbers(b(i.hideLineNumbers)); a.setHideTopMenu(b(i.hideTopMenu)); <START> a.setIgnoreWhitespace(Whitespace.forCode( PatchListKey.WHITESPACE_TYPES.get(i.ignoreWhitespace))); <END> a.setIntralineDifference(b(i.intralineDifference)); a.setLineLength(i.lineLength == null ? DiffPreferencesInfo.DEFAULT_LINE_LENGTH : i.lineLength); a.setManualReview(i.manualReview); a.setRenderEntireFile(b(i.renderEntireFile)); a.setRetainHeader(b(i.retainHeader)); a.setShowLineEndings(b(i.showLineEndings)); a.setShowTabs(b(i.showTabs)); a.setShowWhitespaceErrors(b(i.showWhitespaceErrors)); a.setSkipDeleted(b(i.skipDeleted)); a.setSkipUncommented(b(i.skipUncommented)); a.setSyntaxHighlighting(b(i.syntaxHighlighting)); a.setTabSize(i.tabSize == null ? DiffPreferencesInfo.DEFAULT_TAB_SIZE : i.tabSize); a.setTheme(i.theme); a.setHideEmptyPane(b(i.hideEmptyPane)); a.setAutoHideDiffTableHeader(b(i.autoHideDiffTableHeader)); return a; }</code><technical_language>'i.ignoreWhitespace' null is set in input caller this fail NPE user Internal Server Error</technical_language>

Target:
private static AccountDiffPreference initAccountDiffPreferences( AccountDiffPreference a, DiffPreferencesInfo i, Account.Id id) { if (a == null) { a = AccountDiffPreference.createDefault(id); } int context = i.context == null ? DiffPreferencesInfo.DEFAULT_CONTEXT : i.context; a.setContext((short)context); a.setExpandAllComments(b(i.expandAllComments)); a.setHideLineNumbers(b(i.hideLineNumbers)); a.setHideTopMenu(b(i.hideTopMenu)); a.setIgnoreWhitespace(i.ignoreWhitespace == null ? Whitespace.IGNORE_NONE : Whitespace.forCode( PatchListKey.WHITESPACE_TYPES.get(i.ignoreWhitespace))); a.setIntralineDifference(b(i.intralineDifference)); a.setLineLength(i.lineLength == null ? DiffPreferencesInfo.DEFAULT_LINE_LENGTH : i.lineLength); a.setManualReview(b(i.manualReview)); a.setRenderEntireFile(b(i.renderEntireFile)); a.setRetainHeader(b(i.retainHeader)); a.setShowLineEndings(b(i.showLineEndings)); a.setShowTabs(b(i.showTabs)); a.setShowWhitespaceErrors(b(i.showWhitespaceErrors)); a.setSkipDeleted(b(i.skipDeleted)); a.setSkipUncommented(b(i.skipUncommented)); a.setSyntaxHighlighting(b(i.syntaxHighlighting)); a.setTabSize(i.tabSize == null ? DiffPreferencesInfo.DEFAULT_TAB_SIZE : i.tabSize); a.setTheme(i.theme); a.setHideEmptyPane(b(i.hideEmptyPane)); a.setAutoHideDiffTableHeader(b(i.autoHideDiffTableHeader)); return a; }
Source:
<code>private void expectTaskGetTopic(boolean anyTimes) { final Capture<String> connectorCapture = EasyMock.newCapture(); final Capture<String> topicCapture = EasyMock.newCapture(); IExpectationSetters<TopicStatus> expect = EasyMock.expect(statusBackingStore.getTopic( EasyMock.capture(connectorCapture), EasyMock.capture(topicCapture))); if (anyTimes) { expect.andStubAnswer(() -> new TopicStatus( topicCapture.getValue(), new ConnectorTaskId(connectorCapture.getValue(), 0), Time.SYSTEM.milliseconds())); } else { expect.andStubAnswer(() -> new TopicStatus( topicCapture.getValue(), new ConnectorTaskId(connectorCapture.getValue(), 0), <START> Time.SYSTEM.milliseconds())); <END> } if (connectorCapture.hasCaptured() && topicCapture.hasCaptured()) { assertEquals("job", connectorCapture.getValue()); assertEquals(TOPIC, topicCapture.getValue()); } }</code><technical_language>missing it, I a difference blocks, other occurrences. this return expect.AndAnswer(...)</technical_language>

Target:
private void expectTaskGetTopic(boolean anyTimes) { final Capture<String> connectorCapture = EasyMock.newCapture(); final Capture<String> topicCapture = EasyMock.newCapture(); IExpectationSetters<TopicStatus> expect = EasyMock.expect(statusBackingStore.getTopic( EasyMock.capture(connectorCapture), EasyMock.capture(topicCapture))); if (anyTimes) { expect.andStubAnswer(() -> new TopicStatus( topicCapture.getValue(), new ConnectorTaskId(connectorCapture.getValue(), 0), Time.SYSTEM.milliseconds())); } else { expect.andAnswer(() -> new TopicStatus( topicCapture.getValue(), new ConnectorTaskId(connectorCapture.getValue(), 0), Time.SYSTEM.milliseconds())); } if (connectorCapture.hasCaptured() && topicCapture.hasCaptured()) { assertEquals("job", connectorCapture.getValue()); assertEquals(TOPIC, topicCapture.getValue()); } }