auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void testDeleteArtifactAndEmptyTrashForAllRepositories(String acceptHeader, @MavenRepository(repositoryId = REPOSITORY_WITH_TRASH_3) @RepositoryAttributes(trashEnabled = true) Repository repository1, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_TRASH_3, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.0") Path artifactPath1, @MavenRepository(repositoryId = REPOSITORY_WITH_FORCE_DELETE_2) Repository repository2, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_FORCE_DELETE_2, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.1") Path artifactPath2) { String url = getContextBaseUrl(); ValidatableMockMvcResponse response = given().accept(acceptHeader) .when() .delete(url) .peek() .then() .statusCode(HttpStatus.OK.value()); String message = "The trash for all repositories was successfully removed."; validateResponseBody(response, acceptHeader, message); <START> assertFalse(Files.exists(getPathToArtifactInTrash(repository1, artifactPath1)), <END> "Failed to empty trash for repository '" + repository1.getId() + "'!"); }</code><technical_language>above, please RepositoryFiles.trash</technical_language>

Target:
void testDeleteArtifactAndEmptyTrashForAllRepositories(String acceptHeader, @MavenRepository(repositoryId = REPOSITORY_WITH_TRASH_3) @RepositoryAttributes(trashEnabled = true) Repository repository1, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_TRASH_3, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.0") Path artifactPath1, @MavenRepository(repositoryId = REPOSITORY_WITH_FORCE_DELETE_2) Repository repository2, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_FORCE_DELETE_2, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.1") Path artifactPath2) throws IOException { String url = getContextBaseUrl(); ValidatableMockMvcResponse response = given().accept(acceptHeader) .when() .delete(url) .peek() .then() .statusCode(HttpStatus.OK.value()); String message = "The trash for all repositories was successfully removed."; validateResponseBody(response, acceptHeader, message); final RepositoryPath artifactRepositoryPath = (RepositoryPath) artifactPath1.normalize(); final Path artifactFileInTrash = RepositoryFiles.trash(artifactRepositoryPath); assertFalse(Files.exists(artifactFileInTrash), "Failed to empty trash for repository '" + repository1.getId() + "'!"); }
Source:
<code>public TransactionStatus(TransactionStateType status, String message, Iterable<FragmentReportType> fragmentReports) { this.status = checkNotNull(status); this.message = checkNotNull(message); <START> if (fragmentReports == null) { <END> this.fragmentReports = Optional.absent(); } else { this.fragmentReports = Optional.<List<FragmentReportType>>of( ImmutableList.copyOf(fragmentReports) ); } }</code><technical_language>nice extract this if/else a "fromNullable" private method, in order constructor short simple</technical_language>

Target:
public TransactionStatus(TransactionStateType status, String message, Iterable<FragmentReportType> fragmentReports) { this.status = checkNotNull(status); this.message = checkNotNull(message); this.fragmentReports = fromNullable(fragmentReports); }
Source:
<code>private void populateReviewAction() { final Button b = new Button(Util.C.buttonReview()); b.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { <START> Gerrit.display("change,publish," + patchSet.getId().toString(), <END> new PublishCommentScreen(patchSet.getId())); } }); actionsPanel.add(b); }</code><technical_language>I a hard time understanding reason for this change</technical_language>

Target:
private void populateReviewAction() { final Button b = new Button(Util.C.buttonReview()); b.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { Gerrit.display(Dispatcher.toPublish(patchSet.getId())); } }); actionsPanel.add(b); }
Source:
<code>public String rawId() { <START> return String.valueOf(id); <END> }</code><technical_language>This is needed anymore... return id</technical_language>

Target:
public String rawId() { return id; }
Source:
<code>public void handleFault(MessageContext synCtx) { boolean traceOn = synCtx.getTracingState() == SynapseConstants.TRACING_ON; boolean traceOrDebugOn = traceOn || log.isDebugEnabled(); <START> List handlers = synCtx.getEnvironment().getSynapseHandlers(); Iterator<SynapseHandler> iterator = handlers.iterator(); <END> while (iterator.hasNext()) { SynapseHandler handler = iterator.next(); if ((handler instanceof AbstractExtendedSynapseHandler) && (synCtx.getProperty("HasCountedError") == null)) { if (!((AbstractExtendedSynapseHandler) handler).handleError(synCtx)) { return; } } } if (traceOrDebugOn) { traceOrDebugWarn(traceOn, "FaultHandler executing impl: " + this.getClass().getName()); } try { synCtx.getServiceLog().info("FaultHandler executing impl: " + this.getClass().getName()); onFault(synCtx); } catch (SynapseException e) { Stack faultStack = synCtx.getFaultStack(); if (faultStack != null && !faultStack.isEmpty()) { ((FaultHandler) faultStack.pop()).handleFault(synCtx); } } }</code><technical_language>move this a common method</technical_language>

Target:
public void handleFault(MessageContext synCtx) { boolean traceOn = synCtx.getTracingState() == SynapseConstants.TRACING_ON; boolean traceOrDebugOn = traceOn || log.isDebugEnabled(); executeExtendedSynapseHandlerOnFault(synCtx); if (traceOrDebugOn) { traceOrDebugWarn(traceOn, "FaultHandler executing impl: " + this.getClass().getName()); } try { String msg = "FaultHandler executing impl: " + this.getClass().getName(); synCtx.getServiceLog().info(msg); onFault(synCtx); } catch (SynapseException e) { Stack faultStack = synCtx.getFaultStack(); if (faultStack != null && !faultStack.isEmpty()) { ((FaultHandler) faultStack.pop()).handleFault(synCtx); } } }
Source:
<code>public Stream<StringResult> clearAllQueryCaches() { securityContext.assertCredentialsNotExpired(); if ( !securityContext.isAdmin() ) { throw new AuthorizationViolationException( PERMISSION_DENIED ); } QueryExecutionEngine queryExecutionEngine = graph.getDependencyResolver().resolveDependency( QueryExecutionEngine.class ); long numberOfClearedQueries = queryExecutionEngine.clearQueryCaches() - 1; String result = numberOfClearedQueries == 0 ? "Query cache already empty." : "Query caches successfully cleared of " + numberOfClearedQueries + " queries."; <START> log.info( result ); <END> return Stream.of( new StringResult( result ) ); }</code><technical_language>adding log.info( "Called dbms.clearQueryCaches(): " + result )</technical_language>

Target:
public Stream<StringResult> clearAllQueryCaches() { securityContext.assertCredentialsNotExpired(); if ( !securityContext.isAdmin() ) { throw new AuthorizationViolationException( PERMISSION_DENIED ); } QueryExecutionEngine queryExecutionEngine = graph.getDependencyResolver().resolveDependency( QueryExecutionEngine.class ); long numberOfClearedQueries = queryExecutionEngine.clearQueryCaches() - 1; String result = numberOfClearedQueries == 0 ? "Query cache already empty." : "Query caches successfully cleared of " + numberOfClearedQueries + " queries."; log.info( "Called dbms.clearQueryCaches(): " + result ); return Stream.of( new StringResult( result ) ); }
Source:
<code>public List<PatchSetApproval> byPatchSet(ReviewDb db, ChangeNotes notes, PatchSet.Id psId) throws OrmException { if (!migration.readPatchSetApprovals()) { return sortApprovals(db.patchSetApprovals().byPatchSet(psId)); } ImmutableListMultimap<Id, PatchSetApproval> approvals = notes.load().getApprovals(); <START> if (approvals != null) { <END> return approvals.get(psId); } return Collections.emptyList(); }</code><technical_language>I want return null getApprovals(). hard modify ChangeNotes.onLoad handle a null revision</technical_language>

Target:
public List<PatchSetApproval> byPatchSet(ReviewDb db, ChangeNotes notes, PatchSet.Id psId) throws OrmException { if (!migration.readPatchSetApprovals()) { return sortApprovals(db.patchSetApprovals().byPatchSet(psId)); } return notes.load().getApprovals().get(psId); }
Source:
<code>public ConfigTemperaturesMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType+" Payload Len -> "+this.payload.length); if (this.payload.length == CONFIG_TEMPERATURES_PAYLOAD_LEN) { this.comfortTemp = payload[0]/2.0; this.ecoTemp = payload[1]/2.0; this.maxTemp = payload[2]/2.0; this.minTemp = payload[3]/2.0; this.offset = (payload[4]/2.0)-3.5; this.windowOpenTemp = payload[5]/2.0; this.windowOpenTime = payload[6]*5.0; } <START> else logger.error("Got "+this.msgType+" message with incorrect length!"); <END> }</code><technical_language>please add curly braces</technical_language>

Target:
public ConfigTemperaturesMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType + " Payload Len -> " + this.payload.length); if (this.payload.length == CONFIG_TEMPERATURES_PAYLOAD_LEN) { this.comfortTemp = payload[0] / 2.0; this.ecoTemp = payload[1] / 2.0; this.maxTemp = payload[2] / 2.0; this.minTemp = payload[3] / 2.0; this.offset = (payload[4] / 2.0) - 3.5; this.windowOpenTemp = payload[5] / 2.0; this.windowOpenTime = payload[6] * 5.0; } else { logger.error("Got " + this.msgType + " message with incorrect length!"); } }
Source:
<code>private Throwable extractException(Map<String, Throwable> failures) { if (failures.isEmpty()) { return new AssertionError(); } if (failures.size() == 1) { return failures.values().iterator().next(); } <START> StringBuilder errorMessage = new StringBuilder(); <END> for (Map.Entry<String, Throwable> failureEntry : failures.entrySet()) { errorMessage.append("\n\n").append(failureEntry.getKey()).append(":\n"); Throwable throwable = failureEntry.getValue(); errorMessage .append(throwable.getClass()).append(": ") .append(throwable.getMessage()); for (StackTraceElement e : throwable.getStackTrace()) { errorMessage.append("\n at ").append(e); } } return new AssertionError(errorMessage.toString()); }</code><technical_language>a org.junit.runners.model.MultipleFailureException adding failures suppressed exceptions. need create exception for entry in map key message in order of approaches</technical_language>

Target:
private Throwable extractException(Map<String, Throwable> failures) { if (failures.isEmpty()) { return new AssertionError(); } if (failures.size() == 1) { return failures.values().iterator().next(); } StringBuilder errorMessage = new StringBuilder("========== Multiple Failures =========="); for (Map.Entry<String, Throwable> failureEntry : failures.entrySet()) { errorMessage.append("\n\n=== "). append(failureEntry.getKey()).append(" ===\n"); Throwable throwable = failureEntry.getValue(); errorMessage .append(throwable.getClass()).append(": ") .append(throwable.getMessage()); for (StackTraceElement e : throwable.getStackTrace()) { if (e.getClassName().equals(getClass().getName())) { break; } errorMessage.append("\n at ").append(e); } } errorMessage.append("\n=======================================\n\n"); AssertionError assertionError = new AssertionError(errorMessage.toString()); return assertionError; }
Source:
<code>public void getReserveStatistics() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); <START> return null; <END> } }).build(); final ReserveService reserveService = adapter.create(ReserveService.class); reserveService.getStatistics(new RetrofitPromise<List<ReserveStatistics>>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/reserve/statistics", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); }</code><technical_language>Add newline return</technical_language>

Target:
public void getReserveStatistics() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final ReserveService reserveService = adapter.create(ReserveService.class); reserveService.getStatistics(new RetrofitPromise<List<ReserveStatistics>>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/reserve/statistics", MOCK_URL)); }
Source:
<code>private String getSubject(final Report report, final Instant scheduled) { <START> final String formattedTime = ZonedDateTime.ofInstant(scheduled, ZoneId.of("UTC")).toString(); <END> return "[Report] " + report.getName() + " for " + formattedTime; }</code><technical_language>I this configurable, a bit more complicated a format string fine punting for now</technical_language>

Target:
private String getSubject(final Report report, final Instant scheduled) { final String formattedTime = ZonedDateTime.ofInstant(scheduled, ZoneOffset.UTC).toString(); return "[Report] " + report.getName() + " for " + formattedTime; }
Source:
<code>public static void showDialog(Context context) { AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.setTitle(context.getString(R.string.pref_filter_feed_title)); dialog.setPositiveButton(null, null); dialog.setNegativeButton(android.R.string.cancel, (d, listener) -> d.dismiss()); int selectedIndexTemp = 0; int selected = UserPreferences.getFeedFilter(); String[] entryValues = context.getResources().getStringArray(R.array.nav_drawer_feed_filter_values); for (int i = 0; i < entryValues.length; i++) { if (Integer.parseInt(entryValues[i]) == selected) selectedIndexTemp = i; } final int selectedIndex = selectedIndexTemp; <START> dialog.setSingleChoiceItems(context.getResources().getStringArray(R.array.nav_drawer_feed_filter_options), selectedIndex, (d, which) -> { <END> if (selectedIndex != which) { UserPreferences.setFeedFilter(entryValues[which]); EventBus.getDefault().post(new UnreadItemsUpdateEvent()); } d.dismiss(); }); dialog.show(); }</code><technical_language>a checkstyle errors left: [ERROR] /home/circleci/AntennaPod/./app/src/main/java/de/danoeh/antennapod/dialog/FeedFilterDialog.java:24: 'if' construct '{}'s. [NeedBraces] [ERROR] /home/circleci/AntennaPod/./app/src/main/java/de/danoeh/antennapod/dialog/FeedFilterDialog.java:29: Line is longer 120 characters (found 145). [LineLength] [ERROR] /home/circleci/AntennaPod/./core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java:1064:51: WhitespaceAround: '{' is preceded whitespace. [WhitespaceAround]</technical_language>

Target:
public static void showDialog(Context context) { AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.setTitle(context.getString(R.string.pref_filter_feed_title)); dialog.setNegativeButton(android.R.string.cancel, (d, listener) -> d.dismiss()); int selectedIndexTemp = 0; int selected = UserPreferences.getFeedFilter(); String[] entryValues = context.getResources().getStringArray(R.array.nav_drawer_feed_filter_values); for (int i = 0; i < entryValues.length; i++) { if (Integer.parseInt(entryValues[i]) == selected) { selectedIndexTemp = i; } } final int selectedIndex = selectedIndexTemp; String[] items = context.getResources().getStringArray(R.array.nav_drawer_feed_filter_options); dialog.setSingleChoiceItems(items, selectedIndex, (d, which) -> { if (selectedIndex != which) { UserPreferences.setFeedFilter(entryValues[which]); EventBus.getDefault().post(new UnreadItemsUpdateEvent()); } d.dismiss(); }); dialog.show(); }
Source:
<code>public void testAjaxAndEnclosures() throws Exception { <START> tester.startPage(SimplePage3.class); <END> tester.assertRenderedPage(SimplePage3.class); tester.clickLink("ajaxLink", true); String lastResponse = tester.getLastResponseAsString(); String headerContribution = lastResponse.split("<header-contribution")[1].split("</header-contribution")[0]; Pattern headerStylesheetLinkExtractor = Pattern.compile("<link.*/>"); Matcher headerStyleSheetLinkMatcher = headerStylesheetLinkExtractor.matcher(headerContribution); List<String> headerStylesheetLinks = new ArrayList<>(); while (headerStyleSheetLinkMatcher.find()){ headerStylesheetLinks.add(headerStyleSheetLinkMatcher.group()); } assertTrue(headerStylesheetLinks.contains("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../enclosedInInline.css\" />")); assertTrue(headerStylesheetLinks.contains("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../enclosed.css\" />")); }</code><technical_language>rename page name InlineEnclosureAjaxRenderPage. SimplePages legacy, for new stuff try better! :-)</technical_language>

Target:
public void testAjaxAndEnclosures() throws Exception { tester.startPage(EnclosureAjaxRenderPage.class); tester.assertRenderedPage(EnclosureAjaxRenderPage.class); tester.clickLink("ajaxLink", true); String lastResponse = tester.getLastResponseAsString(); String headerContribution = lastResponse.split("<header-contribution")[1].split("</header-contribution")[0]; Pattern headerStylesheetLinkExtractor = Pattern.compile("<link.*/>"); Matcher headerStyleSheetLinkMatcher = headerStylesheetLinkExtractor.matcher(headerContribution); List<String> headerStylesheetLinks = new ArrayList<>(); while (headerStyleSheetLinkMatcher.find()){ headerStylesheetLinks.add(headerStyleSheetLinkMatcher.group()); } assertTrue(headerStylesheetLinks.contains("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../enclosedInInline.css\" />")); assertTrue(headerStylesheetLinks.contains("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../enclosed.css\" />")); }
Source:
<code>AuthenticationRequestState getWaitingRequest(final int requestId) throws AuthenticationException { Logger.v(TAG, "Get waiting request: " + requestId); AuthenticationRequestState request; synchronized (mDelegateMap) { request = mDelegateMap.get(requestId); } if (request == null) { Logger.e(TAG, "Request callback is not available for requestid:" + requestId, "", ADALError.CALLBACK_IS_NOT_FOUND); throw new AuthenticationException(ADALError.CALLBACK_IS_NOT_FOUND, <START> "Request callback is not available for requestid:" + requestId); <END> } return request; }</code><technical_language>requestid [](start = 59, length = 9) requestId #Closed</technical_language>

Target:
AuthenticationRequestState getWaitingRequest(final int requestId) throws AuthenticationException { Logger.v(TAG, "Get waiting request: " + requestId); AuthenticationRequestState request; synchronized (mDelegateMap) { request = mDelegateMap.get(requestId); } if (request == null) { Logger.e(TAG, "Request callback is not available for requestId:" + requestId, "", ADALError.CALLBACK_IS_NOT_FOUND); throw new AuthenticationException(ADALError.CALLBACK_IS_NOT_FOUND, "Request callback is not available for requestId:" + requestId); } return request; }
Source:
<code>private static String getCookie(HttpServletRequest request) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (javax.servlet.http.Cookie cookie : cookies) { <START> if (cookie.getName().equals(OAuthConstants.STATUSCOOKIE)) { <END> return cookie.getValue(); } } } return null; }</code><technical_language>check equals, constant</technical_language>

Target:
private static String getCookie(HttpServletRequest request) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (javax.servlet.http.Cookie cookie : cookies) { if (OAuthConstants.STATUSCOOKIE.equals(cookie.getName())) { return cookie.getValue(); } } } return null; }
Source:
<code>public static SyncState fromJSON(JSONObject sync) throws JSONException { SyncState state = new SyncState(); state.id = sync.getLong(SmartStore.SOUP_ENTRY_ID); state.type = Type.valueOf(sync.getString(SYNC_TYPE)); state.name = JSONObjectHelper.optString(sync, SYNC_NAME); final JSONObject jsonTarget = sync.optJSONObject(SYNC_TARGET); state.target = (state.type == Type.syncDown ? SyncDownTarget.fromJSON(jsonTarget) : SyncUpTarget.fromJSON(jsonTarget)); state.options = SyncOptions.fromJSON(sync.optJSONObject(SYNC_OPTIONS)); state.soupName = sync.getString(SYNC_SOUP_NAME); state.status = Status.valueOf(sync.getString(SYNC_STATUS)); state.progress = sync.getInt(SYNC_PROGRESS); state.totalSize = sync.getInt(SYNC_TOTAL_SIZE); state.maxTimeStamp = sync.optLong(SYNC_MAX_TIME_STAMP, -1); state.startTime = sync.optLong(SYNC_START_TIME, 0); state.endTime = sync.optLong(SYNC_START_TIME, 0); <START> state.errorJSON = sync.getString(SYNC_ERROR); <END> return state; }</code><technical_language>instead do java state.errorJSON = JSONObjectHelper.optString(sync, SYNC_ERROR, ""); Sync states created code change missing field, calling getString(...) throw a JSONException</technical_language>

Target:
public static SyncState fromJSON(JSONObject sync) throws JSONException { SyncState state = new SyncState(); state.id = sync.getLong(SmartStore.SOUP_ENTRY_ID); state.type = Type.valueOf(sync.getString(SYNC_TYPE)); state.name = JSONObjectHelper.optString(sync, SYNC_NAME); final JSONObject jsonTarget = sync.optJSONObject(SYNC_TARGET); state.target = (state.type == Type.syncDown ? SyncDownTarget.fromJSON(jsonTarget) : SyncUpTarget.fromJSON(jsonTarget)); state.options = SyncOptions.fromJSON(sync.optJSONObject(SYNC_OPTIONS)); state.soupName = sync.getString(SYNC_SOUP_NAME); state.status = Status.valueOf(sync.getString(SYNC_STATUS)); state.progress = sync.getInt(SYNC_PROGRESS); state.totalSize = sync.getInt(SYNC_TOTAL_SIZE); state.maxTimeStamp = sync.optLong(SYNC_MAX_TIME_STAMP, -1); state.startTime = sync.optLong(SYNC_START_TIME, 0); state.endTime = sync.optLong(SYNC_START_TIME, 0); state.errorJSON = JSONObjectHelper.optString(sync, SYNC_ERROR, ""); return state; }
Source:
<code>public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { boolean ignoreOwnership = ignoreOwnership(command); AggregateCompletionStage<Void> aggregateCompletionStage = null; for (Object key : command.getKeys()) { CompletionStage<Void> stage = entryFactory.wrapEntryForReading(ctx, key, keyPartitioner.getSegment(key), ignoreOwnership || canReadKey(key)); aggregateCompletionStage = accumulateStage(stage, aggregateCompletionStage); } <START> InvocationFinallyFunction<GetAllCommand> handleFunction = (rCtx, getAllCommand, rv, t) -> { <END> if (useRepeatableRead) { for (Object key : getAllCommand.getKeys()) { CacheEntry cacheEntry = rCtx.lookupEntry(key); if (cacheEntry == null) { if (trace) log.tracef(t, "Missing entry for " + key); } else { cacheEntry.setSkipLookup(true); } } } AggregateCompletionStage<Void> stage = CompletionStages.aggregateCompletionStage(); if (t == null && rv instanceof Map) { boolean notify = !command.hasAnyFlag(FlagBitSets.SKIP_LISTENER_NOTIFICATION) && notifier.hasListener(CacheEntryVisited.class); log.tracef("Notifying getAll? %s; result %s", notify, rv); if (notify) { Map<Object, Object> map = (Map<Object, Object>) rv; for (Map.Entry<Object, Object> entry : map.entrySet()) { Object value = entry.getValue(); if (value != null) { Object finalValue = command.isReturnEntries() ? ((CacheEntry) value).getValue() : entry.getValue(); CompletionStage<Void> innerStage = notifier.notifyCacheEntryVisited(entry.getKey(), finalValue, true, rCtx, getAllCommand); stage.dependsOn(innerStage.thenCompose(ig -> notifier.notifyCacheEntryVisited(entry.getKey(), finalValue, false, rCtx, getAllCommand))); } } } } return delayedValue(stage.freeze(), rv, t); }; if (aggregateCompletionStage != null) { return asyncValue(aggregateCompletionStage.freeze()).andHandle(ctx, command, handleFunction); } return invokeNextAndHandle(ctx, command, handleFunction); }</code><technical_language>offtopic: cached :) ps. sounding Dan xD</technical_language>

Target:
public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { boolean ignoreOwnership = ignoreOwnership(command); AggregateCompletionStage<Void> aggregateCompletionStage = null; for (Object key : command.getKeys()) { CompletionStage<Void> stage = entryFactory.wrapEntryForReading(ctx, key, keyPartitioner.getSegment(key), ignoreOwnership || canReadKey(key)); aggregateCompletionStage = accumulateStage(stage, aggregateCompletionStage); } return makeStage(asyncInvokeNext(ctx, command, aggregatedStageOrCompleted(aggregateCompletionStage))) .andHandle(ctx, command, getAllHandleFunction); }
Source:
<code>private Object primaryReturnHandler(InvocationContext ctx, VisitableCommand visitableCommand, Object localResult) { DataWriteCommand command = (DataWriteCommand) visitableCommand; if (!command.isSuccessful()) { if (trace) log.tracef("Skipping the replication of the conditional command as it did not succeed on primary owner (%s).", command); return localResult; } DistributionInfo distributionInfo = checkTopologyId(command).getDistribution(command.getKey()); Collection<Address> owners = distributionInfo.writeOwners(); if (owners.size() == 1) { return localResult; } ValueMatcher originalMatcher = command.getValueMatcher(); command.setValueMatcher(ValueMatcher.MATCH_ALWAYS); <START> Collection<Address> recipients = isReplicated ? null : owners; <END> RpcOptions rpcOptions = determineRpcOptionsForBackupReplication(rpcManager, isSynchronous(command), recipients); CompletableFuture<Map<Address, Response>> remoteInvocation = rpcManager.invokeRemotelyAsync(recipients, command, rpcOptions); return asyncValue(remoteInvocation.handle((responses, t) -> { command.setValueMatcher(originalMatcher.matcherForRetry()); CompletableFutures.rethrowException(t instanceof RemoteException ? t.getCause() : t); return localResult; })); }</code><technical_language>if this kind of optimization needed. of asymmetric caches, broadcast needed. Also, JGroupsTransport checks if recipients list is cluster view performs a broadcast</technical_language>

Target:
private Object primaryReturnHandler(InvocationContext ctx, VisitableCommand visitableCommand, Object localResult) { DataWriteCommand command = (DataWriteCommand) visitableCommand; if (!command.isSuccessful()) { if (trace) log.tracef("Skipping the replication of the conditional command as it did not succeed on primary owner (%s).", command); return localResult; } LocalizedCacheTopology cacheTopology = checkTopologyId(command); DistributionInfo distributionInfo = cacheTopology.getDistribution(command.getKey()); Collection<Address> owners = distributionInfo.writeOwners(); if (owners.size() == 1) { return localResult; } Collection<Address> recipients = isReplicated ? null : owners; ValueMatcher originalMatcher = command.getValueMatcher(); command.setValueMatcher(ValueMatcher.MATCH_ALWAYS); RpcOptions rpcOptions = determineRpcOptionsForBackupReplication(rpcManager, isSynchronous(command), recipients); CompletableFuture<Map<Address, Response>> remoteInvocation = rpcManager.invokeRemotelyAsync(recipients, command, rpcOptions); return asyncValue(remoteInvocation.handle((responses, t) -> { command.setValueMatcher(originalMatcher.matcherForRetry()); CompletableFutures.rethrowException(t instanceof RemoteException ? t.getCause() : t); return localResult; })); }
Source:
<code>public static KeyPair genKeyPair(KeyPairType type) throws UnsupportedTypeException{ if(type.equals(KeyPairType.DSA)){ <START> throw new UnsupportedTypeException(type); <END> } try { KeyPairGenerator kg = KeyPairGenerator.getInstance(type.alg); kg.initialize(type.spec); return kg.generateKeyPair(); } catch (GeneralSecurityException e) { Logger.error(KeyGenUtils.class, "Internal error; please report:", e); } return null; }</code><technical_language>reason for plain IllegalArgumentException? I types in KeyPairType (except for DSA) present a Freenet installation, forcing user wrap code try( ) catch( ) unnecessarily increase number of lines in consuming code</technical_language>

Target:
public static KeyPair genKeyPair(KeyPairType type) { if(type.equals(KeyPairType.DSA)){ throw new UnsupportedTypeException(type); } try { KeyPairGenerator kg = KeyPairGenerator.getInstance(type.alg); kg.initialize(type.spec); return kg.generateKeyPair(); } catch (GeneralSecurityException e) { Logger.error(KeyGenUtils.class, "Internal error; please report:", e); } return null; }
Source:
<code>public boolean isDirectory() { try { <START> if (directoryFlagSupplier == null) { <END> return childProvider != null; } return directoryFlagSupplier.test(this); } catch (Exception e) { throw handleErrorInCallback(e, "directoryFlagSupplier"); } }</code><technical_language>I inverting this if check improve readability/flow</technical_language>

Target:
public boolean isDirectory() { try { if (directoryFlagSupplier != null) { return directoryFlagSupplier.test(this); } return childProvider != null; } catch (Exception e) { throw handleErrorInCallback(e, "directoryFlagSupplier"); } }
Source:
<code>public CompletableFuture<Object> invokeAsync(InvocationContext ctx, VisitableCommand command) { try { <START> command.init(componentRegistry); <END> Object result = firstInterceptor.visitCommand(ctx, command); if (result instanceof InvocationStage) { return ((InvocationStage) result).toCompletableFuture(); } else { if (result == null) { return CompletableFutures.completedNull(); } return CompletableFuture.completedFuture(result); } } catch (Throwable t) { return CompletableFutures.completedExceptionFuture(t); } }</code><technical_language>I this is needed originator: keyDataConversion valueDataConversion private command, wired, if wireDependencies is idempotent, cheap. SingleRpcCommand PrepareCommand init sub-commands target nodes, need add in BackupWriteCommand</technical_language>

Target:
public CompletableFuture<Object> invokeAsync(InvocationContext ctx, VisitableCommand command) { try { Object result = firstInterceptor.visitCommand(ctx, command); if (result instanceof InvocationStage) { return ((InvocationStage) result).toCompletableFuture(); } else { if (result == null) { return CompletableFutures.completedNull(); } return CompletableFuture.completedFuture(result); } } catch (Throwable t) { return CompletableFutures.completedExceptionFuture(t); } }
Source:
<code>public void testNullValue() { Properties empty = new Properties(); assertNull(PGProperty.LOG_LEVEL.getSetString(empty)); <START> assertNull(PGProperty.LOG_LEVEL.getSetString(empty)); <END> Properties withLogging = new Properties(); withLogging.setProperty(PGProperty.LOG_LEVEL.getName(), "2"); assertNotNull(PGProperty.LOG_LEVEL.getSetString(withLogging)); }</code><technical_language>Do "double check" here</technical_language>

Target:
public void testNullValue() { Properties empty = new Properties(); assertNull(PGProperty.LOG_LEVEL.getSetString(empty)); Properties withLogging = new Properties(); withLogging.setProperty(PGProperty.LOG_LEVEL.getName(), "2"); assertNotNull(PGProperty.LOG_LEVEL.getSetString(withLogging)); }
Source:
<code>public BundleFilterTimeRange(@JsonProperty(value = "time", required = true) AutoField time, @JsonProperty("before") String before, @JsonProperty("after") String after, @JsonProperty("defaultExit") boolean defaultExit, @JsonProperty("timeFormat") String timeFormat, @JsonProperty("timeZone") String timeZone) { this.time = time; this.before = before; this.after = after; this.defaultExit = defaultExit; this.timeFormat = timeFormat; this.timeZone = timeZone; if (before != null) { tbefore = convertDate(before); } else { tbefore = 0; } if (after != null) { tafter = convertDate(after); } else { tafter = 0; } <START> if ( timeZone != null ) { END> this.format = DateTimeFormat.forPattern(timeFormat).withZone(DateTimeZone.forID(timeZone)); } else if( timeZone == null && timeFormat != null ) { this.format = DateTimeFormat.forPattern(timeFormat); } else { this.format = null; } }</code><technical_language>if timeFormat is null here, happens</technical_language>

Target:
public BundleFilterTimeRange(@JsonProperty(value = "time", required = true) AutoField time, @JsonProperty("before") String before, @JsonProperty("after") String after, @JsonProperty("defaultExit") boolean defaultExit, @JsonProperty("timeFormat") String timeFormat, @JsonProperty("timeZone") String timeZone) { this.time = time; this.before = before; this.after = after; this.defaultExit = defaultExit; this.timeFormat = timeFormat; this.timeZone = timeZone; if (before != null) { tbefore = convertDate(before); } else { tbefore = 0; } if (after != null) { tafter = convertDate(after); } else { tafter = 0; } if( timeFormat == null ) { this.format = null; } else if ( timeZone == null ) { this.format = DateTimeFormat.forPattern(timeFormat); } else { this.format = DateTimeFormat.forPattern(timeFormat).withZone(DateTimeZone.forID(timeZone)); } }
Source:
<code>private void validatePublicModifierOnJavaMethod(final JaxrsResourceMethod resourceMethod) throws CoreException { final IMethod javaMethod = resourceMethod.getJavaElement(); final IType parentClass = resourceMethod.getParentResource().getJavaElement(); <START> if (!parentClass.isInterface() && !Flags.isPublic(javaMethod.getFlags())) { <END> final ISourceRange nameRange = javaMethod.getNameRange(); markerManager.addMarker(resourceMethod, nameRange, JaxrsValidationMessages.RESOURCE_METHOD_NO_PUBLIC_MODIFIER, new String[]{resourceMethod.getName()}, JaxrsPreferences.RESOURCE_METHOD_NO_PUBLIC_MODIFIER); } }</code><technical_language>happened null check</technical_language>

Target:
private void validatePublicModifierOnJavaMethod(final JaxrsResourceMethod resourceMethod) throws CoreException { final IMethod javaMethod = resourceMethod.getJavaElement(); final JaxrsResource parentResource = resourceMethod.getParentResource(); if(javaMethod == null || parentResource == null || parentResource.getJavaElement() == null) { return; } if (!parentResource.getJavaElement().isInterface() && !Flags.isPublic(javaMethod.getFlags())) { final ISourceRange nameRange = javaMethod.getNameRange(); markerManager.addMarker(resourceMethod, nameRange, JaxrsValidationMessages.RESOURCE_METHOD_NO_PUBLIC_MODIFIER, new String[]{resourceMethod.getName()}, JaxrsPreferences.RESOURCE_METHOD_NO_PUBLIC_MODIFIER); } }
Source:
<code><START> protected static Stream<HttpClient> getHttpClients() { <END> if (testMode == TestMode.PLAYBACK) { return Stream.of(new HttpClient[]{null}); } return HttpClientProviders.getAllHttpClients().stream().filter(TestBase::shouldClientBeTested); }</code><technical_language>public static instead of protected static</technical_language>

Target:
public static Stream<HttpClient> getHttpClients() { if (testMode == TestMode.PLAYBACK) { return Stream.of(new HttpClient[]{null}); } return HttpClientProviders.getAllHttpClients().stream().filter(TestBase::shouldClientBeTested); }
Source:
<code>private List<String> getArchivedResourcesId(List<String> resourceIds) { List<String> archivedResources = null; if (null != resourceIds) { Iterator<String> it = resourceIds.iterator(); String id = null; while (it.hasNext()) { ResourceInterface resourceInterface = null; id = (String) it.next(); try { resourceInterface = this.getResourceManager().loadResource(id); if (null != resourceInterface) { if ( null == archivedResources) { archivedResources = new ArrayList<>(); } archivedResources.add(id); } } catch (Throwable t) { <START> logger.error("Errore in verifica risorsa " + id, t); <END> throw new RuntimeException("Errore in verifica risorsa in archivio, id " + id, t); } } } return archivedResources; }</code><technical_language>Translate this log message in English please</technical_language>

Target:
private List<String> getArchivedResourcesId(List<String> resourceIds) { List<String> archivedResources = null; if (null != resourceIds) { Iterator<String> it = resourceIds.iterator(); String id = null; while (it.hasNext()) { ResourceInterface resourceInterface = null; id = (String) it.next(); try { resourceInterface = this.getResourceManager().loadResource(id); if (null != resourceInterface) { if ( null == archivedResources) { archivedResources = new ArrayList<>(); } archivedResources.add(id); } } catch (Throwable t) { logger.error("Error checking resource " + id, t); throw new RuntimeException("Error checking resource " + id, t); } } } return archivedResources; }
Source:
<code>public void setNeedsReschedule(boolean needsReschedule) { <START> mWorkDatabase.beginTransaction(); <END> try { Preference preference = new Preference(KEY_RESCHEDULE_NEEDED, needsReschedule); mWorkDatabase.preferenceDao().insertPreference(preference); mWorkDatabase.setTransactionSuccessful(); } finally { mWorkDatabase.endTransaction(); } }</code><technical_language>here, need a transaction</technical_language>

Target:
public void setNeedsReschedule(boolean needsReschedule) { Preference preference = new Preference(KEY_RESCHEDULE_NEEDED, needsReschedule); mWorkDatabase.preferenceDao().insertPreference(preference); mWorkDatabase.setTransactionSuccessful(); }
Source:
<code>public void testGetRangeMultipart() throws InterruptedException, IOException { String container = getContainerName(); try { String name = "apples"; long length = getMinimumMultipartBlobSize(); ByteSource byteSource = TestUtils.randomByteSource().slice(0, length); Blob blob = view.getBlobStore().blobBuilder(name) .payload(byteSource) .contentLength(length) .build(); view.getBlobStore().putBlob(container, blob, new PutOptions().multipart(true)); blob = view.getBlobStore().getBlob(container, name, range(0, 5)); <START> validateMetadata(blob.getMetadata(), container, name); <END> } finally { returnContainer(container); } }</code><technical_language>Compare blob payload partial byteSource</technical_language>

Target:
public void testGetRangeMultipart() throws InterruptedException, IOException { String container = getContainerName(); InputStream expect = null; InputStream actual = null; try { String name = "apples"; long length = getMinimumMultipartBlobSize(); ByteSource byteSource = TestUtils.randomByteSource().slice(0, length); Blob blob = view.getBlobStore().blobBuilder(name) .payload(byteSource) .contentLength(length) .build(); view.getBlobStore().putBlob(container, blob, new PutOptions().multipart(true)); blob = view.getBlobStore().getBlob(container, name, range(0, 5)); validateMetadata(blob.getMetadata(), container, name); expect = byteSource.slice(0, 6).openStream(); actual = blob.getPayload().openStream(); assertThat(actual).hasContentEqualTo(expect); } finally { Closeables2.closeQuietly(expect); Closeables2.closeQuietly(actual); returnContainer(container); } }
Source:
<code>public static <T extends Descriptor> List<T> applyType(Class<?> contextClass, Iterable<T> source) { ExtensionList<DescriptorVisibilityFilter> filters = all(); List<T> r = new ArrayList<T>(); OUTER: for (T d : source) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Determining visibility of " + d + " in contexts of type " + contextClass); } for (DescriptorVisibilityFilter f : filters) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Querying " + f + " for visibility of " + d + " in type " + contextClass); } <START> if (contextClass != null && !f.filterType(contextClass, d)) { <END> if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.config("Filter " + f + " hides " + d + " in contexts of type " + contextClass); } continue OUTER; } } r.add(d); } return r; }</code><technical_language>Filter is extension point, want protected Runtime exceptions</technical_language>

Target:
public static <T extends Descriptor> List<T> applyType(Class<?> contextClass, Iterable<T> source) { ExtensionList<DescriptorVisibilityFilter> filters = all(); List<T> r = new ArrayList<T>(); OUTER: for (T d : source) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Determining visibility of " + d + " in contexts of type " + contextClass); } for (DescriptorVisibilityFilter f : filters) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Querying " + f + " for visibility of " + d + " in type " + contextClass); } try { if (contextClass != null && !f.filterType(contextClass, d)) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.config("Filter " + f + " hides " + d + " in contexts of type " + contextClass); } continue OUTER; } } catch (Error e) { LOGGER.log(Level.WARNING, "Encountered error while processing filter " + f + " for contexts of type " + contextClass, e); throw e; } catch (Throwable e) { LOGGER.log(logLevelFor(f), "Uncaught exception from filter " + f + " for context of type " + contextClass, e); continue OUTER; } } r.add(d); } return r; }
Source:
<code>public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (UserPreferences.PREF_CAST_ENABLED.equals(key)) { isCastEnabled = UserPreferences.isCastEnabled(); Log.d(TAG, "onSharedPreferenceChanged(), isCastEnabled set to " + isCastEnabled); mMediaRouteActionProvider.setEnabled(isCastEnabled); if (isCastEnabled) { if (castUICounter==1) { <START> mCastManager.incrementUiCounter(); <END> castUICounter++; } } else { if (castUICounter > 1) { mCastManager.decrementUiCounter(); castUICounter--; } if (!PlaybackService.isRunning) { CastManager.getInstance().disconnect(); } } } }</code><technical_language>a method handles incrementing (both increasing number cast manager). Also, I declaring a variable volatile is enough thread safe. I this jmethod is called UI thread, a lock properly protect it</technical_language>

Target:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (UserPreferences.PREF_CAST_ENABLED.equals(key)) { boolean newValue = UserPreferences.isCastEnabled(); Log.d(TAG, "onSharedPreferenceChanged(), isCastEnabled set to " + newValue); castButtonVisibilityManager.setPrefEnabled(newValue); if (!newValue && !PlaybackService.isRunning) { CastManager.getInstance().disconnect(); } } }
Source:
<code>public CompletableFuture<TermIndex> notifyInstallSnapshotFromLeader( RaftProtos.RoleInfoProto roleInfoProto, TermIndex firstTermIndexInLog) { if (roleInfoProto.getRole() != RaftProtos.RaftPeerRole.FOLLOWER) { return RaftJournalUtils.completeExceptionally( <START> new IllegalStateException("Received snapshot as a non-follower")); <END> } return mSnapshotManager.installSnapshotFromLeader(); }</code><technical_language>this message means. explain add more details in message</technical_language>

Target:
public CompletableFuture<TermIndex> notifyInstallSnapshotFromLeader( RaftProtos.RoleInfoProto roleInfoProto, TermIndex firstTermIndexInLog) { if (roleInfoProto.getRole() != RaftProtos.RaftPeerRole.FOLLOWER) { return RaftJournalUtils.completeExceptionally( new IllegalStateException(String.format( "Server should be a follower when installing a snapshot from leader. Actual: %s", roleInfoProto.getRole()))); } return mSnapshotManager.installSnapshotFromLeader(); }
Source:
<code>private boolean hasSameSeparateDerivedEncodings() { <START> return (separateDerivedEncodingsButton == null) <END> || (separateDerivedEncodingsButton.getSelection() == getStoredSeparateDerivedEncodingsValue()); }</code><technical_language>get rid of parenthesis way</technical_language>

Target:
private boolean hasSameSeparateDerivedEncodings() { return separateDerivedEncodingsButton == null || separateDerivedEncodingsButton.getSelection() == getStoredSeparateDerivedEncodingsValue(); }
Source:
<code>public boolean hasNext() { try { if (currentResponse == null) { if (programmeQueries.hasNext()) { currentResponse = client.execute(programmeQueries.next()); return currentResponse.hasNext(); } else { return false; } <START> } else if (currentResponse.hasNext()) { END> return true; } else { if (programmeQueries.hasNext()) { currentResponse = client.execute(programmeQueries.next()); return currentResponse.hasNext(); } else { return false; } } } catch (GlycerinException e) { throw Throwables.propagate(e); } }</code><technical_language>For matter, I coping pages of response anywhere</technical_language>

Target:
public boolean hasNext() { if (currentResponse == null) { return executeRequest(); } else { return currentResponse.hasNext(); } }
Source:
<code>protected RequestScope(String path, JsonApiDocument jsonApiDocument, RequestScope outerRequestScope) { this.jsonApiDocument = jsonApiDocument; <START> this.baseUrlEndPoint = null; <END> this.path = path; this.transaction = outerRequestScope.transaction; this.user = outerRequestScope.user; this.dictionary = outerRequestScope.dictionary; this.mapper = outerRequestScope.mapper; this.auditLogger = outerRequestScope.auditLogger; this.queryParams = Optional.empty(); this.sparseFields = Collections.emptyMap(); this.sorting = Sorting.getDefaultEmptyInstance(); this.pagination = Pagination.getDefaultPagination(outerRequestScope.getElideSettings()); this.objectEntityCache = outerRequestScope.objectEntityCache; this.newPersistentResources = outerRequestScope.newPersistentResources; this.permissionExecutor = outerRequestScope.getPermissionExecutor(); this.dirtyResources = outerRequestScope.dirtyResources; this.deletedResources = outerRequestScope.deletedResources; this.filterDialect = outerRequestScope.filterDialect; this.expressionsByType = outerRequestScope.expressionsByType; this.elideSettings = outerRequestScope.elideSettings; this.useFilterExpressions = outerRequestScope.useFilterExpressions; this.updateStatusCode = outerRequestScope.updateStatusCode; this.lifecycleEvents = outerRequestScope.lifecycleEvents; this.distinctLifecycleEvents = outerRequestScope.distinctLifecycleEvents; this.queuedLifecycleEvents = outerRequestScope.queuedLifecycleEvents; }</code><technical_language>this.baseUrlEndPoint = outerRequestScope.baseUrlEndpoint</technical_language>

Target:
protected RequestScope(String path, JsonApiDocument jsonApiDocument, RequestScope outerRequestScope) { this.jsonApiDocument = jsonApiDocument; this.baseUrlEndPoint = outerRequestScope.baseUrlEndPoint; this.path = path; this.transaction = outerRequestScope.transaction; this.user = outerRequestScope.user; this.dictionary = outerRequestScope.dictionary; this.mapper = outerRequestScope.mapper; this.auditLogger = outerRequestScope.auditLogger; this.queryParams = Optional.empty(); this.sparseFields = Collections.emptyMap(); this.sorting = Sorting.getDefaultEmptyInstance(); this.pagination = Pagination.getDefaultPagination(outerRequestScope.getElideSettings()); this.objectEntityCache = outerRequestScope.objectEntityCache; this.newPersistentResources = outerRequestScope.newPersistentResources; this.permissionExecutor = outerRequestScope.getPermissionExecutor(); this.dirtyResources = outerRequestScope.dirtyResources; this.deletedResources = outerRequestScope.deletedResources; this.filterDialect = outerRequestScope.filterDialect; this.expressionsByType = outerRequestScope.expressionsByType; this.elideSettings = outerRequestScope.elideSettings; this.useFilterExpressions = outerRequestScope.useFilterExpressions; this.updateStatusCode = outerRequestScope.updateStatusCode; this.lifecycleEvents = outerRequestScope.lifecycleEvents; this.distinctLifecycleEvents = outerRequestScope.distinctLifecycleEvents; this.queuedLifecycleEvents = outerRequestScope.queuedLifecycleEvents; }
Source:
<code><START> public double getHomLogLikelihood(final Map<Nucleotide, List<BaseQuality>> baseQualities, <END> final Nucleotide refNucleotide, final Nucleotide altNucleotide, final double homRefPrior) { return GATKProtectedMathUtils.logSumExp( FastMath.log(homRefPrior) + getSingletonLogLikelihood(baseQualities, refNucleotide), FastMath.log(1 - homRefPrior) + getSingletonLogLikelihood(baseQualities, altNucleotide)); }</code><technical_language>If is visible for testing, get default (package) visibility right? remove public</technical_language>

Target:
double getHomLogLikelihood(final Map<Nucleotide, List<BaseQuality>> baseQualities, final Nucleotide refNucleotide, final Nucleotide altNucleotide, final double homRefPrior) { return GATKProtectedMathUtils.logSumExp( FastMath.log(homRefPrior) + getSingletonLogLikelihood(baseQualities, refNucleotide), FastMath.log(1 - homRefPrior) + getSingletonLogLikelihood(baseQualities, altNucleotide)); }
Source:
<code>public long getRunningTasksCount() { return executeReadOnlyTransaction(session -> { Query query = session.getNamedQuery("getRunningTasksCount") .setParameterList("jobStatus", NOT_FINISHED_JOB_STATUSES) .setParameterList("taskStatus", Arrays.asList(TaskStatus.RUNNING)); return (Long) query.uniqueResult(); <START> }); <END> }</code><technical_language>return</technical_language>

Target:
public long getRunningTasksCount() { return executeReadOnlyTransaction(session -> { Query query = session.getNamedQuery("getRunningTasksCount") .setParameterList("jobStatus", NOT_FINISHED_JOB_STATUSES) .setParameterList("taskStatus", Collections.singletonList(TaskStatus.RUNNING)); return (Long) query.uniqueResult(); }); }