auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Map<Long, Double> extractResult(final QueryResult res, final ComputeDistributionStat.Percentile percentile) { final Map<Long,Double> resMap = new HashMap<>(); List<ShardedResultGroup> shardedResultGroups = res.getGroups(); for(ShardedResultGroup shardedGrpRes : shardedResultGroups){ Set<String> pTags = new HashSet<>(); shardedGrpRes.getSeries().forEach(s->s.getTags().entrySet().stream() <START> .filter(t->t.getKey().contentEquals("tdigestat")) <END> .forEach(ss->pTags.add(ss.getValue()))); assertEquals(1, pTags.size()); if ( !pTags.contains(percentile.getName())) continue; MetricCollection metricCollection = shardedGrpRes.getMetrics(); for(Point p : metricCollection.getDataAs(Point.class)){ resMap.put(p.getTimestamp(), p.getValue()); } } return resMap; }</code><technical_language>tdigeststat</technical_language>

Target:
private Map<Long, Double> extractResult(final QueryResult res, final ComputeDistributionStat.Percentile percentile) { final Map<Long,Double> resMap = new HashMap<>(); List<ShardedResultGroup> shardedResultGroups = res.getGroups(); for(ShardedResultGroup shardedGrpRes : shardedResultGroups){ Set<String> pTags = new HashSet<>(); shardedGrpRes.getSeries().forEach(s->s.getTags().entrySet().stream() .filter(t->t.getKey().contentEquals("tdigeststat")) .forEach(ss->pTags.add(ss.getValue()))); assertEquals(1, pTags.size()); if ( !pTags.contains(percentile.getName())) continue; MetricCollection metricCollection = shardedGrpRes.getMetrics(); for(Point p : metricCollection.getDataAs(Point.class)){ resMap.put(p.getTimestamp(), p.getValue()); } } return resMap; }
Source:
<code>public EventType() { this.validationStrategies = Lists.newArrayList(); this.enrichmentStrategies = Lists.newArrayList(); this.partitionStrategy = PartitionStrategy.RANDOM_STRATEGY; this.writeScopes = Collections.emptySet(); <START> this.readScopes = Collections.emptySet(); <END> }</code><technical_language>For strange for initialising collections approaches 5-line method :) (Guava java.util.Collections) I prefer homogenous approach (at method) matter one</technical_language>

Target:
public EventType() { this.validationStrategies = Collections.emptyList(); this.enrichmentStrategies = Collections.emptyList(); this.partitionStrategy = PartitionStrategy.RANDOM_STRATEGY; this.writeScopes = Collections.emptySet(); this.readScopes = Collections.emptySet(); }
Source:
<code>private List<Map<String, Object>> toIceServers(List<IceServersServerMessage.IceServer> iceServers) { List<Map<String, Object>> result = new LinkedList<>(); for (IceServersServerMessage.IceServer iceServer : iceServers) { Map<String, Object> map = new HashMap<>(); List<String> urls = new LinkedList<>(); if (iceServer.getUrl() != null && !iceServer.getUrl().equals("null")) { urls.add(iceServer.getUrl()); } if (iceServer.getUrls() != null) { urls.addAll(Arrays.asList(iceServer.getUrls())); } map.put("urls", urls); map.put("credential", iceServer.getCredential()); map.put("credentialType", "token"); <START> map.put("username", iceServers.get(2).getUsername()); <END> result.add(map); } return (result); }</code><technical_language>get(2)</technical_language>

Target:
private List<Map<String, Object>> toIceServers(List<IceServersServerMessage.IceServer> iceServers) { List<Map<String, Object>> result = new LinkedList<>(); for (IceServersServerMessage.IceServer iceServer : iceServers) { Map<String, Object> map = new HashMap<>(); List<String> urls = new LinkedList<>(); if (iceServer.getUrl() != null && !iceServer.getUrl().equals("null")) { urls.add(iceServer.getUrl()); } if (iceServer.getUrls() != null) { urls.addAll(Arrays.asList(iceServer.getUrls())); } map.put("urls", urls); map.put("credential", iceServer.getCredential()); map.put("credentialType", "token"); map.put("username", iceServer.getUsername()); result.add(map); } return (result); }
Source:
<code>private void continueSpan(HttpServletRequest request, Span spanFromRequest) { this.tracer.continueSpan(spanFromRequest); request.setAttribute(TraceRequestAttributes.SPAN_CONTINUED_REQUEST_ATTR, "true"); if (log.isDebugEnabled()) { <START> log.debug("There has already been a span in the request " + spanFromRequest + ""); <END> } }</code><technical_language>nit: accidental concat of empty string</technical_language>

Target:
private void continueSpan(HttpServletRequest request, Span spanFromRequest) { this.tracer.continueSpan(spanFromRequest); request.setAttribute(TraceRequestAttributes.SPAN_CONTINUED_REQUEST_ATTR, "true"); if (log.isDebugEnabled()) { log.debug("There has already been a span in the request " + spanFromRequest); } }
Source:
<code>public T perform() throws BusinessException { do { try { return this.op.perform(); } catch (BusinessException e) { this.errors.add(e); if (this.attempts.incrementAndGet() >= this.maxAttempts || !this.test.test(e)) { throw e; } try { <START> long testDelay = Math.pow(2, this.attempts)*1000 + Math.round(Math.random()*1000); <END> long delay = (testDelay<this.maxDelay) ? testDelay : maxDelay; Thread.sleep(delay); } catch (InterruptedException f) { } } } while (true); }</code><technical_language>I Math.random() give increasing backoff. of fibonacci series for delay. similar <LINK_0></technical_language>

Target:
public T perform() throws BusinessException { do { try { return this.op.perform(); } catch (BusinessException e) { this.errors.add(e); if (this.attempts.incrementAndGet() >= this.maxAttempts || !this.test.test(e)) { throw e; } try { Random rand = new Random(); long testDelay = (long) Math.pow(2, this.attempts.intValue()) * 1000 + rand.nextInt(1000); long delay = testDelay < this.maxDelay ? testDelay : maxDelay; Thread.sleep(delay); } catch (InterruptedException f) { } } } while (true); }
Source:
<code>public void run() { LifecycleNotificationDAO lifecycleNotificationDAO = new JDBCLifecycleNotificationDAOImpl(); ArrayList<LCNotification> notifications = new ArrayList<LCNotification>(); try { notifications = lifecycleNotificationDAO .getValidNotifications(CommonUtil.getRegistryService().getRegistry()); } catch (GovernanceException e) { log.error("Error while getting notifications. Hold notification sending job.", e); return; } catch (RegistryException e) { log.error("Error while getting notifications to send Lifecycle checkpoint notifications.", e); } if (notifications != null && notifications.size() > 0) { for (LCNotification schedulerBean : notifications) { String notificationMessage = getNotificationMessage(schedulerBean); LifecycleNotificationEvent<String> notificationEvent = new LifecycleNotificationEvent<String> (notificationMessage); notificationEvent.setTenantId(schedulerBean.getTenantId()); notificationEvent.setResourcePath(schedulerBean.getRegPath()); NotificationService notificationService = new EventingServiceImpl(); try { notificationService.notify(notificationEvent); if (log.isDebugEnabled()) { log.debug("Notification '" + notificationMessage + "' sent to notification service."); } <START> } catch (Exception e) { <END> log.error("Error getting registry while getting scheduler objects to send notifications", e); } } } }</code><technical_language>Do want catch "Exception" ? please explain</technical_language>

Target:
public void run() { try { ArrayList<LCNotification> notifications = getValidNotifications(); if (notifications.size() > 0) { for (LCNotification schedulerBean : notifications) { String notificationMessage = getNotificationMessage(schedulerBean); LifecycleNotificationEvent<String> notificationEvent = new LifecycleNotificationEvent<>(notificationMessage); notificationEvent.setTenantId(superTenantId); notificationEvent.setResourcePath(schedulerBean.getRegPath()); NotificationService notificationService = new EventingServiceImpl(); try { notificationService.notify(notificationEvent); if (log.isDebugEnabled()) { log.debug("Notification '" + notificationMessage + "' sent to notification service."); } } catch (Exception e) { log.error("Error getting registry while getting scheduler objects to send notifications", e); } } } } catch (RegistryException e) { log.error("Error while getting valid notifications on " + getCurrentDate(), e); } }
Source:
<code>private void cleanAgents(HashSet<String> existingLinks) { List<Agent> agents = objectManager.find(Agent.class, AGENT.REMOVED, new Condition(ConditionType.NULL), AGENT.EXTERNAL_ID, new Condition(ConditionType.NOTNULL)); if(agents.size() > 0) { for(Agent agent : agents) { String[] uri = agent.getUri().substring(EXTERNAL_AGENT_URI_PREFIX.length()).split("_"); String region_env = String.format("%s:%s", uri[0], uri[1]); <START> if(existingLinks.contains(region_env)) { <END> continue; } List<AccountLink> links = objectManager.find(AccountLink.class, ACCOUNT_LINK.LINKED_REGION, uri[0], ACCOUNT_LINK.LINKED_ACCOUNT, uri[1], ACCOUNT_LINK.REMOVED, null); if(links.size()>0) { continue; } try { objectProcessManager.executeStandardProcess(StandardProcess.DEACTIVATE, agent, null); objectProcessManager.executeStandardProcess(StandardProcess.REMOVE, agent, null); } catch (Exception ex) { log.warn(String.format("Failed to clean agent with id [%s] - %s", agent.getId(), ex)); } } } }</code><technical_language>camelcase :) regionEnv</technical_language>

Target:
private void cleanAgents(HashSet<String> existingLinks) { List<Agent> agents = objectManager.find(Agent.class, AGENT.REMOVED, new Condition(ConditionType.NULL), AGENT.EXTERNAL_ID, new Condition(ConditionType.NOTNULL)); if(agents.size() > 0) { for(Agent agent : agents) { String[] uri = agent.getUri().substring(RegionUtil.EXTERNAL_AGENT_URI_PREFIX.length()).split("_"); String regionEnv = String.format("%s:%s", uri[0], uri[1]); if(existingLinks.contains(regionEnv)) { continue; } agentRemove.deactivateThenRemove(agent, null); } } }
Source:
<code>public boolean isChangesRequiresResponseDeletion(FeedbackQuestionDetails newDetails) { FeedbackMsqQuestionDetails newMsqDetails = (FeedbackMsqQuestionDetails) newDetails; if (this.numOfMsqChoices != newMsqDetails.numOfMsqChoices || !this.msqChoices.containsAll(newMsqDetails.msqChoices) || !newMsqDetails.msqChoices.containsAll(this.msqChoices)) { return true; } if (this.generateOptionsFor != newMsqDetails.generateOptionsFor) { return true; } if (this.maxSelectableChoices == Integer.MIN_VALUE && newMsqDetails.maxSelectableChoices != Integer.MIN_VALUE) { return true; } if (this.minSelectableChoices == Integer.MIN_VALUE && newMsqDetails.minSelectableChoices != Integer.MIN_VALUE) { return true; } if (this.minSelectableChoices != Integer.MIN_VALUE && newMsqDetails.minSelectableChoices != Integer.MIN_VALUE <START> && this.minSelectableChoices > newMsqDetails.minSelectableChoices) { <END> return true; } if (this.maxSelectableChoices != Integer.MIN_VALUE && newMsqDetails.maxSelectableChoices != Integer.MIN_VALUE && this.maxSelectableChoices < newMsqDetails.maxSelectableChoices) { return true; } return this.otherEnabled != newMsqDetails.otherEnabled; }</code><technical_language>I understand this wrongly, other around? If new details enforces 2 enforces 3, answer is valid for new details. if new details enforces 3 enforces 2, some answers pick 2 options invalid</technical_language>

Target:
public boolean isChangesRequiresResponseDeletion(FeedbackQuestionDetails newDetails) { FeedbackMsqQuestionDetails newMsqDetails = (FeedbackMsqQuestionDetails) newDetails; if (this.numOfMsqChoices != newMsqDetails.numOfMsqChoices || !this.msqChoices.containsAll(newMsqDetails.msqChoices) || !newMsqDetails.msqChoices.containsAll(this.msqChoices)) { return true; } if (this.generateOptionsFor != newMsqDetails.generateOptionsFor) { return true; } if (this.maxSelectableChoices == Integer.MIN_VALUE && newMsqDetails.maxSelectableChoices != Integer.MIN_VALUE) { return true; } if (this.minSelectableChoices == Integer.MIN_VALUE && newMsqDetails.minSelectableChoices != Integer.MIN_VALUE) { return true; } if (this.minSelectableChoices != Integer.MIN_VALUE && newMsqDetails.minSelectableChoices != Integer.MIN_VALUE && this.minSelectableChoices < newMsqDetails.minSelectableChoices) { return true; } if (this.maxSelectableChoices != Integer.MIN_VALUE && newMsqDetails.maxSelectableChoices != Integer.MIN_VALUE && this.maxSelectableChoices > newMsqDetails.maxSelectableChoices) { return true; } return this.otherEnabled != newMsqDetails.otherEnabled; }
Source:
<code>public void createSheet(String name, List<Object> headers) throws IOException { <START> if (name.length() <= 31) { <END> Sheet sheet = workbook.getSheet(name); if (sheet == null) { sheet = workbook.createSheet(name); internalWriteRow(headers, sheet, 0); } } else { throw new MaximumSheetNameLengthExceededException(name); } }</code><technical_language>Store magic number in a static final field</technical_language>

Target:
public void createSheet(String name, List<Object> headers) { if (name.length() <= MAXIMUM_SHEET_LENGTH) { Sheet sheet = workbook.getSheet(name); if (sheet == null) { sheet = workbook.createSheet(name); internalWriteRow(headers, sheet, 0); } } else { throw new MaximumSheetNameLengthExceededException(name); } }
Source:
<code>private void resurrectCheckpoints() { ExecutorService executorService = Executors.newFixedThreadPool(numOfWorkers, new ThreadFactoryBuilder() .setNameFormat("FastObjectLoaderResurrectCheckpointsThread-%d").build()); CompletableFuture[] cfs = new CompletableFuture[streamsMetaData.size()]; int i = 0; try { for (Map.Entry<UUID, StreamMetaData> entry : streamsMetaData.entrySet()) { <START> cfs[i++] = CompletableFuture.runAsync(() -> { <END> CheckPoint checkPoint = entry.getValue().getLatestCheckPoint(); if (checkPoint == null) { log.info("resurrectCheckpoints[{}]: Truncated checkpoint for this stream", Utils.toReadableId(entry.getKey())); return; } for (long address : checkPoint.getAddresses()) { updateCorfuObject(getLogData(runtime, loadInCache, address)); } }); } executorService.shutdown(); executorService.awaitTermination(timeoutInMinutesForLoading, TimeUnit.MINUTES); for (CompletableFuture future : cfs) { if (!future.isDone() || future.isCancelled() || future.isCompletedExceptionally()) { throw new FastObjectLoaderException("Failed to load checkpoints"); } } } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new FastObjectLoaderException("Failed to resurrectCheckpoints"); } finally { executorService.shutdownNow(); } }</code><technical_language>pass executorservice a parameter for runAsync it. ForkJoinPool default otherwise</technical_language>

Target:
private void resurrectCheckpoints() { ExecutorService executorService = Executors.newFixedThreadPool(numOfWorkers, new ThreadFactoryBuilder() .setNameFormat("FastObjectLoaderResurrectCheckpointsThread-%d").build()); CompletableFuture[] cfs = new CompletableFuture[streamsMetaData.size()]; int i = 0; try { for (Map.Entry<UUID, StreamMetaData> entry : streamsMetaData.entrySet()) { cfs[i++] = CompletableFuture.runAsync(() -> { CheckPoint checkPoint = entry.getValue().getLatestCheckPoint(); if (checkPoint == null) { log.info("resurrectCheckpoints[{}]: Truncated checkpoint for this stream", Utils.toReadableId(entry.getKey())); return; } for (long address : checkPoint.getAddresses()) { updateCorfuObject(getLogData(runtime, loadInCache, address)); } }, executorService); } executorService.shutdown(); executorService.awaitTermination(timeoutInMinutesForLoading, TimeUnit.MINUTES); for (CompletableFuture future : cfs) { if (!future.isDone() || future.isCancelled() || future.isCompletedExceptionally()) { throw new FastObjectLoaderException("Failed to load checkpoints"); } } } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new FastObjectLoaderException("Failed to resurrectCheckpoints"); } finally { executorService.shutdownNow(); } }
Source:
<code>public synchronized void start() { _d2Config = new DatastreamD2Config(_config, _clusterName, _endpoints); if (_isLeader.getAsBoolean()) { try { <START> configureCluster(); <END> } catch (Exception e) { String errMsg = "Failed to set up D2 cluster, server=" + this; LOG.error(errMsg, e); throw new DatastreamRuntimeException(errMsg, e); } } try { waitForClusterSetup(); joinCluster(); _isStopped = false; } catch (Exception e) { String errMsg = "Failed to join D2 cluster, server=" + this; LOG.error(errMsg, e); throw new DatastreamRuntimeException(errMsg, e); } }</code><technical_language>Is this idempotent? If this is, need called leader? If this is idempotent, do ensure this called multiple times</technical_language>

Target:
public synchronized void start() { _d2Config = new DatastreamD2Config(_config, _clusterName, _svcEndpoints); if (_isLeader.getAsBoolean()) { try { configureCluster(); } catch (Exception e) { String errMsg = "Failed to set up D2 cluster, server=" + this; LOG.error(errMsg, e); throw new DatastreamRuntimeException(errMsg, e); } } try { waitForClusterSetup(); joinCluster(); _isStopped = false; } catch (Exception e) { String errMsg = "Failed to join D2 cluster, server=" + this; LOG.error(errMsg, e); throw new DatastreamRuntimeException(errMsg, e); } }
Source:
<code>public static String toDot(CFG cfg) { <START> StringBuilder sb = new StringBuilder(); <END> List<Block> blocks = cfg.blocks(); sb.append("cfg{"); sb.append(DOT_NEW_LINE); int firstBlockId = blocks.size() - 1; for (Block block : blocks) { int id = block.id(); sb.append(DOT_PADDING); sb.append(id + dotBlockLabel(id, firstBlockId) + ";"); sb.append(DOT_NEW_LINE); } sb.append(DOT_NEW_LINE); for (Block block : blocks) { for (Block successor : block.successors()) { sb.append(DOT_PADDING); sb.append(block.id() + "->" + successor.id() + dotSuccessorLabel(block, successor) + ";"); sb.append(DOT_NEW_LINE); } for (Block exception : block.exceptions()) { sb.append(DOT_PADDING); sb.append(block.id() + "->" + exception.id() + dotExceptionLabel(block, exception) + ";"); sb.append(DOT_NEW_LINE); } } sb.append("}"); return sb.toString(); }</code><technical_language>StringFormat a Striing builder for of cases</technical_language>

Target:
public static String toDot(CFG cfg) { StringBuilder sb = new StringBuilder(); List<Block> blocks = cfg.blocks(); int firstBlockId = blocks.size() - 1; blocks.stream().map(block -> dotBlockLabel(block.id(), firstBlockId)).forEach(sb::append); sb.append(NEW_LINE); for (Block block : blocks) { block.successors().stream().map(successor -> dotSuccessorFormat(block, successor)).forEach(sb::append); block.exceptions().stream().map(exception -> dotExceptionFormat(block, exception)).forEach(sb::append); } return escapeNewLines("graph cfg {" + NEW_LINE + sb.toString() + "}"); }
Source:
<code>public void updateProviderWithReservedName() throws Exception { <START> NewServiceProvider newProvider1 = NewServiceProviderBuilder.newServiceProvider().name("name1").build(); <END> NewServiceProvider newProvider2 = NewServiceProviderBuilder.newServiceProvider().name("name2").build(); Object id = repository.create(newProvider1); repository.create(newProvider2); ServiceProvider provider = ServiceProviderBuilder.newProvider().id(new ID(id)).name("name2").build(); repository.update(provider); }</code><technical_language>static import</technical_language>

Target:
public void updateProviderWithReservedName() throws Exception { NewServiceProvider newProvider1 = newServiceProvider().name("name1").build(); NewServiceProvider newProvider2 = newServiceProvider().name("name2").build(); Object id = repository.create(newProvider1); repository.create(newProvider2); ServiceProvider provider = ServiceProviderBuilder.newProvider().id(new ID(id)).name("name2").build(); repository.update(provider); }
Source:
<code>public FateStatus getStatus(ReadOnlyTStore<T> zs, IZooReader zk, String lockPath, Set<Long> filterTxid, EnumSet<TStatus> filterStatus) throws KeeperException, InterruptedException { Map<Long,List<String>> heldLocks = new HashMap<>(); Map<Long,List<String>> waitingLocks = new HashMap<>(); findLocks(zk, lockPath, heldLocks, waitingLocks); <START> FateStatus status = getTransactionStatus(zs, filterTxid, filterStatus, heldLocks, waitingLocks); <END> return status; }</code><technical_language>suggestion return getTransactionStatus(zs, filterTxid, filterStatus, heldLocks, waitingLocks);</technical_language>

Target:
public FateStatus getStatus(ReadOnlyTStore<T> zs, IZooReader zk, String lockPath, Set<Long> filterTxid, EnumSet<TStatus> filterStatus) throws KeeperException, InterruptedException { Map<Long,List<String>> heldLocks = new HashMap<>(); Map<Long,List<String>> waitingLocks = new HashMap<>(); findLocks(zk, lockPath, heldLocks, waitingLocks); return getTransactionStatus(zs, filterTxid, filterStatus, heldLocks, waitingLocks); }
Source:
<code>public static <S> void close(S dynamicProxy) { <START> IOUtils.closeQuietly(getPool(dynamicProxy)); <END> }</code><technical_language>Newer versions of Ostrich Guava's Closeables.close(getPool(dynamicProxy), true). do introduce a new dependency</technical_language>

Target:
public static <S> void close(S dynamicProxy) { try { Closeables.close(getPool(dynamicProxy), true); } catch (IOException e) { throw new AssertionError(); } }
Source:
<code>public final boolean flush(long timeout, TimeUnit unit) { validateBlockingAction(); if (stateUpdater.get(this) == STATE_NOT_RUNNING) { return true; } long timeLimit = System.currentTimeMillis() + unit.toMillis(timeout); try { while (stateUpdater.get(this) == STATE_RUNNING && timeLimit > System.currentTimeMillis()) { if (tasks.isEmpty()) { <START> return true; <END> } Thread.sleep(10); } } catch (InterruptedException e) { } return stateUpdater.get(this) == STATE_NOT_RUNNING; }</code><technical_language>fix offending flush add this complex piece</technical_language>

Target:
public final boolean flush(long timeout, TimeUnit unit) { validateBlockingCall(); if (stateUpdater.get(this) == STATE_NOT_RUNNING) { return true; } long timeLimit = System.currentTimeMillis() + unit.toMillis(timeout); try { while (stateUpdater.get(this) == STATE_RUNNING && timeLimit > System.currentTimeMillis()) { if (tasks.isEmpty()) { return true; } Thread.sleep(10); } } catch (InterruptedException e) { } return stateUpdater.get(this) == STATE_NOT_RUNNING; }
Source:
<code>protected void focusFirstField() { final Iterator<Entry<String, FormFieldWidget>> fieldWidgestIterator = fieldWidgets.entrySet().iterator(); boolean focused = false; while (fieldWidgestIterator.hasNext() && !focused) { final Entry<String, FormFieldWidget> reducedFormWidget = fieldWidgestIterator.next(); final FormFieldWidget formFieldWidget = reducedFormWidget.getValue(); <START> if (formFieldWidget!=null && formFieldWidget.getType()!=null && widgetTypesToFocus.contains(formFieldWidget.getType())) { <END> focused = true; formFieldWidget.setFocusOn(); } } }</code><technical_language>indentation fix - I null check is necessary (the type null event if if was, is null in widgetTypesToFocus)</technical_language>

Target:
protected void focusFirstField() { final Iterator<Entry<String, FormFieldWidget>> fieldWidgestIterator = fieldWidgets.entrySet().iterator(); boolean focused = false; while (fieldWidgestIterator.hasNext() && !focused) { final Entry<String, FormFieldWidget> reducedFormWidget = fieldWidgestIterator.next(); final FormFieldWidget formFieldWidget = reducedFormWidget.getValue(); if (formFieldWidget != null && widgetTypesToFocus.contains(formFieldWidget.getType())) { if (formFieldWidget.getType().equals(WidgetType.RICH_TEXTAREA)) { formFieldWidget.getElement().focus(); } else { formFieldWidget.setFocusOn(); } focused = true; } } }
Source:
<code><START> public Mono<HttpClientResponse> deletePolicy(String vhost, String name) { <END> return doDelete(builder -> builder.pathSegment("policies", vhost, name)); }</code><technical_language>a boolean (whether delete succeeded)</technical_language>

Target:
public Mono<HttpResponse> deletePolicy(String vhost, String name) { return doDelete("policies", enc(vhost), enc(name)); }
Source:
<code>public void setFocus(final IDMContext[] focus, RequestMonitor rm) { assert focus != null; IDMContext elem = focus[0]; if (elem instanceof IFrameDMContext) { final IFrameDMContext finalFrameCtx = (IFrameDMContext)elem; setFrameFocus(finalFrameCtx, new ImmediateRequestMonitor(rm) { @Override public void handleSuccess() { fCurrentGDBFocus = finalFrameCtx; rm.done(); } }); } else if (elem instanceof IMIExecutionDMContext) { final IMIExecutionDMContext finalThreadCtx = (IMIExecutionDMContext)elem; setThreadFocus(finalThreadCtx, new ImmediateRequestMonitor(rm) { @Override protected void handleSuccess() { fCurrentGDBFocus = finalThreadCtx; rm.done(); } @Override protected void handleFailure() { <START> rm.done(); <END> } }); } else { assert false; rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid context to set focus to", null)); return; } }</code><technical_language>I client decides do error. Silencing in service prevents clients control do want. I suggest putting overridden handleFailure in GdbDebugContextSyncManager</technical_language>

Target:
public void setFocus(final IDMContext[] focus, RequestMonitor rm) { assert focus != null; IDMContext elem = focus[0]; if (elem instanceof IFrameDMContext) { final IFrameDMContext finalFrameCtx = (IFrameDMContext)elem; setFrameFocus(finalFrameCtx, new ImmediateRequestMonitor(rm) { @Override public void handleSuccess() { fCurrentGDBFocus = finalFrameCtx; rm.done(); } }); } else if (elem instanceof IMIExecutionDMContext) { final IMIExecutionDMContext finalThreadCtx = (IMIExecutionDMContext)elem; setThreadFocus(finalThreadCtx, new ImmediateRequestMonitor(rm) { @Override protected void handleSuccess() { fCurrentGDBFocus = finalThreadCtx; rm.done(); } @Override protected void handleFailure() { rm.done(); } }); } else if (elem instanceof IMIContainerDMContext) { setProcessFocus((IMIContainerDMContext)elem, rm); } else { assert false; rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid context to set focus to", null)); return; } }
Source:
<code>public MessageChannel resolveDestination(String name) { Assert.state(this.beanFactory != null, "BeanFactory is required"); try { return this.beanFactory.getBean(name, MessageChannel.class); } catch (BeansException e) { if (this.replyChannelRegistry != null) { MessageChannel channel = this.replyChannelRegistry.channelNameToChannel(name); if (channel != null) { return channel; } } throw new DestinationResolutionException( "failed to look up MessageChannel bean with name '" + name + "'" <START> + (this.replyChannelRegistry == null ? " (no header channel registry present)" : ""), e); <END> } }</code><technical_language>Actually, in cases HeaderChannelRegistry contains TemporaryReplyChannels beans this exception message for gateways some serialization flow, HeaderChannelRegistry. So, position change more generic statement: > "Failed MessageChannel name '" + name + "' in BeanFactory" + (this.replyChannelRegistry == null ? " (and is HeaderChannelRegistry present)." : "."</technical_language>

Target:
public MessageChannel resolveDestination(String name) { Assert.state(this.beanFactory != null, "BeanFactory is required"); try { return this.beanFactory.getBean(name, MessageChannel.class); } catch (BeansException e) { if (this.replyChannelRegistry != null) { MessageChannel channel = this.replyChannelRegistry.channelNameToChannel(name); if (channel != null) { return channel; } } throw new DestinationResolutionException( "failed to look up MessageChannel with name '" + name + "' in the BeanFactory" + (this.replyChannelRegistry == null ? " (and there is no HeaderChannelRegistry present)." : "."), e); } }
Source:
<code>Type getType() { if (root != null) { return root.type; } else { return type; <START> } <END> }</code><technical_language>Minor ... if block returns, is need for 'else' block, do this: if (root != null) { return root.type; } return type; or, yet: return root != null ? root.type : type;</technical_language>

Target:
Type getType() { return root != null ? root.type : type; }
Source:
<code>public void readData(ObjectDataInput in) throws IOException { key = IOUtil.readObject(in); value = IOUtil.readObject(in); cost = in.readLong(); creationTime = in.readLong(); expirationTime = in.readLong(); hits = in.readLong(); lastAccessTime = in.readLong(); lastStoredTime = in.readLong(); lastUpdateTime = in.readLong(); version = in.readLong(); ttl = in.readLong(); <START> maxIdle = in.readLong(); <END> }</code><technical_language>RU compatibility</technical_language>

Target:
public void readData(ObjectDataInput in) throws IOException { key = IOUtil.readObject(in); value = IOUtil.readObject(in); cost = in.readLong(); creationTime = in.readLong(); expirationTime = in.readLong(); hits = in.readLong(); lastAccessTime = in.readLong(); lastStoredTime = in.readLong(); lastUpdateTime = in.readLong(); version = in.readLong(); ttl = in.readLong(); if (in.getVersion().isGreaterOrEqual(V3_11)) { maxIdle = in.readLong(); } }
Source:
<code>public void startDocument(List<Node> nodes) { String fileContent; try { fileContent = getHtmlSourceCode().inputFile().contents(); } catch (IOException e) { throw new IllegalStateException(e); } if (isRegularExpression) { checkRegularExpression(fileContent); } else { HeaderLinesProcessor processor = new HeaderLinesProcessor(expectedLines); <START> new BufferedReader(new StringReader(fileContent)).lines() <END> .forEachOrdered(processor::processLine); if (!processor.getResult()) { createViolation(0, MESSAGE); } } }</code><technical_language>BufferedReader closed</technical_language>

Target:
public void startDocument(List<Node> nodes) { String fileContent; try { fileContent = getHtmlSourceCode().inputFile().contents(); } catch (IOException e) { throw new IllegalStateException(e); } if (isRegularExpression) { checkRegularExpression(fileContent); } else { HeaderLinesProcessor processor = new HeaderLinesProcessor(expectedLines); try (BufferedReader br = new BufferedReader(new StringReader(fileContent))) { List<String> lines = br.lines().collect(Collectors.toList()); for (String line : lines) { if (!processor.processLine(line)) { break; } } if (!processor.getResult()) { createViolation(0, MESSAGE); } } catch (IOException e) { throw new IllegalStateException(e); } } }
Source:
<code>public KeyVaultCredentialPolicy(TokenCredential credential) { <START> Objects.requireNonNull(credential); this.cache = new ScopeTokenCache((request) -> credential.getToken(request)); this.httpClient = null; this.logOptions = null; <END> }</code><technical_language>This ctr call other overload</technical_language>

Target:
public KeyVaultCredentialPolicy(TokenCredential credential) { Objects.requireNonNull(credential); this.cache = new ScopeTokenCache((request) -> credential.getToken(request)); }
Source:
<code>private static @NonNull TmfTraceContext getCurrentTraceContext() { TmfTraceManager instance = TmfTraceManager.getInstance(); ITmfTrace activeTrace = instance.getActiveTrace(); return activeTrace == null ? <START> TmfTraceContext.NULL_CONTEXT : <END> instance.getTraceContext(activeTrace); }</code><technical_language>return null handle directly, instead of making null context public deprecating immmediately</technical_language>

Target:
private static @Nullable TmfTraceContext getCurrentTraceContext() { TmfTraceManager instance = TmfTraceManager.getInstance(); ITmfTrace activeTrace = instance.getActiveTrace(); return activeTrace == null ? null : instance.getTraceContext(activeTrace); }
Source:
<code>protected boolean configure() { Configuration configuration = getConfig(); <START> Map<String, String> properties = editProperties(); <END> if (getBridge() == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "bridge missing"); return false; } sensorCount = Integer.valueOf(properties.get(PROPERTY_SENSORCOUNT)); for (int i = 0; i < sensorCount; i++) { String configKey = (i == 0) ? CONFIG_ID : CONFIG_ID + String.valueOf(i); if (configuration.get(configKey) != null) { String sensorId = (String) configuration.get(configKey); if (SENSOR_ID_PATTERN.matcher(sensorId).matches()) { sensorIds.add(sensorId); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "sensor id format mismatch"); return false; } } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "sensor id missing"); return false; } } if (configuration.get(CONFIG_REFRESH) != null) { refreshInterval = ((BigDecimal) configuration.get(CONFIG_REFRESH)).intValue() * 1000; } else { refreshInterval = 300 * 1000; } lastRefresh = 0; return true; }</code><technical_language>call editProperties is expected call updateProperties, don't. simply access current properties, simply do thing.getProperties() instead</technical_language>

Target:
protected boolean configure() { Configuration configuration = getConfig(); Map<String, String> properties = thing.getProperties(); if (getBridge() == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "bridge missing"); return false; } sensorCount = Integer.valueOf(properties.get(PROPERTY_SENSORCOUNT)); for (int i = 0; i < sensorCount; i++) { String configKey = (i == 0) ? CONFIG_ID : CONFIG_ID + String.valueOf(i); if (configuration.get(configKey) != null) { String sensorId = (String) configuration.get(configKey); if (SENSOR_ID_PATTERN.matcher(sensorId).matches()) { sensorIds.add(sensorId); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "sensor id format mismatch"); return false; } } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "sensor id missing"); return false; } } if (configuration.get(CONFIG_REFRESH) != null) { refreshInterval = ((BigDecimal) configuration.get(CONFIG_REFRESH)).intValue() * 1000; } else { refreshInterval = 300 * 1000; } if (thing.getChannel(CHANNEL_PRESENT) != null) { showPresence = true; } lastRefresh = 0; return true; }
Source:
<code>public KTableValueGetterSupplier<K, V> view() { final KTableValueGetterSupplier<K, V> parentValueGetterSupplier = parentKTable.valueGetterSupplier(); return new KTableValueGetterSupplier<K, V>() { @Override public KTableValueGetter<K, V> get() { final KTableValueGetter<K, V> parentGetter = parentValueGetterSupplier.get(); return new KTableValueGetter<K, V>() { private TimeOrderedKeyValueBuffer<K, V> buffer; @SuppressWarnings("unchecked") @Override public void init(final ProcessorContext context) { parentGetter.init(context); buffer = requireNonNull((TimeOrderedKeyValueBuffer<K, V>) context.getStateStore(storeName)); } @Override public ValueAndTimestamp<V> get(final K key) { <START> if (buffer.hasKey(key)) { <END> return buffer.priorValueForBuffered(key); } else { return parentGetter.get(key); } } @Override public void close() { parentGetter.close(); } }; } @Override public String[] storeNames() { final String[] parentStores = parentValueGetterSupplier.storeNames(); final String[] stores = new String[1 + parentStores.length]; System.arraycopy(parentStores, 0, stores, 1, parentStores.length); stores[0] = storeName; return stores; } }; }</code><technical_language>serialized key in hasKey in priorValueForBuffered, alter interface takes in serialized key do once</technical_language>

Target:
public KTableValueGetterSupplier<K, V> view() { final KTableValueGetterSupplier<K, V> parentValueGetterSupplier = parentKTable.valueGetterSupplier(); return new KTableValueGetterSupplier<K, V>() { @Override public KTableValueGetter<K, V> get() { final KTableValueGetter<K, V> parentGetter = parentValueGetterSupplier.get(); return new KTableValueGetter<K, V>() { private TimeOrderedKeyValueBuffer<K, V> buffer; @SuppressWarnings("unchecked") @Override public void init(final ProcessorContext context) { parentGetter.init(context); buffer = requireNonNull((TimeOrderedKeyValueBuffer<K, V>) context.getStateStore(storeName)); } @Override public ValueAndTimestamp<V> get(final K key) { final Maybe<ValueAndTimestamp<V>> maybeValue = buffer.priorValueForBuffered(key); if (maybeValue.isDefined()) { return maybeValue.getNullableValue(); } else { return parentGetter.get(key); } } @Override public void close() { parentGetter.close(); } }; } @Override public String[] storeNames() { final String[] parentStores = parentValueGetterSupplier.storeNames(); final String[] stores = new String[1 + parentStores.length]; System.arraycopy(parentStores, 0, stores, 1, parentStores.length); stores[0] = storeName; return stores; } }; }
Source:
<code>public void beforeClass(final @Optional String testType) throws IOException { <START> if (testType.equals("buckets")) { <END> throw new SkipException("Directory tests will be skipped in Manta Buckets"); } IntegrationTestHelper.createTestBucketOrDirectory(mantaClient, testPathPrefix, testType); }</code><technical_language>testType null, invert equals() check so: java if ("buckets".equals(testType)) {</technical_language>

Target:
public void beforeClass(final @Optional String testType) throws IOException { if ("buckets".equals(testType)) { throw new SkipException("Directory tests will be skipped in Manta Buckets"); } IntegrationTestHelper.createTestBucketOrDirectory(mantaClient, testPathPrefix, testType); }
Source:
<code>private Map<String, Object> getTaskCompletionRowStats() { Map<String, Object> metrics = Maps.newHashMap(); <START> if (determinePartitionsMeters != null) { <END> metrics.put( "determinePartitions", determinePartitionsMeters.getTotals() ); } if (buildSegmentsMeters != null) { metrics.put( "buildSegments", buildSegmentsMeters.getTotals() ); } return metrics; }</code><technical_language>suggest moving of final objects instead of nullable</technical_language>

Target:
private Map<String, Object> getTaskCompletionRowStats() { Map<String, Object> metrics = Maps.newHashMap(); metrics.put( RowIngestionMeters.DETERMINE_PARTITIONS, determinePartitionsMeters.getTotals() ); metrics.put( RowIngestionMeters.BUILD_SEGMENTS, buildSegmentsMeters.getTotals() ); return metrics; }
Source:
<code>static void setVolumeSliderColor(Context context, MediaRouteVolumeSlider volumeSlider) { int progressAndThumbColor, backgroundColor; if (isLightTheme(context)) { progressAndThumbColor = ContextCompat.getColor(context, R.color.mr_cast_progressbar_progress_and_thumb_light); backgroundColor = ContextCompat.getColor(context, R.color.mr_cast_progressbar_background_light); } else { progressAndThumbColor = ContextCompat.getColor(context, R.color.mr_cast_progressbar_progress_and_thumb_dark); backgroundColor = ContextCompat.getColor(context, R.color.mr_cast_progressbar_background_dark); } <START> volumeSlider.setProgressAndThumbColor(progressAndThumbColor); <END> volumeSlider.setBackgroundColor(backgroundColor); }</code><technical_language>setColor(int progressAndThumbColor, int backgroundColor) if alway need set together</technical_language>

Target:
static void setVolumeSliderColor(Context context, MediaRouteVolumeSlider volumeSlider) { int progressAndThumbColor, backgroundColor; if (isLightTheme(context)) { progressAndThumbColor = ContextCompat.getColor(context, R.color.mr_cast_progressbar_progress_and_thumb_light); backgroundColor = ContextCompat.getColor(context, R.color.mr_cast_progressbar_background_light); } else { progressAndThumbColor = ContextCompat.getColor(context, R.color.mr_cast_progressbar_progress_and_thumb_dark); backgroundColor = ContextCompat.getColor(context, R.color.mr_cast_progressbar_background_dark); } volumeSlider.setColor(progressAndThumbColor, backgroundColor); }
Source:
<code>public final List<String> getGroupNames() { List<String> groupNames = new ArrayList<>(m_groups.size()); <START> m_groups.forEach(g -> groupNames.add(g.m_name)); <END> return groupNames; }</code><technical_language>this return m_groups is immutable? atl east construct takes a Collection new ArrayList<>(m_groups);</technical_language>

Target:
public final List<String> getGroupNames() { return m_groups.stream().map(g -> g.m_name).collect(Collectors.toList()); }
Source:
<code>private boolean avoidRpcToGetTable(boolean alwaysHitServer, Long resolvedTimestamp, boolean systemTable, PTable table, PTableRef tableRef, long tableResolvedTimestamp) { if (table != null && !alwaysHitServer) { if (systemTable && table.getRowTimestampColPos() == -1 || resolvedTimestamp == tableResolvedTimestamp) { return true; } long effectiveUpdateCacheFrequency = table.getUpdateCacheFrequency() != 0L ? table.getUpdateCacheFrequency() : connection.getQueryServices().getProps().getLong( <START> QueryServices.DEFAULT_UPDATE_CACHE_FREQUENCY_ATRRIB, QueryServicesOptions.DEFAULT_UPDATE_CACHE_FREQUENCY); <END> return (table.getRowTimestampColPos() == -1 && connection.getMetaDataCache().getAge(tableRef) < effectiveUpdateCacheFrequency); } return false; }</code><technical_language>add a debug log line table-level property connection-level property table tenantId + table schema + table name</technical_language>

Target:
private boolean avoidRpcToGetTable(boolean alwaysHitServer, Long resolvedTimestamp, boolean systemTable, PTable table, PTableRef tableRef, long tableResolvedTimestamp) { if (table != null && !alwaysHitServer) { if (systemTable && table.getRowTimestampColPos() == -1 || resolvedTimestamp == tableResolvedTimestamp) { return true; } final long effectiveUpdateCacheFreq; final String ucfInfoForLogging; if (table.getUpdateCacheFrequency() != 0L) { effectiveUpdateCacheFreq = table.getUpdateCacheFrequency(); ucfInfoForLogging = "table-level"; } else { effectiveUpdateCacheFreq = (Long) ConnectionProperty.UPDATE_CACHE_FREQUENCY.getValue( connection.getQueryServices().getProps().get( QueryServices.DEFAULT_UPDATE_CACHE_FREQUENCY_ATRRIB)); ucfInfoForLogging = connection.getQueryServices().getProps().get( QueryServices.DEFAULT_UPDATE_CACHE_FREQUENCY_ATRRIB) != null ? "connection-level" : "default"; } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Using " + ucfInfoForLogging + " Update Cache Frequency (value = " + effectiveUpdateCacheFreq + "ms) for " + table.getName() + (table.getTenantId() != null ? ", Tenant ID: " + table.getTenantId() : "")); } return (table.getRowTimestampColPos() == -1 && connection.getMetaDataCache().getAge(tableRef) < effectiveUpdateCacheFreq); } return false; }
Source:
<code>public void tearDown() throws Exception { <START> setAutoBuildEnabled(true); <END> ValidationFramework.getDefault().suspendAllValidation(false); JobUtils.waitForIdle(100); ServerCreationTestUtils.deleteAllServersAndRuntimes(); ProjectUtility.deleteAllProjects(); ASMatrixTests.clearStateLocation(); JobUtils.waitForIdle(); }</code><technical_language>no, need capture autobuild state setup restore teardown</technical_language>

Target:
public void tearDown() throws Exception { JobUtils.waitForIdle(100); ServerCreationTestUtils.deleteAllServersAndRuntimes(); ProjectUtility.deleteAllProjects(); ASMatrixTests.clearStateLocation(); JobUtils.waitForIdle(); }
Source:
<code>private static void getPackageFragmentRootContainers(IRuntimeClasspathEntry entry, List<ISourceContainer> containers) { IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); IPath entryPath = entry.getPath(); boolean found = false; try { IJavaProject[] jps = model.getJavaProjects(); for (int i = 0; i < jps.length; i++) { IJavaProject jp = jps[i]; IProject p = jp.getProject(); if (p.isOpen()) { IPackageFragmentRoot[] allRoots = jp.getPackageFragmentRoots(); for (int j = 0; j < allRoots.length; j++) { IPackageFragmentRoot root = allRoots[j]; if (root.getPath().equals(entryPath) && isSourceAttachmentEqual(root, entry)) { PackageFragmentRootSourceContainer container = new PackageFragmentRootSourceContainer(root); if (!containers.contains(container)) { containers.add(container); <START> found = <END> true; } } } } } } catch (JavaModelException e) { LaunchingPlugin.log(e); } if (!found) { tryToAddSourceAttachment(entry, containers); } }</code><technical_language>if existed in containers, is sufficient</technical_language>

Target:
private static void getPackageFragmentRootContainers(IRuntimeClasspathEntry entry, List<ISourceContainer> containers) { IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); IPath entryPath = entry.getPath(); boolean found = false; try { IJavaProject[] jps = model.getJavaProjects(); for (int i = 0; i < jps.length; i++) { IJavaProject jp = jps[i]; IProject p = jp.getProject(); if (p.isOpen()) { IPackageFragmentRoot[] allRoots = jp.getPackageFragmentRoots(); for (int j = 0; j < allRoots.length; j++) { IPackageFragmentRoot root = allRoots[j]; if (root.getPath().equals(entryPath) && isSourceAttachmentEqual(root, entry)) { PackageFragmentRootSourceContainer container = new PackageFragmentRootSourceContainer(root); if (!containers.contains(container)) { containers.add(container); found = true; } } } } } } catch (JavaModelException e) { LaunchingPlugin.log(e); } if (!found) { addSourceAttachment(entry, containers); } }
Source:
<code>private Iterator<ServerIssue> fetchServerIssues(ConnectedSonarLintEngine engine, String moduleKey, String relativePath) { try { <START> return engine.downloadServerIssues(moduleKey, relativePath); <END> } catch (SonarLintWrappedException e) { return engine.getServerIssues(moduleKey, relativePath); } catch (Throwable t) { SonarLintConsole.get(myProject).error("could not get server issues", t); return Collections.emptyIterator(); } }</code><technical_language>log in debug in this class is do, mentioning module relativePath</technical_language>

Target:
private Iterator<ServerIssue> fetchServerIssues(ConnectedSonarLintEngine engine, String moduleKey, String relativePath) { try { LOGGER.debug("fetchServerIssues moduleKey=" + moduleKey + ", filepath=" + relativePath); return engine.downloadServerIssues(moduleKey, relativePath); } catch (SonarLintWrappedException e) { SonarLintConsole.get(myProject).error("could not download server issues", e); return engine.getServerIssues(moduleKey, relativePath); } catch (Throwable t) { SonarLintConsole.get(myProject).error("could not get server issues", t); return Collections.emptyIterator(); } }
Source:
<code><START> public @ResponseBody byte[] getVpnAppleMobileConfig( <END> @RequestHeader(value = Constants.PASSWORD_HEADER) Optional<String> password, @PathVariable UUID id) { return CryptoSession.execute(password, () -> userService.canAccessPrivateData(id), () -> new byte[0]); }</code><technical_language>understanding is this is a text file, String a more return type. do this time finalize iOS-related code</technical_language>

Target:
public @ResponseBody String getVpnAppleMobileConfig( @RequestHeader(value = Constants.PASSWORD_HEADER) Optional<String> password, @PathVariable UUID id) { return CryptoSession.execute(password, () -> userService.canAccessPrivateData(id), () -> ""); }
Source:
<code>public void submitCollectionSheet(int groupId, CollectionSheetPayload payload) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(collectionDataManager.submitCollectionSheet(groupId, payload) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<GenericResponse>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); try { <START> if (e instanceof HttpException) { <END> String errorMessage = ((HttpException) e).response().errorBody() .string(); if (((HttpException) e).code() == 500) { getMvpView().showError(errorMessage); } else { getMvpView().showError(MFErrorParser.parseError(errorMessage) .getErrors().get(0).getDefaultUserMessage()); } } } catch (Throwable throwable) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } } @Override public void onNext(GenericResponse response) { getMvpView().showProgressbar(false); getMvpView().showError(c.getResources().getString( R.string.collectionsheet_submit_success)); } })); }</code><technical_language>this utils method show error <LINK_0></technical_language>

Target:
public void submitCollectionSheet(int groupId, CollectionSheetPayload payload) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(collectionDataManager.submitCollectionSheet(groupId, payload) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<GenericResponse>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(MFErrorParser.errorMessage(e)); } @Override public void onNext(GenericResponse genericResponse) { getMvpView().showProgressbar(false); getMvpView().showError(c.getResources().getString( R.string.collectionsheet_submit_success)); } })); }