auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void buildPayload( String urlEncodedJson, String enc ) { try { JSONObject jsonVars = new JSONObject( urlEncodedJson ); String actionClass = URLDecoder.decode( jsonVars.getString( ActionUtil.INVOKER_ACTIONCLASS ), enc ); String actionId = URLDecoder.decode( jsonVars.getString( ActionUtil.INVOKER_ACTIONID ), enc ); actionUser = URLDecoder.decode( jsonVars.getString( ActionUtil.INVOKER_ACTIONUSER ), enc ); <START> workItemUid = URLDecoder.decode( jsonVars.getString( ActionUtil.WORK_ITEM_UID ), enc ); <END> action = getActionBean( actionClass, actionId ); String stringActionParams = URLDecoder.decode( jsonVars.getString( ActionUtil.INVOKER_ACTIONPARAMS ), enc ); ActionParams actionParams = ActionParams.fromJson( stringActionParams ); actionMap = ActionParams.deserialize( action, actionParams ); } catch ( JSONException | IOException | ActionInvocationException e ) { throw new IllegalArgumentException( e ); } }</code><technical_language>workItemUid needs included in job passed main pentaho server in scripts create JSON input, this payload for key (workItemUid) exist. thinking it, create some object allows put "extras" in payload modifying scripts. @pedrofvteixeira ^^</technical_language>

Target:
private void buildPayload( String urlEncodedJson, String enc ) { try { JSONObject jsonVars = new JSONObject( urlEncodedJson ); String actionClass = URLDecoder.decode( jsonVars.getString( ActionUtil.INVOKER_ACTIONCLASS ), enc ); String actionId = URLDecoder.decode( jsonVars.getString( ActionUtil.INVOKER_ACTIONID ), enc ); actionUser = URLDecoder.decode( jsonVars.getString( ActionUtil.INVOKER_ACTIONUSER ), enc ); action = getActionBean( actionClass, actionId ); String stringActionParams = URLDecoder.decode( jsonVars.getString( ActionUtil.INVOKER_ACTIONPARAMS ), enc ); ActionParams actionParams = ActionParams.fromJson( stringActionParams ); actionMap = ActionParams.deserialize( action, actionParams ); } catch ( JSONException | IOException | ActionInvocationException e ) { throw new IllegalArgumentException( e ); } }
Source:
<code>public Optional<Row> getNextMergedRow() throws IOException { RowMerger builder = null; while (!lastResponseProcessed) { ResultQueueEntry<ReadRowsResponse> queueEntry = getNext(); if (queueEntry.isCompletionMarker()) { lastResponseProcessed = true; break; } ReadRowsResponse partialRow = queueEntry.getResponseOrThrow(); <START> if (builder == null) { <END> builder = new RowMerger(); } builder.addPartialRow(partialRow); if (builder.isRowCommitted()) { return Optional.of(builder.buildRow()); } } Preconditions.checkState( builder == null, "End of stream marker encountered while merging a row."); Preconditions.checkState( lastResponseProcessed, "Should only exit merge loop with by returning a complete Row or hitting end of stream."); return Optional.absent(); }</code><technical_language>chance of creating a row is high, create builder beginning? if (lastResponseProcessed) { // illegal state exception ??? } RowMerger builder = new RowMerger();</technical_language>

Target:
public synchronized Row getNextMergedRow() throws IOException { RowMerger builder = null; while (!lastResponseProcessed) { ResultQueueEntry<ReadRowsResponse> queueEntry = getNext(); if (queueEntry.isCompletionMarker()) { lastResponseProcessed = true; break; } ReadRowsResponse partialRow = queueEntry.getResponseOrThrow(); if (builder == null) { builder = new RowMerger(); } builder.addPartialRow(partialRow); if (builder.isRowCommitted()) { return builder.buildRow(); } } Preconditions.checkState( builder == null, "End of stream marker encountered while merging a row."); Preconditions.checkState( lastResponseProcessed, "Should only exit merge loop with by returning a complete Row or hitting end of stream."); return null; }
Source:
<code>public void removeCache(String cacheName) { authzHelper.checkPermission(AuthorizationPermission.ADMIN); <START> if (cacheManagerAdmin != null) <END> cacheManagerAdmin.removeCache(cacheName); else { RemoveCacheCommand.removeCache(this, cacheName); } }</code><technical_language>I cacheManagerAdmin null</technical_language>

Target:
public void removeCache(String cacheName) { cacheManagerAdmin.removeCache(cacheName); }
Source:
<code>private static void ensureEntry(final String path, final RemoteConfigurationRegistryClient remoteClient) { if (!remoteClient.entryExists(path)) { remoteClient.createEntry(path); } else { List<RemoteConfigurationRegistryClient.EntryACL> entryACLs = remoteClient.getACL(path); for (RemoteConfigurationRegistryClient.EntryACL entryACL : entryACLs) { if ("world".equals(entryACL.getType()) && "anyone".equals(entryACL.getId())) { LOG.suspectWritableRemoteConfigurationEntry(path); if (remoteClient.isAuthenticationConfigured()) { LOG.correctingSuspectWritableRemoteConfigurationEntry(path); <START> if (remoteClient.authenticationType() <END> .equalsIgnoreCase("Kerberos") && !remoteClient .isBackwardsCompatible()) { remoteClient.setACL(path, Collections.singletonList(KERBEROS_KNOX_ALL)); } else { remoteClient.setACL(path, Collections .singletonList(AUTHENTICATED_USERS_ALL)); } } } } } }</code><technical_language>authenticationType() NULL (see LocalFileSystemRemoteConfigurationRegistryClientService implementation below) -> remoteClient.authenticationType().equalsIgnoreCase("Kerberos") throw a NPE</technical_language>

Target:
private static void ensureEntry(final String path, final RemoteConfigurationRegistryClient remoteClient) { if (!remoteClient.entryExists(path)) { remoteClient.createEntry(path); } else { List<RemoteConfigurationRegistryClient.EntryACL> entryACLs = remoteClient.getACL(path); for (RemoteConfigurationRegistryClient.EntryACL entryACL : entryACLs) { if ("world".equals(entryACL.getType()) && "anyone".equals(entryACL.getId())) { LOG.suspectWritableRemoteConfigurationEntry(path); if (remoteClient.isAuthenticationConfigured()) { LOG.correctingSuspectWritableRemoteConfigurationEntry(path); if(ZooKeeperClientService.AUTH_TYPE_KERBEROS.equalsIgnoreCase(remoteClient.authenticationType()) && !remoteClient.isBackwardsCompatible()) { remoteClient.setACL(path, Collections.singletonList(KERBEROS_KNOX_ALL)); } else { remoteClient.setACL(path, Collections .singletonList(AUTHENTICATED_USERS_ALL)); } } } } } }
Source:
<code>public static void main(String[] args) throws FileNotFoundException { System.out.println(); System.out.println(">>> Logistic regression model loaded from Spark through serialization over partitioned dataset usage example started."); try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Ignite grid started."); IgniteCache<Integer, Object[]> dataCache = TitanicUtils.readPassengers(ignite); IgniteBiFunction<Integer, Object[], Vector> featureExtractor = (k, v) -> { double[] data = new double[] {(double)v[0], (double)v[5], (double)v[6]}; data[0] = Double.isNaN(data[0]) ? 0 : data[0]; data[1] = Double.isNaN(data[1]) ? 0 : data[1]; data[2] = Double.isNaN(data[2]) ? 0 : data[2]; return VectorUtils.of(data); }; IgniteBiFunction<Integer, Object[], Double> lbExtractor = (k, v) -> (double)v[1]; LogisticRegressionModel mdl = (LogisticRegressionModel) SparkModelParser.parse( <START> new Path("examples/src/main/resources/models/spark/serialized/data" + <END> "/part-00000-7551081d-c0a8-4ed7-afe4-a464aabc7f80-c000.snappy.parquet"), SupportedSparkModels.LOG_REGRESSION ); System.out.println(">>> Logistic regression model: " + mdl); double accuracy = BinaryClassificationEvaluator.evaluate( dataCache, mdl, featureExtractor, lbExtractor, new Accuracy<>() ); System.out.println("\n>>> Accuracy " + accuracy); System.out.println("\n>>> Test Error " + (1 - accuracy)); } }</code><technical_language>I IgniteUtils.resolveIgnitePath. works TeamCity local run 100%, code</technical_language>

Target:
public static void main(String[] args) throws FileNotFoundException { System.out.println(); System.out.println(">>> Logistic regression model loaded from Spark through serialization over partitioned dataset usage example started."); try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Ignite grid started."); IgniteCache<Integer, Object[]> dataCache = TitanicUtils.readPassengers(ignite); IgniteBiFunction<Integer, Object[], Vector> featureExtractor = (k, v) -> { double[] data = new double[] {(double)v[0], (double)v[5], (double)v[6]}; data[0] = Double.isNaN(data[0]) ? 0 : data[0]; data[1] = Double.isNaN(data[1]) ? 0 : data[1]; data[2] = Double.isNaN(data[2]) ? 0 : data[2]; return VectorUtils.of(data); }; IgniteBiFunction<Integer, Object[], Double> lbExtractor = (k, v) -> (double)v[1]; LogisticRegressionModel mdl = (LogisticRegressionModel) SparkModelParser.parse( SPARK_LOG_REG_MDL_PATH, SupportedSparkModels.LOG_REGRESSION ); System.out.println(">>> Logistic regression model: " + mdl); double accuracy = BinaryClassificationEvaluator.evaluate( dataCache, mdl, featureExtractor, lbExtractor, new Accuracy<>() ); System.out.println("\n>>> Accuracy " + accuracy); System.out.println("\n>>> Test Error " + (1 - accuracy)); } }
Source:
<code>public <T extends Enum<?>> T getEnum(final T[] all, final String section, final String subsection, final String name, final T defaultValue) { String value = getString(section, subsection, name); if (value == null) return defaultValue; <START> if (defaultValue instanceof ConfigEnum) { <END> for (T t : all) { if (((ConfigEnum) t).matchConfigValue(value)) return t; } } String n = value.replace(' ', '_'); n = n.replace('-', '_'); T trueState = null; T falseState = null; for (T e : all) { if (StringUtils.equalsIgnoreCase(e.name(), n)) return e; else if (StringUtils.equalsIgnoreCase(e.name(), "TRUE")) trueState = e; else if (StringUtils.equalsIgnoreCase(e.name(), "FALSE")) falseState = e; } if (trueState != null && falseState != null) { try { return StringUtils.toBoolean(n) ? trueState : falseState; } catch (IllegalArgumentException err) { } } if (subsection != null) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().enumValueNotSupported3, section, subsection, name, value)); else throw new IllegalArgumentException( MessageFormat.format(JGitText.get().enumValueNotSupported2, section, name, value)); }</code><technical_language>t[0] acceptable. Ist defaultValue is null, t[0] be</technical_language>

Target:
public <T extends Enum<?>> T getEnum(final T[] all, final String section, final String subsection, final String name, final T defaultValue) { String value = getString(section, subsection, name); if (value == null) return defaultValue; if (all[0] instanceof ConfigEnum) { for (T t : all) { if (((ConfigEnum) t).matchConfigValue(value)) return t; } } String n = value.replace(' ', '_'); n = n.replace('-', '_'); T trueState = null; T falseState = null; for (T e : all) { if (StringUtils.equalsIgnoreCase(e.name(), n)) return e; else if (StringUtils.equalsIgnoreCase(e.name(), "TRUE")) trueState = e; else if (StringUtils.equalsIgnoreCase(e.name(), "FALSE")) falseState = e; } if (trueState != null && falseState != null) { try { return StringUtils.toBoolean(n) ? trueState : falseState; } catch (IllegalArgumentException err) { } } if (subsection != null) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().enumValueNotSupported3, section, subsection, name, value)); else throw new IllegalArgumentException( MessageFormat.format(JGitText.get().enumValueNotSupported2, section, name, value)); }
Source:
<code>public long getMaxWalArchiveSize() { <START> if (maxWalArchiveSize == UNLIMITED_WAL_ARCHIVE) <END> return UNLIMITED_WAL_ARCHIVE; return maxWalArchiveSize <= 0 ? DFLT_WAL_ARCHIVE_MAX_SIZE : maxWalArchiveSize; }</code><technical_language>field returned here, invariants checked in setter</technical_language>

Target:
public long getMaxWalArchiveSize() { return maxWalArchiveSize; }
Source:
<code>private List<DeviceIdentifier> installApplication(String applicationUUID, List<DeviceIdentifier> deviceList) throws ApplicationManagementException { List<DeviceIdentifier> failedDeviceList = new ArrayList<>(deviceList); List<org.wso2.carbon.device.mgt.common.DeviceIdentifier> androidDevices = new ArrayList<>(); List<org.wso2.carbon.device.mgt.common.DeviceIdentifier> iosDevices = new ArrayList<>(); for (DeviceIdentifier device : deviceList) { org.wso2.carbon.device.mgt.common.DeviceIdentifier deviceIdentifier = new org.wso2.carbon.device.mgt .common.DeviceIdentifier(device.getId(), device.getType()); try { DeviceManagementDAOFactory.openConnection(); if (DeviceManagementDAOFactory.getDeviceDAO().getDevice(deviceIdentifier).isEmpty()) { log.error("Device with ID: " + device.getId() + " not found to install the application."); } else { if (log.isDebugEnabled()) { log.debug("Prepare application install to : " + device.getId()); } <START> if (device.getType().equals(ANDROID)) { <END> androidDevices.add(deviceIdentifier); } else { iosDevices.add(deviceIdentifier); } DAOFactory.getSubscriptionDAO().addDeviceApplicationMapping(device.getId(), applicationUUID, false); failedDeviceList.remove(device); } } catch (DeviceManagementDAOException | SQLException e) { throw new ApplicationManagementException("Error locating device.", e); } finally { DeviceManagementDAOFactory.closeConnection(); } } return failedDeviceList; }</code><technical_language>Do need some device specific check here? app manager implementation generic, tied device type</technical_language>

Target:
private List<DeviceIdentifier> installApplication(String applicationUUID, List<DeviceIdentifier> deviceList) throws ApplicationManagementException { List<DeviceIdentifier> failedDeviceList = new ArrayList<>(deviceList); List<org.wso2.carbon.device.mgt.common.DeviceIdentifier> activeDeviceList = new ArrayList<>(); for (DeviceIdentifier device : deviceList) { org.wso2.carbon.device.mgt.common.DeviceIdentifier deviceIdentifier = new org.wso2.carbon.device.mgt .common.DeviceIdentifier(device.getId(), device.getType()); try { DeviceManagementDAOFactory.openConnection(); if (DeviceManagementDAOFactory.getDeviceDAO().getDevice(deviceIdentifier).isEmpty()) { log.error("Device with ID: " + device.getId() + " not found to install the application."); } else { if (log.isDebugEnabled()) { log.debug("Prepare application install to : " + device.getId()); } activeDeviceList.add(deviceIdentifier); DAOFactory.getSubscriptionDAO().addDeviceApplicationMapping(device.getId(), applicationUUID, false); failedDeviceList.remove(device); } } catch (DeviceManagementDAOException | SQLException e) { throw new ApplicationManagementException("Error locating device.", e); } finally { DeviceManagementDAOFactory.closeConnection(); } } return failedDeviceList; }
Source:
<code>private static void deleteLocalFormInstances(Long formIdToDelete) { DeleteInstancesTask dit = new DeleteInstancesTask(); <START> dit.setContentResolver( <END> Collect.getInstance().getApplication() .getContentResolver()); dit.execute(formIdToDelete); }</code><technical_language>do this in constructor in a separate setter</technical_language>

Target:
private static void deleteLocalFormInstances(Long formIdToDelete) { DeleteInstancesTask dit = new DeleteInstancesTask(Collect.getInstance().getApplication() .getContentResolver()); dit.execute(formIdToDelete); }
Source:
<code>public static void show(final CheckoutResult result, final Repository repository, final String target) { BranchResultDialog.target = target; if (result.getStatus() == CheckoutResult.Status.CONFLICTS) PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); new BranchResultDialog(shell, repository, result, target) .open(); } }); else if (result.getStatus() == CheckoutResult.Status.NONDELETED) { boolean show = false; List<String> pathList = result.getUndeletedList(); for (String path : pathList) if (new File(repository.getWorkTree(), path).exists()) { show = true; break; } if (!show) return; PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); new NonDeletedFilesDialog(shell, repository, result .getUndeletedList()).open(); } }); } else if (result.getStatus() == CheckoutResult.Status.OK) { <START> if (RepositoryUtil.isDetachedHead(repository)) { <END> showDetachedHeadWarning(); } } }</code><technical_language>Please braces <LINK_0></technical_language>

Target:
public static void show(final CheckoutResult result, final Repository repository, final String target) { BranchResultDialog.target = target; if (result.getStatus() == CheckoutResult.Status.CONFLICTS) PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); new BranchResultDialog(shell, repository, result, target) .open(); } }); else if (result.getStatus() == CheckoutResult.Status.NONDELETED) { boolean show = false; List<String> pathList = result.getUndeletedList(); for (String path : pathList) if (new File(repository.getWorkTree(), path).exists()) { show = true; break; } if (!show) return; PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); new NonDeletedFilesDialog(shell, repository, result .getUndeletedList()).open(); } }); } else if (result.getStatus() == CheckoutResult.Status.OK) { if (RepositoryUtil.isDetachedHead(repository)) showDetachedHeadWarning(); } }
Source:
<code>private void handleResubscription() { if (_zkClient == null || _zkClient.isClosed()) { return; } _zkClient.unsubscribeAll(); <START> ZkRoutingDataReader.subscribeRoutingDataChanges(_zkClient, this, this); <END> _routingDataListener.refreshRoutingData(_namespace); }</code><technical_language>a util class for this purpose</technical_language>

Target:
private void handleResubscription() { if (_zkClient == null || _zkClient.isClosed()) { return; } _zkClient.unsubscribeAll(); _zkClient.subscribeRoutingDataChanges(this, this); _routingDataListener.refreshRoutingData(_namespace); }
Source:
<code>protected Object getMdcContextObject() { Long stackId = getStackId(); <START> return stackService.getByIdWithListsInTransaction(stackId); <END> }</code><technical_language>please change this getById</technical_language>

Target:
protected Object getMdcContextObject() { return stackService.getStackById(getStackId()); }
Source:
<code>private void tryFulfillSlotRequestOrMakeAvailable(AllocatedSlot allocatedSlot) { Preconditions.checkState(!allocatedSlot.isUsed(), "Provided slot is still in use."); final PendingRequest pendingRequest = findMatchingPendingRequest(allocatedSlot); if (pendingRequest != null) { log.debug("Fulfilling pending slot request with slot [{}]", pendingRequest.getSlotRequestId(), allocatedSlot.getAllocationId()); final AllocationID allocationIdOfRequest = pendingRequests.getKeyBByKeyA(pendingRequest.getSlotRequestId()); removePendingRequest(pendingRequest.getSlotRequestId()); allocatedSlots.add(pendingRequest.getSlotRequestId(), allocatedSlot); pendingRequest.getAllocatedSlotFuture().complete(allocatedSlot); <START> if (allocationIdOfRequest != null) { <END> maybeRemapOrphanedAllocation(allocationIdOfRequest, allocatedSlot.getAllocationId()); } } else { log.debug("Adding slot to available slots", allocatedSlot.getAllocationId()); availableSlots.add(allocatedSlot, clock.relativeTimeMillis()); } }</code><technical_language>I ask pendingRequest.getAllocationId(). need query pendingRequests again</technical_language>

Target:
private void tryFulfillSlotRequestOrMakeAvailable(AllocatedSlot allocatedSlot) { Preconditions.checkState(!allocatedSlot.isUsed(), "Provided slot is still in use."); final PendingRequest pendingRequest = findMatchingPendingRequest(allocatedSlot); if (pendingRequest != null) { log.debug("Fulfilling pending slot request with slot [{}]", pendingRequest.getSlotRequestId(), allocatedSlot.getAllocationId()); removePendingRequest(pendingRequest.getSlotRequestId()); allocatedSlots.add(pendingRequest.getSlotRequestId(), allocatedSlot); pendingRequest.getAllocatedSlotFuture().complete(allocatedSlot); final Optional<AllocationID> allocationIdOfRequest = pendingRequest.getAllocationId(); if (allocationIdOfRequest.isPresent()) { maybeRemapOrphanedAllocation(allocationIdOfRequest.get(), allocatedSlot.getAllocationId()); } } else { log.debug("Adding slot to available slots", allocatedSlot.getAllocationId()); availableSlots.add(allocatedSlot, clock.relativeTimeMillis()); } }
Source:
<code>void uploadFile(final File localTempFile, final String remotePath) { withRetry(new DefaultRetry<Void>(String.format("SFTP upload file '%s'", remotePath)) { @Override public Void call() throws Exception { final FileObject remoteFile = newSftpFile(getSftpFileUri(remotePath)); <START> final OutputStream outputStream = openStream(remoteFile); <END> try (TimeoutCloser ignored = new TimeoutCloser(outputStream)) { appendFile(localTempFile, remoteFile, outputStream); return null; } finally { remoteFile.close(); } } }); }</code><technical_language>Minor: BufferedOutputStream is correct</technical_language>

Target:
void uploadFile(final File localTempFile, final String remotePath) { withRetry(new DefaultRetry<Void>(String.format("SFTP upload file '%s'", remotePath)) { @Override public Void call() throws Exception { final FileObject remoteFile = newSftpFile(getSftpFileUri(remotePath)); final BufferedOutputStream outputStream = openStream(remoteFile); try (TimeoutCloser ignored = new TimeoutCloser(outputStream)) { appendFile(localTempFile, remoteFile, outputStream); return null; } finally { remoteFile.close(); } } }); }
Source:
<code>public static String getResponseType(final ImmutableList<Ds3ResponseCode> responseCodes) { for (final Ds3ResponseCode responseCode : responseCodes) { final int rc = responseCode.getCode(); <START> if (rc >= 200 && rc < 300) { <END> for (final Ds3ResponseType responseType : responseCode.getDs3ResponseTypes()) { if (ConverterUtil.hasContent(responseType.getType()) && !responseType.getType().contentEquals("null")) { return StructHelper.getResponseTypeName(responseType.getType()); } else if (ConverterUtil.hasContent(responseType.getComponentType()) && !responseType.getComponentType().contentEquals("null")) { return StructHelper.getResponseTypeName(responseType.getComponentType()); } } } } return ""; }</code><technical_language>save nesting if do: if (rc < 200 || rc >=300) continue</technical_language>

Target:
public static String getResponseType(final ImmutableList<Ds3ResponseCode> responseCodes) { for (final Ds3ResponseCode responseCode : responseCodes) { final int rc = responseCode.getCode(); if (rc < 200 || rc >= 300) continue; for (final Ds3ResponseType responseType : responseCode.getDs3ResponseTypes()) { if (ConverterUtil.hasContent(responseType.getType()) && !responseType.getType().contentEquals("null")) { return StructHelper.getResponseTypeName(responseType.getType()); } if (ConverterUtil.hasContent(responseType.getComponentType()) && !responseType.getComponentType().contentEquals("null")) { return StructHelper.getResponseTypeName(responseType.getComponentType()); } } } return ""; }
Source:
<code>private void loadConnections() { <START> progressWheel.spin(); <END> countDown(); new FirebaseCollection<>(connectionUrl(), Connection.class) .query(getString(R.string.connectionStatus), 2, new DataCallback<List<Connection>>() { @Override public void onSuccess(List<Connection> data) { stopTimer(); if (!data.isEmpty()) { for (Connection connection : data) { if (!connection.getSender().equals(user.getId()) && connection.getConnectionStatus() == ConnectionStatus.PENDING.getStatus()) { addConnection(connection); } } retry.setVisibility(View.GONE); } else { displayMessage(getString(R.string.no_request_found)); retry.setVisibility(View.VISIBLE); } } @Override public void onError(String errorMessage) { displayMessage(errorMessage); stopTimer(); } }); }</code><technical_language>NITPICK: maintain message display method in contact fragment</technical_language>

Target:
private void loadConnections() { new FirebaseCollection<>(connectionUrl(), Connection.class) .query(getString(R.string.connectionStatus), 2, new DataCallback<List<Connection>>() { @Override public void onSuccess(List<Connection> data) { int size = data.size(); if (size > 0) { for (Connection connection : data) { if (isConnectionPending(connection)) { addConnection(connection); } } if (connections.size() > 0) { noContacts.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); } } else { displayMessage(getString(R.string.no_request_found)); noContacts.setVisibility(View.VISIBLE); recyclerView.setVisibility(View.VISIBLE); } } @Override public void onError(String errorMessage) { displayMessage(errorMessage); } }); }
Source:
<code>public void updateTailSegment(long newTailSegment) { if (tailSegment.get() >= newTailSegment) { <START> log.debug("New tail segment equals to the old one: {}. Ignore", newTailSegment); <END> return; } dataStore.put(newTailSegment, TAIL_SEGMENT_RECORD); tailSegment.set(newTailSegment); }</code><technical_language>correct log message, equal</technical_language>

Target:
public void updateTailSegment(long newTailSegment) { if (tailSegment.get() >= newTailSegment) { log.debug("New tail segment less than or equals to the old one: {}. Ignore", newTailSegment); return; } log.trace("Update tail segment to: {}", newTailSegment); dataStore.put(TAIL_SEGMENT_RECORD, newTailSegment); tailSegment.set(newTailSegment); }
Source:
<code>private String calculateHref(Object tab) { String href = "#"; if (tab instanceof AbstractTab) { href = ((AbstractTab)tab).getTargetHistoryToken(); } <START> else if (tab instanceof GroupedTabData) { <END> href = ((GroupedTabData)tab).getHistoryToken(); } return href; }</code><technical_language>I 2 calculateHrefs, takes Tab takes GroupedTabData. convert GroupedTabData a Tab somehow. Passing in Object wrong</technical_language>

Target:
private String calculateHref(Object tab) { String href = "#"; if (tab instanceof AbstractTab) { href = ((AbstractTab)tab).getTargetHistoryToken(); } return href; }
Source:
<code>protected AtomicHashMap<K, V> getDeltaMapForWrite() { CacheEntry lookedUpEntry = lookupEntryFromCurrentTransaction(); boolean lockedAndCopied = lookedUpEntry != null && lookedUpEntry.isChanged() && toMap(lookedUpEntry.getValue()).copied; if (lockedAndCopied) { return getDeltaMapForRead(); } else { boolean suppressLocks = flagContainer != null && flagContainer.hasFlag(Flag.SKIP_LOCKING); if (!suppressLocks && flagContainer != null) flagContainer.setFlags(Flag.FORCE_WRITE_LOCK); if (trace) { if (suppressLocks) log.trace("Skip locking flag used. Skipping locking."); else log.trace("Forcing write lock even for reads"); } if (suppressLocks) flagContainer.setFlags(Flag.SKIP_LOCKING); AtomicHashMap<K, V> map = getDeltaMapForRead(); AtomicHashMap<K, V> copy = map == null ? new AtomicHashMap<K, V>(true) : map.copy(); copy.initForWriting(); <START> cache.withFlags(Flag.SKIP_REMOTE_LOOKUP, Flag.SKIP_CACHE_LOAD).put(deltaMapKey, copy); <END> return copy; } }</code><technical_language>for this top efficiency execute cache.withFlags(Flag.SKIP_REMOTE_LOOKUP, Flag.SKIP_CACHE_LOAD) Proxy initialization store return in a final field for reause. Flag in Lucene directory</technical_language>

Target:
protected AtomicHashMap<K, V> getDeltaMapForWrite() { CacheEntry lookedUpEntry = lookupEntryFromCurrentTransaction(); boolean lockedAndCopied = lookedUpEntry != null && lookedUpEntry.isChanged() && toMap(lookedUpEntry.getValue()).copied; if (lockedAndCopied) { return getDeltaMapForRead(); } else { boolean suppressLocks = flagContainer != null && flagContainer.hasFlag(Flag.SKIP_LOCKING); if (!suppressLocks && flagContainer != null) flagContainer.setFlags(Flag.FORCE_WRITE_LOCK); if (trace) { if (suppressLocks) log.trace("Skip locking flag used. Skipping locking."); else log.trace("Forcing write lock even for reads"); } if (suppressLocks) flagContainer.setFlags(Flag.SKIP_LOCKING); AtomicHashMap<K, V> map = getDeltaMapForRead(); AtomicHashMap<K, V> copy = map == null ? new AtomicHashMap<K, V>(true) : map.copy(); copy.initForWriting(); cacheForWriting.put(deltaMapKey, copy); return copy; } }
Source:
<code>public void run() { long duration = System.currentTimeMillis() - timestamp; if (duration > highWatermark) { <START> eventHandler.onHighWatermark(duration); <END> } process(); }</code><technical_language>other changes, I if handler is needed need a disable it. If keeping it, I if onReceived(Map<String, Object>) onProcess(Map<String, Object>), _received_timestamp highWatermark logic move handler</technical_language>

Target:
public void run() { eventHandler.onRequestStarted(ephemeralProperties); try { TTransport input = new TMemoryInputTransport(frameBytes, 4, frameBytes.length); TMemoryOutputBuffer output = new TMemoryOutputBuffer(NATS_MAX_MESSAGE_SIZE); try { FProtocol inputProto = inputProtoFactory.getProtocol(input); inputProto.setEphemeralProperties(ephemeralProperties); FProtocol outputProto = outputProtoFactory.getProtocol(output); processor.process(inputProto, outputProto); } catch (TException e) { LOGGER.error("error processing request", e); return; } catch (RuntimeException e) { try { conn.publish(reply, output.getWriteBytes()); conn.flush(Duration.ofSeconds(60)); } catch (Exception ignored) { } return; } if (!output.hasWriteData()) { return; } conn.publish(reply, output.getWriteBytes()); } finally { eventHandler.onRequestEnded(ephemeralProperties); } }
Source:
<code>@Test public void replacementCharacter() throws Exception { SSLSession session = session("" + "-----BEGIN CERTIFICATE-----\n" + "MIIBSDCB86ADAgECAhRLR4TGgXBegg0np90FZ1KPeWpDtjANBgkqhkiG9w0BAQsF\n" + "ADASMRAwDgYDVQQDDAdmb28uY29tMCAXDTIwMTAyOTA2NTkwNVoYDzIxMjAxMDA1\n" + "MDY1OTA1WjASMRAwDgYDVQQDDAdmb28uY29tMFwwDQYJKoZIhvcNAQEBBQADSwAw\n" + "SAJBALQcTVW9aW++ClIV9/9iSzijsPvQGEu/FQOjIycSrSIheZyZmR8bluSNBq0C\n" + "9fpalRKZb0S2tlCTi5WoX8d3K30CAwEAAaMfMB0wGwYDVR0RBBQwEoIH4oShLmNv\n" + "bYIH4oSqLmNvbTANBgkqhkiG9w0BAQsFAANBAA1+/eDvSUGv78iEjNW+1w3OPAwt\n" + "Ij1qLQ/YI8OogZPMk7YY46/ydWWp7UpD47zy/vKmm4pOc8Glc8MoDD6UADs=\n" + "-----END CERTIFICATE-----\n"); <START> assertThat(verifier.verify("���.com", session)).isFalse(); <END> }</code><technical_language>is this supposed replacement chars</technical_language>

Target:
@Test public void replacementCharacter() throws Exception { SSLSession session = session("" + "-----BEGIN CERTIFICATE-----\n" + "MIIBSDCB86ADAgECAhRLR4TGgXBegg0np90FZ1KPeWpDtjANBgkqhkiG9w0BAQsF\n" + "ADASMRAwDgYDVQQDDAdmb28uY29tMCAXDTIwMTAyOTA2NTkwNVoYDzIxMjAxMDA1\n" + "MDY1OTA1WjASMRAwDgYDVQQDDAdmb28uY29tMFwwDQYJKoZIhvcNAQEBBQADSwAw\n" + "SAJBALQcTVW9aW++ClIV9/9iSzijsPvQGEu/FQOjIycSrSIheZyZmR8bluSNBq0C\n" + "9fpalRKZb0S2tlCTi5WoX8d3K30CAwEAAaMfMB0wGwYDVR0RBBQwEoIH4oShLmNv\n" + "bYIH4oSqLmNvbTANBgkqhkiG9w0BAQsFAANBAA1+/eDvSUGv78iEjNW+1w3OPAwt\n" + "Ij1qLQ/YI8OogZPMk7YY46/ydWWp7UpD47zy/vKmm4pOc8Glc8MoDD6UADs=\n" + "-----END CERTIFICATE-----\n"); assertThat(verifier.verify("���.com", session)).isFalse(); assertThat(verifier.verify("℡.com", session)).isFalse(); }
Source:
<code>public void testFailingBulkAction() throws Exception { String result = async.newRequest(BulkRunAction.ID) .set("action", AutomationBulkAction.ACTION_NAME) .set("query", "SELECT * FROM Folder") .set("bucketSize", "10") .set("batchSize", "5") <START> .set("parameters", MAPPER.writeValueAsString("{}")) <END> .executeReturningExceptionEntity(SC_INTERNAL_SERVER_ERROR); assertTrue( result.startsWith("Unknown operation id null in command: org.nuxeo.ecm.core.bulk.message.BulkCommand")); }</code><technical_language>put "{}" calling MAPPER? writeValueAsString is serialize object JSON (or other), giving a String. thought is: writing a string string return input string. If case, final in test understand fail want control/catch</technical_language>

Target:
public void testFailingBulkAction() throws Exception { String result = async.newRequest(BulkRunAction.ID) .set("action", AutomationBulkAction.ACTION_NAME) .set("query", "SELECT * FROM Folder") .set("bucketSize", "10") .set("batchSize", "5") .set("parameters", "{}") .executeReturningExceptionEntity(SC_INTERNAL_SERVER_ERROR); assertTrue( result.startsWith("Unknown operation id null in command: org.nuxeo.ecm.core.bulk.message.BulkCommand")); }
Source:
<code><START> private static void deleteSupplementaryFile(String selection) { <END> java.util.List<IResource> resourceToDelete = new ArrayList<>(); java.util.List<String> ids = XmlUtils.getIdsFromFile(selection); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(0); for (IProject project : projects) { TmfProjectElement pElement = TmfProjectRegistry.getProject(project); if (pElement != null) { TmfTraceFolder tracesFolder = pElement.getTracesFolder(); for (TmfTraceElement tElement : tracesFolder.getTraces()) { boolean closeEditor = false; for (IResource resource : tElement.getSupplementaryResources()) { for (String id : ids) { if (resource.getName().startsWith(id)) { resourceToDelete.add(resource); closeEditor = true; } } } if (closeEditor) { tElement.closeEditors(); } } } } for (IResource resource : resourceToDelete) { try { resource.delete(false, null); } catch (CoreException e) { Activator.logError(Messages.ManageXMLAnalysisDialog_delete_file_error + resource.getName()); } } }</code><technical_language>right</technical_language>

Target:
private static void deleteSupplementaryFile(String selection) { java.util.List<IResource> resourceToDelete = new ArrayList<>(); java.util.List<String> ids = XmlUtils.getAnalysisIdsFromFile(selection + XmlUtils.XML_EXTENSION); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(0); for (IProject project : projects) { TmfProjectElement pElement = TmfProjectRegistry.getProject(project); if (pElement != null) { TmfTraceFolder tracesFolder = pElement.getTracesFolder(); for (TmfTraceElement tElement : tracesFolder.getTraces()) { boolean closeEditor = false; for (IResource resource : tElement.getSupplementaryResources()) { for (String id : ids) { if (resource.getName().startsWith(id)) { resourceToDelete.add(resource); closeEditor = true; } } } if (closeEditor) { tElement.closeEditors(); } } } } for (IResource resource : resourceToDelete) { try { resource.delete(false, null); } catch (CoreException e) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_delete_file_error, resource.getName())); } } }
Source:
<code>private static BingTile[] getTilesInBetween(BingTile leftUpperTile, BingTile rightLowerTile, int zoomLevel) { checkArgument(leftUpperTile.getZoomLevel() == rightLowerTile.getZoomLevel()); checkArgument(leftUpperTile.getZoomLevel() > zoomLevel); int divisor = 1 << (leftUpperTile.getZoomLevel() - zoomLevel); <START> int minX = (int) floor(leftUpperTile.getX() / divisor); <END> int maxX = (int) floor(rightLowerTile.getX() / divisor); int minY = (int) floor(leftUpperTile.getY() / divisor); int maxY = (int) floor(rightLowerTile.getY() / divisor); BingTile[] tiles = new BingTile[(maxX - minX + 1) * (maxY - minY + 1)]; int index = 0; for (int x = minX; x <= maxX; x++) { for (int y = minY; y <= maxY; y++) { tiles[index] = BingTile.fromCoordinates(x, y, OPTIMIZED_TILING_MIN_ZOOM_LEVEL); index++; } } return tiles; }</code><technical_language>mix new logic changes existing code</technical_language>

Target:
private static BingTile[] getTilesInBetween(BingTile leftUpperTile, BingTile rightLowerTile, int zoomLevel) { checkArgument(leftUpperTile.getZoomLevel() == rightLowerTile.getZoomLevel()); checkArgument(leftUpperTile.getZoomLevel() > zoomLevel); int divisor = 1 << (leftUpperTile.getZoomLevel() - zoomLevel); int minX = (int) Math.floor(leftUpperTile.getX() / divisor); int maxX = (int) Math.floor(rightLowerTile.getX() / divisor); int minY = (int) Math.floor(leftUpperTile.getY() / divisor); int maxY = (int) Math.floor(rightLowerTile.getY() / divisor); BingTile[] tiles = new BingTile[(maxX - minX + 1) * (maxY - minY + 1)]; int index = 0; for (int x = minX; x <= maxX; x++) { for (int y = minY; y <= maxY; y++) { tiles[index] = BingTile.fromCoordinates(x, y, OPTIMIZED_TILING_MIN_ZOOM_LEVEL); index++; } } return tiles; }
Source:
<code>public static @Nullable String transform(String type, String function, String value) { Logger logger = LoggerFactory.getLogger(Transformation.class); String result; try { result = trans(type, function, value); } catch (TransformationException e) { <START> logger.error("Error executing the transformation '{}': {}", type, e.getMessage()); <END> result = value; } return result; }</code><technical_language>log error, a warning (if service is found). declare this function expects failures treats internally already, I claim DEBUG, INFO WARN level - prefer DEBUG</technical_language>

Target:
public static @Nullable String transform(String type, String function, String value) { Logger logger = LoggerFactory.getLogger(Transformation.class); String result; try { result = trans(type, function, value); } catch (TransformationException e) { logger.debug("Error executing the transformation '{}': {}", type, e.getMessage()); result = value; } return result; }
Source:
<code>public void clearOkCacheIfNeeded(@Nullable APIStatus status, boolean forceClear) { long lastCacheClear = mPrefs.getLong(STATUS_CACHE_CLEAR_KEY, Long.MIN_VALUE); if (status != null && mOkHttpCache != null && (forceClear || lastCacheClear < status.getLastOkHttpCacheClear())) { Schedulers.io().createWorker().schedule(() -> { Log.i(Constants.LOG_TAG, "Clearing OkHttp cache"); try { mOkHttpCache.evictAll(); mPrefs.edit() <START> .putLong(STATUS_CACHE_CLEAR_KEY, System.currentTimeMillis() / 1000l) <END> .apply(); } catch (IOException e) { e.printStackTrace(); } }); } }</code><technical_language>I read number "10001" glance. a capital L avoid 1/l ambiguity in monospace font</technical_language>

Target:
public void clearOkCacheIfNeeded(@Nullable APIStatus status, boolean forceClear) { long lastCacheClear = mPrefs.getLong(STATUS_CACHE_CLEAR_KEY, Long.MIN_VALUE); if (status != null && mOkHttpCache != null && (forceClear || lastCacheClear < status.getLastOkHttpCacheClear())) { Schedulers.io().createWorker().schedule(() -> { Log.i(Constants.LOG_TAG, "Clearing OkHttp cache"); try { mOkHttpCache.evictAll(); mPrefs.edit() .putLong(STATUS_CACHE_CLEAR_KEY, System.currentTimeMillis() / 1000L) .apply(); } catch (IOException e) { e.printStackTrace(); } }); } }
Source:
<code>private Map<PartitionKeyRange, String> getRangeQueryMap( Map<PartitionKeyRange, List<Pair<String, PartitionKey>>> partitionRangeItemKeyMap, PartitionKeyDefinition partitionKeyDefinition) { String partitionKeyPathString = partitionKeyDefinition.getPaths().get(0); String partitionKeyPath = (new StringBuilder(partitionKeyPathString)).deleteCharAt(0).toString(); Map<PartitionKeyRange, String> rangeQueryMap = new HashMap<>(); for (PartitionKeyRange range : partitionRangeItemKeyMap.keySet()) { StringBuilder queryStringBuilder = new StringBuilder(); queryStringBuilder.append("select * from c where "); List<Pair<String, PartitionKey>> pairsList = partitionRangeItemKeyMap.get(range); for (Pair p : pairsList) { <START> queryStringBuilder.append("(c.id = \""); <END> queryStringBuilder.append(p.getLeft()); queryStringBuilder.append("\" and "); queryStringBuilder.append(" c."); queryStringBuilder.append(partitionKeyPath); queryStringBuilder.append(("=\"")); PartitionKey pkey = (PartitionKey) p.getRight(); String val = pkey.toString(); StringBuilder stringBuilder = new StringBuilder(val); stringBuilder.delete(0, 2); stringBuilder.setLength(stringBuilder.length()-2); queryStringBuilder.append(stringBuilder.toString()); queryStringBuilder.append("\") "); queryStringBuilder.append(" or "); } queryStringBuilder.delete((queryStringBuilder.length() -1) - 4, queryStringBuilder.length()-1); rangeQueryMap.put(range, queryStringBuilder.toString()); } return rangeQueryMap; }</code><technical_language>create template of query StringBuilder, SqlQuerySpec SqlParameter for passing id pk values? worry serializing query is safe sql query injection attack</technical_language>

Target:
private Map<PartitionKeyRange, SqlQuerySpec> getRangeQueryMap( Map<PartitionKeyRange, List<Pair<String, PartitionKey>>> partitionRangeItemKeyMap, PartitionKeyDefinition partitionKeyDefinition) { Map<PartitionKeyRange, SqlQuerySpec> rangeQueryMap = new HashMap<>(); String partitionKeySelector = createPkSelector(partitionKeyDefinition); for(Map.Entry<PartitionKeyRange, List<Pair<String, PartitionKey>>> entry: partitionRangeItemKeyMap.entrySet()) { SqlQuerySpec sqlQuerySpec; if (partitionKeySelector.equals("[\"id\"]")) { sqlQuerySpec = createReadManyQuerySpecPartitionKeyIdSame(entry.getValue(), partitionKeySelector); } else { sqlQuerySpec = createReadManyQuerySpec(entry.getValue(), partitionKeySelector); } rangeQueryMap.put(entry.getKey(), sqlQuerySpec); } return rangeQueryMap; }
Source:
<code>private void handleUnmanagedCommands() { List<AsyncTask> asyncTasks = asyncTaskDao.getAll(); Set<Guid> asyncTaskManagerManagedCommands = asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getRootCommandId()).collect(Collectors.toSet()); asyncTaskManagerManagedCommands.addAll(asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getCommandId()).collect(Collectors.toSet())); getCommands(false).stream() .filter(x -> x.getCommandStatus() == CommandStatus.ACTIVE) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) <START> .forEach(x -> retrieveCommand(x.getId()).reacquireLocks()); <END> ENDED_WITH_FAILURE. getCommands(false).stream() .filter(x -> !x.isCallbackEnabled()) .filter(x -> x.getCommandStatus() == CommandStatus.ACTIVE) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> commandsCache.updateCommandStatus(x.getId(), CommandStatus.ENDED_WITH_FAILURE)); }</code><technical_language>hi, notes - 1. locks for commands in status ENDED_SUCCESFULLY/ENDED_WITH_FAILURE/NOT_STARTED/UNKNOWN (so basically - for commands execution, i add boolean member method enum for checking maintainable new enum values added). 2.we filter out commands managed ATM/COCO - commands status is updated ENDED_WITH_FAILURE in line 98. this code needs update done in line 98</technical_language>

Target:
private void handleUnmanagedCommands() { List<AsyncTask> asyncTasks = asyncTaskDao.getAll(); Set<Guid> asyncTaskManagerManagedCommands = asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getRootCommandId()).collect(Collectors.toSet()); asyncTaskManagerManagedCommands.addAll(asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getCommandId()).collect(Collectors.toSet())); ENDED_WITH_FAILURE. getCommands(false).stream() .filter(x -> !x.isCallbackEnabled()) .filter(x -> x.getCommandStatus() == CommandStatus.ACTIVE) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> commandsCache.updateCommandStatus(x.getId(), CommandStatus.ENDED_WITH_FAILURE)); getCommands(false).stream() .filter(x -> x.getCommandStatus().isReacquireLocksOnRestart()) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> retrieveCommand(x.getId()).reacquireLocks()); }
Source:
<code>private boolean areProgramsFilterClean(ArtifactReadable webProgram) throws OseeCoreException { List<String> filterData = webProgram.getAttributeValues(CoreAttributeTypes.Description); for (String att : filterData) { <START> if (att.equals("Apply_Filter")) { <END> return false; } } return true; }</code><technical_language>Apply_Filter a constant</technical_language>

Target:
private boolean areProgramsFilterClean(ArtifactReadable webProgram) throws OseeCoreException { List<String> filterData = webProgram.getAttributeValues(CoreAttributeTypes.Description); for (String att : filterData) { if (att.equals(FILTER_KEYWORD)) { return false; } } return true; }
Source:
<code>protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) { xml.optAttribute("queryid", queryId); xml.optBooleanAttribute("complete", complete); xml.optBooleanAttribute("stable", stable); if (rsmSet == null) { <START> xml.closeEmptyElement(); <END> } else { xml.rightAngleBracket(); xml.element(rsmSet); } return xml; }</code><technical_language>This setEmptyElement(). reason this caused issues is Smack puts MamFinIQ wire</technical_language>

Target:
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) { xml.optAttribute("queryid", queryId); xml.optBooleanAttribute("complete", complete); xml.optBooleanAttribute("stable", stable); if (rsmSet == null) { xml.setEmptyElement(); } else { xml.rightAngleBracket(); xml.element(rsmSet); } return xml; }
Source:
<code>public final Message<?> receive(long timeout) { ChannelInterceptorList interceptorList = getInterceptors(); Deque<ChannelInterceptor> interceptorStack = null; boolean counted = false; try { if (interceptorList.getInterceptors().size() > 0) { interceptorStack = new ArrayDeque<ChannelInterceptor>(); if (!interceptorList.preReceive(this, interceptorStack)) { return null; } } Message<?> message = this.doReceive(timeout); if (isCountsEnabled()) { getMetrics().afterReceive(); <START> } <END> message = interceptorList.postReceive(message, this); if (interceptorStack != null) { interceptorList.afterReceiveCompletion(message, this, null, interceptorStack); } return message; } catch (RuntimeException e) { if (isCountsEnabled() && !counted) { getMetrics().afterError(); } if (interceptorStack != null) { interceptorList.afterReceiveCompletion(null, this, e, interceptorStack); } throw e; } }</code><technical_language>Missed counted = true; in PollableAmqpChannel</technical_language>

Target:
public final Message<?> receive(long timeout) { ChannelInterceptorList interceptorList = getInterceptors(); Deque<ChannelInterceptor> interceptorStack = null; boolean counted = false; try { if (interceptorList.getInterceptors().size() > 0) { interceptorStack = new ArrayDeque<ChannelInterceptor>(); if (!interceptorList.preReceive(this, interceptorStack)) { return null; } } Message<?> message = this.doReceive(timeout); if (isCountsEnabled()) { getMetrics().afterReceive(); counted = true; } message = interceptorList.postReceive(message, this); if (interceptorStack != null) { interceptorList.afterReceiveCompletion(message, this, null, interceptorStack); } return message; } catch (RuntimeException e) { if (isCountsEnabled() && !counted) { getMetrics().afterError(); } if (interceptorStack != null) { interceptorList.afterReceiveCompletion(null, this, e, interceptorStack); } throw e; } }