auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void setContainerInfo(ITmfStateSystemBuilder ssb, int containerQuark, long timestamp, ContainerInfo containerInfo) { <START> assert (ssb.getAttributeName(containerQuark).startsWith(ContainerAttributes.CONTAINER_ID)); <END> try { int containerInfoQuark = ssb.getQuarkRelativeAndAdd(containerQuark, ContainerAttributes.CONTAINER_INFO); int containerPPIDQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.PPID); ssb.modifyAttribute(timestamp, TmfStateValue.newValueInt(containerInfo.getContainerParentTID()), containerPPIDQuark); int containerINodeQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.CONTAINER_INODE); ssb.modifyAttribute(timestamp, TmfStateValue.newValueInt(containerInfo.getContainerInode()), containerINodeQuark); int containerHostnameQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.HOSTNAME); ssb.modifyAttribute(timestamp, TmfStateValue.newValueString(containerInfo.getContainerHostname()), containerHostnameQuark); } catch (AttributeNotFoundException e) { e.printStackTrace(); } }</code><technical_language>asserts more useless, enabled if compile program -ea, does. Instead do if check log error and/or throw exception. Applies other place too</technical_language>

Target:
private static void setContainerInfo(ITmfStateSystemBuilder ssb, int containerQuark, long timestamp, ContainerInfo containerInfo) { if (!ssb.getAttributeName(containerQuark).startsWith(ContainerAttributes.CONTAINER_ID_PREFIX)) { throw new IllegalStateException("Wrong container ID!"); } try { int containerInfoQuark = ssb.getQuarkRelativeAndAdd(containerQuark, ContainerAttributes.CONTAINER_INFO); int containerPPIDQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.PPID); ssb.modifyAttribute(timestamp, TmfStateValue.newValueInt(containerInfo.getContainerParentTID()), containerPPIDQuark); int containerINodeQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.CONTAINER_INODE); ssb.modifyAttribute(timestamp, TmfStateValue.newValueInt(containerInfo.getContainerInode()), containerINodeQuark); int containerHostnameQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.HOSTNAME); ssb.modifyAttribute(timestamp, TmfStateValue.newValueString(containerInfo.getContainerHostname()), containerHostnameQuark); } catch (AttributeNotFoundException e) { e.printStackTrace(); } }
Source:
<code>public VaultEnvironmentRepositoryFactory(ObjectProvider<HttpServletRequest> request, EnvironmentWatch watch, Optional<VaultRestTemplateFactory> vaultRestTemplateFactory) { this.request = request; this.watch = watch; this.vaultRestTemplateFactory = vaultRestTemplateFactory; <START> this.tokenProvider = null; <END> }</code><technical_language>http token provider default here</technical_language>

Target:
public VaultEnvironmentRepositoryFactory(ObjectProvider<HttpServletRequest> request, EnvironmentWatch watch, Optional<VaultRestTemplateFactory> vaultRestTemplateFactory) { this.request = request; this.watch = watch; this.vaultRestTemplateFactory = vaultRestTemplateFactory; this.tokenProvider = new HttpRequestConfigTokenProvider(request); }
Source:
<code><START> public PageCacheLongArray( PagedFile pagedFile, long length, long defaultValue, long base ) throws IOException <END> { super( pagedFile, Long.BYTES, length, defaultValue, base ); }</code><technical_language>package private constructor</technical_language>

Target:
PageCacheLongArray( PagedFile pagedFile, long length, long defaultValue, long base ) throws IOException { super( pagedFile, Long.BYTES, length, defaultValue, base ); }
Source:
<code>private void getAllDependentProjects(Map<CDICoreNature, Integer> result, int level) { if(level > 10) return; <START> CDICoreNature[] array = null; <END> synchronized(this) { array = usedBy.toArray(new CDICoreNature[0]); } for (CDICoreNature n: array) { if(!result.containsKey(n) || result.get(n).intValue() < level) { result.put(n, level); n.getAllDependentProjects(result, level + 1); } } }</code><technical_language>I guess this commited for <LINK_0> for JQM 1.4 Palette</technical_language>

Target:
private void getAllDependentProjects(Map<CDICoreNature, Integer> result, int level) { if(level > 10) return; for (CDICoreNature n:usedBy) { if(!result.containsKey(n) || result.get(n).intValue() < level) { result.put(n, level); n.getAllDependentProjects(result, level + 1); } } }
Source:
<code>private boolean isJavascriptProject() { <START> return model.getLocation().append("package.json").toFile().exists(); <END> }</code><technical_language>extract "package.json" a constant for improved visibility</technical_language>

Target:
private boolean isJavascriptProject() { return model.getLocation().append(JS_PACKAGE_JSON_FILE).toFile().exists(); }
Source:
<code><START> private SetParameter getSetParameter() throws ProtocolAdapterException { <END> final AttributeAddress alarmRegisterValue = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); final DataObject data = DataObject.newUInteger32Data(ALARM_CODE); return new SetParameter(alarmRegisterValue, data); }</code><technical_language>remove 'throws ProtocolAdapterException'</technical_language>

Target:
private SetParameter getSetParameter() { final AttributeAddress alarmRegisterValue = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); final DataObject data = DataObject.newUInteger32Data(ALARM_CODE); return new SetParameter(alarmRegisterValue, data); }
Source:
<code>protected void refNameSelected(String refName) { boolean tagSelected = refName != null && refName.startsWith(Constants.R_TAGS); boolean branchSelected = refName != null && (refName.startsWith(Constants.R_HEADS) || refName .startsWith(Constants.R_REMOTES)); if (((TreeSelection) branchTree.getSelection()).size() > 1) { TreeSelection selection = (TreeSelection) branchTree .getSelection(); boolean onlySelectionAreBranches = onlyBranchesAreSelected(selection); deleteteButton.setEnabled(onlySelectionAreBranches); <START> renameButton.setEnabled(!onlySelectionAreBranches); <END> newButton.setEnabled(!onlySelectionAreBranches); } else { getButton(Window.OK).setEnabled(branchSelected || tagSelected); renameButton.setEnabled(branchSelected && !tagSelected); deleteteButton.setEnabled(branchSelected && !tagSelected); newButton.setEnabled(true); } getButton(Window.OK).setEnabled( refName != null && !refName.equals(currentBranch)); }</code><technical_language>if I select a tag a branch I rename? Rename disabled rename new/* old/* somethng that. single selection in dialog... I new enabled for multiple selection</technical_language>

Target:
protected void refNameSelected(String refName) { boolean tagSelected = refName != null && refName.startsWith(Constants.R_TAGS); boolean branchSelected = refName != null && (refName.startsWith(Constants.R_HEADS) || refName .startsWith(Constants.R_REMOTES)); if (((TreeSelection) branchTree.getSelection()).size() > 1) { TreeSelection selection = (TreeSelection) branchTree .getSelection(); boolean onlyBranchesAreSelected = onlyBranchesAreSelected(selection); deleteteButton.setEnabled(onlyBranchesAreSelected); renameButton.setEnabled(false); newButton.setEnabled(false); } else { getButton(Window.OK).setEnabled(branchSelected || tagSelected); renameButton.setEnabled(branchSelected && !tagSelected); deleteteButton.setEnabled(branchSelected && !tagSelected); newButton.setEnabled(true); } getButton(Window.OK).setEnabled( refName != null && !refName.equals(currentBranch)); }
Source:
<code>public void run() { try { waypoint = DataStore.loadWaypoint(waypointId); <START> calcState = waypoint.getCalculatorSaveState(); <END> loadWaypointHandler.sendMessage(Message.obtain()); } catch (final Exception e) { Log.e("EditWaypointActivity.loadWaypoint.run", e); } }</code><technical_language>Other methods named "getCalculatorState" "Save". I prefer short version</technical_language>

Target:
public void run() { try { waypoint = DataStore.loadWaypoint(waypointId); calcState = waypoint.getCalculatorStoredState(); loadWaypointHandler.sendMessage(Message.obtain()); } catch (final Exception e) { Log.e("EditWaypointActivity.loadWaypoint.run", e); } }
Source:
<code>public static int getNumberOfColumns(FormEntryPrompt formEntryPrompt, Context context) { int numColumns = 1; String appearance = getSanitizedAppearanceHint(formEntryPrompt); if (appearance.contains(COLUMNS_N) || appearance.contains(COMPACT_N)) { try { String columnsAppearance = appearance.contains(COLUMNS_N) ? COLUMNS_N : COMPACT_N; try { appearance = appearance.substring(appearance.indexOf(columnsAppearance)); int idx = appearance.indexOf(columnsAppearance); if (idx != -1) { String substringFromNumColumns = appearance.substring(idx + columnsAppearance.length()); numColumns = Integer.parseInt(substringFromNumColumns.substring(0, substringFromNumColumns.contains(" ") ? substringFromNumColumns.indexOf(' ') : substringFromNumColumns.length())); <START> if (numColumns < 1) { <END> numColumns = 1; } else if (numColumns > 10) { numColumns = 10; } } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } else if (appearance.contains(COLUMNS)) { switch (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) { case Configuration.SCREENLAYOUT_SIZE_SMALL: numColumns = 2; break; case Configuration.SCREENLAYOUT_SIZE_NORMAL: numColumns = 3; break; case Configuration.SCREENLAYOUT_SIZE_LARGE: numColumns = 4; break; case Configuration.SCREENLAYOUT_SIZE_XLARGE: numColumns = 5; break; default: numColumns = 3; } } return numColumns; }</code><technical_language>officially supporting 10 columns, I this is necessary. I more confusing worth. I unofficially continue supporting arbitrary values of N</technical_language>

Target:
public static int getNumberOfColumns(FormEntryPrompt formEntryPrompt, Context context) { int numColumns = 1; String appearance = getSanitizedAppearanceHint(formEntryPrompt); if (appearance.contains(COLUMNS_N) || appearance.contains(COMPACT_N)) { try { String columnsAppearance = appearance.contains(COLUMNS_N) ? COLUMNS_N : COMPACT_N; try { appearance = appearance.substring(appearance.indexOf(columnsAppearance)); int idx = appearance.indexOf(columnsAppearance); if (idx != -1) { String substringFromNumColumns = appearance.substring(idx + columnsAppearance.length()); numColumns = Integer.parseInt(substringFromNumColumns.substring(0, substringFromNumColumns.contains(" ") ? substringFromNumColumns.indexOf(' ') : substringFromNumColumns.length())); if (numColumns < 1) { numColumns = 1; } } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } else if (appearance.contains(COLUMNS)) { switch (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) { case Configuration.SCREENLAYOUT_SIZE_SMALL: numColumns = 2; break; case Configuration.SCREENLAYOUT_SIZE_NORMAL: numColumns = 3; break; case Configuration.SCREENLAYOUT_SIZE_LARGE: numColumns = 4; break; case Configuration.SCREENLAYOUT_SIZE_XLARGE: numColumns = 5; break; default: numColumns = 3; } } return numColumns; }
Source:
<code>private static SyncUser createFakeUser(String id) { final Token token = new Token("token_value", id, "path_value", Long.MAX_VALUE, null); try { return SYNC_USER_CONSTRUCTOR.newInstance(token, authUrl); <START> } catch (InstantiationException e) { <END> fail(e.getMessage()); } catch (IllegalAccessException e) { fail(e.getMessage()); } catch (InvocationTargetException e) { fail(e.getMessage()); } return null; }</code><technical_language>Java 8 here. catch InstantiationException | IllegalAccessException | ..</technical_language>

Target:
private static SyncUser createFakeUser(String id) { final Token token = new Token("token_value", id, "path_value", Long.MAX_VALUE, null); try { return SYNC_USER_CONSTRUCTOR.newInstance(token, authUrl); } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { fail(e.getMessage()); } return null; }
Source:
<code>public void preCreateTable(Table table) throws MetaException { if (table.getPartitionKeysSize() != 0) { throw new MetaException("PARTITIONED BY may not be specified for Druid"); } if (table.getSd().getBucketColsSize() != 0) { throw new MetaException("CLUSTERED BY may not be specified for Druid"); } String dataSourceName = Preconditions .checkNotNull(table.getParameters().get(Constants.DRUID_DATA_SOURCE), "WTF dataSource name is null !" ); try { connector.createSegmentTable(); } catch (Exception e) { LOG.error("Exception while trying to create druid segments table", e); throw new MetaException(e.getMessage()); } Collection<String> existingDataSources = DruidStorageHandlerUtils .getAllDataSourceNames(connector, druidMetadataStorageTablesConfig); LOG.debug(String.format("pre-create data source with name [%s]", dataSourceName)); if (existingDataSources.contains(dataSourceName)) { throw new MetaException(String.format("Data source [%s] already existing", dataSourceName)); } }</code><technical_language>is OK leave prevent user 'LOCATION' a CREATE EXTERNAL TABLE statement</technical_language>

Target:
public void preCreateTable(Table table) throws MetaException { if (MetaStoreUtils.isExternalTable(table) && !StringUtils .isEmpty(table.getSd().getLocation())) { throw new MetaException("LOCATION may not be specified for Druid"); } if (table.getPartitionKeysSize() != 0) { throw new MetaException("PARTITIONED BY may not be specified for Druid"); } if (table.getSd().getBucketColsSize() != 0) { throw new MetaException("CLUSTERED BY may not be specified for Druid"); } String dataSourceName = table.getParameters().get(Constants.DRUID_DATA_SOURCE); if (MetaStoreUtils.isExternalTable(table)) { return; } try { connector.createSegmentTable(); } catch (Exception e) { LOG.error("Exception while trying to create druid segments table", e); throw new MetaException(e.getMessage()); } Collection<String> existingDataSources = DruidStorageHandlerUtils .getAllDataSourceNames(connector, druidMetadataStorageTablesConfig); LOG.debug(String.format("pre-create data source with name [%s]", dataSourceName)); if (existingDataSources.contains(dataSourceName)) { throw new MetaException(String.format("Data source [%s] already existing", dataSourceName)); } }
Source:
<code>public LatexCitationsTab(BibDatabaseContext databaseContext, PreferencesService preferencesService, TaskExecutor taskExecutor) { this.viewModel = new LatexCitationsTabViewModel(databaseContext, preferencesService, taskExecutor); this.searchPane = new StackPane(); this.progressIndicator = new ProgressIndicator(); this.graphicCitationList = FXCollections.observableArrayList(); setText(Localization.lang("LaTeX Citations")); setTooltip(new Tooltip(Localization.lang("Search citations for this entry in LaTeX files"))); <START> setGraphic(IconTheme.JabRefIcons.APPLICATION_TEXSTUDIO.getGraphicNode()); <END> }</code><technical_language>ok reuse texstudio icon I introduce a new LATEX_CITATIONS enum clearer semantics</technical_language>

Target:
public LatexCitationsTab(BibDatabaseContext databaseContext, PreferencesService preferencesService, TaskExecutor taskExecutor) { this.viewModel = new LatexCitationsTabViewModel(databaseContext, preferencesService, taskExecutor); this.searchPane = new StackPane(); this.progressIndicator = new ProgressIndicator(); setText(Localization.lang("LaTeX Citations")); setTooltip(new Tooltip(Localization.lang("Search citations for this entry in LaTeX files"))); setGraphic(IconTheme.JabRefIcons.LATEX_CITATIONS.getGraphicNode()); setSearchPane(); }
Source:
<code>public List<InterpreterCompletion> completion(String buffer, int cursor) { String lines[] = buffer.split(System.getProperty("line.separator")); if (lines.length > 0 && lines[0].startsWith("%") && cursor <= lines[0].trim().length()) { int idx = lines[0].indexOf(' '); if (idx < 0 || (idx > 0 && cursor <= idx)) { return note.getInterpreterCompletion(); } } this.interpreter = getBindedInterpreter(); String trimmedBuffer = buffer != null ? buffer.trim() : null; cursor = calculateCursorPosition(buffer, trimmedBuffer, cursor); <START> setText(trimmedBuffer); <END> InterpreterContext interpreterContext = getInterpreterContextWithoutRunner(null); try { if (this.interpreter != null) { return this.interpreter.completion(this.scriptText, cursor, interpreterContext); } else { return null; } } catch (InterpreterException e) { throw new RuntimeException("Fail to get completion", e); } }</code><technical_language>change text here</technical_language>

Target:
public List<InterpreterCompletion> completion(String buffer, int cursor) { String lines[] = buffer.split(System.getProperty("line.separator")); if (lines.length > 0 && lines[0].startsWith("%") && cursor <= lines[0].trim().length()) { int idx = lines[0].indexOf(' '); if (idx < 0 || (idx > 0 && cursor <= idx)) { return note.getInterpreterCompletion(); } } this.interpreter = getBindedInterpreter(); setText(buffer); cursor = calculateCursorPosition(buffer, cursor); InterpreterContext interpreterContext = getInterpreterContextWithoutRunner(null); try { if (this.interpreter != null) { return this.interpreter.completion(this.scriptText, cursor, interpreterContext); } else { return null; } } catch (InterpreterException e) { throw new RuntimeException("Fail to get completion", e); } }
Source:
<code><START> private boolean isShellValid() { <END> return shell != null && !shell.isDisposed(); }</code><technical_language>Widgets.isAccessible(shell)</technical_language>

Target:
private boolean isShellValid() { return Widgets.isAccessible(shell); }
Source:
<code>public void execute(TerminalClient client, Scanner arguments) { if (!arguments.hasNext()) throw new IllegalArgumentException(); String message = arguments.next(); if (arguments.hasNext()) throw new IllegalArgumentException(); Message expectedMessage = Message.get(message); List<Field> expectedFields = expectedMessage.getFields(); while (true) { try { Thread.sleep(WAIT_TIME_MILLIS); Message receivedMessage = getLastMsg(client.getMessages()); if (IGNORED_MESSAGES.contains(receivedMessage.getMsgType())) <START> continue; <END> List<Field> actualFields = receivedMessage.getFields(); if (compareMsgsFields(expectedFields, actualFields)) { printf("%s\n", receivedMessage); break; } } catch (InterruptedException e) { break; } } }</code><technical_language>I IGNORED_MESSAGES is superfluous MsgType(35) field simply of fields match on</technical_language>

Target:
public void execute(TerminalClient client, Scanner arguments) { if (!arguments.hasNext()) throw new IllegalArgumentException(); String message = arguments.next(); if (arguments.hasNext()) throw new IllegalArgumentException(); Message expectedMessage = Message.get(message); List<Field> expectedFields = expectedMessage.getFields(); int offset = 0; while (true) { try { Thread.sleep(WAIT_TIME_MILLIS); List<Message> collection = client.getMessages().collect(); if (collection.isEmpty() || offset == collection.size() - 1) continue; while (offset < collection.size() - 1) { Message receivedMessage = collection.get(offset); offset++; if (IGNORED_MESSAGES.contains(receivedMessage.getMsgType())) continue; List<Field> actualFields = receivedMessage.getFields(); if (compareMsgsFields(expectedFields, actualFields)) { printf("%s\n", receivedMessage); return; } } } catch (InterruptedException e) { break; } } }
Source:
<code>public Node(T value, List<Node<T>> children) { Objects.requireNonNull(children, "children is null"); this.value = value; this.children = children; <START> this.size = children.size() + 1; <END> }</code><technical_language>children.foldLeft(...)</technical_language>

Target:
public Node(T value, List<Node<T>> children) { Objects.requireNonNull(children, "children is null"); this.value = value; this.children = children; this.size = 1 + this.children.foldLeft(0, (acc, child) -> acc + child.size); }
Source:
<code>private InputStatus emitNextSortedRecord(DataOutput<T> output) throws Exception { if (emittedLast) { return InputStatus.END_OF_INPUT; } Tuple2<byte[], StreamRecord<T>> next = sortedInput.next(); if (next != null) { output.emitRecord(next.f1); return InputStatus.MORE_AVAILABLE; } else { emittedLast = true; <START> output.emitWatermark(Watermark.MAX_WATERMARK); <END> return InputStatus.END_OF_INPUT; } }</code><technical_language>track of input watermark emit maximum end</technical_language>

Target:
private InputStatus emitNextSortedRecord(DataOutput<T> output) throws Exception { if (emittedLast) { return InputStatus.END_OF_INPUT; } Tuple2<byte[], StreamRecord<T>> next = sortedInput.next(); if (next != null) { output.emitRecord(next.f1); return InputStatus.MORE_AVAILABLE; } else { emittedLast = true; if (watermarkSeen > Long.MIN_VALUE) { output.emitWatermark(new Watermark(watermarkSeen)); } return InputStatus.END_OF_INPUT; } }
Source:
<code>public VanityUrlAPIImpl() { cache404VanityUrl.setInode(VanityUrlAPI.CACHE_404_VANITY_URL); cache404VanityUrl.setIdentifier(VanityUrlAPI.CACHE_404_VANITY_URL); <START> cache404VanityUrl.setAction(404); <END> }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Assign this magic number 404 a well-named constant, constant instead. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public VanityUrlAPIImpl() { cache404VanityUrl.setInode(VanityUrlAPI.CACHE_404_VANITY_URL); cache404VanityUrl.setIdentifier(VanityUrlAPI.CACHE_404_VANITY_URL); cache404VanityUrl.setAction(CODE_404_VALUE); }
Source:
<code><START> public Iterable<Contents> listObjects(final String bucket) throws SignatureException, IOException { <END> final List<Contents> result = new ArrayList<>(); boolean isTruncated = false; String marker = null; do { final GetBucketRequest request = new GetBucketRequest(bucket); if (isTruncated) { request.withNextMarker(marker); } final ListBucketResult response = this.client.getBucket(request).getResult(); isTruncated = response.isTruncated(); marker = response.getNextMarker(); for (final Contents contents : response.getContentsList()) { result.add(contents); } } while (isTruncated); return result; }</code><technical_language>telescoping methods in C# SDK for setting prefix max keys. add functions well</technical_language>

Target:
public Iterable<Contents> listObjects(final String bucket) throws SignatureException, IOException { return this.listObjects(bucket, null); }
Source:
<code><START> public void startThreads() <END> { int nbThreads = this.configuration.getProperty("mentions.poolSize", 1); for (int i = 0; i < nbThreads; i++) { startConsumer(); } }</code><technical_language>if call this times? recreate asked number of threads. some flag started no</technical_language>

Target:
public void startThreads() { synchronized (this) { if (!this.threadStarted) { int nbThreads = this.configuration.getProperty("mentions.poolSize", 1); for (int i = 0; i < nbThreads; i++) { startConsumer(); } this.threadStarted = true; } } }
Source:
<code>AccessController.doPrivileged((PrivilegedAction<ServiceLoaderSupplier<Provider>>) () -> new ServiceLoaderSupplier<>(Provider.class, ElytronXmlParser.class.getClassLoader())) : new ServiceLoaderSupplier<>(Provider.class, ElytronXmlParser.class.getClassLoader()); private static final Supplier<Provider[]> DEFAULT_PROVIDER_SUPPLIER = ProviderUtil.aggregate(ELYTRON_PROVIDER_SUPPLIER, Security::getProviders); static final Map<String, Version> KNOWN_NAMESPACES; private static final class Version { final int major; final int minor; <START> Version(int major, int minor) { <END> this.major = major; this.minor = minor; } boolean isAtLeast(int major, int minor) { return this.major > major || this.major == major && this.minor >= minor; } boolean isAtMost(int major, int minor) { return this.major < major || this.major == major && this.minor <= minor; } } static { Map<String, Version> knownNamespaces = new HashMap<>(); knownNamespaces.put("urn:elytron:1.0", new Version(1, 0)); knownNamespaces.put("urn:elytron:client:1.1", new Version(1, 1)); KNOWN_NAMESPACES = Collections.unmodifiableMap(knownNamespaces); } private ElytronXmlParser() { }</code><technical_language>a single enum encapsulates namespace version information, add a map namespace a key population of map a manual correlation</technical_language>

Target:
AccessController.doPrivileged((PrivilegedAction<ServiceLoaderSupplier<Provider>>) () -> new ServiceLoaderSupplier<>(Provider.class, ElytronXmlParser.class.getClassLoader())) : new ServiceLoaderSupplier<>(Provider.class, ElytronXmlParser.class.getClassLoader()); private static final Supplier<Provider[]> DEFAULT_PROVIDER_SUPPLIER = ProviderUtil.aggregate(ELYTRON_PROVIDER_SUPPLIER, Security::getProviders); static final Map<String, Version> KNOWN_NAMESPACES; private enum Version { VERSION_1_0("urn:elytron:1.0", 1, 0), VERSION_1_1("urn:elytron:client:1.1", 1, 1); final String namespace; final int major; final int minor; Version(String namespace, int major, int minor) { this.namespace = namespace; this.major = major; this.minor = minor; } boolean isAtLeast(int major, int minor) { return this.major > major || this.major == major && this.minor >= minor; } boolean isAtLeastMinor(int major, int minor) { return this.major == major && this.minor >= minor; } } static { Map<String, Version> knownNamespaces = new HashMap<>(); for (Version version : Version.values()) { knownNamespaces.put(version.namespace, version); } KNOWN_NAMESPACES = Collections.unmodifiableMap(knownNamespaces); } private ElytronXmlParser() { }
Source:
<code>public void notifySubscriptions(Topic topic, Instant beforeMigrationInstant) { waitUntilOffsetsAvailableOnAllKafkaTopics(topic, CHECK_OFFSETS_AVAILABLE_TIMEOUT); logger.info("Offsets available on all partitions of topic {}", topic.getQualifiedName()); <START> subscriptionRepository.listSubscriptions(topic.getName()) <END> .stream() .filter(sub -> Subscription.State.SUSPENDED != sub.getState()) .map(Subscription::getName) .forEach(sub -> notifySingleSubscription(topic, beforeMigrationInstant, sub) ); }</code><technical_language>a private method, 2 times</technical_language>

Target:
void notifySubscriptions(Topic topic, Instant beforeMigrationInstant) { waitUntilOffsetsAvailableOnAllKafkaTopics(topic, CHECK_OFFSETS_AVAILABLE_TIMEOUT); logger.info("Offsets available on all partitions of topic {}", topic.getQualifiedName()); notSuspendedSubscriptionsForTopic(topic) .map(Subscription::getName) .forEach(sub -> notifySingleSubscription(topic, beforeMigrationInstant, sub)); }
Source:
<code>public NodeChildrenContainer getNamedChildren() { return NodeChildrenContainer.newNodeChildrenContainer() .child(CHILD_VALUE, value) .build(); <START> } <END></code><technical_language>I do static import in places reduce boiler plate @Override public NodeChildrenContainer getNamedChildren() { return newNodeChildrenContainer() .child(CHILD_VALUE, value) .build(); }</technical_language>

Target:
public NodeChildrenContainer getNamedChildren() { return newNodeChildrenContainer() .child(CHILD_VALUE, value) .build(); }
Source:
<code>public void testDisablingTopStateReplicaByDisablingInstance() throws Exception { int participantCount = 5; setupEnvironment(participantCount); setThrottleConfigForLoadBalance(); PropertyKey key = _accessor.keyBuilder().instanceConfig(_participants[0].getInstanceName()); InstanceConfig instanceConfig = _accessor.getProperty(key); instanceConfig.setInstanceEnabled(false); _accessor.setProperty(key, instanceConfig); ClusterControllerManager controller = new ClusterControllerManager(ZK_ADDR, _clusterName, "controller_0"); controller.syncStart(); <START> Thread.sleep(10000L); <END> PropertyKey liveInstanceKey = _accessor.keyBuilder().liveInstance(_participants[0].getInstanceName()); LiveInstance liveInstance = _accessor.getProperty(liveInstanceKey); if (liveInstance != null) { String sessionId = liveInstance.getEphemeralOwner(); List<CurrentState> currentStates = _accessor.getChildValues( _accessor.keyBuilder().currentStates(_participants[0].getInstanceName(), sessionId), true); for (CurrentState currentState : currentStates) { for (Map.Entry<String, String> partitionState : currentState.getPartitionStateMap() .entrySet()) { Assert.assertFalse(partitionState.getValue().equals("MASTER")); } } } controller.syncStop(); for (int i = 0; i < participantCount; i++) { _participants[i].syncStop(); } deleteCluster(_clusterName); }</code><technical_language>do this..</technical_language>

Target:
public void testDisablingTopStateReplicaByDisablingInstance() throws Exception { int participantCount = 5; setupEnvironment(participantCount); setThrottleConfigForLoadBalance(); PropertyKey key = _accessor.keyBuilder().instanceConfig(_participants[0].getInstanceName()); InstanceConfig instanceConfig = _accessor.getProperty(key); instanceConfig.setInstanceEnabled(false); _accessor.setProperty(key, instanceConfig); ClusterControllerManager controller = new ClusterControllerManager(ZK_ADDR, _clusterName, "controller_0"); controller.syncStart(); Thread.sleep(500L); PropertyKey liveInstanceKey = _accessor.keyBuilder().liveInstance(_participants[0].getInstanceName()); LiveInstance liveInstance = _accessor.getProperty(liveInstanceKey); if (liveInstance != null) { String sessionId = liveInstance.getEphemeralOwner(); List<CurrentState> currentStates = _accessor.getChildValues( _accessor.keyBuilder().currentStates(_participants[0].getInstanceName(), sessionId), true); for (CurrentState currentState : currentStates) { for (Map.Entry<String, String> partitionState : currentState.getPartitionStateMap() .entrySet()) { Assert.assertFalse(partitionState.getValue().equals("MASTER")); } } } controller.syncStop(); for (int i = 0; i < participantCount; i++) { _participants[i].syncStop(); } deleteCluster(_clusterName); }
Source:
<code>private static List<Integer> getIds(JSONObject params) throws ApiException { List<Integer> listIds = new ArrayList<>(); for (String id : params.getString(PARAM_IDS).split(",")) { <START> String trimmedId = id.trim(); <END> if (!trimmedId.isEmpty()) { try { listIds.add(Integer.parseInt(trimmedId)); } catch (NumberFormatException e) { throw new ApiException(ApiException.Type.ILLEGAL_PARAMETER, PARAM_IDS, e); } } } if (listIds.isEmpty()) { throw new ApiException(ApiException.Type.MISSING_PARAMETER, PARAM_IDS); } return listIds; }</code><technical_language>reason do split trim time, avoid extra var? i.e.: params.getString(PARAM_IDS).split(",").trim()</technical_language>

Target:
private static List<Integer> getIds(JSONObject params) throws ApiException { List<Integer> listIds = new ArrayList<>(); for (String id : params.getString(PARAM_IDS).split(",")) { try { listIds.add(Integer.valueOf(id.trim())); } catch (NumberFormatException e) { throw new ApiException(ApiException.Type.ILLEGAL_PARAMETER, PARAM_IDS, e); } } if (listIds.isEmpty()) { throw new ApiException(ApiException.Type.MISSING_PARAMETER, PARAM_IDS); } return listIds; }
Source:
<code>public static void processTimespan(Timespan agent, eu.europeana.corelib.edm.model.schemaorg.ContextualEntity timespanObject) { <START> timespanObject.setId(agent.getAbout()); <END> addMultilingualProperties(timespanObject, agent.getPrefLabel(), SchemaOrgConstants.PROPERTY_NAME); addMultilingualProperties(timespanObject, agent.getAltLabel(), SchemaOrgConstants.PROPERTY_ALTERNATE_NAME); addMultilingualProperties(timespanObject, agent.getNote(), SchemaOrgConstants.PROPERTY_DESCRIPTION); addTextProperties(timespanObject, toList(agent.getOwlSameAs()), SchemaOrgConstants.PROPERTY_SAME_AS); addTextProperties(timespanObject, toList(agent.getIsPartOfArray()), SchemaOrgConstants.PROPERTY_IS_PART_OF); addTextProperties(timespanObject, toList(agent.getIsNextInSequence()), SchemaOrgConstants.PROPERTY_NEXT_IN_SEQUENCE); addTextProperties(timespanObject, Arrays.asList(agent.getBeginString()), SchemaOrgConstants.PROPERTY_BEGIN_DATE); addTextProperties(timespanObject, Arrays.asList(agent.getEndString()), SchemaOrgConstants.PROPERTY_END_DATE); }</code><technical_language>for time Timespans mapped things, please refactor processConcept extract implementation in a new method processCommonField common ContextualClass itnerface input param. Reuse new method, in processConcept processTimespan methods</technical_language>

Target:
public static void processTimespan(Timespan agent, eu.europeana.corelib.edm.model.schemaorg.ContextualEntity timespanObject) { timespanObject.setId(agent.getAbout()); addMultilingualProperties(timespanObject, agent.getPrefLabel(), SchemaOrgConstants.PROPERTY_NAME); addMultilingualProperties(timespanObject, agent.getAltLabel(), SchemaOrgConstants.PROPERTY_ALTERNATE_NAME); addMultilingualProperties(timespanObject, agent.getNote(), SchemaOrgConstants.PROPERTY_DESCRIPTION); addTextProperties(timespanObject, toList(agent.getOwlSameAs()), SchemaOrgConstants.PROPERTY_SAME_AS); }
Source:
<code>public ResultSet getTableTypes() throws SQLException { String types[] = new String[tableTypeClauses.size()]; int i = 0; for (String s : tableTypeClauses.keySet()) { <START> types[i++] = s; <END> } sortStringArray(types); Field f[] = new Field[1]; List<byte[][]> v = new ArrayList<byte[][]>(); f[0] = new Field("TABLE_TYPE", Oid.VARCHAR); for (String type : types) { byte[][] tuple = new byte[1][]; tuple[0] = connection.encodeString(type); v.add(tuple); } return ((BaseStatement) createMetaDataStatement()).createDriverResultSet(f, v); }</code><technical_language>please convert tableTypeClauses.keySet().toArray(new String[0]) here</technical_language>

Target:
public ResultSet getTableTypes() throws SQLException { String types[] = tableTypeClauses.keySet().toArray(new String[0]); sortStringArray(types); Field f[] = new Field[1]; List<byte[][]> v = new ArrayList<byte[][]>(); f[0] = new Field("TABLE_TYPE", Oid.VARCHAR); for (String type : types) { byte[][] tuple = new byte[1][]; tuple[0] = connection.encodeString(type); v.add(tuple); } return ((BaseStatement) createMetaDataStatement()).createDriverResultSet(f, v); }
Source:
<code>public void clearErrorStat() { <START> hasException = true; <END> this.updateCounts.remove((long) Statement.EXECUTE_FAILED); }</code><technical_language>reverting set hasException false</technical_language>

Target:
public void clearErrorStat() { hasException = false; this.updateCounts.remove((long) Statement.EXECUTE_FAILED); }
Source:
<code>public double next() throws IOException { <START> input.readFully(buffer, 0, (int) SIZE_OF_DOUBLE); <END> return slice.getDouble(0); }</code><technical_language>This cast is necessary (same others)</technical_language>

Target:
public double next() throws IOException { input.readFully(buffer, 0, SIZE_OF_DOUBLE); return slice.getDouble(0); }
Source:
<code>public void shutdown() { executor.shutdown(); <START> try { <END> if (!executor.awaitTermination(60, TimeUnit.SECONDS)) { LOGGER.debug("One minute passed, saving still not completed. Trying forced shutdown."); executor.shutdownNow(); if (executor.awaitTermination(60, TimeUnit.SECONDS)) { LOGGER.debug("One minute passed again - forced shutdown worked."); } else { LOGGER.error("DelayedTaskThrottler did not terminate"); } } } catch (InterruptedException ie) { executor.shutdownNow(); Thread.currentThread().interrupt(); } }</code><technical_language>call helper method</technical_language>

Target:
public void shutdown() { JabRefExecutorService.gracefullyShutdown(executor); }
Source:
<code>private void updateServer(IServerWorkingCopy server) throws OpenShiftException { String connectionUrl = getConnectionUrl(getConnection()); String baseServerName = OpenShiftServerUtils.getServerName(getService(), getConnection()); String serverName = ServerUtils.getServerName(baseServerName); String routeURL = isSelectDefaultRoute() && getRoute() != null ? getRoute().getURL() : null; OpenShiftServerUtils.updateServer( serverName, connectionUrl, getService(), sourcePath, podPath, deployProject, routeURL, server); String profile = getProfileId(); ServerProfileModel.setProfile(server, profile); OpenShiftServerUtils.updateServerProject( connectionUrl, getService(), sourcePath, podPath, routeURL, deployProject); IModule[] matchingModules = ServerUtil.getModules(deployProject); try { <START> server.modifyModules(matchingModules, new IModule[]{}, new NullProgressMonitor()); <END> } catch(CoreException ce) { throw new OpenShiftException(ce, "Could not get add modules to server ", server.getName()); } }</code><technical_language>this fails for nodejs apps</technical_language>

Target:
private void updateServer(IServerWorkingCopy server) throws OpenShiftException { String connectionUrl = getConnectionUrl(getConnection()); String baseServerName = OpenShiftServerUtils.getServerName(getService(), getConnection()); String serverName = ServerUtils.getServerName(baseServerName); String routeURL = isSelectDefaultRoute() && getRoute() != null ? getRoute().getURL() : null; OpenShiftServerUtils.updateServer( serverName, connectionUrl, getService(), sourcePath, podPath, deployProject, routeURL, server); String profile = getProfileId(); ServerProfileModel.setProfile(server, profile); OpenShiftServerUtils.updateServerProject( connectionUrl, getService(), sourcePath, podPath, routeURL, deployProject); IModule[] matchingModules = ServerUtil.getModules(deployProject); if( matchingModules != null && matchingModules.length > 0) { try { server.modifyModules(matchingModules, new IModule[]{}, new NullProgressMonitor()); } catch(CoreException ce) { throw new OpenShiftException(ce, "Could not get add modules to server ", server.getName()); } } }
Source:
<code><START> public CapInfoDTO(List<String> resources, List<String> areas) { <END> this.resources = ImmutableList.copyOf(resources); this.areas = ImmutableList.copyOf(areas); }</code><technical_language>public</technical_language>

Target:
CapInfoDTO(List<String> resources, List<String> areas) { this.resources = ImmutableList.copyOf(resources); this.areas = ImmutableList.copyOf(areas); }
Source:
<code>private int deleteTokensOlderThanSpecifiedDate() { <START> ZonedDateTime cut_off_date = ZonedDateTime.now(ZoneId.of("UTC")).plusDays(DAYS_TILL_EXPIRY); <END> return tokenDao.deleteTokensOlderThanSpecifiedDate(cut_off_date); }</code><technical_language>camel case for Java variables, cutOffDate. get cut date a negative variable do ZonedDateTime.now(ZoneId.of("UTC")).minusDays(TOKEN_EXPIRY_DAYS)</technical_language>

Target:
private int deleteTokensOlderThanSpecifiedDate() { ZonedDateTime cutOffDate = ZonedDateTime.now(ZoneId.of("UTC")).minusDays(TOKEN_EXPIRY_DAYS); return tokenDao.deleteTokensOlderThanSpecifiedDate(cutOffDate); }
Source:
<code>public List<Diagnosis> getUniqueDiagnoses(Patient patient, Date fromDate) { List<Diagnosis> diagnoses = getDiagnoses(patient, fromDate); <START> Set<Diagnosis> uniqueDiagnoses = new HashSet<Diagnosis>(); <END> uniqueDiagnoses.addAll(diagnoses); return new ArrayList<>(uniqueDiagnoses); }</code><technical_language>this implemented in emrapi module</technical_language>

Target:
public List<Diagnosis> getUniqueDiagnoses(Patient patient, Date fromDate) { List<Diagnosis> diagnoses = getDiagnoses(patient, fromDate); Set<CodedOrFreeText> answers = new HashSet<CodedOrFreeText>(); Iterator<Diagnosis> iterator = diagnoses.iterator(); while(iterator.hasNext()) { Diagnosis diagnosis = iterator.next(); if (!answers.add(diagnosis.getDiagnosis())) { iterator.remove(); } } return diagnoses; }
Source:
<code>public Iterable<TestingSchedulingExecutionVertex> getVertices() { <START> return regionVertices.values(); <END> }</code><technical_language>Consider wrapping in Collections.unmodifiableCollection() for immutability returning a copy. in getConsumedResults()</technical_language>

Target:
public Iterable<TestingSchedulingExecutionVertex> getVertices() { return Collections.unmodifiableCollection(regionVertices.values()); }
Source:
<code><START> public Response undeployApplication(int applicationId) <END> { Response response = delete(uri, APPLICATIONS + "/" + applicationId); validateStatusSuccess(response); return response; }</code><technical_language>This class abstract client underlying connection, returning a Response forces client deal it</technical_language>

Target:
public String undeployApplication(int applicationId) { Response response = delete(uri, APPLICATIONS + "/" + applicationId); validateStatusSuccess(response); return response.readEntity(String.class); }
Source:
<code><START> private static String sanitizeNoProxy(String noProxyString) { return sanitizeNonProxyHosts(noProxyString.split(",")); } <END></code><technical_language>names of methods similar - sanitizeNoProxy sanitizeNonProxyHosts do thing. worth combining a more descriptive method name</technical_language>

Target:
private static String sanitizeNoProxy(String noProxyString) { String[] nonProxyHosts = noProxyString.split(","); for (int i = 0; i < nonProxyHosts.length; i++) { String prefixWildcard = ""; String suffixWildcard = ""; String body = nonProxyHosts[i]; if (body.startsWith(".*")) { prefixWildcard = ".*"; body = body.substring(2); } else if (body.startsWith("*") || body.startsWith(".")) { prefixWildcard = ".*"; body = body.substring(1); } if (body.endsWith(".*")) { suffixWildcard = ".*"; body = body.substring(0, body.length() - 2); } else if (body.endsWith("*") || body.endsWith(".")) { suffixWildcard = ".*"; body = body.substring(0, body.length() - 1); } nonProxyHosts[i] = prefixWildcard + Pattern.quote(body) + suffixWildcard; } return String.join("|", nonProxyHosts); }
Source:
<code>private static void serializeIdentity(final PreSharedKeyIdentity principal, final DatagramWriter writer) { writer.writeByte(ClientAuthenticationType.PSK.code); if (principal.isScopedIdentity()) { writer.writeByte((byte) 1); byte[] virtualHost = principal.getVirtualHost() == null ? EMPTY_BYTE_ARRAY : principal.getVirtualHost().getBytes(StandardCharsets.UTF_8); <START> writeBytesWithLength(PSK_LENGTH_BITS, virtualHost, writer); <END> writeBytesWithLength(PSK_LENGTH_BITS, principal.getIdentity().getBytes(StandardCharsets.UTF_8), writer); } else { writer.writeByte((byte) 0); writeBytesWithLength(PSK_LENGTH_BITS, principal.getIdentity().getBytes(StandardCharsets.UTF_8), writer); } }</code><technical_language>sounds a bit strange PSK_LENGHT_BITS constant for virtualHost length</technical_language>

Target:
private static void serializeIdentity(final PreSharedKeyIdentity principal, final DatagramWriter writer) { writer.writeByte(ClientAuthenticationType.PSK.code); if (principal.isScopedIdentity()) { writer.writeByte((byte) 1); byte[] virtualHost = principal.getVirtualHost() == null ? EMPTY_BYTE_ARRAY : principal.getVirtualHost().getBytes(StandardCharsets.UTF_8); writeBytesWithLength(PSK_HOSTNAME_LENGTH_BITS, virtualHost, writer); writeBytesWithLength(PSK_IDENTITY_LENGTH_BITS, principal.getIdentity().getBytes(StandardCharsets.UTF_8), writer); } else { writer.writeByte((byte) 0); writeBytesWithLength(PSK_IDENTITY_LENGTH_BITS, principal.getIdentity().getBytes(StandardCharsets.UTF_8), writer); } }
Source:
<code>public static int getContainerFromTaskTid(ITmfStateSystemBuilder ssb, int taskTid) { int rootQuark = getRootContainerQuark(ssb); int parentContainerQuark = fCONTAINER_QUARK_NOT_FOUND; try { <START> List<Integer> VTIDsSection = ssb.getSubAttributes(rootQuark, true, ContainerAttributes.CONTAINER_TASKS); <END> if (VTIDsSection.size() >= 1) { for (Integer quarkVTIDsSection : VTIDsSection) { List<Integer> VTIDs = ssb.getSubAttributes(quarkVTIDsSection, false); for (Integer quarkVTid : VTIDs) { int real_tid_quark = ssb.getQuarkRelative(quarkVTid, ContainerAttributes.REAL_TID); int tid_in_container = ssb.queryOngoingState(real_tid_quark).unboxInt(); if (taskTid == tid_in_container) { parentContainerQuark = ssb.getParentAttributeQuark(quarkVTid); parentContainerQuark = ssb.getParentAttributeQuark(parentContainerQuark); break; } } } } } catch (AttributeNotFoundException e) { e.printStackTrace(); } return parentContainerQuark; }</code><technical_language>singular, VTIDSection. in French (ex. magasin de souliers a shoe store)</technical_language>

Target:
public static int getContainerFromTaskTid(ITmfStateSystemBuilder ssb, int taskTid) { int rootQuark = getRootContainerQuark(ssb); int parentContainerQuark = CONTAINER_QUARK_NOT_FOUND; try { List<Integer> vtidSection = ssb.getSubAttributes(rootQuark, true, ContainerAttributes.CONTAINER_TASKS); if (!vtidSection.isEmpty()) { for (Integer quarkVTIDSection : vtidSection) { List<Integer> VTIDs = ssb.getSubAttributes(quarkVTIDSection, false); for (Integer quarkVTid : VTIDs) { int real_tid_quark = ssb.getQuarkRelative(quarkVTid, ContainerAttributes.REAL_TID); int tid_in_container = ssb.queryOngoingState(real_tid_quark).unboxInt(); if (taskTid == tid_in_container) { parentContainerQuark = ssb.getParentAttributeQuark(quarkVTid); parentContainerQuark = ssb.getParentAttributeQuark(parentContainerQuark); return parentContainerQuark; } } } } } catch (AttributeNotFoundException e) { throw new IllegalStateException(); } return parentContainerQuark; }
Source:
<code>public void onPartitionBecomeOfflineFromInactive(String partitionName) { PartitionStateChangeListener replicationManagerListener = partitionStateChangeListeners.get(StateModelListenerType.ReplicationManagerListener); if (replicationManagerListener != null) { try { replicationManagerListener.onPartitionBecomeOfflineFromInactive(partitionName); replicaSyncUpManager.waitDisconnectionCompleted(partitionName); } catch (InterruptedException e) { logger.error("Disconnection was interrupted on partition {}", partitionName); participantMetrics.inactiveCount.addAndGet(-1); participantMetrics.errorStateCount.addAndGet(1); throw new StateTransitionException("Disconnection failed or was interrupted", DisconnectionFailure); } catch (StateTransitionException e) { logger.error("Disconnection didn't complete ", e); participantMetrics.inactiveCount.addAndGet(-1); participantMetrics.errorStateCount.addAndGet(1); throw e; } } PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); if (storageManagerListener != null) { try { storageManagerListener.onPartitionBecomeOfflineFromInactive(partitionName); } catch (Exception e) { participantMetrics.inactiveCount.addAndGet(-1); participantMetrics.errorStateCount.addAndGet(1); throw e; } } <START> participantMetrics.inactiveCount.addAndGet(-1); <END> participantMetrics.offlineCount.addAndGet(1); }</code><technical_language>finally</technical_language>

Target:
public void onPartitionBecomeOfflineFromInactive(String partitionName) { PartitionStateChangeListener replicationManagerListener = partitionStateChangeListeners.get(StateModelListenerType.ReplicationManagerListener); try { if (replicationManagerListener != null) { replicationManagerListener.onPartitionBecomeOfflineFromInactive(partitionName); replicaSyncUpManager.waitDisconnectionCompleted(partitionName); } PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); if (storageManagerListener != null) { storageManagerListener.onPartitionBecomeOfflineFromInactive(partitionName); } } catch (InterruptedException e) { logger.error("Disconnection was interrupted on partition {}", partitionName); participantMetrics.errorStateCount.addAndGet(1); throw new StateTransitionException("Disconnection failed or was interrupted", DisconnectionFailure); } catch (StateTransitionException e) { logger.error("Exception occurred during Inactive-To-Offline transition ", e); participantMetrics.errorStateCount.addAndGet(1); throw e; } finally { participantMetrics.inactiveCount.addAndGet(-1); } participantMetrics.offlineCount.addAndGet(1); }
Source:
<code>private void findAllOccurrences(TreeItem item, Object element, ArrayList<TreeItem> list) { if (element.equals(item.getData())) { list.add(item); } for (TreeItem <START> item2 : <END> item.getItems()) { findAllOccurrences(item2, element, list); } }</code><technical_language>rename child childItem</technical_language>

Target:
private void findAllOccurrences(TreeItem item, Object element, ArrayList<TreeItem> list) { if (element.equals(item.getData())) { list.add(item); } for (TreeItem childItem : item.getItems()) { findAllOccurrences(childItem, element, list); } }