auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean isActiveVds() { VDS vds = vdsDao.get(getParameters().getId()); if (vds == null || vds.getStatus() != VDSStatus.Up) { getQueryReturnValue().setExceptionString(String.format( "Cannot fetch storage devices, host %s is not UP.", <START> vds.getHostName())); <END> getQueryReturnValue().setSucceeded(false); return false; } return true; }</code><technical_language>If host removed in meantime, vds null, NPE thrown hostName. need like: private boolean isActiveVds() { VDS vds = vdsDao.get(getParameters().getId()); if (vds == null) { getQueryReturnValue().setExceptionString( "Cannot fetch storage devices, host exist anymore."); } else if (vds.getStatus() != VDSStatus.Up) { getQueryReturnValue().setExceptionString(String.format( "Cannot fetch storage devices, host %s is UP.", vds.getHostName())); } else { return true; } getQueryReturnValue().setSucceeded(false); return false; }</technical_language>

Target:
private boolean isActiveVds() { VDS vds = vdsDao.get(getParameters().getId()); if (vds == null) { getQueryReturnValue().setExceptionString( "Cannot fetch storage devices, host doesn't exist anymore."); } else if (vds.getStatus() != VDSStatus.Up) { getQueryReturnValue().setExceptionString(String.format( "Cannot fetch storage devices, host %s is not UP.", vds.getHostName())); } else { return true; } getQueryReturnValue().setSucceeded(false); return false; }
Source:
<code>private Set<String> validateTools(Devfile devfile) throws DevfileFormatException { Set<String> existingNames = new HashSet<>(); Tool editorTool = null; for (Tool tool : devfile.getTools()) { if (!existingNames.add(tool.getName())) { throw new DevfileFormatException(format("Duplicate tool name found:'%s'", tool.getName())); } switch (tool.getType()) { case EDITOR_TOOL_TYPE: if (editorTool != null) { throw new DevfileFormatException( format( "Multiple editor tools found: '%s', '%s'", editorTool.getName(), tool.getName())); } editorTool = tool; break; case PLUGIN_TOOL_TYPE: break; <START> case KUBERNETES_TOOL_TYPE: <END> case OPENSHIFT_TOOL_TYPE: case DOCKERIMAGE_TOOL_TYPE: break; default: throw new DevfileFormatException( format("Unsupported tool '%s' type provided:'%s'", tool.getName(), tool.getType())); } } return existingNames; }</code><technical_language>resulting code strange. do: case PLUGIN_TOOL_TYPE: case KUBERNETES_TOOL_TYPE: case OPENSHIFT_TOOL_TYPE: case DOCKERIMAGE_TOOL_TYPE: // do break;</technical_language>

Target:
private Set<String> validateTools(Devfile devfile) throws DevfileFormatException { Set<String> existingNames = new HashSet<>(); Tool editorTool = null; for (Tool tool : devfile.getTools()) { if (!existingNames.add(tool.getName())) { throw new DevfileFormatException(format("Duplicate tool name found:'%s'", tool.getName())); } switch (tool.getType()) { case EDITOR_TOOL_TYPE: if (editorTool != null) { throw new DevfileFormatException( format( "Multiple editor tools found: '%s', '%s'", editorTool.getName(), tool.getName())); } editorTool = tool; break; case PLUGIN_TOOL_TYPE: case KUBERNETES_TOOL_TYPE: case OPENSHIFT_TOOL_TYPE: case DOCKERIMAGE_TOOL_TYPE: break; default: throw new DevfileFormatException( format("Unsupported tool '%s' type provided:'%s'", tool.getName(), tool.getType())); } } return existingNames; }
Source:
<code>protected String[] getSlimFlags() { String slimFlags = getVariable("slim.flags"); if (slimFlags == null) { slimFlags = getVariable(SLIM_FLAGS); } <START> return slimFlags == null ? new String[] : slimFlags.trim().split("\\s"); <END> }</code><technical_language>is a smarter parser in ClientBuilder.parseCommandLine(). account quoted values</technical_language>

Target:
protected String[] getSlimFlags() { String slimFlags = getVariable("slim.flags"); if (slimFlags == null) { slimFlags = getVariable(SLIM_FLAGS); } return slimFlags == null ? new String[] : parseCommandLine(slimFlags); }
Source:
<code>public GhprbRootAction() { triggerThreads = Collections.newSetFromMap(new WeakHashMap<StartTrigger, Boolean>()); <START> this.pool = Executors.newFixedThreadPool(10); <END> }</code><technical_language>want this configurable a System property. .NET CI need a higher count</technical_language>

Target:
public GhprbRootAction() { triggerThreads = Collections.newSetFromMap(new WeakHashMap<StartTrigger, Boolean>()); this.pool = Executors.newCachedThreadPool(); }
Source:
<code>protected String toSqlType(Type type) { if (VARBINARY.equals(type)) { <START> return "bytea"; <END> } return super.toSqlType(type); }</code><technical_language>This Postgres data type. refer this doc (<LINK_0> for Clickhouse</technical_language>

Target:
protected String toSqlType(Type type) { if (REAL.equals(type)) { return "double"; } if (TIMESTAMP.equals(type) || TIME_WITH_TIME_ZONE.equals(type) || TIMESTAMP_WITH_TIME_ZONE.equals(type)) { return "datetime"; } if (VARBINARY.equals(type)) { throw new PrestoException(NOT_SUPPORTED, "Unsupported column type: " + type.getDisplayName()); } if (isVarcharType(type)) { return "string"; } return super.toSqlType(type); }
Source:
<code>protected void enhanceConfiguration(ConfigurationBuilder builder) { builder.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class).shared(true).async().enable(); <START> } <END></code><technical_language>I set storeName shared store, data shared properly</technical_language>

Target:
protected void enhanceConfiguration(ConfigurationBuilder builder) { builder.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class).shared(true).storeName(getTestName()).async().enable(); }
Source:
<code>private void queueMessageForDisplay(@NonNull OSInAppMessage message) { synchronized (messageDisplayQueue) { <START> messageDisplayQueue.add(message); <END> OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "queueMessageForDisplay: " + messageDisplayQueue); if (messageDisplayQueue.size() > 0 && !isInAppMessageShowing()) displayMessage(messageDisplayQueue.get(0)); OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "In app message is currently showing, next message will not display yet!"); } }</code><technical_language>Need check add message more</technical_language>

Target:
private void queueMessageForDisplay(@NonNull OSInAppMessage message) { synchronized (messageDisplayQueue) { if (!isInAppMessageQueued(message)) { messageDisplayQueue.add(message); OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "In app message with id, " + message.messageId + ", added to the queue"); } OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "queueMessageForDisplay: " + messageDisplayQueue); if (messageDisplayQueue.size() > 0 && !isInAppMessageShowing()) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "No IAM showing currently, showing first item in the queue!"); displayMessage(messageDisplayQueue.get(0)); return; } OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "In app message is currently showing or there are no IAMs left in the queue!"); } }
Source:
<code>private static String createDefaultMessage( BuildTarget target, ImmutableSet<Flavor> invalidFlavors, ImmutableSet<Flavor> validFlavors) { ImmutableSet<String> invalidFlavorsStr = invalidFlavors.stream().map(Flavor::toString).collect(MoreCollectors.toImmutableSet()); String invalidFlavorsDisplayStr = String.join(", ", invalidFlavorsStr); return String.format( "The following flavor(s) are not supported on target %s:\n%s. Available flavors are: %s", <START> target, invalidFlavorsDisplayStr, validFlavors.stream().map(Flavor::getName).collect( <END> Collectors.joining(", "))); }</code><technical_language>nit: please extract expression a local variable, semantical level other argument statements</technical_language>

Target:
private static String createDefaultMessage( BuildTarget target, ImmutableSet<Flavor> invalidFlavors, ImmutableSet<Flavor> validFlavors) { String invalidFlavorsStr = invalidFlavors .stream() .map(Flavor::toString) .collect(Collectors.joining(System.lineSeparator())); String validFlavorsStr = validFlavors .stream() .map(Flavor::getName) .collect(Collectors.joining(System.lineSeparator())); String invalidFlavorsDisplayStr = String.join(", ", invalidFlavorsStr); return String.format( "The following flavor(s) are not supported on target %s:\n%s\n\nAvailable flavors are:\n%s\n", target, invalidFlavorsDisplayStr, validFlavorsStr); }
Source:
<code>public static long getDelayFromXml() { long delay = (long) minimum; if (appConfigDelay != null) { try { if (randomDelay == true){ <START> if (appConfigDelay_asInit > 0) { <END> delay = Long.parseLong(getRandomInRange(minimum, appConfigDelay_asInit)); } else { appConfigDelay_asInit = Integer.parseInt(String.valueOf(appConfigDelay)); delay = Long.parseLong(getRandomInRange(minimum, appConfigDelay_asInit)); } } else { delay = appConfigDelay; } return delay; }catch (Exception e) { } } else { AppConfig config = AppConfig.getInstance(); if (config.getDelayMinimum() > minimum){ minimum = (int) config.getDelayMinimum(); } if (config.getConstantDelay() > 0) { appConfigDelay = config.getConstantDelay(); } else if (config.getRandomDelay() > 0){ appConfigDelay = config.getRandomDelay(); randomDelay = true; }else{ delay = (long) minimum; } } return delay; }</code><technical_language>I simplify this code using: if (appConfigDelay_asInit <= 0) { appConfigDelay_asInit = Integer.parseInt(String.valueOf(appConfigDelay)); } delay = Long.parseLong(getRandomInRange(minimum, appConfigDelay_asInit));</technical_language>

Target:
public static long getDelayFromXml() { long delay = (long) minimum; if (appConfigDelay != null) { try { if (randomDelay == true){ if (appConfigDelay_asInit <= 0) { appConfigDelay_asInit = Integer.parseInt(String.valueOf(appConfigDelay)); } delay = Long.parseLong(getRandomInRange(minimum, appConfigDelay_asInit)); } else { delay = appConfigDelay; } return delay; }catch (Exception e) { log.error("get to get delay from xml, {}", e); } } else { AppConfig config = AppConfig.getInstance(); if (config.getDelayMinimum() > minimum){ minimum = (int) config.getDelayMinimum(); } if (config.getConstantDelay() > 0) { appConfigDelay = config.getConstantDelay(); } else if (config.getRandomDelay() > 0){ appConfigDelay = config.getRandomDelay(); randomDelay = true; }else{ delay = (long) minimum; } } return delay; }
Source:
<code>public void handle(String error) { eventService.publish( new RuntimeAbnormalStoppingEvent( getContext().getIdentity(), "Machine is abnormal stopped.")); try { internalStop(emptyMap()); } catch (InfrastructureException e) { LOG.error(e.getLocalizedMessage(), e); } finally { eventService.publish( new RuntimeAbnormalStoppedEvent( <START> getContext().getIdentity(), "Machine is abnormal stopped.")); <END> } }</code><technical_language>machine is abnormally stopped.</technical_language>

Target:
public void handle(String error) { eventService.publish(new RuntimeAbnormalStoppingEvent(getContext().getIdentity(), error)); try { internalStop(emptyMap()); } catch (InfrastructureException e) { LOG.error(e.getLocalizedMessage(), e); } finally { eventService.publish(new RuntimeAbnormalStoppedEvent(getContext().getIdentity(), error)); } }
Source:
<code>public static Entity fromString(EntityType type, String str) { try { Unmarshaller unmarshaler = type.getUnmarshaller(); XMLInputFactory xif = XMLInputFactory.newFactory(); <START> xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); <END> xif.setProperty(XMLInputFactory.SUPPORT_DTD, false); XMLStreamReader xsr = xif.createXMLStreamReader(new StringReader(str)); return (Entity) unmarshaler.unmarshal(xsr); } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>extract this editing giving user a method reused places</technical_language>

Target:
public static Entity fromString(EntityType type, String str) { try { Unmarshaller unmarshaler = type.getUnmarshaller(); XMLInputFactory xif = SchemaHelper.createXmlInputFactory(); XMLStreamReader xsr = xif.createXMLStreamReader(new StringReader(str)); return (Entity) unmarshaler.unmarshal(xsr); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>protected IStatus run(IProgressMonitor monitor) { fStatsMod.waitForInitialization(); ITmfStatistics stats = fStatsMod.getStatistics(); if (stats == null) { throw new IllegalStateException(); } ITmfStateSystem ss = fStatsMod.getStateSystem(TmfStatisticsEventTypesModule.ID); if (ss == null) { throw new IllegalStateException(); } <START> TmfTimeRange localtimeRange = fIsGlobal ? fTimeRange : fTimeRangePartial; <END> long start = localtimeRange.getStartTime().normalize(0, TIME_SCALE).getValue(); long end = localtimeRange.getEndTime().normalize(0, TIME_SCALE).getValue(); while (!ss.waitUntilBuilt(LIVE_UPDATE_DELAY)) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } localtimeRange = fIsGlobal ? fTimeRange : fTimeRangePartial; start = localtimeRange.getStartTime().normalize(0, TIME_SCALE).getValue(); end = localtimeRange.getEndTime().normalize(0, TIME_SCALE).getValue(); Map<String, Long> map = stats.getEventTypesInRange(start, end); updateStats(map); } Map<String, Long> map = stats.getEventTypesInRange(start, end); updateStats(map); return Status.OK_STATUS; }</code><technical_language>do a do-while instead, condition set local variable beginning of do. avoid repeating loop code loop. here, pass of loop done twice, loop</technical_language>

Target:
protected IStatus run(IProgressMonitor monitor) { fStatsMod.waitForInitialization(); ITmfStatistics stats = fStatsMod.getStatistics(); if (stats == null) { throw new IllegalStateException(); } ITmfStateSystem ss = fStatsMod.getStateSystem(TmfStatisticsEventTypesModule.ID); if (ss == null) { throw new IllegalStateException(); } long start = 0; long end = 0; do { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } TmfTimeRange localtimeRange = fIsGlobal ? fTimeRange : fTimeRangePartial; start = localtimeRange.getStartTime().normalize(0, TIME_SCALE).getValue(); end = localtimeRange.getEndTime().normalize(0, TIME_SCALE).getValue(); Map<String, Long> map = stats.getEventTypesInRange(start, end); updateStats(map); } while (!ss.waitUntilBuilt(LIVE_UPDATE_DELAY)); Map<String, Long> map = stats.getEventTypesInRange(start, end); updateStats(map); return Status.OK_STATUS; }
Source:
<code>FSTreeIterator(TreePath p) { AclStatus acls = null; Path remotePath = p.getFileStatus().getPath(); try { acls = getAclStatus(fs, remotePath); } catch (IOException e) { LOG.warn( "Got exception when trying to get remote acls for path : {}", remotePath, e.getMessage()); } getPendingQueue().addFirst( <START> new TreePath(p.getFileStatus(), p.getParentId(), this, fs, acls)); <END> }</code><technical_language>Extract</technical_language>

Target:
FSTreeIterator(TreePath p) { this(p.getFileStatus(), p.getParentId()); }
Source:
<code>private List<Availability> getNitroAvailabilities(Clip clip) throws GlycerinException { AvailabilityQuery query = AvailabilityQuery.builder() .withDescendantsOf(clip.getPid()) .withPageSize(pageSize) .build(); <START> GlycerinResponse<Availability> availabilities = glycerin.execute(query); <END> return availabilities.getResults(); }</code><technical_language>This needs do exhaustive call</technical_language>

Target:
private ImmutableList<Availability> getNitroAvailabilities(Clip clip) throws GlycerinException { List<ListenableFuture<ImmutableList<Availability>>> futures = Lists.newArrayList(); AvailabilityQuery query = AvailabilityQuery.builder() .withDescendantsOf(clip.getPid()) .withPageSize(pageSize) .build(); futures.add(executor.submit(exhaustingAvailabilityCallable(query))); ListenableFuture<List<ImmutableList<Availability>>> all = Futures.allAsList(futures); try { return ImmutableList.copyOf(Iterables.concat(all.get())); } catch (InterruptedException | ExecutionException e) { if (e.getCause() instanceof GlycerinException) { throw (GlycerinException) e.getCause(); } throw Throwables.propagate(e); } }
Source:
<code>private void handleCredentials(HttpServletRequest request, String user, String password) { UserProfile userProfile = translateUser(user); AuthenticationProfile profile = AuthenticationProfileRepository.getInstance().getProfile(userProfile.profile); if (profile == null) { String msg = String.format("Error in obtaining profile %1$s", userProfile.profile); <START> log.error(msg); <END> } else { ExtMap outputMap = profile.getAuthn().invoke(new ExtMap().mput( Base.InvokeKeys.COMMAND, Authn.InvokeCommands.AUTHENTICATE_CREDENTIALS ).mput( Authn.InvokeKeys.USER, userProfile.userName ).mput( Authn.InvokeKeys.CREDENTIALS, password ) ); if (outputMap.<Integer> get(Base.InvokeKeys.RESULT) == Base.InvokeResult.SUCCESS && outputMap.<Integer> get(Authn.InvokeKeys.RESULT) == Authn.AuthResult.SUCCESS) { request.getSession(true); request.setAttribute(FiltersHelper.Constants.REQUEST_AUTH_RECORD_KEY, outputMap.<ExtMap> get(Authn.InvokeKeys.AUTH_RECORD)); request.setAttribute(FiltersHelper.Constants.REQUEST_PROFILE_KEY, userProfile.profile); } else { log.error( String.format( "Failure in authentication to profile %1$s. Invocation Result code is %2$s. Authn result code is %3$s", userProfile.profile, outputMap.<Integer> get(Base.InvokeKeys.RESULT), outputMap.<Integer> get(Authn.InvokeKeys.RESULT) ) ); } } }</code><technical_language>do need this msg temp var</technical_language>

Target:
private void handleCredentials(HttpServletRequest request, String user, String password) { UserProfile userProfile = translateUser(user); AuthenticationProfile profile = AuthenticationProfileRepository.getInstance().getProfile(userProfile.profile); if (profile == null) { log.error(String.format("Error in obtaining profile %1$s", userProfile.profile)); } else { ExtMap outputMap = profile.getAuthn().invoke(new ExtMap().mput( Base.InvokeKeys.COMMAND, Authn.InvokeCommands.AUTHENTICATE_CREDENTIALS ).mput( Authn.InvokeKeys.USER, userProfile.userName ).mput( Authn.InvokeKeys.CREDENTIALS, password ) ); if (outputMap.<Integer> get(Base.InvokeKeys.RESULT) == Base.InvokeResult.SUCCESS && outputMap.<Integer> get(Authn.InvokeKeys.RESULT) == Authn.AuthResult.SUCCESS) { request.setAttribute(FiltersHelper.Constants.REQUEST_AUTH_RECORD_KEY, outputMap.<ExtMap> get(Authn.InvokeKeys.AUTH_RECORD)); request.setAttribute(FiltersHelper.Constants.REQUEST_PROFILE_KEY, userProfile.profile); } else { log.error( String.format( "Failure in authentication to profile %1$s. Invocation Result code is %2$s. Authn result code is %3$s", userProfile.profile, outputMap.<Integer> get(Base.InvokeKeys.RESULT), outputMap.<Integer> get(Authn.InvokeKeys.RESULT) ) ); } } }
Source:
<code>public UserSqlSandbox(String username) { <START> caseStorage = new SqlIndexedStorageUtility<>(Case.class, username, "CCCase"); <END> ledgerStorage = new SqlIndexedStorageUtility<>(Ledger.class, username, "Ledger"); userStorage = new SqlIndexedStorageUtility<>(User.class, username, "User"); userFixtureStorage = new SqlIndexedStorageUtility<>(FormInstance.class, username, "UserFixture"); appFixtureStorage = new SqlIndexedStorageUtility<>(FormInstance.class, username, "AppFixture"); }</code><technical_language>Storage Keys for objects possible, right</technical_language>

Target:
public UserSqlSandbox(String username) { caseStorage = new SqliteIndexedStorageUtility<>(Case.class, username, "CCCase"); ledgerStorage = new SqliteIndexedStorageUtility<>(Ledger.class, username, Ledger.STORAGE_KEY); userStorage = new SqliteIndexedStorageUtility<>(User.class, username, User.STORAGE_KEY); userFixtureStorage = new SqliteIndexedStorageUtility<>(FormInstance.class, username, "UserFixture"); appFixtureStorage = new SqliteIndexedStorageUtility<>(FormInstance.class, username, "AppFixture"); }
Source:
<code><START> protected static void addAction(List<PDAction> actions, <END> org.apache.pdfbox.pdmodel.interactive.action.PDAction buffer) { if (buffer != null) { actions.add(buffer instanceof PDActionNamed ? new PBoxPDNamedAction( (PDActionNamed) buffer) : new PBoxPDAction(buffer)); } }</code><technical_language>remove static</technical_language>

Target:
protected void addAction(List<PDAction> actions, org.apache.pdfbox.pdmodel.interactive.action.PDAction buffer) { if (buffer != null) { actions.add(buffer instanceof PDActionNamed ? new PBoxPDNamedAction( (PDActionNamed) buffer) : new PBoxPDAction(buffer)); } }
Source:
<code>private String createPrivateKeyString(KeyPair sshKeyPair) { String privateKeyStr = PkiUtil.convert(sshKeyPair.getPrivate()); <START> if (privateKeyStr.endsWith("\n")) { privateKeyStr = privateKeyStr.substring(0, privateKeyStr.length() - 1); } return privateKeyStr; <END> }</code><technical_language>StringUtils.removeEnd(String str, String remove) a bit simpler</technical_language>

Target:
private String createPrivateKeyString(KeyPair sshKeyPair) { return StringUtils.removeEnd(PkiUtil.convert(sshKeyPair.getPrivate()), "\n"); }
Source:
<code>protected String decorateMessageSubject(String subject) { if ("".equals(subject)) { return ""; } <START> StringBuilder bldr = new StringBuilder("*"); <END> bldr.append(subject).append("*").append("\n"); return bldr.toString(); }</code><technical_language>If for bold, Mattermost wants asterisks Slack's one. <LINK_1> <LINK_0></technical_language>

Target:
protected String decorateMessageSubject(String subject) { if ("".equals(subject)) { return ""; } StringBuilder bldr = new StringBuilder("**"); bldr.append(subject).append("**").append("\n"); return bldr.toString(); }
Source:
<code>public void displayHighlighted( StringNormalizer.Result normalized, String text, FuzzyScore fuzzyScore, TextView view, Context context <START> ) { <END> displayHighlighted(normalized, text, fuzzyScore, view, false, context); }</code><technical_language>(paren above)</technical_language>

Target:
public boolean displayHighlighted(StringNormalizer.Result normalized, String text, FuzzyScore fuzzyScore, TextView view, Context context) { FuzzyScore.MatchInfo matchInfo = fuzzyScore.match(normalized.codePoints); if (!matchInfo.match) { view.setText(text); return false; } SpannableString enriched = new SpannableString(text); int primaryColor = UIColors.getPrimaryColor(context); for (Pair<Integer, Integer> position : matchInfo.getMatchedSequences()) { enriched.setSpan( new ForegroundColorSpan(primaryColor), normalized.mapPosition(position.first), normalized.mapPosition(position.second), Spannable.SPAN_INCLUSIVE_INCLUSIVE ); } view.setText(enriched); return true; }
Source:
<code>public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { <START> for (Uri uri : files) { <END> File sourceFile = new File(getRealPathFromURI(uri)); String path = mAdapter.getItem(i).path; File destFile = new File(path, sourceFile.getName()); try { copy(sourceFile, destFile); } catch (IOException e) { Log.e(TAG, "Failed copying file", e); } } getActivity().finish(); }</code><technical_language>currently this GUI thread, done in a background thread (probably AsyncTask)</technical_language>

Target:
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { if (!copying) { copying = true; RestApi.Folder destFolder = getItemFolder(i); CopyFilesTaskParams copyFilesTaskParams = new CopyFilesTaskParams(mFiles, destFolder); new CopyFilesTask().execute(copyFilesTaskParams); } }
Source:
<code>public static void beforeClass() { SWTBotUtils.initialize(); Thread.currentThread().setName("SWTBotTest"); SWTBotPreferences.TIMEOUT = 20000; SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; fLogger.removeAllAppenders(); fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT)); SWTWorkbenchBot bot = new SWTWorkbenchBot(); <START> final List<SWTBotView> openViews = bot.views(); for (SWTBotView view : openViews) { if (view.getTitle().equals("Welcome")) { view.close(); bot.waitUntil(ConditionHelpers.ViewIsClosed(view)); } } <END> switchTracingPerspective(); SWTBotUtils.waitForJobs(); }</code><technical_language>SWTBotUtils.closeView("welcome", fBot);</technical_language>

Target:
public static void beforeClass() { SWTBotUtils.initialize(); Thread.currentThread().setName("SWTBotTest"); SWTBotPreferences.TIMEOUT = 20000; SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; fLogger.removeAllAppenders(); fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT)); SWTWorkbenchBot bot = new SWTWorkbenchBot(); SWTBotUtils.closeView("welcome", bot); SWTBotUtils.switchToTracingPerspective(); SWTBotUtils.waitForJobs(); }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder("DefaultKfsAccountForAwsResultWrapper {"); defaultKfsAccountsForAws.stream().forEach(acct -> sb.append("[").append(acct.toString()).append("]")); sb.append("}"); <START> return sb.toString(); <END> }</code><technical_language>If wanted simplify this logic further, perform a collect() operation stream Collectors.joining() concatenate elements, need StringBuilder explicitly</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder("DefaultKfsAccountForAwsResultWrapper {"); String joinedStringOutput = defaultKfsAccountsForAws.stream() .map(acct -> acct.toString()) .collect(Collectors.joining("] [", "[", "]")); sb.append(joinedStringOutput).append("}"); return sb.toString(); }
Source:
<code>public RomanColumnFamily(BlockFamilyDefinition definition, BlockBuilderHelper blockBuilder) { super(definition, blockBuilder); BLOCKS = new TByteObjectHashMap<Block>(); blockUri = new BlockUri(definition.getUrn()); BLOCKS.put((byte) 0, makeABlock(definition, blockBuilder, "lone_block", blockUri, (byte) 0)); <START> BLOCKS.put(SideBitFlag.getSide(Side.TOP), makeABlock(definition, blockBuilder, "on_bottom", blockUri, SideBitFlag.getSide(Side.TOP))); <END> BLOCKS.put(SideBitFlag.getSide(Side.BOTTOM), makeABlock(definition, blockBuilder, "on_top", blockUri, SideBitFlag.getSide(Side.BOTTOM))); BLOCKS.put(SideBitFlag.getSides(Side.BOTTOM, Side.TOP), makeABlock(definition, blockBuilder, "in_a_line", blockUri, SideBitFlag.getSides(Side.TOP, Side.BOTTOM))); this.setBlockUri(blockUri); this.setCategory(definition.getCategories()); }</code><technical_language>move lines a helper function end repeating getSides for in map set bitflag</technical_language>

Target:
public RomanColumnFamily(BlockFamilyDefinition definition, BlockBuilderHelper blockBuilder) { super(definition, blockBuilder); blocks = new TByteObjectHashMap<Block>(); blockUri = new BlockUri(definition.getUrn()); addConnection((byte) 0, "lone_block", definition, blockBuilder); addConnection(SideBitFlag.getSide(Side.TOP), "on_bottom", definition, blockBuilder); addConnection(SideBitFlag.getSide(Side.BOTTOM), "on_top", definition, blockBuilder); addConnection(SideBitFlag.getSides(Side.TOP, Side.BOTTOM), "in_a_line", definition, blockBuilder); this.setBlockUri(blockUri); this.setCategory(definition.getCategories()); this.setCategory(categories); }
Source:
<code>public void testDeactivateDoesNotRestoreForNoOpenTasks() { taskActivityManager.activateTask(task1); taskActivityManager.deactivateTask(task1); assertNoTaskOrTextEditorsOpen(); taskActivityManager.activateTask(task1); <START> assertEquals(Collections.emptyList(), getOpenEditorsByType(TaskEditor.class)); <END> }</code><technical_language>call assertNoTaskOrTextEditorsOpen again</technical_language>

Target:
public void testDeactivateDoesNotRestoreForNoOpenTasks() { taskActivityManager.activateTask(task1); taskActivityManager.deactivateTask(task1); assertNoTaskOrTextEditorsOpen(); taskActivityManager.activateTask(task1); assertNoTaskOrTextEditorsOpen(); }
Source:
<code><START> public static void assertSchedulable(String entityType){ <END> if (entityType.equalsIgnoreCase(EntityType.PROCESS.toString()) || entityType.equalsIgnoreCase(EntityType.FEED.toString())){ return; } else { throw new IllegalArgumentException("EntityType "+ entityType + " is not valid,Feed and Process are the valid input type."); } }</code><technical_language>EntityType.getEnum this method? This method pretty similar AbstractSchedulableEntityManager.checkSchedulableEntity, except, exception different</technical_language>

Target:
public static void assertSchedulable(String entityType){ EntityType type = EntityType.getEnum(entityType); if (type.isSchedulable()){ return; } else { throw new IllegalArgumentException("EntityType "+ entityType + " is not valid,Feed and Process are the valid input type."); } }
Source:
<code>private Mono<TransactionCoordinator> createTransactionCoordinator() { if (isDisposed()) { return Mono.error(logger.logExceptionAsError(new IllegalStateException(String.format( "Cannot create coordinator send link '%s' from a closed session.", TRANSACTION_LINK_NAME)))); } if (transactionCoordinator != null) { logger.verbose("Coordinator[{}]: Returning existing transaction coordinator.", TRANSACTION_LINK_NAME); return Mono.just(transactionCoordinator); } <START> synchronized (coordinatorLock) { <END> return createCoordinatorSendLink(TRANSACTION_LINK_NAME, openTimeout, retryPolicy) .handle((amqpLink, sink) -> { logger.info("Coordinator[{}]: Creating transaction coordinator.", TRANSACTION_LINK_NAME); final TransactionCoordinator transactionCoordinator = new TransactionCoordinator(amqpLink, messageSerializer); sink.next(transactionCoordinator); }); } }</code><technical_language>1. is a lock here? operation is asynchronous. call returns immediately setting Mono. multiple createCoordinatorSendLink. 1. Creating AtomicReference _plus_ a lock for this right approach here</technical_language>

Target:
private Mono<TransactionCoordinator> createTransactionCoordinator() { if (isDisposed()) { return Mono.error(logger.logExceptionAsError(new IllegalStateException(String.format( "Cannot create coordinator send link '%s' from a closed session.", TRANSACTION_LINK_NAME)))); } TransactionCoordinator existing = transactionCoordinator.get(); if (existing != null) { logger.verbose("Coordinator[{}]: Returning existing transaction coordinator.", TRANSACTION_LINK_NAME); return Mono.just(existing); } return createCoordinatorSendLink(openTimeout, retryPolicy) .map(sendLink -> { TransactionCoordinator newCoordinator = new TransactionCoordinator(sendLink, messageSerializer); if (transactionCoordinator.compareAndSet(null, newCoordinator)) { logger.info("Coordinator[{}]: Created transaction coordinator.", TRANSACTION_LINK_NAME); } else { logger.info("linkName[{}]: Another transaction coordinator exists.", TRANSACTION_LINK_NAME); } return transactionCoordinator.get(); }); }
Source:
<code>public void setAttribute(PatientProgramAttribute attribute) { if (this.getAttributes() == null) { this.addAttribute(attribute); } else { if (this.getActiveAttributes(attribute.getAttributeType()).size() == 1) { <START> PatientProgramAttribute i$ = this.getActiveAttributes(attribute.getAttributeType()).get(0); <END> if (!i$.getValue().equals(attribute.getValue())) { if (i$.getId() != null) { i$.setVoided(Boolean.TRUE); } else { this.getAttributes().remove(i$); } this.getAttributes().add(attribute); attribute.setOwner(this); } } else { for (PatientProgramAttribute existing : this.getActiveAttributes(attribute.getAttributeType())) { if (existing.getAttributeType().equals(attribute.getAttributeType())) { if (existing.getId() != null) { existing.setVoided(Boolean.TRUE); } else { this.getAttributes().remove(existing); } } } this.getAttributes().add(attribute); attribute.setOwner(this); } } }</code><technical_language>sort of variable name is "i$"</technical_language>

Target:
public void setAttribute(PatientProgramAttribute attribute) { if (this.getAttributes() == null) { this.addAttribute(attribute); } else { if (this.getActiveAttributes(attribute.getAttributeType()).size() == 1) { PatientProgramAttribute patientProgramAttribute = this.getActiveAttributes(attribute.getAttributeType()).get(0); if (!patientProgramAttribute.getValue().equals(attribute.getValue())) { if (patientProgramAttribute.getId() != null) { patientProgramAttribute.setVoided(Boolean.TRUE); } else { this.getAttributes().remove(patientProgramAttribute); } this.getAttributes().add(attribute); attribute.setOwner(this); } } else { for (PatientProgramAttribute existing : this.getActiveAttributes(attribute.getAttributeType())) { if (existing.getAttributeType().equals(attribute.getAttributeType())) { if (existing.getId() != null) { existing.setVoided(Boolean.TRUE); } else { this.getAttributes().remove(existing); } } } this.getAttributes().add(attribute); attribute.setOwner(this); } } }
Source:
<code>public void onDeleted(Item item) { if (!(item instanceof TopLevelItem)) { return; } TopLevelItem tli = (TopLevelItem) item; Jenkins jenkins = Jenkins.get(); Computer.threadPoolForRemoting.submit(new CleanupTask(tli, jenkins)); <START> if(System.getenv("BRANCH_API_THREAD_LIMIT") == null){ jenkins.getNodes().forEach((node) -> { Computer.threadPoolForRemoting.submit(new CleanupTask(tli, node)); }); }else{ new CleanupTaskProvisioner(tli, jenkins.getNodes()).run(); <END> } }</code><technical_language>suggestion // Starts provisioner Thread is tasked starting cleanup Threads new CleanupTaskProvisioner(tli, jenkins.getNodes()).run();</technical_language>

Target:
public void onDeleted(Item item) { if (!(item instanceof TopLevelItem)) { return; } TopLevelItem tli = (TopLevelItem) item; Jenkins jenkins = Jenkins.get(); Computer.threadPoolForRemoting.submit(new CleanupTask(tli, jenkins)); new CleanupTaskProvisioner(tli, jenkins.getNodes()).run(); }
Source:
<code>public void describeMismatchSafely(final Response item, final Description description) { description.appendText("header was: ") .appendDescriptionOf(this.headerm) <START> .appendText(VALUES_STR) <END> .appendValue(this.failedvals); }</code><technical_language>@exper0 full path HmRsHeader.VALUES_STR</technical_language>

Target:
public void describeMismatchSafely(final Response item, final Description description) { description.appendText("header was: ") .appendDescriptionOf(this.header) .appendText(HmRsHeader.VALUES_STR) .appendValue(this.failed); }
Source:
<code>private NextAction processWithListeners(ListenerContext listenerContext, WorkflowInstance instance, AbstractWorkflowDefinition<? extends WorkflowState> definition, StateExecutionImpl execution, WorkflowState state) { <START> List<WorkflowExecutorListener> chain = new LinkedList<>(asList(this.executorListeners)); <END> ProcessingExecutorListener processingListener = new ProcessingExecutorListener(instance, definition, execution, state); chain.add(processingListener); NextAction nextAction = new ExecutorListenerChain(chain).next(listenerContext); if (execution.isStateProcessInvoked()) { return nextAction; } return new SkippedStateHandler(nextAction, instance, definition, execution, state).processState(); }</code><technical_language>Prefer arraylist (with size + 1 for bonus element) linked list. type of this.executorListeners Collection. need convert invocation</technical_language>

Target:
private NextAction processWithListeners(ListenerContext listenerContext, WorkflowInstance instance, AbstractWorkflowDefinition<? extends WorkflowState> definition, StateExecutionImpl execution, WorkflowState state) { ProcessingExecutorListener processingListener = new ProcessingExecutorListener(instance, definition, execution, state); List<WorkflowExecutorListener> chain = new ArrayList<>(executorListeners.size() + 1); for (WorkflowExecutorListener listener : executorListeners) { if (listener.appliesTo(listenerContext)) { chain.add(listener); } } chain.add(processingListener); NextAction nextAction = new ExecutorListenerChain(chain).next(listenerContext); if (execution.isStateProcessInvoked()) { return nextAction; } return new SkippedStateHandler(nextAction, instance, definition, execution, state).processState(); }
Source:
<code>CosmosAsyncClient(CosmosClientBuilder builder) { this.configs = builder.configs(); this.serviceEndpoint = builder.getEndpoint(); this.keyOrResourceToken = builder.getKey(); this.connectionPolicy = builder.getConnectionPolicy(); this.desiredConsistencyLevel = builder.getConsistencyLevel(); this.permissions = builder.getPermissions(); this.cosmosAuthorizationTokenResolver = builder.getAuthorizationTokenResolver(); this.credential = builder.getCredential(); this.sessionCapturingOverride = builder.isSessionCapturingOverrideEnabled(); this.enableTransportClientSharing = builder.isConnectionSharingAcrossClientsEnabled(); this.contentResponseOnWriteEnabled = builder.isContentResponseOnWriteEnabled(); <START> this.tracerProvider = new TracerProvider(ServiceLoader.load(Tracer.class)); <END> this.asyncDocumentClient = new AsyncDocumentClient.Builder() .withServiceEndpoint(this.serviceEndpoint) .withMasterKeyOrResourceToken(this.keyOrResourceToken) .withConnectionPolicy(this.connectionPolicy) .withConsistencyLevel(this.desiredConsistencyLevel) .withSessionCapturingOverride(this.sessionCapturingOverride) .withConfigs(this.configs) .withTokenResolver(this.cosmosAuthorizationTokenResolver) .withCredential(this.credential) .withTransportClientSharing(this.enableTransportClientSharing) .withContentResponseOnWriteEnabled(this.contentResponseOnWriteEnabled) .build(); }</code><technical_language>Calling ServiceLoader.load() for instance of client is required. This done result of loader change lifespan of application</technical_language>

Target:
CosmosAsyncClient(CosmosClientBuilder builder) { this.configs = builder.configs(); this.serviceEndpoint = builder.getEndpoint(); this.keyOrResourceToken = builder.getKey(); this.connectionPolicy = builder.getConnectionPolicy(); this.desiredConsistencyLevel = builder.getConsistencyLevel(); this.permissions = builder.getPermissions(); this.cosmosAuthorizationTokenResolver = builder.getAuthorizationTokenResolver(); this.credential = builder.getCredential(); this.sessionCapturingOverride = builder.isSessionCapturingOverrideEnabled(); this.dataEncryptionKeyProvider = builder.getDataEncryptionKeyProvider(); this.enableTransportClientSharing = builder.isConnectionSharingAcrossClientsEnabled(); this.contentResponseOnWriteEnabled = builder.isContentResponseOnWriteEnabled(); this.tracerProvider = new TracerProvider(TRACER); this.asyncDocumentClient = new AsyncDocumentClient.Builder() .withServiceEndpoint(this.serviceEndpoint) .withMasterKeyOrResourceToken(this.keyOrResourceToken) .withConnectionPolicy(this.connectionPolicy) .withConsistencyLevel(this.desiredConsistencyLevel) .withSessionCapturingOverride(this.sessionCapturingOverride) .withConfigs(this.configs) .withTokenResolver(this.cosmosAuthorizationTokenResolver) .withCredential(this.credential) .withTransportClientSharing(this.enableTransportClientSharing) .withDataEncryptionKeyProvider(this.dataEncryptionKeyProvider) .withContentResponseOnWriteEnabled(this.contentResponseOnWriteEnabled) .build(); }
Source:
<code>private boolean hasAnySanitizedField(StudentProfileAttributes profile) { return isSanitizedHtml(profile.shortName) || isSanitizedHtml(profile.email) || isSanitizedHtml(profile.institute) || isSanitizedHtml(profile.nationality) <START> || isSanitizedHtml(String.valueOf(profile.gender)) || isSanitizedHtml(profile.moreInfo); <END> }</code><technical_language>need in check anymore too</technical_language>

Target:
private boolean hasAnySanitizedField(StudentProfileAttributes profile) { return isSanitizedHtml(profile.shortName) || isSanitizedHtml(profile.email) || isSanitizedHtml(profile.institute) || isSanitizedHtml(profile.nationality) || isSanitizedHtml(profile.moreInfo); }
Source:
<code>public ContainerAttributes containerAttributes() { final ContainerAttributes containerAttributes = new ContainerAttributes(); setConfiguredContainerAttributes(containerAttributes); final String containerIp = environment.getProperty("xd.container.ip"); final String containerHostname = environment.getProperty("xd.container.hostname"); <START> if (StringUtils.hasText(containerIp)) { <END> containerAttributes.setIp(containerIp); } else { containerAttributes.setIp(RuntimeUtils.getIpAddress()); } if (StringUtils.hasText(containerHostname)) { containerAttributes.setHost(containerHostname); } else { containerAttributes.setHost(RuntimeUtils.getHost()); } containerAttributes.setPid(RuntimeUtils.getPid()); return containerAttributes; }</code><technical_language>this instead of if...else: containerAttributes.setIp(StringUtils.hasText(containerIp) ? containerIp : RuntimeUtils.getIpAddress());</technical_language>

Target:
public ContainerAttributes containerAttributes() { final ContainerAttributes containerAttributes = new ContainerAttributes(); setConfiguredContainerAttributes(containerAttributes); final String containerIp = environment.getProperty("xd.container.ip"); final String containerHostname = environment.getProperty("xd.container.hostname"); containerAttributes.setIp(StringUtils.hasText(containerIp) ? containerIp : RuntimeUtils.getIpAddress()); containerAttributes.setHost(StringUtils.hasText(containerHostname) ? containerHostname : RuntimeUtils.getHost()); containerAttributes.setPid(RuntimeUtils.getPid()); return containerAttributes; }
Source:
<code>public static String readDigestFromStream( final InputStream inputStream ) throws IOException { try { String raw = StringUtils.chomp( IOUtil.toString( inputStream, "UTF-8" ) ).trim(); <START> if ( raw != null && StringUtils.isEmpty( raw ) ) <END> { return ""; } String digest; if ( raw.contains( "=" ) || raw.contains( ":" ) ) { digest = raw.split( "[=:]", 2 )[1].trim(); } else { digest = raw.split( " ", 2 )[0]; } if ( !isDigest( digest ) ) { digest = compress( digest ); } if ( !isDigest( digest ) ) { digest = compress( raw ); } if ( !isDigest( digest ) ) { digest = compress( raw.substring( 0, raw.lastIndexOf( " " ) ).trim() ); } if ( !isDigest( digest ) ) { digest = raw.split( " ", 2 )[0]; } return digest; } finally { IOUtil.close( inputStream ); } }</code><technical_language>raw != null && StringUtils.isEmpty( raw )? StringUtils.isBlank( raw ) only</technical_language>

Target:
public static String readDigestFromStream( final InputStream inputStream ) throws IOException { try { String raw = StringUtils.chomp( IOUtil.toString( inputStream, "UTF-8" ) ).trim(); if ( StringUtils.isEmpty( raw ) ) { return ""; } String digest; if ( raw.contains( "=" ) || raw.contains( ":" ) ) { digest = raw.split( "[=:]", 2 )[1].trim(); } else { digest = raw.split( " ", 2 )[0]; } if ( !isDigest( digest ) ) { digest = compress( digest ); } if ( !isDigest( digest ) ) { digest = compress( raw ); } if ( !isDigest( digest ) ) { digest = compress( raw.substring( 0, raw.lastIndexOf( " " ) ).trim() ); } if ( !isDigest( digest ) ) { digest = raw.split( " ", 2 )[0]; } return digest; } finally { IOUtil.close( inputStream ); } }
Source:
<code>protected void handleMessageInRunContext(final Message jmsMessage) throws JMSException { final JmsMessageReader<DTO> messageReader = JmsMessageReader.newInstance(jmsMessage, m_marshaller); final IMessage<DTO> message = messageReader.readMessage(); final String correlationId = messageReader.readCorrelationId(); createRunContext() .withCorrelationId(correlationId) .withThreadLocal(IMessage.CURRENT, message) .run(new IRunnable() { @Override public void run() throws Exception { try { m_listener.onMessage(message); } catch (Exception e) { throw BEANS.get(PlatformExceptionTranslator.class).translate(e) <START> .withContextInfo("JMSCorrelationID", correlationId); <END> } } }); }</code><technical_language>In theory, this is JMSCorrelationID. JmsMessageReader generates a new CorrelationID if is received JMS. is more Scout Correlation ID</technical_language>

Target:
protected void handleMessageInRunContext(final Message jmsMessage) throws JMSException { final JmsMessageReader<DTO> messageReader = JmsMessageReader.newInstance(jmsMessage, m_marshaller); final IMessage<DTO> message = messageReader.readMessage(); final String correlationId = messageReader.readCorrelationId(); createRunContext() .withCorrelationId(correlationId) .withThreadLocal(IMessage.CURRENT, message) .run(new IRunnable() { @Override public void run() throws Exception { try { m_listener.onMessage(message); } catch (Exception e) { throw BEANS.get(PlatformExceptionTranslator.class).translate(e) .withContextInfo("correlationId", correlationId); } } }); }
Source:
<code>public Result apply(LimitNode parent, Captures captures, Context context) { JoinNode joinNode = captures.get(CHILD); PlanNode left = joinNode.getLeft(); PlanNode right = joinNode.getRight(); if (isLeftOuter(joinNode.getType()) && !isLimited(left, context.getLookup(), parent.getCount())) { left = new LimitNode(context.getIdAllocator().getNextId(), left, parent.getCount(), true); } <START> if (isRightOuter(joinNode.getType()) && !isLimited(right, context.getLookup(), parent.getCount())) { <END> right = new LimitNode(context.getIdAllocator().getNextId(), right, parent.getCount(), true); } if (joinNode.getLeft() != left || joinNode.getRight() != right) { return Result.ofPlanNode( parent.replaceChildren(ImmutableList.of( joinNode.replaceChildren(ImmutableList.of(left, right))))); } return Result.empty(); }</code><technical_language>Potentially result a performance regression. If key selected right match row left - entire right side streamed Join outputs rows. I feel strong it, I try safe, add a session property disable this optimization in case of emergency</technical_language>

Target:
public Result apply(LimitNode parent, Captures captures, Context context) { if (!isPushLimitThroughOuterJoin(context.getSession())) { return Result.empty(); } JoinNode joinNode = captures.get(CHILD); PlanNode left = joinNode.getLeft(); PlanNode right = joinNode.getRight(); if (joinNode.getType() == LEFT && !isLimited(left, context.getLookup(), parent.getCount())) { left = new LimitNode(context.getIdAllocator().getNextId(), left, parent.getCount(), true); } if (joinNode.getType() == RIGHT && !isLimited(right, context.getLookup(), parent.getCount())) { right = new LimitNode(context.getIdAllocator().getNextId(), right, parent.getCount(), true); } if (joinNode.getLeft() != left || joinNode.getRight() != right) { return Result.ofPlanNode( parent.replaceChildren(ImmutableList.of( joinNode.replaceChildren(ImmutableList.of(left, right))))); } return Result.empty(); }
Source:
<code>String translate(String sentence) { List<String> translatedWords = Arrays.stream(sentence.split(" ")) .map(this::translateWord) .collect(Collectors.toList()); <START> return String.join(" ", translatedWords); <END> }</code><technical_language>get rid of this line: java String.join(" ", translatedWords); java .collect(Collectors.joining(" "));</technical_language>

Target:
String translate(String sentence) { return Arrays.stream(sentence.split(" ")) .map(this::translateWord) .collect(Collectors.joining(" ")); }
Source:
<code>public Object visitComputeCommand(InvocationContext ctx, ComputeCommand command) throws Throwable { return invokeNextThenAccept(ctx, command, (rCtx, rCommand, rv) -> { ComputeCommand computeCommand = (ComputeCommand) rCommand; if (!isStoreEnabled(computeCommand) || rCtx.isInTxScope() || !computeCommand.isSuccessful()) return; if (!isProperWriter(rCtx, computeCommand, computeCommand.getKey())) return; Object key = computeCommand.getKey(); <START> storeEntry(rCtx, key, computeCommand); <END> if (getStatisticsEnabled()) cacheStores.incrementAndGet(); }); }</code><technical_language>handle entry removed modified</technical_language>

Target:
public Object visitComputeCommand(InvocationContext ctx, ComputeCommand command) throws Throwable { return invokeNextThenAccept(ctx, command, (rCtx, rCommand, rv) -> { ComputeCommand computeCommand = (ComputeCommand) rCommand; if (!isStoreEnabled(computeCommand) || rCtx.isInTxScope() || !computeCommand.isSuccessful()) return; if (!isProperWriter(rCtx, computeCommand, computeCommand.getKey())) return; Object key = computeCommand.getKey(); if(rv == null) { boolean resp = persistenceManager.deleteFromAllStores(key, BOTH); if (trace) getLog().tracef("Removed entry under key %s and got response %s from CacheStore", key, resp); } else { storeEntry(rCtx, key, computeCommand); if (getStatisticsEnabled()) cacheStores.incrementAndGet(); } }); }