auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Pair<ImmutableList<String>, ImmutableList<String>> removeStarlarkOptions( List<String> list) { ImmutableList.Builder<String> keep = ImmutableList.builder(); ImmutableList.Builder<String> remove = ImmutableList.builder(); for (String name : list) { <START> (name.matches("--(no)?(@.*)? END> } return Pair.of(remove.build(), keep.build()); }</code><technical_language>Regex-based parsing is fall difficulties. this strip -- (if present), call [LabelValidator.validateAbsoluteLabel](<LINK_0>;drc=61d663a503710c8cb0d03d18f2eb776981b49e17;l=227), check for exceptions thrown</technical_language>

Target:
public static Pair<ImmutableList<String>, ImmutableList<String>> removeStarlarkOptions( List<String> list) { ImmutableList.Builder<String> keep = ImmutableList.builder(); ImmutableList.Builder<String> remove = ImmutableList.builder(); for (String name : list) { if (!name.startsWith("--")) { keep.add(name); continue; } String potentialStarlarkFlag = name.substring(2); if (name.startsWith("no")) { potentialStarlarkFlag = potentialStarlarkFlag.substring(2); } try { LabelValidator.validateAbsoluteLabel(potentialStarlarkFlag); remove.add(name); } catch (BadLabelException e) { keep.add(name); } } return Pair.of(remove.build(), keep.build()); }
Source:
<code>private Image getImageForBuildStatus(String status) { ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); <START> <END> if (status.equals(BuildStatus.SUCCESS.toString())) { return CommonImages.CHECKBOX_SELECTED.createImage(); } else if (status.equals(BuildStatus.STARTED.toString())) { return CommonImages.DISCOVERY.createImage(); } return CommonImages.ERROR.createImage(); }</code><technical_language>CommonImages.getImage instead of createImage a memory leak</technical_language>

Target:
private Image getImageForBuildStatus(String status) { if (status.equals(BuildStatus.SUCCESS.toString())) { return CommonImages.getImage(CommonImages.CHECKBOX_SELECTED); } else if (status.equals(BuildStatus.STARTED.toString())) { return CommonImages.getImage(CommonImages.DISCOVERY); } return CommonImages.getImage(CommonImages.ERROR); }
Source:
<code><START> public void before() { <END> testExtensionContext = mock(TestExtensionContext.class); isClosed = false; context = new JupiterEngineExecutionContext(null, null).extend().withThrowableCollector( new ThrowableCollector()).withExtensionContext(testExtensionContext).build(); }</code><technical_language>consider making this method package-private for brevity</technical_language>

Target:
void before() { testExtensionContext = mock(TestExtensionContext.class); isClosed = false; context = new JupiterEngineExecutionContext(null, null).extend().withThrowableCollector( new ThrowableCollector()).withExtensionContext(testExtensionContext).build(); }
Source:
<code>public void xgroup() { Map<String,String> map = new HashMap<String, String>(); map.put("f1", "v1"); StreamEntryID id1 = jedis.xadd("xgroup-stream", null, map); String status = jedis.xgroupCreate("xgroup-stream", "consumer-group-name", null, false); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); status = jedis.xgroupSetID("xgroup-stream", "consumer-group-name", id1); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); status = jedis.xgroupCreate("xgroup-stream", "consumer-group-name1", StreamEntryID.LAST_ENTRY, false); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); jedis.xgroupDestroy("xgroup-stream", "consumer-group-name"); Long pendingMessageNum = jedis.xgroupDelConsumer("xgroup-stream", "consumer-group-name1", "myconsumer1"); <START> assertNotNull(pendingMessageNum); <END> }</code><technical_language>assertEquals(0L, pendingMessageNum.longValue());</technical_language>

Target:
public void xgroup() { Map<String,String> map = new HashMap<String, String>(); map.put("f1", "v1"); StreamEntryID id1 = jedis.xadd("xgroup-stream", null, map); String status = jedis.xgroupCreate("xgroup-stream", "consumer-group-name", null, false); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); status = jedis.xgroupSetID("xgroup-stream", "consumer-group-name", id1); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); status = jedis.xgroupCreate("xgroup-stream", "consumer-group-name1", StreamEntryID.LAST_ENTRY, false); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); jedis.xgroupDestroy("xgroup-stream", "consumer-group-name"); Long pendingMessageNum = jedis.xgroupDelConsumer("xgroup-stream", "consumer-group-name1", "myconsumer1"); assertEquals(0L, pendingMessageNum.longValue()); }
Source:
<code>public void testProcessSingleConsumerWithNoInteractionIdNoProducers() { Trace trace = new Trace(); trace.setId("traceId"); trace.setBusinessTransaction("traceName"); trace.setStartTime(100); Consumer c = new Consumer(); c.setUri("uri"); c.setBaseTime(1); c.setDuration(200000000); c.getProperties().add(new Property(Constants.PROP_FAULT, "myFault")); c.setEndpointType("HTTP"); trace.getNodes().add(c); TraceCompletionInformationInitiator initiator = new TraceCompletionInformationInitiator(); TraceCompletionInformation ci = null; try { ci = initiator.processOneToOne(null, trace); } catch (Exception e) { fail("Failed: " + e); } assertNotNull(ci); assertEquals(1, ci.getCommunications().size()); assertTrue(ci.getCommunications().get(0).getIds().contains("traceId:0")); assertEquals(trace.getId(), ci.getCompletionTime().getId()); assertEquals(trace.getBusinessTransaction(), ci.getCompletionTime().getBusinessTransaction()); assertEquals(c.getEndpointType(), ci.getCompletionTime().getEndpointType()); assertFalse(ci.getCompletionTime().isInternal()); assertEquals(trace.getStartTime(), ci.getCompletionTime().getTimestamp()); assertEquals(c.getUri(), ci.getCompletionTime().getUri()); <START> assertEquals(200000000, ci.getCompletionTime().getDuration()); <END> assertEquals(1, ci.getCompletionTime().getProperties(Constants.PROP_FAULT).size()); assertEquals(c.getProperties(Constants.PROP_FAULT), ci.getCompletionTime().getProperties(Constants.PROP_FAULT)); }</code><technical_language>Check source data. for below</technical_language>

Target:
public void testProcessSingleConsumerWithNoInteractionIdNoProducers() { Trace trace = new Trace(); trace.setId("traceId"); trace.setBusinessTransaction("traceName"); trace.setStartTime(100000); Consumer c = new Consumer(); c.setUri("uri"); c.setBaseTime(1); c.setDuration(200000); c.getProperties().add(new Property(Constants.PROP_FAULT, "myFault")); c.setEndpointType("HTTP"); trace.getNodes().add(c); TraceCompletionInformationInitiator initiator = new TraceCompletionInformationInitiator(); TraceCompletionInformation ci = null; try { ci = initiator.processOneToOne(null, trace); } catch (Exception e) { fail("Failed: " + e); } assertNotNull(ci); assertEquals(1, ci.getCommunications().size()); assertTrue(ci.getCommunications().get(0).getIds().contains("traceId:0")); assertEquals(trace.getId(), ci.getCompletionTime().getId()); assertEquals(trace.getBusinessTransaction(), ci.getCompletionTime().getBusinessTransaction()); assertEquals(c.getEndpointType(), ci.getCompletionTime().getEndpointType()); assertFalse(ci.getCompletionTime().isInternal()); assertEquals(trace.getStartTime(), ci.getCompletionTime().getTimestamp()); assertEquals(c.getUri(), ci.getCompletionTime().getUri()); assertEquals(200000, ci.getCompletionTime().getDuration()); assertEquals(1, ci.getCompletionTime().getProperties(Constants.PROP_FAULT).size()); assertEquals(c.getProperties(Constants.PROP_FAULT), ci.getCompletionTime().getProperties(Constants.PROP_FAULT)); }
Source:
<code>public void verifyRestartable() throws RestartNotSupportedException { <START> if (EXIT_ON_RESTART == null) { <END> if (Platform.isDarwin() && !Platform.isSnowLeopardOrLater()) throw new RestartNotSupportedException("Restart is not supported on Mac OS X"); if (args==null) throw new RestartNotSupportedException("Failed to obtain the command line arguments of the process",failedToObtainArgs); } }</code><technical_language>unrelated change</technical_language>

Target:
public void verifyRestartable() throws RestartNotSupportedException { if (Platform.isDarwin() && !Platform.isSnowLeopardOrLater()) throw new RestartNotSupportedException("Restart is not supported on Mac OS X"); if (args==null) throw new RestartNotSupportedException("Failed to obtain the command line arguments of the process",failedToObtainArgs); }
Source:
<code>public HttpFileUploadIntegrationTest(SmackIntegrationTestEnvironment<?> environment) throws XMPPErrorException, NotConnectedException, NoResponseException, InterruptedException, TestNotPossibleException { super(environment); <START> if (Security.getProvider("BC") == null) { <END> Security.addProvider(new BouncyCastleProvider()); } hfumOne = HttpFileUploadManager.getInstanceFor(conOne); if (!hfumOne.discoverUploadService()) { throw new TestNotPossibleException( "HttpFileUploadManager was unable to discover a HTTP File Upload service"); } UploadService uploadService = hfumOne.getDefaultUploadService(); if (!uploadService.acceptsFileOfSize(FILE_SIZE)) { throw new TestNotPossibleException("The upload service at " + uploadService.getAddress() + " does not accept files of size " + FILE_SIZE + ". It only accepts files with a maximum size of " + uploadService.getMaxFileSize()); } hfumOne.setTlsContext(environment.configuration.tlsContext); }</code><technical_language>I if BC provider simply installed in a static block in SmackIntegrationTestEnvironment SmackIntegrationTestFramework</technical_language>

Target:
public HttpFileUploadIntegrationTest(SmackIntegrationTestEnvironment<?> environment) throws XMPPErrorException, NotConnectedException, NoResponseException, InterruptedException, TestNotPossibleException { super(environment); hfumOne = HttpFileUploadManager.getInstanceFor(conOne); if (!hfumOne.discoverUploadService()) { throw new TestNotPossibleException( "HttpFileUploadManager was unable to discover a HTTP File Upload service"); } UploadService uploadService = hfumOne.getDefaultUploadService(); if (!uploadService.acceptsFileOfSize(FILE_SIZE)) { throw new TestNotPossibleException("The upload service at " + uploadService.getAddress() + " does not accept files of size " + FILE_SIZE + ". It only accepts files with a maximum size of " + uploadService.getMaxFileSize()); } hfumOne.setTlsContext(environment.configuration.tlsContext); }
Source:
<code><START> private void logMetrics() { <END> try { Thread.sleep(METRIC_INIT_DELAY_MS); while (true) { Thread.sleep(metricsWindowMs); final double processingUnit = getProcessingUnit(); if (processingUnit != Double.POSITIVE_INFINITY) { final ServerMetrics metricsMessage = ServerMetrics.newBuilder() .setWindowIndex(windowIndex) .setNumPartitionBlocks(0) .setMetricWindowMs(metricsWindowMs) .setAvgProcessingTime(processingUnit) .build(); LOG.log(Level.INFO, "ServerMetrics {0}", metricsMessage); } windowIndex++; } } catch (final InterruptedException e) { LOG.log(Level.SEVERE, "Exception Occurred", e); throw new RuntimeException(e); } }</code><technical_language>If send metrics, this method is necessary; printing logs in apply() in push/pull operations</technical_language>

Target:
private void logMetrics() { try { Thread.sleep(METRIC_INIT_DELAY_MS); while (true) { Thread.sleep(metricsWindowMs); final double avgPullTime = getAvgProcTimePerReq(pullStats); final double avgPushTime = getAvgProcTimePerReq(pushStats); final double avgReqProcTime = getAvgProcTimePerReq(requestStats); resetStats(); if (avgPullTime != Double.POSITIVE_INFINITY && avgPushTime != Double.POSITIVE_INFINITY) { final ServerMetrics metricsMessage = ServerMetrics.newBuilder() .setWindowIndex(windowIndex) .setNumPartitionBlocks(0) .setMetricWindowMs(metricsWindowMs) .setAvgPullProcessingTime(avgPullTime) .setAvgPushProcessingTime(avgPushTime) .setAvgReqProcessingTime(avgReqProcTime) .build(); LOG.log(Level.FINE, "ServerMetrics {0}", metricsMessage); } windowIndex++; } } catch (final InterruptedException e) { LOG.log(Level.SEVERE, "Exception Occurred", e); throw new RuntimeException(e); } }
Source:
<code>public boolean doCheckAndSend() throws JobEmailNotificationException { String jobStatus = jobState.getGenericInformation().get(GENERIC_INFORMATION_KEY_NOTIFICATION_EVENT); List<String> jobStatusList = new ArrayList<>(); if(jobStatus != null){ jobStatusList = Arrays.asList(jobStatus.toLowerCase().split("\\s*,\\s*")); } switch (eventType) { case JOB_CHANGE_PRIORITY: case JOB_IN_ERROR: case JOB_PAUSED: case JOB_PENDING_TO_FINISHED: case JOB_PENDING_TO_RUNNING: case JOB_RESTARTED_FROM_ERROR: case JOB_RESUMED: case JOB_RUNNING_TO_FINISHED: case JOB_SUBMITTED: break; default: logger.trace("Event not in the list of email notification, doing nothing"); return false; } if (!PASchedulerProperties.EMAIL_NOTIFICATIONS_ENABLED.getValueAsBoolean()) { logger.debug("Notification emails disabled, doing nothing"); return false; } <START> if(jobStatusList!=null && !jobStatusList.contains(eventType.toString().toLowerCase())){ <END> return false; } try { sender.sender(getTo(), getSubject(), getBody()); return true; } catch (AddressException e) { throw new JobEmailNotificationException("Malformed email address", e); } catch (MessagingException e) { throw new JobEmailNotificationException("Error sending email: " + e.getMessage(), e); } }</code><technical_language>jobStatusList is assigned a new ArrayList<> in line 51, check jobStatusList != null is longer necessary</technical_language>

Target:
public boolean doCheckAndSend() throws JobEmailNotificationException { String jobStatus = jobState.getGenericInformation().get(GENERIC_INFORMATION_KEY_NOTIFICATION_EVENT); List<String> jobStatusList = new ArrayList<>(); if(jobStatus != null){ jobStatusList = Arrays.asList(jobStatus.toLowerCase().split("\\s*,\\s*")); } switch (eventType) { case JOB_CHANGE_PRIORITY: case JOB_IN_ERROR: case JOB_PAUSED: case JOB_PENDING_TO_FINISHED: case JOB_PENDING_TO_RUNNING: case JOB_RESTARTED_FROM_ERROR: case JOB_RESUMED: case JOB_RUNNING_TO_FINISHED: case JOB_SUBMITTED: break; default: logger.trace("Event not in the list of email notification, doing nothing"); return false; } if (!PASchedulerProperties.EMAIL_NOTIFICATIONS_ENABLED.getValueAsBoolean()) { logger.debug("Notification emails disabled, doing nothing"); return false; } if(!jobStatusList.contains(eventType.toString().toLowerCase())){ return false; } try { sender.sender(getTo(), getSubject(), getBody()); return true; } catch (AddressException e) { throw new JobEmailNotificationException("Malformed email address", e); } catch (MessagingException e) { throw new JobEmailNotificationException("Error sending email: " + e.getMessage(), e); } }
Source:
<code>public void drained( BoltConnection from, Collection<Job> batch ) { <START> checkLimitsOnDequeue( from, counters.compute( from.id(), ( k, v ) -> v == null ? new AtomicInteger( 0 ) : v ).addAndGet( -batch.size() ) ); <END> }</code><technical_language>Consider Map#computeIfAbsent()</technical_language>

Target:
public void drained( BoltConnection from, Collection<Job> batch ) { checkLimitsOnDequeue( from, counters.computeIfAbsent( from.id(), k -> new AtomicInteger( 0 ) ).addAndGet( -batch.size() ) ); }
Source:
<code>public static void main(final String[] args) throws Exception { <START> LauncherStatus run = run(args); <END> LOGGER.info("Exit with status " + run); }</code><technical_language>run -> status</technical_language>

Target:
public static void main(final String[] args) throws Exception { LauncherStatus status = run(args); LOGGER.info("Exit with status " + status); }
Source:
<code>public Description matchTry (TryTree tree, VisitorState state) { if (badEmptyCatchBlock(tree, state)) { BlockTree bt = tree.getFinallyBlock(); if (bt == null || bt.getStatements().size() == 0) { CatchTree lastCatch = tree.getCatches().get(tree.getCatches().size() - 1); <START> LineMap lineMap = state.getPath().getCompilationUnit().getLineMap(); <END> return describeMatch(lastCatch); } } return Description.NO_MATCH; }</code><technical_language>lineMap is unused here, please delete it</technical_language>

Target:
public Description matchTry (TryTree tree, VisitorState state) { if (badEmptyCatchBlock(tree, state)) { BlockTree bt = tree.getFinallyBlock(); if (bt == null || bt.getStatements().size() == 0) { CatchTree lastCatch = tree.getCatches().get(tree.getCatches().size() - 1); return describeMatch(lastCatch); } } return Description.NO_MATCH; }
Source:
<code>protected Void run() throws Exception { <START> SlackNotifier.DescriptorImpl slackDesc = Jenkins.getInstance().getDescriptorByType(SlackNotifier.DescriptorImpl.class); <END> String team = step.teamDomain != null ? step.teamDomain : slackDesc.getTeamDomain(); String token = step.token != null ? step.token : slackDesc.getToken(); String channel = step.channel != null ? step.channel : slackDesc.getRoom(); String color = step.color != null ? step.color : ""; listener.getLogger().println(Messages.SlackSendStepConfig(step.teamDomain == null, step.token == null, step.channel == null, step.color == null)); SlackService testSlackService = new StandardSlackService(team, token, channel); boolean publishSuccess = testSlackService.publish(step.message, color); if(!publishSuccess && step.failOnError) { throw new AbortException(Messages.NotificationFailed()); } else if(!publishSuccess) { listener.error(Messages.NotificationFailed()); } return null; }</code><technical_language>NIT: Jenkins.getInstance() null, static analysis errors</technical_language>

Target:
protected Void run() throws Exception { Jenkins jenkins; try { jenkins = Jenkins.getInstance(); } catch (NullPointerException ne) { listener.error(Messages.NotificationFailedWithException(ne)); return null; } SlackNotifier.DescriptorImpl slackDesc = jenkins.getDescriptorByType(SlackNotifier.DescriptorImpl.class); String team = step.teamDomain != null ? step.teamDomain : slackDesc.getTeamDomain(); String token = step.token != null ? step.token : slackDesc.getToken(); String channel = step.channel != null ? step.channel : slackDesc.getRoom(); String color = step.color != null ? step.color : ""; listener.getLogger().println(Messages.SlackSendStepConfig(step.teamDomain == null, step.token == null, step.channel == null, step.color == null)); SlackService slackService = getSlackService(team, token, channel); boolean publishSuccess = slackService.publish(step.message, color); if (!publishSuccess && step.failOnError) { throw new AbortException(Messages.NotificationFailed()); } else if (!publishSuccess) { listener.error(Messages.NotificationFailed()); } return null; }
Source:
<code>private static FieldSchema singleFieldToFieldSchema(String fieldName, Field field) throws FrontendException { switch (field.getType()) { case TType.LIST: if (PigUtil.Pig9orNewer && field.getListElemField().getType()==TType.STRUCT) { Schema internalSchema=singleFieldToTupleSchema(fieldName, field.getListElemField()); return new FieldSchema(fieldName, new Schema(new FieldSchema("t",internalSchema,DataType.TUPLE)), DataType.BAG); } else { Schema internalSchema=singleFieldToTupleSchema(fieldName + "_tuple", field.getListElemField()); return new FieldSchema(fieldName, internalSchema, DataType.BAG); } case TType.SET: <START> if (PigUtil.Pig9orNewer && field.getSetElemField().getType()==TType.STRUCT) { <END> Schema internalSchema=singleFieldToTupleSchema(fieldName, field.getSetElemField()); return new FieldSchema(fieldName, new Schema(new FieldSchema("t",internalSchema,DataType.TUPLE)), DataType.BAG); } else { Schema internalSchema=singleFieldToTupleSchema(fieldName + "_tuple", field.getSetElemField()); return new FieldSchema(fieldName, internalSchema, DataType.BAG); } case TType.MAP: if (field.getMapKeyField().getType() != TType.STRING && field.getMapKeyField().getType() != TType.ENUM) { LOG.warn("Using a map with non-string key for field " + field.getName() + ". while converting to PIG Tuple, toString() is used for the key." + " It could result in incorrect maps."); } return new FieldSchema(fieldName, null, DataType.MAP); default: return new FieldSchema(fieldName, null, getPigDataType(field)); } }</code><technical_language>fix singleFieldToTupleSchema() replace // wrapping STRUCT in a FieldSchema impossible // access fields in PIG script (causes runtime error). return toSchema(field.gettStructDescriptor()); if (PigUtil.Pig9orNewer) { fieldSchema = new FieldSchema(fieldName, toSchema(field.gettStructDescriptor()), DataType.TUPLE) } else { return toSchema(field.gettStructDescriptor()); }</technical_language>

Target:
private static FieldSchema singleFieldToFieldSchema(String fieldName, Field field) throws FrontendException { switch (field.getType()) { case TType.LIST: return new FieldSchema(fieldName, singleFieldToTupleSchema(fieldName + "_tuple", field.getListElemField()), DataType.BAG); case TType.SET: return new FieldSchema(fieldName, singleFieldToTupleSchema(fieldName + "_tuple", field.getSetElemField()), DataType.BAG); case TType.MAP: if (field.getMapKeyField().getType() != TType.STRING && field.getMapKeyField().getType() != TType.ENUM) { LOG.warn("Using a map with non-string key for field " + field.getName() + ". while converting to PIG Tuple, toString() is used for the key." + " It could result in incorrect maps."); } return new FieldSchema(fieldName, null, DataType.MAP); default: return new FieldSchema(fieldName, null, getPigDataType(field)); } }
Source:
<code>public boolean equals(Object that) { if (true) { <START> return (Object) this; <END> } if (true) { return (Object) equals(); } return false; }</code><technical_language>another example of expression a return statement... example is hard follow</technical_language>

Target:
public boolean equals(Object that) { ((Object) this).hashCode(); double d = (double) hashCode(); return false; }
Source:
<code><START> private void cancelDownloadsForAccount(Account account){ <END> ConcurrentMap downloadsAccount = mPendingDownloads.get(account); Iterator<String> it = downloadsAccount.keySet().iterator(); Log_OC.d(TAG, "Number of pending downloads= " + downloadsAccount.size()); while (it.hasNext()) { String key = it.next(); Log_OC.d(TAG, "download CANCELLED " + key); if (key.startsWith(account.name)) { DownloadFileOperation download; synchronized (mPendingDownloads) { download = mPendingDownloads.get(key); if (download != null) { String remotePath = download.getRemotePath(); if (mPendingDownloads.contains(account, remotePath)) { mPendingDownloads.remove(account, remotePath); } } } } } }</code><technical_language>This code is duplicating code incancel(Account ...); replace block a call this</technical_language>

Target:
private void cancelDownloadsForAccount(Account account) { mPendingDownloads.remove(account); }
Source:
<code>private List<LookupBean> getLookupsListFromLookupConfig() { <START> List<LookupBean> lookupBeanList = new ArrayList<>(); <END> if (lookupConfig.getEnableLookupSyncOnStartup()) { String tier = lookupListeningAnnouncerConfig.getLookupTier(); lookupBeanList = getLookupListFromCoordinator(tier); if (lookupBeanList == null) { LOG.info("Coordinator is unavailable. Loading saved snapshot instead"); lookupBeanList = getLookupListFromSnapshot(); } } else { lookupBeanList = getLookupListFromSnapshot(); } return lookupBeanList; }</code><technical_language>Pointless assignment</technical_language>

Target:
private List<LookupBean> getLookupsListFromLookupConfig() { List<LookupBean> lookupBeanList; if (lookupConfig.getEnableLookupSyncOnStartup()) { String tier = lookupListeningAnnouncerConfig.getLookupTier(); lookupBeanList = getLookupListFromCoordinator(tier); if (lookupBeanList == null) { LOG.info("Coordinator is unavailable. Loading saved snapshot instead"); lookupBeanList = getLookupListFromSnapshot(); } } else { lookupBeanList = getLookupListFromSnapshot(); } return lookupBeanList; }
Source:
<code>public FilterCursorWrapper(Cursor cursor,String filter,int column1, int column2) { super(cursor); this.mFilter = filter.toLowerCase(); this.mColumn = new int[] {column1, column2}; <START> if (this.mFilter != "") { <END> mCount = super.getCount(); this.mIndex = new int[this.mCount]; for (int i = 0; i < this.mCount; i++) { super.moveToPosition(i); if (this.getString(this.mColumn[0]).toLowerCase().contains(this.mFilter) || this.getString(this.mColumn[1]).toLowerCase().contains(this.mFilter)) this.mIndex[this.mPosition++] = i; } this.mCount = this.mPosition; this.mPosition = 0; super.moveToFirst(); } else { this.mCount = super.getCount(); this.mIndex = new int[this.mCount]; for (int i = 0; i < this.mCount; i++) { this.mIndex[i] = i; } } }</code><technical_language>isEmpty</technical_language>

Target:
public FilterCursorWrapper(Cursor cursor,String filter,int column1, int column2) { super(cursor); this.mFilter = filter.toLowerCase(); this.mColumn = new int[] {column1, column2}; if (this.mFilter.isEmpty()) { mCount = super.getCount(); this.mIndex = new int[this.mCount]; for (int i = 0; i < this.mCount; i++) { super.moveToPosition(i); if (this.getString(this.mColumn[0]).toLowerCase().contains(this.mFilter) || this.getString(this.mColumn[1]).toLowerCase().contains(this.mFilter)) this.mIndex[this.mPosition++] = i; } this.mCount = this.mPosition; this.mPosition = 0; super.moveToFirst(); } else { this.mCount = super.getCount(); this.mIndex = new int[this.mCount]; for (int i = 0; i < this.mCount; i++) { this.mIndex[i] = i; } } }
Source:
<code>private Optional<List<String>> validateNotifySettingsRequest(JsonNode payload){ <START> Optional<List<String>> checkList = requestValidator.checkIfExistsOrEmpty(payload, <END> FIELD_OPERATION, FIELD_OPERATION_PATH); if(checkList.isPresent()){ return checkList; } String op = payload.get(FIELD_OPERATION).asText(); if (!VALID_ATTRIBUTE_UPDATE_OPERATIONS.get(FIELD_OPERATION).contains(op)) { return Optional.of(asList(format("Operation [%s] is invalid for path [%s]", op, FIELD_OPERATION))); } JsonNode valueNode = payload.get(FIELD_VALUES); checkList = requestValidator.checkIfExistsOrEmpty(valueNode, FIELD_NOTIFY_API_TOKEN, FIELD_NOTIFY_TEMPLATE_ID); return checkList; }</code><technical_language>checkList ? u errors</technical_language>

Target:
private Optional<List<String>> validateNotifySettingsRequest(JsonNode payload){ String op = payload.get(FIELD_OPERATION).asText(); if (!VALID_ATTRIBUTE_UPDATE_OPERATIONS.get(FIELD_OPERATION).contains(op)) { return Optional.of(asList(format("Operation [%s] is not valid for path [%s]", op, FIELD_OPERATION))); } if(op.equals("remove")) { return Optional.empty(); } JsonNode valueNode = payload.get(FIELD_VALUES); if(null == valueNode) { return Optional.of(asList(format("Field [%s] is required", FIELD_VALUES))); } return requestValidator.checkIfExistsOrEmpty(valueNode, FIELD_NOTIFY_API_TOKEN, FIELD_NOTIFY_TEMPLATE_ID); }
Source:
<code>protected void verifyAccesibleForSpecificUser() { InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); new GateKeeper().verifyAccessible(instructor, session, false, <START> Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS); <END> }</code><technical_language>INSTRUCTOR_PERMISSION_MODIFY_SESSION first, create a separate issue for a new permission</technical_language>

Target:
protected void verifyAccesibleForSpecificUser() { InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); new GateKeeper().verifyAccessible(instructor, session, false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); }
Source:
<code>public CompositeItemWriterBuilder delegates(List<ItemWriter<? super T>> delegates) { Assert.notNull(delegates, "A list of delegates is required."); <START> Assert.notEmpty(delegates, "The delegates list must have one or more delegates."); <END> this.delegates = delegates; return this; }</code><technical_language>asserts in build method prevent duplication (for null check). If user passes in null, ok long call build call else..</technical_language>

Target:
public CompositeItemWriterBuilder delegates(List<ItemWriter<? super T>> delegates) { this.delegates = delegates; return this; }
Source:
<code>public Iterator<Bucket> iterator() { return new Iterator<Bucket>() { private int currentIndex; @Override public boolean hasNext() { return currentIndex < indices.length; } @Override <START> public Bucket next() <END> { if (!hasNext()) { throw new NoSuchElementException(); } final Bucket bucket = new Bucket( indices[currentIndex] * (max - min) / bucketCount, (indices[currentIndex] + 1) * (max - min) / bucketCount, weights[currentIndex], counts[currentIndex]); ++currentIndex; return bucket; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }</code><technical_language>this iterate buckets, bucket-weight. this confusing, I understand geared a case. I in Bucket a parametric type in this case held a view a collection of weights + counts, strong opinion</technical_language>

Target:
public Iterator<BucketWeight> iterator() { return new Iterator<BucketWeight>() { private int currentIndex; @Override public boolean hasNext() { return currentIndex < indices.length; } @Override public BucketWeight next() { if (!hasNext()) { throw new NoSuchElementException(); } final BucketWeight bucket = new BucketWeight( getLeftValueForIndex(bucketCount, min, max, indices[currentIndex]), getRightValueForIndex(bucketCount, min, max, indices[currentIndex]), weights[currentIndex], counts[currentIndex]); ++currentIndex; return bucket; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }
Source:
<code>private boolean canRemoveVmPool(Guid vmPoolId) { <START> return getVmPoolDao().getVmPoolsMapByVmPoolId(vmPoolId).size() == 0; <END> }</code><technical_language>while it, changing isEmpty</technical_language>

Target:
private boolean canRemoveVmPool(Guid vmPoolId) { return getVmPoolDao().getVmPoolsMapByVmPoolId(vmPoolId).isEmpty(); }
Source:
<code>public void processRecord(ComputationContext context, String inputStreamName, Record record) { BulkBucket bucket = BulkCodecs.getBucketCodec().decode(record.getData()); command = getCommand(bucket.getCommandId()); if (command == null) { <START> log.error("[%s] Stopping processing, unknown command: {}, offset: {}, record: {}.", metadata.name(), <END> bucket.getCommandId(), context.getLastOffset(), record); context.askForTermination(); return; } for (List<String> batch : Lists.partition(bucket.getIds(), command.getBatchSize())) { processBatchOfDocuments(batch); } endBucket(context, bucket.getIds().size()); context.askForCheckpoint(); }</code><technical_language>%s</technical_language>

Target:
public void processRecord(ComputationContext context, String inputStreamName, Record record) { BulkBucket bucket = BulkCodecs.getBucketCodec().decode(record.getData()); command = getCommand(bucket.getCommandId()); if (command != null) { for (List<String> batch : Lists.partition(bucket.getIds(), command.getBatchSize())) { processBatchOfDocuments(batch); } endBucket(context, bucket.getIds().size()); context.askForCheckpoint(); } else { if (isAbortedCommand(bucket.getCommandId())) { log.debug("Skipping aborted command: {}", bucket.getCommandId()); context.askForCheckpoint(); } else { log.error("Stopping processing, unknown command: {}, offset: {}, record: {}.", bucket.getCommandId(), context.getLastOffset(), record); context.askForTermination(); } } }
Source:
<code><START> public List<Double> get(@PathParam("userID") String userID, <END> @PathParam("itemID") List<PathSegment> pathSegmentsList) { ALSServingModelManager alsServingModelManager = (ALSServingModelManager) servletContext.getAttribute(ModelManagerListener.MANAGER_KEY); ALSServingModel alsServingModel = alsServingModelManager.getModel(); String[] itemIDs = new String[pathSegmentsList.size()]; for (int i = 0; i < itemIDs.length; i++) { itemIDs[i] = pathSegmentsList.get(i).getPath(); } return Doubles.asList(alsServingModel.dotProduct(userID, itemIDs)); }</code><technical_language>reason for renaming getEstimatePreferences() get()</technical_language>

Target:
public List<Double> get(@PathParam("userID") String userID, @PathParam("itemID") List<PathSegment> pathSegmentsList) { ServingModelManager<?> alsServingModelManager = (ServingModelManager<?>) servletContext.getAttribute(ModelManagerListener.MANAGER_KEY); ALSServingModel alsServingModel = (ALSServingModel) alsServingModelManager.getModel(); String[] itemIDs = new String[pathSegmentsList.size()]; for (int i = 0; i < itemIDs.length; i++) { itemIDs[i] = pathSegmentsList.get(i).getPath(); } return Doubles.asList(alsServingModel.dotProduct(userID, itemIDs)); }
Source:
<code>private DatastoreConfig(final String dbName, final Config config) { final ConfigValue directory = config.root().get("migration.directory"); <START> if (directory != null && directory.valueType() == ConfigValueType.STRING) { <END> _directory = (String) directory.unwrapped(); } else { _directory = "cassandra/migration/" + dbName; } _hosts = config.getStringList("hosts"); _keyspace = config.getString("keyspace"); _replication = config.getObject("replication").unwrapped(); }</code><technical_language>equals ==</technical_language>

Target:
private DatastoreConfig(final String dbName, final Config config) { final ConfigValue directory = config.root().get("migration.directory"); if (directory != null && ConfigValueType.STRING.equals(directory.valueType())) { _directory = Paths.get((String) directory.unwrapped()); } else { _directory = Paths.get("cassandra/migration/" + dbName); } _hosts = config.getStringList("hosts"); _keyspace = config.getString("keyspace"); _replication = MAPPER.valueToTree(config.getObject("replication").unwrapped()); }
Source:
<code>public boolean test() { shell = ShellLookup.getInstance().getCurrentActiveShell(); <START> return shell != null ? true : false; <END> }</code><technical_language>is difference shell != null shell != null ? true : false. IMHO do here. simply call SWT API returns null active shell do a find out if shell is active</technical_language>

Target:
public boolean test() { shell = ShellLookup.getInstance().getCurrentActiveShell(); return shell != null; }
Source:
<code>private static Format[] getClosedCaptionsTrackFormats( List<AdaptationSet> adaptationSets, int[] adaptationSetIndices) { for (int i : adaptationSetIndices) { AdaptationSet adaptationSet = adaptationSets.get(i); List<Descriptor> descriptors = adaptationSets.get(i).accessibilityDescriptors; for (Descriptor descriptor : descriptors) { <START> return parseClosedCaptionsDescriptor(adaptationSet.id, descriptor); <END> } } return new Format[0]; }</code><technical_language>irrelevant if proposal above, this return if parsedClosedCaptionsDescriptor returned null. Else parsing fail if a descriptor for other 608/708 descriptor for</technical_language>

Target:
private static Format[] getClosedCaptionsTrackFormats( List<AdaptationSet> adaptationSets, int[] adaptationSetIndices) { for (int i : adaptationSetIndices) { AdaptationSet adaptationSet = adaptationSets.get(i); List<Descriptor> descriptors = adaptationSets.get(i).accessibilityDescriptors; for (int j = 0; j < descriptors.size(); j++) { Descriptor descriptor = descriptors.get(j); if ("urn:scte:dash:cc:cea-608:2015".equals(descriptor.schemeIdUri)) { Format cea608Format = new Format.Builder() .setSampleMimeType(MimeTypes.APPLICATION_CEA608) .setId(adaptationSet.id + ":cea608") .build(); return parseClosedCaptionsDescriptor( descriptor, CEA608_SERVICE_DESCRIPTOR_REGEX, cea608Format); } else if ("urn:scte:dash:cc:cea-708:2015".equals(descriptor.schemeIdUri)) { Format cea708Format = new Format.Builder() .setSampleMimeType(MimeTypes.APPLICATION_CEA708) .setId(adaptationSet.id + ":cea708") .build(); return parseClosedCaptionsDescriptor( descriptor, CEA708_SERVICE_DESCRIPTOR_REGEX, cea708Format); } } } return new Format[0]; }
Source:
<code>default ScheduledExecutorService getTimerExecutor() { <START> return Executors.newScheduledThreadPool(1); <END> }</code><technical_language>default impl is disputable. invocation of this method result in new pool caller responsible for shutdown etc. I throw unsupported operation exception that</technical_language>

Target:
default ScheduledExecutorService getTimerExecutor() { return null; }
Source:
<code>public Credential getCredentialFromFileCredentialStoreForInstalledApp( String clientId, String clientSecret, String filePath, List<String> scopes) throws IOException, GeneralSecurityException { <START> return getCredentialFromFileCredentialStoreForInstalledApp( <END> clientId, clientSecret, filePath, scopes); }</code><technical_language>+ getStaticTransport() arg</technical_language>

Target:
public Credential getCredentialFromFileCredentialStoreForInstalledApp( String clientId, String clientSecret, String filePath, List<String> scopes) throws IOException, GeneralSecurityException { return getCredentialFromFileCredentialStoreForInstalledApp( clientId, clientSecret, filePath, scopes, getStaticHttpTransport()); }
Source:
<code>public void setUp() throws Exception { if (!mKernelImageCheckTool.exists()) { throw new <START> RuntimeException("Invalid kernel image tool: <END> " + mKernelImageCheckTool); } mKernelImageFile = getBuild().getFile(mKernelImageName); mKernelAbiFile = getBuild().getFile("abi.out"); if (mKernelImageFile == null || !mKernelImageFile.exists()) { File imageDir = new File(mKernelImageAltPath); if (imageDir.isDirectory()) { mKernelImageFile = new File(imageDir, mKernelImageName); mKernelAbiFile = new File(imageDir, "abi.out"); } } if (mKernelImageFile == null || !mKernelImageFile.exists()) { throw new RuntimeException("Cannot find kernel image file: " + mKernelImageName); } }</code><technical_language>nit: invalid, missing. along: "Could find kernel image tool ..." switch exception IOException</technical_language>

Target:
public void setUp() throws Exception { if (!mKernelImageCheckTool.exists()) { throw new IOException("Could not find kernel image tool at: " + mKernelImageCheckTool); } if (!mKernelAbiFile.exists()) { throw new IOException("Could not find kernel ABI at: " + mKernelAbiFile); } mKernelImageFile = getBuild().getFile(mKernelImageName); if (mKernelImageFile == null || !mKernelImageFile.exists()) { File imageDir = new File(mKernelImageAltPath); if (imageDir.isDirectory()) { mKernelImageFile = new File(imageDir, mKernelImageName); } } if (mKernelImageFile == null || !mKernelImageFile.exists()) { throw new RuntimeException("Cannot find kernel image file: " + mKernelImageName); } }
Source:
<code>private void checkSetters(ASTMethodDeclaration node, Object data, String nameOfMethod) { <START> if (!hasIgnoredAnnotation(node)) { <END> ASTResultType resultType = node.getResultType(); if (hasPrefix(nameOfMethod, "set") && !resultType.isVoid()) { addViolationWithMessage(data, node, "Linguistics Antipattern - The setter ''{0}'' should not return any type except void linguistically", new Object[] { nameOfMethod }); } } }</code><technical_language>move this line 83 (within visit(ASTMethodDeclaration node, Object data)), ignore overridden methods setters</technical_language>

Target:
private void checkSetters(ASTMethodDeclaration node, Object data, String nameOfMethod) { ASTResultType resultType = node.getResultType(); if (hasPrefix(nameOfMethod, "set") && !resultType.isVoid()) { addViolationWithMessage(data, node, "Linguistics Antipattern - The setter ''{0}'' should not return any type except void linguistically", new Object[] { nameOfMethod }); } }
Source:
<code>private static boolean startsWithInheritDoc(DetailNode root) { <START> boolean flag = false; <END> final DetailNode[] children = root.getChildren(); for (int i = 0; !flag && i < children.length - 1; i++) { final DetailNode child = children[i]; if (child.getType() == JavadocTokenTypes.JAVADOC_INLINE_TAG && child.getChildren()[1].getType() == JavadocTokenTypes.INHERIT_DOC_LITERAL) { flag = true; } else if (child.getType() != JavadocTokenTypes.LEADING_ASTERISK && !CommonUtils.isBlank(child.getText())) { break; } } return flag; }</code><technical_language>renamed</technical_language>

Target:
private static boolean startsWithInheritDoc(DetailNode root) { boolean found = false; final DetailNode[] children = root.getChildren(); for (int i = 0; !found && i < children.length - 1; i++) { final DetailNode child = children[i]; if (child.getType() == JavadocTokenTypes.JAVADOC_INLINE_TAG && child.getChildren()[1].getType() == JavadocTokenTypes.INHERIT_DOC_LITERAL) { found = true; } else if (child.getType() != JavadocTokenTypes.LEADING_ASTERISK && !CommonUtils.isBlank(child.getText())) { break; } } return found; }
Source:
<code>public Channel getChannel() { synchronized (this.consumersMonitor) { Channel channel = null; while (channel == null) { for (SimpleConsumer consumer : getConsumers()) { if (this.inUseConsumerChannels.putIfAbsent(consumer.getChannel(), Boolean.TRUE) == null) { channel = consumer.getChannel(); break; } } if (channel == null) { <START> this.consumerCount++; <END> super.setConsumersPerQueue(this.consumerCount); } } return channel; } }</code><technical_language>I missing decrease this variable remove consumers</technical_language>

Target:
public Channel getChannel() { synchronized (this.consumersMonitor) { Channel channel = null; while (channel == null) { if (!isRunning()) { throw new IllegalStateException("Direct reply-to container is not running"); } for (SimpleConsumer consumer : this.consumers) { Channel candidate = consumer.getChannel(); if (candidate.isOpen() && this.inUseConsumerChannels.putIfAbsent(candidate, consumer) == null) { channel = candidate; this.whenUsed.put(consumer, System.currentTimeMillis()); break; } } if (channel == null) { this.consumerCount++; super.setConsumersPerQueue(this.consumerCount); } } return channel; } }
Source:
<code>protected Map<String, String> getProperties() { ExploreProperties.Builder builder = ExploreProperties.builder(); <START> builder.addAll(new HashMap<>(tableSinkConfig.getProperties().getProperties())); <END> builder.setExploreTableName(tableSinkConfig.getName()); builder.add(Properties.BatchReadableWritable.TYPE, Table.class.getName()); return builder.build().getProperties(); }</code><technical_language>need do new HashMap<>()</technical_language>

Target:
protected Map<String, String> getProperties() { ExploreProperties.Builder builder = ExploreProperties.builder(); builder.addAll(tableSinkConfig.getProperties().getProperties()); if ((tableSinkConfig.exploreName != null) && (!tableSinkConfig.exploreName.isEmpty())) { builder.setExploreTableName(tableSinkConfig.exploreName); } else { builder.setExploreTableName(tableSinkConfig.getName()); } builder.add(Properties.BatchReadableWritable.TYPE, Table.class.getName()); return builder.build().getProperties(); }
Source:
<code>public Map<String, String> getProperties() { Map<String, String> results = new HashMap<>(); if (hashiCorpVaultToken == null) { printMisconfigurationMessage(); return results; } final WebTarget secretsTarget = client <START> .target(configuration.getVaultAddress() + "/v1" + configuration.getPath()); <END> final Response secretsResponse = secretsTarget .request() .accept(MediaType.APPLICATION_JSON) .header("Authorization", "Bearer " + hashiCorpVaultToken) .get(); if (secretsResponse.getStatus() != 200) { LOGGER.log(Level.WARNING, "Unable to get secrets from the vault. Make sure all the configurtaion options has been entered correctly"); return results; } try { final String secretString = readSecretString((InputStream) secretsResponse.getEntity()); try (final StringReader reader = new StringReader(secretString)) { return readMap(reader); } } catch (ProcessingException | JsonException | IOException ex) { LOGGER.log(Level.WARNING, "Unable to read secret value", ex); } return results; }</code><technical_language>This line is confusing a user. path include /data for a v2 API? include /kv? If this feature supports KV stores taken. this cleared explained in admin console. failed responses log endpoint is called debug</technical_language>

Target:
public Map<String, String> getProperties() { Map<String, String> results = new HashMap<>(); if (hashiCorpVaultToken == null) { printMisconfigurationMessage(); return results; } String secretsURL = vaultAddress + "/v1/" + secretsEnginePath + "/data/" + secretsPath; if (apiVersion == 1) { secretsURL = vaultAddress + "/v1/" + secretsEnginePath + "/" + secretsPath; } final WebTarget secretsTarget = client .target(secretsURL); final Response secretsResponse = secretsTarget .request() .accept(MediaType.APPLICATION_JSON) .header("Authorization", "Bearer " + hashiCorpVaultToken) .get(); if (secretsResponse.getStatus() != 200) { LOGGER.log(Level.WARNING, "Unable to get secrets from the vault using the following URL: " + secretsURL + ". " + "Make sure all the configurtaion options has been entered correctly and HashiCorp Vault Token is correct"); return results; } try { final String secretString = readSecretString((InputStream) secretsResponse.getEntity()); try (final StringReader reader = new StringReader(secretString)) { return readMap(reader); } } catch (ProcessingException | JsonException | IOException ex) { LOGGER.log(Level.WARNING, "Unable to read secret value", ex); } return results; }
Source:
<code>private static RqRegex request(final String code) throws Exception { return new RqRegex.Fake( <START> PATTERN, <END> URLEncoder.encode(TkEmVerifyTest.ENC.encrypt(code), "UTF-8") ); }</code><technical_language>@kujtimiihoxha statics prependended class name, TkEmVerifyTest.PATTERN</technical_language>

Target:
private static RqRegex request(final String code) throws Exception { return new RqRegex.Fake( TkEmVerifyTest.PATTERN, URLEncoder.encode(TkEmVerifyTest.ENC.encrypt(code), "UTF-8") ); }
Source:
<code>protected boolean moveSegment( final BalancerSegmentHolder segment, final ImmutableDruidServer toServer, final DruidCoordinatorRuntimeParams params ) { final LoadQueuePeon toPeon = params.getLoadManagementPeons().get(toServer.getName()); final ImmutableDruidServer fromServer = segment.getFromServer(); final DataSegment segmentToMove = segment.getSegment(); final String segmentName = segmentToMove.getIdentifier(); if (!toPeon.getSegmentsToLoad().contains(segmentToMove) && (toServer.getSegment(segmentName) == null) && new ServerHolder(toServer, toPeon).getAvailableSize() > segmentToMove.getSize()) { log.info("Moving [%s] from [%s] to [%s]", segmentName, fromServer.getName(), toServer.getName()); LoadPeonCallback callback = null; try { Map<String, BalancerSegmentHolder> movingSegments = currentlyMovingSegments.get(toServer.getTier()); movingSegments.put(segmentName, segment); callback = () -> movingSegments.remove(segmentName); coordinator.moveSegment( fromServer, toServer, <START> segmentToMove, <END> callback ); return true; } catch (Exception e) { log.makeAlert(e, StringUtils.format("[%s] : Moving exception", segmentName)).emit(); if (callback != null) { callback.execute(); } } } return false; }</code><technical_language>Interesting DruidCoordinator.moveSegment() wraps pretty body try { ... } catch (Exception e) { ...}, catch (Exception e) in *this* method obsolete. I left</technical_language>

Target:
protected boolean moveSegment( final BalancerSegmentHolder segment, final ImmutableDruidServer toServer, final DruidCoordinatorRuntimeParams params ) { final LoadQueuePeon toPeon = params.getLoadManagementPeons().get(toServer.getName()); final ImmutableDruidServer fromServer = segment.getFromServer(); final DataSegment segmentToMove = segment.getSegment(); final SegmentId segmentId = segmentToMove.getId(); if (!toPeon.getSegmentsToLoad().contains(segmentToMove) && (toServer.getSegment(segmentId) == null) && new ServerHolder(toServer, toPeon).getAvailableSize() > segmentToMove.getSize()) { log.debug("Moving [%s] from [%s] to [%s]", segmentId, fromServer.getName(), toServer.getName()); LoadPeonCallback callback = null; try { ConcurrentMap<SegmentId, BalancerSegmentHolder> movingSegments = currentlyMovingSegments.get(toServer.getTier()); movingSegments.put(segmentId, segment); callback = () -> movingSegments.remove(segmentId); coordinator.moveSegment( fromServer, toServer, segmentToMove, callback ); return true; } catch (Exception e) { log.makeAlert(e, StringUtils.format("[%s] : Moving exception", segmentId)).emit(); if (callback != null) { callback.execute(); } } } return false; }
Source:
<code>public void dispose() { for (Object <START> element : <END> cache) { ((EditorContribution) element).dispose(); } }</code><technical_language>rename contribution</technical_language>

Target:
public void dispose() { for (Object contribution : cache) { ((EditorContribution) contribution).dispose(); } }