auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static TreeView getDependencyTree(TextAnnotation input, String parseViewName, String dependencyViewName) { CollinsHeadDependencyParser depParser = new CollinsHeadDependencyParser(false); TreeView parseTreeView = (TreeView) input.getView(parseViewName); TreeView depTreeView = new TreeView(dependencyViewName, viewGenerator, input, 1d); int size = 0; for (int i = 0; i < input.getNumberOfSentences(); i++) { if (parseTreeView.getTree(i) != null) { Constituent parseTreeRoot = parseTreeView.getRootConstituent(i); Tree<Pair<String, Integer>> labeledDependencyTree = depParser.getLabeledDependencyTree(parseTreeRoot); try { depTreeView.setDependencyTree(i, labeledDependencyTree); } catch (IllegalStateException e) { <START> logger.info(parseTreeView.toString()); <END> logger.info("Unlabeled dependency tree (for debugging): "); logger.info(depParser.getDependencyTree(parseTreeRoot).toString()); throw e; } size += input.getSentence(i).size(); int nConstituents = depTreeView.getNumberOfConstituents(); if (nConstituents != size) { logger.error("{} nodes in dependency tree, " + "{} tokens in text so far", nConstituents, size); Set<Integer> set = new LinkedHashSet<>(); for (int tokenId = 0; tokenId < size; tokenId++) { set.add(tokenId); } for (Constituent c : depTreeView.getConstituents()) { set.remove(c.getStartSpan()); } StringBuilder sb = new StringBuilder(); for (int tokenId : set) { sb.append(input.getToken(tokenId)).append(" "); } logger.error("Dependency tree does not cover tokens: {}", sb.toString()); } } } return depTreeView; }</code><technical_language>exception, STDERR</technical_language>

Target:
public static TreeView getDependencyTree(TextAnnotation input, String parseViewName, String dependencyViewName) { CollinsHeadDependencyParser depParser = new CollinsHeadDependencyParser(false); TreeView parseTreeView = (TreeView) input.getView(parseViewName); TreeView depTreeView = new TreeView(dependencyViewName, viewGenerator, input, 1d); int size = 0; for (int i = 0; i < input.getNumberOfSentences(); i++) { if (parseTreeView.getTree(i) != null) { Constituent parseTreeRoot = parseTreeView.getRootConstituent(i); Tree<Pair<String, Integer>> labeledDependencyTree = depParser.getLabeledDependencyTree(parseTreeRoot); try { depTreeView.setDependencyTree(i, labeledDependencyTree); } catch (IllegalStateException e) { System.err.println(parseTreeView); System.err.println("Unlabeled dependency tree (for debugging): "); System.err.println(depParser.getDependencyTree(parseTreeRoot)); throw e; } size += input.getSentence(i).size(); int nConstituents = depTreeView.getNumberOfConstituents(); if (nConstituents != size) { logger.error("{} nodes in dependency tree, " + "{} tokens in text so far", nConstituents, size); Set<Integer> set = new LinkedHashSet<>(); for (int tokenId = 0; tokenId < size; tokenId++) { set.add(tokenId); } for (Constituent c : depTreeView.getConstituents()) { set.remove(c.getStartSpan()); } StringBuilder sb = new StringBuilder(); for (int tokenId : set) { sb.append(input.getToken(tokenId)).append(" "); } logger.error("Dependency tree does not cover tokens: {}", sb.toString()); } } } return depTreeView; }
Source:
<code>public void connectionChanged(IConnection connection, String property, Object oldValue, Object newValue) { if(connection.equals(ConnectionPropertySource.this.connection) && "extendedProperties".equals(property)) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { PropertySheet sh = null; try { sh = (PropertySheet)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.eclipse.ui.views.PropertySheet"); <START> } catch (NullPointerException exc) { <END> } if(sh == null) return; IPage page = sh.getCurrentPage(); if(page instanceof TabbedPropertySheetPage) { TabbedPropertySheetPage p = (TabbedPropertySheetPage)page; if(p == null || p.getControl() == null || p.getControl().isDisposed()) return; p.refresh(); } else if(page instanceof PropertySheetPage) { PropertySheetPage p = (PropertySheetPage)page; if(p == null || p.getControl() == null || p.getControl().isDisposed()) return; p.refresh(); } } }); } }</code><technical_language>This lookup for property sheet a great addition OpenShiftUIUtils#showPropertySheet, centralizing view id</technical_language>

Target:
public void connectionChanged(IConnection connection, String property, Object oldValue, Object newValue) { if(connection.equals(ConnectionPropertySource.this.connection) && IOpenShiftConnection.PROPERTY_EXTENDED_PROPERTIES.equals(property)) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { PropertySheet sh = OpenShiftUIUtils.getPropertySheet(); if(sh != null) { OpenShiftUIUtils.refreshPropertySheetPage(sh); } } }); } }
Source:
<code>private void checkIfPatientWasCreatedProperly() { Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, String.format("%staskCreated", MOTECH_ID)); <START> assertEquals(createdPatient.getUuid(), patient.getPerson().getPreferredAddress().getAddress2()); <END> assertEquals(createdPatient.getPerson().getBirthdate().toString(), patient.getPerson().getPreferredAddress().getAddress1()); assertEquals(String.format("%staskCreated", MOTECH_ID), patient.getMotechId()); assertEquals(createdPatient.getPerson().getGender(), patient.getPerson().getGender()); }</code><technical_language>noticed some values checked, for example patient.display here, is reason for ? I verify values</technical_language>

Target:
private void checkIfPatientWasCreatedProperly() { Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, String.format("%staskCreated", MOTECH_ID)); assertEquals(createdPatient.getUuid(), patient.getPerson().getPreferredAddress().getAddress2()); assertEquals(createdPatient.getPerson().getBirthdate().toString(), patient.getPerson().getPreferredAddress().getAddress1()); assertEquals(String.format("%staskCreated", MOTECH_ID), patient.getMotechId()); assertEquals(createdPatient.getPerson().getGender(), patient.getPerson().getGender()); Person.Name actualName = patient.getPerson().getPreferredName(); assertEquals(createdPatient.getPerson().getDisplay(), actualName.getFamilyName()); assertEquals(createdPatient.getPerson().getDisplay(), actualName.getGivenName()); }
Source:
<code>private String getXMI_ID(final EObject eobject) { if (eobject.eResource() instanceof XMIResource) { return ((XMIResource) eobject.eResource()).getID(eobject); } <START> ; <END> return null; }</code><technical_language>Useless</technical_language>

Target:
private String getXMI_ID(final EObject eobject) { if (eobject.eResource() instanceof XMIResource) { return ((XMIResource) eobject.eResource()).getID(eobject); } return null; }
Source:
<code>public List<GenericArtifact> parseArtifacts(String messagePayload) { if (!StringUtils.isNotBlank(messagePayload)) { <START> log.warn("Attempted to parse artifacts from empty message."); <END> return Collections.emptyList(); } ObjectMapper mapper = new ObjectMapper(); return readArtifactList(mapper, jinjaTransform(mapper, messagePayload)); }</code><technical_language>this need a warning? acceptable of triggers</technical_language>

Target:
public List<GenericArtifact> parseArtifacts(String messagePayload) { if (!StringUtils.isNotBlank(messagePayload)) { return Collections.emptyList(); } ObjectMapper mapper = new ObjectMapper(); return readArtifactList(mapper, jinjaTransform(mapper, messagePayload)); }
Source:
<code>protected void addInPeriodListeners() { addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_PERIOD, "Running", Boolean.TRUE, periodStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_PERIOD, "Running", Boolean.FALSE, periodEndListener)); <START> addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", false, jamEndListener)); <END> addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.TRUE, jamStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.TRUE, timeoutStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.FALSE, timeoutEndListener)); }</code><technical_language>Boolean.FALSE for consistency</technical_language>

Target:
protected void addInPeriodListeners() { addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_PERIOD, "Running", Boolean.TRUE, periodStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_PERIOD, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.FALSE, jamEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.TRUE, jamStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.TRUE, timeoutStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.FALSE, timeoutEndListener)); }
Source:
<code>public ClipboardAction(final String name, final Transferable contents) { super(name, ImageProvider.get("copy", ImageSizes.SMALLICON)); this.contents = contents; popup = new JPopupMenu(); <START> JLabel label = new JLabel(I18n.tr("Copied to clipboard…")); <END> label.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); popup.add(label); popup.setBackground(new Color(0f, 0f, 0f, .5f)); label.setForeground(Color.BLACK); }</code><technical_language>need add a new msgid of translation resources, deprecated add new one, translators recognizing a change. <LINK_0></technical_language>

Target:
public ClipboardAction(final String name, final Transferable contents) { super(name, ImageProvider.get("copy", ImageSizes.SMALLICON)); this.contents = contents; popup = new JPopupMenu(); JLabel label = new JLabel(I18n.tr("Copied to clipboard …")); label.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); popup.add(label); popup.setBackground(new Color(0f, 0f, 0f, .5f)); label.setForeground(Color.WHITE); }
Source:
<code><START> public void waitForFinish(Duration timeout) { <END> throw new UnsupportedOperationException(getClass().getName() + " does not support waitForFinish."); }</code><technical_language>sense return a boolean here(indicating application shutdown timeout). Returning void a timeout convey if application shutdown timeout not</technical_language>

Target:
public boolean waitForFinish(Duration timeout) { throw new UnsupportedOperationException(getClass().getName() + " does not support timed waitForFinish."); }
Source:
<code>public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall( final ServerCall<ReqT, RespT> call, final Metadata headers, final ServerCallHandler<ReqT, RespT> next ) { return next.startCall(new ForwardingServerCall.SimpleForwardingServerCall<ReqT, RespT>(call) { @Override public void request(final int numMessages) { log.info("gRPC call: {}", call.getMethodDescriptor().getFullMethodName()); super.request(numMessages); } @Override public void close(final Status status, final Metadata trailers) { if (!status.isOk()) { log.error( "gRPC error: -> {}: {}", call.getMethodDescriptor().getFullMethodName(), String.valueOf(status.getCode().value()), <START> (status.getCause() != null ? status.getCause().getMessage() : "?"), <END> status.getCause() ); } super.close(status, trailers); } }, headers); }</code><technical_language>some sort of static constant for this "?" message represent. DEFAULT_CAUSE_MESSAGE</technical_language>

Target:
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall( final ServerCall<ReqT, RespT> call, final Metadata headers, final ServerCallHandler<ReqT, RespT> next ) { return next.startCall(new ForwardingServerCall.SimpleForwardingServerCall<ReqT, RespT>(call) { @Override public void request(final int numMessages) { log.info("gRPC call: {}", call.getMethodDescriptor().getFullMethodName()); super.request(numMessages); } @Override public void close(final Status status, final Metadata trailers) { if (!status.isOk()) { log.error( "gRPC error: -> {}: {}", call.getMethodDescriptor().getFullMethodName(), String.valueOf(status.getCode().value()), (status.getCause() != null ? status.getCause().getMessage() : NO_CAUSE), status.getCause() ); } super.close(status, trailers); } }, headers); }
Source:
<code>public JGitTransportConfigCallback( GitScmProviderRepository repo, ScmLogger logger ) { if ( repo.getFetchInfo().getProtocol().equals( "ssh" ) ) { if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() == null ) { <START> logger.debug( "using private key with passphrase: " + repo.getPrivateKey() ); <END> sshSessionFactory = new UnprotectedPrivateKeySessionFactory( repo ); } else if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() != null ) { logger.debug( "using private key: " + repo.getPrivateKey() ); sshSessionFactory = new ProtectedPrivateKeyFileSessionFactory( repo ); } else { sshSessionFactory = new SimpleSessionFactory(); } } }</code><technical_language>notice message is wrong? key a passphrase, test repo.getPassphrase() == null</technical_language>

Target:
public JGitTransportConfigCallback( GitScmProviderRepository repo, ScmLogger logger ) { if ( repo.getFetchInfo().getProtocol().equals( "ssh" ) ) { if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() == null ) { logger.debug( "using private key: " + repo.getPrivateKey() ); sshSessionFactory = new UnprotectedPrivateKeySessionFactory( repo ); } else if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() != null ) { logger.debug( "using private key with passphrase: " + repo.getPrivateKey() ); sshSessionFactory = new ProtectedPrivateKeyFileSessionFactory( repo ); } else { sshSessionFactory = new SimpleSessionFactory(); } } }
Source:
<code>public double protectionLeg( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { ArgChecker.notNull(cds, "cds"); ArgChecker.notNull(ratesProvider, "ratesProvider"); ArgChecker.notNull(refData, "refData"); if (!cds.getProtectionEndDate().isAfter(ratesProvider.getValuationDate())) { return 0d; } LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); <START> LocalDate effectiveStartDate = cds.getEffectiveStartDate(stepinDate); <END> double recoveryRate = recoveryRate(cds, ratesProvider); Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> rates = reduceDiscountFactors(cds, ratesProvider); return protectionLeg(cds, rates.getFirst(), rates.getSecond(), referenceDate, effectiveStartDate, recoveryRate); }</code><technical_language>this, getEffectiveStartDate renamed calculateEffectiveStartDate OvernightCompoundedRateComputation.calculatePublicationFromFixing</technical_language>

Target:
public double protectionLeg( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { if (isExpired(cds, ratesProvider)) { return 0d; } LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.calculateEffectiveStartDate(stepinDate); double recoveryRate = recoveryRate(cds, ratesProvider); Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> rates = reduceDiscountFactors(cds, ratesProvider); return protectionLeg(cds, rates.getFirst(), rates.getSecond(), referenceDate, effectiveStartDate, recoveryRate); }
Source:
<code>private void updatePosixProperties(IStorageModel storageModel) { PosixStorageModel posixModel = (PosixStorageModel) storageModel; connection.setVfsType(posixModel.getVfsType().getEntity().toString()); if (posixModel.getMountOptions().getEntity() != null) { <START> connection.setMountOptions(posixModel.getMountOptions().getEntity()); <END> } }</code><technical_language>This change, while true, is unrealted NFS Mount Options. Please publish in a separate fix</technical_language>

Target:
private void updatePosixProperties(IStorageModel storageModel) { PosixStorageModel posixModel = (PosixStorageModel) storageModel; connection.setVfsType(posixModel.getVfsType().getEntity().toString()); if (posixModel.getMountOptions().getEntity() != null) { connection.setMountOptions(posixModel.getMountOptions().getEntity().toString()); } }
Source:
<code>public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) { final View firstVisibleChild = recyclerView.getChildAt(0); final int itemHeight = firstVisibleChild.getHeight(); <START> final int currentPosition = recyclerView.getChildLayoutPosition(firstVisibleChild); <END> int distanceInPixels = Math.abs((currentPosition - position) * itemHeight); if (distanceInPixels == 0) { distanceInPixels = (int) Math.abs(firstVisibleChild.getY()); } final SmoothScroller smoothScroller = new SmoothScroller(recyclerView.getContext(), distanceInPixels, mDuration); smoothScroller.setTargetPosition(position); startSmoothScroll(smoothScroller); }</code><technical_language>I 100% this, I _think_ want getChildAdapterPosition instead. is a quote docs for getChildLayoutPosition: > This position equal Item's adapter position if pending changes in adapter reflected layout yet. I care pending changes scroll start immediately main thread want calculated current positions of items. getChildAdapterPosition preserve current behavior deprecated getChildPosition is internally calling getChildAdapterPosition anyway</technical_language>

Target:
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) { final View firstVisibleChild = recyclerView.getChildAt(0); final int itemHeight = firstVisibleChild.getHeight(); final int currentPosition = recyclerView.getChildAdapterPosition(firstVisibleChild); int distanceInPixels = Math.abs((currentPosition - position) * itemHeight); if (distanceInPixels == 0) { distanceInPixels = (int) Math.abs(firstVisibleChild.getY()); } final SmoothScroller smoothScroller = new SmoothScroller(recyclerView.getContext(), distanceInPixels, mDuration); smoothScroller.setTargetPosition(position); startSmoothScroll(smoothScroller); }
Source:
<code>private void performCleanupCacheStorage(DataObject destOnStore) { destOnStore.processEvent(Event.DestroyRequested); DeleteCommand deleteCommand = new DeleteCommand(destOnStore.getTO()); EndPoint ep = selector.select(destOnStore); try { if (ep == null) { LOGGER.warn("Unable to cleanup staging NFS because no endpoint was found " + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); destOnStore.processEvent(Event.OperationFailed); } else { Answer deleteAnswer = ep.sendMessage(deleteCommand); if (deleteAnswer != null && deleteAnswer.getResult()) { LOGGER.warn("Unable to cleanup staging NFS " + deleteAnswer.getDetails() + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); destOnStore.processEvent(Event.OperationFailed); } } destOnStore.processEvent(Event.OperationSuccessed); <START> } catch (Exception e) { <END> LOGGER.warn("Unable to clean up staging cache Exception " + e.getMessage() + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); } }</code><technical_language>checked unchecked exceptions caught</technical_language>

Target:
private void performCleanupCacheStorage(DataObject destOnStore) { destOnStore.processEvent(Event.DestroyRequested); DeleteCommand deleteCommand = new DeleteCommand(destOnStore.getTO()); EndPoint ep = selector.select(destOnStore); try { if (ep == null) { LOGGER.warn("Unable to cleanup staging NFS because no endpoint was found " + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); destOnStore.processEvent(Event.OperationFailed); } else { Answer deleteAnswer = ep.sendMessage(deleteCommand); if (deleteAnswer != null && deleteAnswer.getResult()) { LOGGER.warn("Unable to cleanup staging NFS " + deleteAnswer.getDetails() + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); destOnStore.processEvent(Event.OperationFailed); } } destOnStore.processEvent(Event.OperationSuccessed); } catch (Exception e) { destOnStore.processEvent(Event.OperationFailed); LOGGER.warn("Unable to clean up staging cache Exception " + e.getMessage() + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); } }
Source:
<code>public void removeTables(Set<TableReference> tableRefs) { if (kv.getAllTableNames().contains(AtlasDbConstants.NAMESPACE_TABLE)) { Multimap<Cell, Long> deletionMap = tableRefs.stream() .map(tableRef -> Cell.create(getBytesForTableRef(tableRef), AtlasDbConstants.NAMESPACE_SHORT_COLUMN_BYTES)) .collect(Multimaps.toMultimap( key -> key, unused -> AtlasDbConstants.TRANSACTION_TS, MultimapBuilder.hashKeys().arrayListValues()::build)); kv.delete(AtlasDbConstants.NAMESPACE_TABLE, deletionMap); } while (true) { <START> BiMap<TableReference, TableReference> existingMap = tableMap.get(); <END> BiMap<TableReference, TableReference> newMap = HashBiMap.create(existingMap); tableRefs.forEach(newMap::remove); if (tableMap.compareAndSet(existingMap, newMap)) { return; } } }</code><technical_language>consider: java tableMap.getAndUpdate(existingMap -> { BiMap<TableReference, TableReference> newMap = HashBiMap.create(existingMap); tableRefs.forEach(newMap::remove); });</technical_language>

Target:
public void removeTables(Set<TableReference> tableRefs) { if (kvs.getAllTableNames().contains(AtlasDbConstants.NAMESPACE_TABLE)) { Multimap<Cell, Long> deletionMap = tableRefs.stream() .map(KvTableMappingService::getKeyCellForTable) .collect(Multimaps.toMultimap( key -> key, unused -> AtlasDbConstants.TRANSACTION_TS, MultimapBuilder.hashKeys().arrayListValues()::build)); kvs.delete(AtlasDbConstants.NAMESPACE_TABLE, deletionMap); } tableMap.updateAndGet(oldTableMap -> invalidateTables(oldTableMap, tableRefs)); }
Source:
<code>public void dispose() { for (IUndoableOperation <START> element : <END> children) { (element).dispose(); } if (triggeringOperation != null) { triggeringOperation.dispose(); } }</code><technical_language>rename operation</technical_language>

Target:
public void dispose() { for (IUndoableOperation operation : children) { operation.dispose(); } if (triggeringOperation != null) { triggeringOperation.dispose(); } }
Source:
<code>public <K> AbstractKeyedStateBackend<K> createKeyedStateBackend( Environment env, JobID jobID, String operatorIdentifier, TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, MetricGroup metricGroup, @Nonnull Collection<KeyedStateHandle> stateHandles, CloseableRegistry cancelStreamRegistry) throws BackendBuildingException { TaskStateManager taskStateManager = env.getTaskStateManager(); HeapPriorityQueueSetFactory priorityQueueSetFactory = new HeapPriorityQueueSetFactory(keyGroupRange, numberOfKeyGroups, 128); <START> ReadableConfig config = env.getTaskManagerInfo().getConfiguration(); int fsReadBufferSize = config.get(CheckpointingOptions.FS_READ_BUFFER_SIZE); <END> return new HeapKeyedStateBackendBuilder<>( kvStateRegistry, keySerializer, env.getUserCodeClassLoader().asClassLoader(), numberOfKeyGroups, keyGroupRange, env.getExecutionConfig(), fsReadBufferSize, ttlTimeProvider, stateHandles, AbstractStateBackend.getCompressionDecorator(env.getExecutionConfig()), taskStateManager.createLocalRecoveryConfig(), priorityQueueSetFactory, isUsingAsynchronousSnapshots(), cancelStreamRegistry).build(); }</code><technical_language>above, please do this of configure</technical_language>

Target:
public <K> AbstractKeyedStateBackend<K> createKeyedStateBackend( Environment env, JobID jobID, String operatorIdentifier, TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, MetricGroup metricGroup, @Nonnull Collection<KeyedStateHandle> stateHandles, CloseableRegistry cancelStreamRegistry) throws BackendBuildingException { TaskStateManager taskStateManager = env.getTaskStateManager(); HeapPriorityQueueSetFactory priorityQueueSetFactory = new HeapPriorityQueueSetFactory(keyGroupRange, numberOfKeyGroups, 128); return new HeapKeyedStateBackendBuilder<>( kvStateRegistry, keySerializer, env.getUserCodeClassLoader().asClassLoader(), numberOfKeyGroups, keyGroupRange, env.getExecutionConfig(), ttlTimeProvider, stateHandles, AbstractStateBackend.getCompressionDecorator(env.getExecutionConfig()), taskStateManager.createLocalRecoveryConfig(), priorityQueueSetFactory, isUsingAsynchronousSnapshots(), cancelStreamRegistry).build(); }
Source:
<code>private void resize() { final int[] oldKeys = keys; final int oldsize = oldKeys.length; final AdvancedExternalizer[] oldValues = values; if (oldsize >= 0x40000000) { throw new IllegalStateException("Table full"); } final int newsize = oldsize << 1; final int mask = newsize - 1; final int[] newKeys = new int[newsize]; final AdvancedExternalizer[] newValues = new AdvancedExternalizer[newsize]; keys = newKeys; values = newValues; if ((resizeCount <<= 1) == 0) { resizeCount = Integer.MAX_VALUE; } for (int oi = 0; oi < oldsize; oi ++) { final int key = oldKeys[oi]; if (oldValues[oi] != null) { int ni = key & mask; for (;;) { <START> final int k = newKeys[ni]; <END> if (newValues[ni] == null) { newKeys[ni] = key; newValues[ni] = oldValues[oi]; break; } ni = (ni + 1) & mask; } } } }</code><technical_language>is</technical_language>

Target:
private void resize() { final int[] oldKeys = keys; final int oldsize = oldKeys.length; final AdvancedExternalizer[] oldValues = values; if (oldsize >= 0x40000000) { throw new IllegalStateException("Table full"); } final int newsize = oldsize << 1; final int mask = newsize - 1; final int[] newKeys = new int[newsize]; final AdvancedExternalizer[] newValues = new AdvancedExternalizer[newsize]; keys = newKeys; values = newValues; if ((resizeCount <<= 1) == 0) { resizeCount = Integer.MAX_VALUE; } for (int oi = 0; oi < oldsize; oi ++) { final int key = oldKeys[oi]; if (oldValues[oi] != null) { int ni = key & mask; for (;;) { if (newValues[ni] == null) { newKeys[ni] = key; newValues[ni] = oldValues[oi]; break; } ni = (ni + 1) & mask; } } } }
Source:
<code>public boolean isDateType(IAttributeType attributeType) { <START> return asdf; <END> }</code><technical_language>Finish implementing function</technical_language>

Target:
public boolean isDateType(IAttributeType attributeType) { return atsServer.getOrcsApi().getOrcsTypes().getAttributeTypes().isDateType(attributeType); }
Source:
<code>private static String loadClientHzConfig() { <START> File file = new File("client-hazelcast.xml"); <END> LOGGER.info("Loading Hazelcast client configuration: " + file.getAbsolutePath()); return fileAsText(file); }</code><technical_language>I missing getDefaultConfigurationFile() here</technical_language>

Target:
private static String loadClientHzConfig() { File file = new File(getDefaultConfigurationFile("client-hazelcast.xml")); LOGGER.info("Loading Hazelcast client configuration: " + file.getAbsolutePath()); return fileAsText(file); }
Source:
<code>public Response add(DataCenter dataCenter) { validateParameters(dataCenter, "name"); validateEnums(DataCenter.class, dataCenter); if (dataCenter.isSetStorageType()) { validateEnum(StorageType.class, dataCenter.getStorageType().toUpperCase()); } else if(!dataCenter.isSetLocal()) { validateParameters(dataCenter, "local"); } StoragePool entity = map(dataCenter); if (entity.getcompatibility_version().isNotValid()) { entity.setcompatibility_version(Version.getLast()); <START> } <END> return performCreate(VdcActionType.AddEmptyStoragePool, new StoragePoolManagementParameter(entity), new QueryIdResolver<Guid>(VdcQueryType.GetStoragePoolById, IdQueryParameters.class)); }</code><technical_language>This is business logic, part of RESTAPI, of backend</technical_language>

Target:
public Response add(DataCenter dataCenter) { validateParameters(dataCenter, "name"); validateEnums(DataCenter.class, dataCenter); if (dataCenter.isSetStorageType()) { validateEnum(StorageType.class, dataCenter.getStorageType().toUpperCase()); } else if(!dataCenter.isSetLocal()) { validateParameters(dataCenter, "local"); } StoragePool entity = map(dataCenter); return performCreate(VdcActionType.AddEmptyStoragePool, new StoragePoolManagementParameter(entity), new QueryIdResolver<Guid>(VdcQueryType.GetStoragePoolById, IdQueryParameters.class)); }
Source:
<code>protected boolean canDoAction() { if(!super.canDoAction()) { return false; <START> } <END> return true; }</code><technical_language>Volume for fetching advanced details</technical_language>

Target:
protected boolean canDoAction() { if(!super.canDoAction()) { return false; } GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!glusterVolume.isOnline()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); } return true; }
Source:
<code>public ChannelHandler storeListingRequestHandler( CatchupServerProtocol catchupServerProtocol ) { return new SimpleChannelInboundHandler<PrepareStoreCopyRequest>() { @Override protected void channelRead0( ChannelHandlerContext channelHandlerContext, PrepareStoreCopyRequest prepareStoreCopyRequest ) { channelHandlerContext.writeAndFlush( ResponseMessageType.PREPARE_STORE_COPY_RESPONSE ); List<File> list = filesystem.stream().map( FakeFile::getFile ).collect( Collectors.toList() ); File[] files = new File[list.size()]; files = list.toArray( files ); long transactionId = 123L; <START> MutableLongSet indexIds = new LongHashSet(); <END> indexIds.add( 13 ); channelHandlerContext.writeAndFlush( PrepareStoreCopyResponse.success( files, indexIds, transactionId ) ); catchupServerProtocol.expect( CatchupServerProtocol.State.MESSAGE_TYPE ); } }; }</code><technical_language>Creation of set single element replaced with: LongSets.mutable.of( 13 )</technical_language>

Target:
public ChannelHandler storeListingRequestHandler( CatchupServerProtocol catchupServerProtocol ) { return new SimpleChannelInboundHandler<PrepareStoreCopyRequest>() { @Override protected void channelRead0( ChannelHandlerContext channelHandlerContext, PrepareStoreCopyRequest prepareStoreCopyRequest ) { channelHandlerContext.writeAndFlush( ResponseMessageType.PREPARE_STORE_COPY_RESPONSE ); List<File> list = filesystem.stream().map( FakeFile::getFile ).collect( Collectors.toList() ); File[] files = new File[list.size()]; files = list.toArray( files ); long transactionId = 123L; LongSet indexIds = LongSets.immutable.of( 13 ); channelHandlerContext.writeAndFlush( PrepareStoreCopyResponse.success( files, indexIds, transactionId ) ); catchupServerProtocol.expect( CatchupServerProtocol.State.MESSAGE_TYPE ); } }; }
Source:
<code>public void searchHalf(ThreadState state) { String predicate = "actionCode = " + (state.random.nextBoolean() ? ActionCode.CODE_0000.toCode() : ActionCode.CODE_9280.toCode()); map.values(new SqlPredicate(predicate)); <START> } <END></code><technical_language>allowed return in a timestep method. Currently is ignored; in future add dead code elimination protection</technical_language>

Target:
public Collection<Transaction> searchHalf(ThreadState state) { String predicate = "actionCode = " + (state.random.nextBoolean() ? ActionCode.CODE_0000.toCode() : ActionCode.CODE_9280.toCode()); return map.values(new SqlPredicate(predicate)); }
Source:
<code>public void testCollectionWithImage() throws Exception { String derivativeFinalPath = "de/75/d8/11/" + RESC_ID; Path uploadedFilePath = Paths.get(dataDir, derivativeFinalPath); Files.createDirectories(uploadedFilePath.getParent()); <START> imgFile = new File(uploadedFilePath.toString()); <END> FileWriter fileWriter = new FileWriter(imgFile.getAbsoluteFile()); BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); bufferedWriter.write("image file"); bufferedWriter.close(); processor.process(exchange); verify(message).setHeader(CdrBinaryMimeType, "image/*"); verify(message).setHeader(CdrBinaryPath, imgFile.getAbsolutePath()); imgFile.delete(); }</code><technical_language>shortcut for writing a file FileUtils.writeStringToFile(imgFile, "image file", StandardCharsets.UTF_8). dont' need delete files created of a TemporaryFolder, removed tests</technical_language>

Target:
public void testCollectionWithImage() throws Exception { String derivativeFinalPath = "de/75/d8/11/" + RESC_ID; Path uploadedFilePath = Paths.get(dataDir, derivativeFinalPath); Files.createDirectories(uploadedFilePath.getParent()); imgFile = new File(uploadedFilePath.toString()); FileUtils.writeStringToFile(imgFile, "image file", StandardCharsets.UTF_8); processor.process(exchange); verify(message).setHeader(CdrBinaryMimeType, "image/*"); verify(message).setHeader(CdrBinaryPath, imgFile.getAbsolutePath()); }
Source:
<code>private Component finalizeBuilder(final Component text, final TextComponent.Builder build) { <START> return build.style(text.style().toBuilder().build()).build(); <END> }</code><technical_language>Is a reason for this toBuilder().build()? compiles fine: final Component component = TextComponent.empty(); TextComponent.builder().style(component.style()).build(); I run - if is a problem worked around, need report Adventure</technical_language>

Target:
private Component finalizeBuilder(final Component text, final TextComponent.Builder build) { return build.style(text.style()).build(); }
Source:
<code><START> public void close() { lastUsed.set(System.currentTimeMillis()); useCnt.decrementAndGet(); if (!RepositoryCache.isCached(this)) { evict(0); } } <END></code><technical_language>If repository is open cache, closed. I leave close was: public void close() { lastUsed.set(System.currentTimeMillis()); if (useCnt.decrementAndGet() == 0) { doClose(); } } move eviction code in terminator thread. IMHO, notion of eviction belongs RepositoryCache object exist in Repository</technical_language>

Target:
public void close() { lastUsed.set(System.currentTimeMillis()); if (useCnt.decrementAndGet() == 0 && !RepositoryCache.isCached(this)) { doClose(); } }
Source:
<code>public int <START> globalToLocal(int <END> globalType) { int index = mGlobalToLocalMapping.indexOfKey(globalType); if (index < 0) { throw new IllegalStateException("requested global type " + globalType + " does" + " not belong to the adapter:" + mWrapper.delegate); } return mGlobalToLocalMapping.valueAt(index); }</code><technical_language>Is correct is assumed localToGlobal called globalToLocal</technical_language>

Target:
public int globalToLocal(int globalType) { int index = mGlobalToLocalMapping.indexOfKey(globalType); if (index < 0) { throw new IllegalStateException("requested global type " + globalType + " does" + " not belong to the adapter:" + mWrapper.adapter); } return mGlobalToLocalMapping.valueAt(index); }
Source:
<code>public void testWithServiceSuperclassAnnotatedMethodOverridePE() throws Exception { ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("GatewayInterfaceTests2-context.xml", getClass()); DirectChannel channel = ac.getBean("requestChannelFoo", DirectChannel.class); final Method fooMethod = Foo.class.getMethod("foo", String.class); final AtomicBoolean called = new AtomicBoolean(); MessageHandler handler = message -> { assertThat(message.getHeaders().get("name"), equalTo("foo")); assertThat(message.getHeaders().get("string"), <START> equalTo("public abstract void org.springframework.integration.gateway.GatewayInterfaceTests$Foo.foo(java.lang.String)")); <END> assertThat(message.getHeaders().get("object"), equalTo(fooMethod)); assertThat(message.getPayload(), equalTo("foo")); called.set(true); }; channel.subscribe(handler); Bar bar = ac.getBean(Bar.class); bar.foo("hello"); assertTrue(called.get()); ac.close(); }</code><technical_language>If fixing line lengths, this too</technical_language>

Target:
public void testWithServiceSuperclassAnnotatedMethodOverridePE() throws Exception { ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("GatewayInterfaceTests2-context.xml", getClass()); DirectChannel channel = ac.getBean("requestChannelFoo", DirectChannel.class); final Method fooMethod = Foo.class.getMethod("foo", String.class); final AtomicBoolean called = new AtomicBoolean(); MessageHandler handler = message -> { assertThat(message.getHeaders().get("name"), equalTo("foo")); assertThat(message.getHeaders().get("string"), equalTo("public abstract void org.springframework.integration.gateway." + "GatewayInterfaceTests$Foo.foo(java.lang.String)")); assertThat(message.getHeaders().get("object"), equalTo(fooMethod)); assertThat(message.getPayload(), equalTo("foo")); called.set(true); }; channel.subscribe(handler); Bar bar = ac.getBean(Bar.class); bar.foo("hello"); assertTrue(called.get()); ac.close(); }
Source:
<code>public void ShouldConvertActivity_WhenStartMainViewIsCalled() throws Exception { activity.startMainView(); ShadowActivity shadowActivity = shadowOf(activity); Intent startedIntent = shadowActivity.getNextStartedActivity(); assertEquals(MainActivity.class.getName(), startedIntent.getComponent().getClassName()); <START> shadowActivity.finish(); <END> }</code><technical_language>call finish</technical_language>

Target:
public void ShouldConvertActivity_WhenStartMainViewIsCalled() throws Exception { activity.startMainView(); Intent expectedIntent = new Intent(activity, MainActivity.class); assertThat(new Intent(RuntimeEnvironment.application, MainActivity.class)).isEqualTo(expectedIntent); }
Source:
<code>private void handleAttemptLockout(long elapsedRealtimeDeadline) { mLockPatternView.clearPattern(); mLockPatternView.setEnabled(false); final long elapsedRealtime = SystemClock.elapsedRealtime(); mCountdownTimer = new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 200) { @Override public void onTick(long millisUntilFinished) { final int secondsRemaining = (int) Math.ceil(millisUntilFinished / 1000.0); mSecurityMessageDisplay.setMessage( R.string.kg_too_many_failed_attempts_countdown, true, secondsRemaining); } @Override public void onFinish() { mLockPatternView.setEnabled(true); <START> displayDefaultSecurityMessage(true); <END> } }.start(); }</code><technical_language>add inline name of parameter for readability: true /* important */ else</technical_language>

Target:
private void handleAttemptLockout(long elapsedRealtimeDeadline) { mLockPatternView.clearPattern(); mLockPatternView.setEnabled(false); final long elapsedRealtime = SystemClock.elapsedRealtime(); final long millisInFuture = ((long) Math.ceil( (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0) + 2) * 1000; mCountdownTimer = new CountDownTimer(millisInFuture, 1000) { @Override public void onTick(long millisUntilFinished) { final int secondsRemaining = (int) Math.round(millisUntilFinished / 1000.0) - 2; if (secondsRemaining > 0) { mSecurityMessageDisplay.setMessage( R.string.kg_too_many_failed_attempts_countdown, true, secondsRemaining); } else { mLockPatternView.setEnabled(true); displayDefaultSecurityMessage(true ); cancel(); } } @Override public void onFinish() { } }.start(); }
Source:
<code><START> protected AliasAnalysis[] createAliasAnalyses(@UnderInitialization AccumulationChecker this) { <END> return new AliasAnalysis[] {AliasAnalysis.RETURNS_RECEIVER}; }</code><technical_language>this return EnumSet</technical_language>

Target:
protected EnumSet<AliasAnalysis> createAliasAnalyses( @UnderInitialization AccumulationChecker this) { return EnumSet.of(AliasAnalysis.RETURNS_RECEIVER); }
Source:
<code>public ToolUseHandler getItemHandler() { return (e, tool, fortune, drops) -> { <START> if (e.isCancelled()) return; <END> Player p = e.getPlayer(); Block b = e.getBlock(); b.getWorld().createExplosion(b.getLocation(), 0.0F); b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F); List<Block> blocks = findBlocks(b); breakBlocks(p, tool, b, blocks, fortune, drops); }; }</code><technical_language>This is completely redundant Listener calls this method checks if is cancelled. missing brackets</technical_language>

Target:
public ToolUseHandler getItemHandler() { return (e, tool, fortune, drops) -> { Player p = e.getPlayer(); Block b = e.getBlock(); b.getWorld().createExplosion(b.getLocation(), 0.0F); b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F); List<Block> blocks = findBlocks(b); breakBlocks(p, tool, b, blocks, fortune, drops); }; }
Source:
<code>public synchronized MetricNames getMeticNames(){ if(metricNames == null){ try { String hostname = InetAddress.getLocalHost().getHostName(); int idx = hostname.indexOf('.'); if(idx > 0){ hostname = hostname.substring(0, idx); } <START> metricNames = new MetricNames(hostname+"."+getSharedResources().getTransactorID()); <END> } catch (UnknownHostException e) { throw new RuntimeException(e); } } return metricNames; }</code><technical_language>integration tests failing time in TravisCI. I this is this line is allocating a Transactor ID changes numbering expected TransactorIT. Tests run: 4, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 9.323 sec <<< FAILURE! - in io.fluo.core.impl.TransactorIT testTransactorAndCache(io.fluo.core.impl.TransactorIT) Time elapsed: 2.131 sec <<< FAILURE! java.lang.AssertionError: expected:<1> was:<2> org.junit.Assert.fail(Assert.java:88) org.junit.Assert.failNotEquals(Assert.java:743) org.junit.Assert.assertEquals(Assert.java:118) org.junit.Assert.assertEquals(Assert.java:144) io.fluo.core.impl.TransactorIT.testTransactorAndCache(TransactorIT.java:50)</technical_language>

Target:
public synchronized MetricNames getMeticNames(){ if(metricNames == null){ String mid = System.getProperty(MetricNames.METRICS_ID_PROP); if(mid == null){ try { String hostname = InetAddress.getLocalHost().getHostName(); int idx = hostname.indexOf('.'); if(idx > 0){ hostname = hostname.substring(0, idx); } mid = hostname+"_"+getSharedResources().getTransactorID(); } catch (UnknownHostException e) { throw new RuntimeException(e); } } mid = mid.replace('.', '_'); metricNames = new MetricNames(mid); } return metricNames; }
Source:
<code>@Nullable HashMap<Integer, GroupKeyEncrypted> getAll() { if (F.isEmpty(grpKeys)) return null; <START> HashMap<Integer, GroupKeyEncrypted> Keys = new HashMap<>(); <END> for (Map.Entry<Integer, List<GroupKey>> entry : grpKeys.entrySet()) { int grpId = entry.getKey(); GroupKey grpKey = entry.getValue().get(0); Keys.put(grpId, new GroupKeyEncrypted(grpKey.unsignedId(), encSpi.encryptKey(grpKey.key()))); } return Keys; }</code><technical_language>Keys -> keys</technical_language>

Target:
@Nullable HashMap<Integer, GroupKeyEncrypted> getAll() { if (F.isEmpty(grpKeys)) return null; HashMap<Integer, GroupKeyEncrypted> keys = U.newHashMap(grpKeys.size()); for (Map.Entry<Integer, List<GroupKey>> entry : grpKeys.entrySet()) { int grpId = entry.getKey(); GroupKey grpKey = entry.getValue().get(0); keys.put(grpId, new GroupKeyEncrypted(grpKey.unsignedId(), encSpi.encryptKey(grpKey.key()))); } return keys; }
Source:
<code><START> public List<TokenCredential> getCredentials() { <END> return Collections.unmodifiableList(tokenCredentials); }</code><technical_language>move this ChainedTokenCredential? users created a CTC continue extract list for modification</technical_language>

Target:
public List<TokenCredential> getCredentials() { return super.getCredentials(); }
Source:
<code>public void prepareCollection() { for (int i = 0; i < DATA_AMOUNT; i++) <START> streamingCol.add(new HashMap.SimpleEntry<>(ThreadLocalRandom.current().nextInt(DATA_AMOUNT), <END> ThreadLocalRandom.current().nextInt(DATA_AMOUNT))); }</code><technical_language>bound random number DATA_AMOUNT</technical_language>

Target:
public void prepareCollection() { for (int i = 0; i < DATA_AMOUNT; i++) streamingCol.add(new HashMap.SimpleEntry<>(ThreadLocalRandom.current().nextInt(), ThreadLocalRandom.current().nextInt())); }
Source:
<code>private static List<TimeGraphState> getCurrentThreads(@NonNull ITmfStateSystem ss, ITmfStateInterval userModeInterval, @NonNull NavigableSet<ITmfStateInterval> currentThreadIntervals) throws StateSystemDisposedException { List<TimeGraphState> list = new ArrayList<>(); for (ITmfStateInterval currentThread : currentThreadIntervals) { if (currentThread.getStartTime() <= userModeInterval.getEndTime() && currentThread.getEndTime() >= userModeInterval.getStartTime()) { long start = Long.max(userModeInterval.getStartTime(), currentThread.getStartTime()); long end = Long.min(userModeInterval.getEndTime(), currentThread.getEndTime()); long duration = end - start + 1; Object tid = currentThread.getValue(); if (tid instanceof Integer) { <START> int execNameQuark = ss.optQuarkAbsolute(Attributes.THREADS, String.valueOf(tid), Attributes.EXEC_NAME); if (execNameQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { Object currentThreadName = ss.querySingleState(currentThread.getEndTime(), execNameQuark).getValue(); if (currentThreadName instanceof String) { list.add(new TimeGraphState(start, duration, StateValues.CPU_STATUS_RUN_USERMODE, (String) currentThreadName)); continue; } } <END> } list.add(new TimeGraphState(start, duration, StateValues.CPU_STATUS_RUN_USERMODE)); } } return list; }</code><technical_language>If want remove exec name CPU status line, this is done</technical_language>

Target:
private static List<TimeGraphState> getCurrentThreads(@NonNull ITmfStateSystem ss, ITmfStateInterval userModeInterval, @NonNull NavigableSet<ITmfStateInterval> currentThreadIntervals) throws StateSystemDisposedException { List<TimeGraphState> list = new ArrayList<>(); for (ITmfStateInterval currentThread : currentThreadIntervals) { if (currentThread.getStartTime() <= userModeInterval.getEndTime() && currentThread.getEndTime() >= userModeInterval.getStartTime()) { long start = Long.max(userModeInterval.getStartTime(), currentThread.getStartTime()); long end = Long.min(userModeInterval.getEndTime(), currentThread.getEndTime()); long duration = end - start + 1; Object tid = currentThread.getValue(); if (tid instanceof Integer) { int execNameQuark = ss.optQuarkAbsolute(Attributes.THREADS, String.valueOf(tid), Attributes.EXEC_NAME); if (execNameQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { Object currentThreadName = ss.querySingleState(currentThread.getEndTime(), execNameQuark).getValue(); if (currentThreadName instanceof String) { list.add(new TimeGraphState(start, duration, StateValues.CPU_STATUS_RUN_USERMODE, Messages.Usermode)); continue; } } } list.add(new TimeGraphState(start, duration, StateValues.CPU_STATUS_RUN_USERMODE)); } } return list; }
Source:
<code>private StripePaymentIntent getPaymentIntent(RefundGatewayRequest request) throws GatewayException.GenericGatewayException, GatewayErrorException, GatewayException.GatewayConnectionTimeoutException{ final String refundResponse = client.postRequestFor(StripeGetPaymentIntentRequest.of(request, stripeGatewayConfig)).getEntity(); StripePaymentIntent stripePaymentIntent = jsonObjectMapper.getObject(refundResponse, StripePaymentIntent.class); <START> logger.info("As part of refund to refund charge id refunded stripe charge id {}", <END> request.getTransactionId(), request.getChargeExternalId(), request.getRefundExternalId() ); return stripePaymentIntent; }</code><technical_language>log Stripe chargeId received for payment intent do similar logging call refundCharge</technical_language>

Target:
private StripePaymentIntent getPaymentIntent(RefundGatewayRequest request) throws GatewayException.GenericGatewayException, GatewayErrorException, GatewayException.GatewayConnectionTimeoutException{ final String refundResponse = client.postRequestFor(StripeGetPaymentIntentRequest.of(request, stripeGatewayConfig)).getEntity(); StripePaymentIntent stripePaymentIntent = jsonObjectMapper.getObject(refundResponse, StripePaymentIntent.class); return stripePaymentIntent; }