auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void handleAsyncUntaggedResponse(ImapResponse response) throws IOException, MessagingException { <END> if (stop) { if (K9MailLib.isDebug()) { Timber.d("Got async untagged response: %s, but stop is set for %s", response, getLogId()); } idleStopper.stopIdle(); } else { if (response.getTag() == null) { if (response.size() > 1) { if (isUntaggedResponseSupported(response)) { wakeLock.acquire(PUSH_WAKE_LOCK_TIMEOUT); if (K9MailLib.isDebug()) { Timber.d("Got useful async untagged response: %s for %s", response, getLogId()); } synchronized (storedUntaggedResponses) { storedUntaggedResponses.add(response); if (!folder.getConnection().areMoreResponsesAvailable()) { processStoredUntaggedResponses(); } } } } else if (response.isContinuationRequested()) { if (K9MailLib.isDebug()) { Timber.d("Idling %s", getLogId()); } idleStopper.startAcceptingDoneContinuation(folder.getConnection()); wakeLock.release(); } } } }</code><technical_language>while it, please change this anonymous class PushRunnable implement interface. executeSimpleCommand(Commands.IDLE, this) executesimpleCommand(Commands.IDLE, untaggedResponseHandler), easier trace handling in IDE. e.g. java private UntaggedHandler untaggedResponseHandler = new UntaggedHandler() { ... } (also, is this "async"? a callback is called in thread runs executeSimpleCommand, it?)</technical_language>

Target:
public void handleAsyncUntaggedResponse(ImapResponse response) { if (K9MailLib.isDebug()) { Timber.v("Got async response: %s", response); } if (stop) { if (K9MailLib.isDebug()) { Timber.d("Got async untagged response: %s, but stop is set for %s", response, getLogId()); } idleStopper.stopIdle(); } else { if (response.getTag() == null) { if (response.size() > 1) { Object responseType = response.get(1); if (equalsIgnoreCase(responseType, "EXISTS") || equalsIgnoreCase(responseType, "EXPUNGE") || equalsIgnoreCase(responseType, "FETCH")) { wakeLock.acquire(PUSH_WAKE_LOCK_TIMEOUT); if (K9MailLib.isDebug()) { Timber.d("Got useful async untagged response: %s for %s", response, getLogId()); } idleStopper.stopIdle(); } } else if (response.isContinuationRequested()) { if (K9MailLib.isDebug()) { Timber.d("Idling %s", getLogId()); } idleStopper.startAcceptingDoneContinuation(connection); wakeLock.release(); } } } }
Source:
<code>public void onPlayerLogin(PlayerLoginEvent event) { TFM_ServerInterface.handlePlayerLogin(event); <START> if(TFM_ConfigEntry.FORCE_IP_ENABLED.getBoolean()){ <END> if(!event.getHostname().equalsIgnoreCase(TFM_ConfigEntry.SERVER_HOSTNAME.getString() + ":" + TFM_ConfigEntry.SERVER_PORT.getInteger())){ event.disallow(PlayerLoginEvent.Result.KICK_OTHER, TFM_ConfigEntry.FORCE_IP_KICKMSG.getString()); } } }</code><technical_language>a space curly brace</technical_language>

Target:
public void onPlayerLogin(PlayerLoginEvent event) { TFM_ServerInterface.handlePlayerLogin(event); if(TFM_ConfigEntry.FORCE_IP_ENABLED.getBoolean()) { if(!event.getHostname().equalsIgnoreCase(TFM_ConfigEntry.SERVER_ADDRESS.getString())) { event.disallow(PlayerLoginEvent.Result.KICK_OTHER, TFM_ConfigEntry.FORCE_IP_KICKMSG.getString().replace("%address%", TFM_ConfigEntry.SERVER_ADDRESS.getString())); } } }
Source:
<code>private CreateFunctionDesc build() throws SemanticException { replCopyTasks.clear(); PrimaryToReplicaResourceFunction conversionFunction = new PrimaryToReplicaResourceFunction(context, metadata, destinationDbName); List<ResourceUri> transformedUris = ImmutableList.copyOf( Lists.transform(metadata.function.getResourceUris(), conversionFunction) ); replCopyTasks.addAll(conversionFunction.replCopyTasks); String fullQualifiedFunctionName = FunctionUtils.qualifyFunctionName( metadata.function.getFunctionName(), destinationDbName ); <START> ReplicationSpec replSpec = (context.dmd == null) ? null : eventOnlyReplicationSpec(context); <END> return new CreateFunctionDesc( fullQualifiedFunctionName, false, metadata.function.getClassName(), transformedUris, replSpec ); }</code><technical_language>_dumpmetadata null anytime</technical_language>

Target:
private CreateFunctionDesc build() throws SemanticException { replCopyTasks.clear(); PrimaryToReplicaResourceFunction conversionFunction = new PrimaryToReplicaResourceFunction(context, metadata, destinationDbName); List<ResourceUri> transformedUris = ImmutableList.copyOf( Lists.transform(metadata.function.getResourceUris(), conversionFunction) ); replCopyTasks.addAll(conversionFunction.replCopyTasks); String fullQualifiedFunctionName = FunctionUtils.qualifyFunctionName( metadata.function.getFunctionName(), destinationDbName ); ReplicationSpec replSpec = (context.dmd == null) ? null : context.eventOnlyReplicationSpec(); return new CreateFunctionDesc( fullQualifiedFunctionName, false, metadata.function.getClassName(), transformedUris, replSpec ); }
Source:
<code>private void onDeviceRejected(String deviceId, String deviceName) { if (deviceId == null) { return; } Log.d(TAG, "Unknown device " + deviceName + "(" + deviceId + ") wants to connect"); String title = mContext.getString(R.string.device_rejected, deviceName.isEmpty() ? deviceId.substring(0, 7) : deviceName); <START> int notificationId = mNotificationHandler.getNotificationIdFromText(title); <END> Intent intentAccept = new Intent(mContext, DeviceActivity.class) .putExtra(DeviceActivity.EXTRA_NOTIFICATION_ID, notificationId) .putExtra(DeviceActivity.EXTRA_IS_CREATE, true) .putExtra(DeviceActivity.EXTRA_DEVICE_ID, deviceId) .putExtra(DeviceActivity.EXTRA_DEVICE_NAME, deviceName); int requestCode = deviceId.hashCode(); PendingIntent piAccept = PendingIntent.getActivity(mContext, requestCode, intentAccept, PendingIntent.FLAG_UPDATE_CURRENT); Intent intentIgnore = new Intent(mContext, SyncthingService.class) .putExtra(SyncthingService.EXTRA_NOTIFICATION_ID, notificationId) .putExtra(SyncthingService.EXTRA_DEVICE_ID, deviceId); intentIgnore.setAction(SyncthingService.ACTION_IGNORE_DEVICE); PendingIntent piIgnore = PendingIntent.getService(mContext, 0, intentIgnore, PendingIntent.FLAG_UPDATE_CURRENT); mNotificationHandler.showConsentNotification(notificationId, title, piAccept, piIgnore); }</code><technical_language>id hashcode of device id</technical_language>

Target:
private void onDeviceRejected(String deviceId, String deviceName) { if (deviceId == null) { return; } Log.d(TAG, "Unknown device " + deviceName + "(" + deviceId + ") wants to connect"); String title = mContext.getString(R.string.device_rejected, deviceName.isEmpty() ? deviceId.substring(0, 7) : deviceName); int notificationId = mNotificationHandler.getNotificationIdFromText(title); Intent intentAccept = new Intent(mContext, DeviceActivity.class) .putExtra(DeviceActivity.EXTRA_NOTIFICATION_ID, notificationId) .putExtra(DeviceActivity.EXTRA_IS_CREATE, true) .putExtra(DeviceActivity.EXTRA_DEVICE_ID, deviceId) .putExtra(DeviceActivity.EXTRA_DEVICE_NAME, deviceName); PendingIntent piAccept = PendingIntent.getActivity(mContext, notificationId, intentAccept, PendingIntent.FLAG_UPDATE_CURRENT); Intent intentIgnore = new Intent(mContext, SyncthingService.class) .putExtra(SyncthingService.EXTRA_NOTIFICATION_ID, notificationId) .putExtra(SyncthingService.EXTRA_DEVICE_ID, deviceId); intentIgnore.setAction(SyncthingService.ACTION_IGNORE_DEVICE); PendingIntent piIgnore = PendingIntent.getService(mContext, 0, intentIgnore, PendingIntent.FLAG_UPDATE_CURRENT); mNotificationHandler.showConsentNotification(notificationId, title, piAccept, piIgnore); }
Source:
<code>public Builder createTokenAt(CreateTokenAtStatementBuilder createTokenAt) { <START> this.createTokenAt = createTokenAt; <END> return this; }</code><technical_language>a BuilderUtils#assertNonNull calls for statement builder a clean safe guard methods I think</technical_language>

Target:
public Builder createTokenAt(CreateTokenAtStatementBuilder createTokenAt) { assertNonNull(createTokenAt, "createTokenAt may not be null"); this.createTokenAt = createTokenAt; return this; }
Source:
<code>private void decodeLocalizedTitles(DBObject dbObject, Described entity) { <START> if (dbObject.containsField(LOCALIZED_TITLES_KEY)) { <END> List<DBObject> localisedTitlesDBO = TranslatorUtils.toDBObjectList(dbObject, LOCALIZED_TITLES_KEY); entity.setLocalizedTitles(Iterables.transform(localisedTitlesDBO, new Function<DBObject, LocalizedTitle>() { @Override public LocalizedTitle apply(DBObject input) { return localizedTitleTranslator.fromDBObject(input, new LocalizedTitle()); } })); } }</code><technical_language>I need this condition. TranslatorUtils.toDBObjectList return emptylist if key set, fine</technical_language>

Target:
private void decodeLocalizedTitles(DBObject dbObject, Described entity) { List<DBObject> localisedTitlesDBO = TranslatorUtils.toDBObjectList(dbObject, LOCALIZED_TITLES_KEY); entity.setLocalizedTitles(Iterables.transform(localisedTitlesDBO, new Function<DBObject, LocalizedTitle>() { @Override public LocalizedTitle apply(DBObject input) { return localizedTitleTranslator.fromDBObject(input, new LocalizedTitle()); } })); }
Source:
<code>protected String getItem(Map<Object, Object> keys, Object pool, String qualifier, PooledResourceOptions options) { PooledResourceItemGenerator generator = null; List<String> tryItems = new ArrayList<>(); if (options.getRequestedItems() != null) { tryItems.addAll(options.getRequestedItems()); } else { tryItems.add(options.getRequestedItem()); } for (PooledResourceItemGeneratorFactory factory : factories) { generator = factory.getGenerator(pool, qualifier); if (generator != null) { break; } } if (generator == null) { log.error("Failed to find generator for pool [{}]", pool); return null; } <START> for (int i = 0; i < tryItems.size(); i++) { <END> if (tryItems.get(i) != null && generator.isInPool(tryItems.get(i))) { String item = tryItems.get(i); Map<Object, Object> newKeys = new HashMap<Object, Object>(keys); newKeys.put(RESOURCE_POOL.ITEM, item); Map<String, Object> props = objectManager.convertToPropertiesFor(ResourcePool.class, newKeys); try { return objectManager.create(ResourcePool.class, props).getItem(); } catch (DataAccessException e) { log.debug("Failed to create item [{}]", item); } } } while (generator.hasNext()) { String item = generator.next(); Map<Object, Object> newKeys = new HashMap<Object, Object>(keys); newKeys.put(RESOURCE_POOL.ITEM, item); Map<String, Object> props = objectManager.convertToPropertiesFor(ResourcePool.class, newKeys); try { return objectManager.create(ResourcePool.class, props).getItem(); } catch (DataAccessException e) { log.debug("Failed to create item [{}]", item); } } return null; }</code><technical_language>Nit: neater construct: for (item in tryItems) { }</technical_language>

Target:
protected String getItem(Map<Object, Object> keys, Object pool, String qualifier, PooledResourceOptions options) { PooledResourceItemGenerator generator = null; List<String> tryItems = new ArrayList<>(); if (options.getRequestedItems() != null) { tryItems.addAll(options.getRequestedItems()); } else { tryItems.add(options.getRequestedItem()); } for (PooledResourceItemGeneratorFactory factory : factories) { generator = factory.getGenerator(pool, qualifier); if (generator != null) { break; } } if (generator == null) { log.error("Failed to find generator for pool [{}]", pool); return null; } for (String item: tryItems) { if (!StringUtils.isEmpty(item) && generator.isInPool(item)) { Map<Object, Object> newKeys = new HashMap<Object, Object>(keys); newKeys.put(RESOURCE_POOL.ITEM, item); Map<String, Object> props = objectManager.convertToPropertiesFor(ResourcePool.class, newKeys); try { return objectManager.create(ResourcePool.class, props).getItem(); } catch (DataAccessException e) { log.debug("Failed to create item [{}]", item); } } } while (generator.hasNext()) { String item = generator.next(); Map<Object, Object> newKeys = new HashMap<Object, Object>(keys); newKeys.put(RESOURCE_POOL.ITEM, item); Map<String, Object> props = objectManager.convertToPropertiesFor(ResourcePool.class, newKeys); try { return objectManager.create(ResourcePool.class, props).getItem(); } catch (DataAccessException e) { log.debug("Failed to create item [{}]", item); } } return null; }
Source:
<code>public void testMissingUnionBranch() throws Exception { <START> List<SchemaIncompatibilityType> types = new ArrayList<SchemaCompatibility.SchemaIncompatibilityType>(details.size()); <END> for (int i = 0 ; i < details.size() ; i++) { types.add(SchemaIncompatibilityType.MISSING_UNION_BRANCH); } validateIncompatibleSchemas(reader, writer, types, details, location); }</code><technical_language>nit: I create a list N SchemaIncompatibilityType.MISSING_UNION_BRANCH items in a single line java.util.Collections#nCopies return is immutable, in this case is issue</technical_language>

Target:
public void testMissingUnionBranch() throws Exception { List<SchemaIncompatibilityType> types = Collections.nCopies(details.size(), SchemaIncompatibilityType.MISSING_UNION_BRANCH); validateIncompatibleSchemas(reader, writer, types, details, location); }
Source:
<code>public static MetricKey<ASTMethodOrConstructorDeclaration> of(final Metric<ASTMethodOrConstructorDeclaration> metric, final String name) { return new MetricKey<ASTMethodOrConstructorDeclaration>() { @Override public String name() { return name; } @Override public Metric<ASTMethodOrConstructorDeclaration> getCalculator() { return metric; } @Override public boolean supports(ASTMethodOrConstructorDeclaration node) { return metric.supports(node); } @Override public boolean equals(Object obj) { <START> return obj == this; <END> } @Override public int hashCode() { return (metric != null ? metric.hashCode() * 31 : 0) + (name != null ? name.hashCode() : 0); } }; }</code><technical_language>equals method. Please update similar in JavaClassMetricKey. Thanks</technical_language>

Target:
public static MetricKey<ASTMethodOrConstructorDeclaration> of(final Metric<ASTMethodOrConstructorDeclaration> metric, final String name) { return new MetricKey<ASTMethodOrConstructorDeclaration>() { @Override public String name() { return name; } @Override public Metric<ASTMethodOrConstructorDeclaration> getCalculator() { return metric; } @Override public boolean supports(ASTMethodOrConstructorDeclaration node) { return metric.supports(node); } @Override public boolean equals(Object obj) { return obj != null && getClass() == obj.getClass() && Objects.equals(name(), getClass().cast(obj).name()) && Objects.equals(getCalculator(), getClass().cast(obj).getCalculator()); } @Override public int hashCode() { return (metric != null ? metric.hashCode() * 31 : 0) + (name != null ? name.hashCode() : 0); } }; }
Source:
<code>private static void collateVisible(final WComponent component, final List<WComponent> list) { if (component.isVisible()) { if (component instanceof Container) { <START> for (WComponent child : ((Container) component).getChildren()) { <END> collateVisible(child, list); } } list.add(component); } }</code><technical_language>new getChildren() method is good API easier use. component extends AbstractWComponent, careful of performance. new getChildren() method needs looked a "public" API - job is writing code easier for application developers. sense returns list of children unmodifiable list protect internal data external code. AbstractComponent needs work internally list of children, need overhead of creating unmodifiable list - life easier for framework developers. for performance, AbstractWComponent continue list model. get a nice "for each" pattern internally is for performance create unmodifiable list exists protect internal data external code</technical_language>

Target:
private static void collateVisible(final WComponent component, final List<WComponent> list) { if (component.isVisible()) { if (component instanceof Container) { final int size = ((Container) component).getChildCount(); for (int i = 0; i < size; i++) { collateVisible(((Container) component).getChildAt(i), list); } } list.add(component); } }
Source:
<code>public PagesSpatialIndexSupplier( Session session, LongArrayList addresses, List<Type> types, List<Integer> outputChannels, List<List<Block>> channels, int geometryChannel, BiPredicate<OGCGeometry, OGCGeometry> spatialRelationshipTest, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory) { STRtree rtree = buildRTree(addresses, channels, geometryChannel); if (rtree.isEmpty()) { <START> index = EMPTY_INDEX; <END> } else { index = new PagesRTreeIndex(session, addresses, types, outputChannels, channels, rtree, spatialRelationshipTest, filterFunctionFactory); } }</code><technical_language>Do need this special case? create a regular PagesRTreeIndex</technical_language>

Target:
public PagesSpatialIndexSupplier( Session session, LongArrayList addresses, List<Type> types, List<Integer> outputChannels, List<List<Block>> channels, int geometryChannel, BiPredicate<OGCGeometry, OGCGeometry> spatialRelationshipTest, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory) { this.session = session; this.addresses = addresses; this.types = types; this.outputChannels = outputChannels; this.channels = channels; this.spatialRelationshipTest = spatialRelationshipTest; this.filterFunctionFactory = filterFunctionFactory; this.rtree = buildRTree(addresses, channels, geometryChannel); this.memorySizeInBytes = INSTANCE_SIZE + (rtree.isEmpty() ? 0 : STRTREE_INSTANCE_SIZE + computeMemorySizeInBytes(rtree.getRoot())); }
Source:
<code>public void editSocketBinding() throws Exception { String socketBinding = undertowOps.createSocketBinding(); <START> ModelNodeResult result = operations.readAttribute(HTTPS_LISTENER_ADDRESS, SOCKET_BINDING); <END> try { new ConfigChecker.Builder(client, HTTPS_LISTENER_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, SOCKET_BINDING, socketBinding) .verifyFormSaved() .verifyAttribute(SOCKET_BINDING, socketBinding); } finally { operations.writeAttribute(HTTPS_LISTENER_ADDRESS, SOCKET_BINDING, result.value()); } }</code><technical_language>ReadAttributeOption.NOT_INCLUDE_DEFAULTS properly retrieve orig value</technical_language>

Target:
public void editSocketBinding() throws Exception { String socketBinding = undertowOps.createSocketBinding(); ModelNode originalSocketBindingValue = operations.readAttribute(HTTPS_LISTENER_ADDRESS, SOCKET_BINDING, ReadAttributeOption.NOT_INCLUDE_DEFAULTS).value(); try { new ConfigChecker.Builder(client, HTTPS_LISTENER_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, SOCKET_BINDING, socketBinding) .verifyFormSaved() .verifyAttribute(SOCKET_BINDING, socketBinding); } finally { operations.writeAttribute(HTTPS_LISTENER_ADDRESS, SOCKET_BINDING, originalSocketBindingValue); } }
Source:
<code>public void start(ServiceProvider<Service> serviceProvider) { this.clusteringService = serviceProvider.getService(ClusteringService.class); this.managementRegistryService = serviceProvider.getService(ManagementRegistryService.class); this.cacheManager = serviceProvider.getService(CacheManagerProviderService.class).getCacheManager(); this.managementCallExecutor = serviceProvider.getService(ExecutionService.class).getOrderedExecutor( configuration.getManagementCallExecutorAlias(), <START> new LinkedBlockingQueue<Runnable>(configuration.getManagementCallQueueSize())); <END> this.collectorService = new DefaultCollectorService(this); this.collectorService.start(serviceProvider); EntityService entityService = serviceProvider.getService(EntityService.class); this.managementAgentEntityFactory = entityService.newClientEntityFactory( ManagementAgentEntityFactory.ENTITYNAME, ManagementAgentEntity.class, ManagementAgentVersion.LATEST.version(), new ManagementAgentConfig()); this.cacheManager.registerListener(this); }</code><technical_language>changing LinkedBlockingQueue</technical_language>

Target:
public void start(ServiceProvider<Service> serviceProvider) { this.clusteringService = serviceProvider.getService(ClusteringService.class); this.managementRegistryService = serviceProvider.getService(ManagementRegistryService.class); this.cacheManager = serviceProvider.getService(CacheManagerProviderService.class).getCacheManager(); this.managementCallExecutor = serviceProvider.getService(ExecutionService.class).getOrderedExecutor( configuration.getManagementCallExecutorAlias(), new ArrayBlockingQueue<Runnable>(configuration.getManagementCallQueueSize())); this.collectorService = new DefaultCollectorService(this); this.collectorService.start(serviceProvider); EntityService entityService = serviceProvider.getService(EntityService.class); this.managementAgentEntityFactory = entityService.newClientEntityFactory( ManagementAgentEntityFactory.ENTITYNAME, ManagementAgentEntity.class, ManagementAgentVersion.LATEST.version(), new ManagementAgentConfig()); this.cacheManager.registerListener(this); }
Source:
<code>public void testVisibilityDefaultMemberFunction() throws Exception { IBinding[] memberBindings = findQualifiedPossiblyImplicit(pdom, "AClass::defaultMemFun"); <START> int visibility = getMemberVisibility(memberBindings[0]); <END> VisibilityAsserts.assertVisibility(ICPPClassType.v_private, visibility); }</code><technical_language>Inline visibility variables in this other tests</technical_language>

Target:
public void testVisibilityDefaultMemberFunction() throws Exception { IBinding[] memberBindings = findQualifiedPossiblyImplicit(pdom, "AClass::defaultMemFun"); assertVisibility(ICPPClassType.v_private, getMemberVisibility(memberBindings[0])); }
Source:
<code>public List<Unit> getUnits(boolean weightClassSorted, boolean weightSorted, boolean unitTypeSorted) { List<Unit> units = getCopyOfUnits(); Comparator<String> naturalOrderComparator = new NaturalOrderComparator(); units.sort((o1, o2) -> naturalOrderComparator.compare(o1.getName(), o2.getName())); if (weightClassSorted || weightSorted || unitTypeSorted) { if (weightSorted && weightClassSorted) { units.sort((lhs, rhs) -> { int weightClass1 = lhs.getEntity().getWeightClass(); int weightClass2 = rhs.getEntity().getWeightClass(); if (weightClass1 == weightClass2) { <START> return (int) (rhs.getEntity().getWeight() - lhs.getEntity().getWeight()); <END> } else { return weightClass2 - weightClass1; } }); } else if (weightClassSorted) { units.sort(Comparator.comparingInt(o -> o.getEntity().getWeightClass())); } else if (weightSorted) { units.sort((lhs, rhs) -> Double.compare(rhs.getEntity().getWeight(), lhs.getEntity().getWeight())); } if (unitTypeSorted) { units.sort(Comparator.comparingInt(e -> e.getEntity().getUnitType())); } } return units; }</code><technical_language>suggestion return Double.compare(rhs.getEntity().getWeight(), lhs.getEntity().getWeight());</technical_language>

Target:
public List<Unit> getUnits(boolean weightClassSorted, boolean weightSorted, boolean unitTypeSorted) { List<Unit> units = getCopyOfUnits(); units.sort(Comparator.comparing(Unit::getName, new NaturalOrderComparator())); if (weightClassSorted || weightSorted || unitTypeSorted) { if (weightSorted && weightClassSorted) { units.sort((lhs, rhs) -> { int weightClass1 = lhs.getEntity().getWeightClass(); int weightClass2 = rhs.getEntity().getWeightClass(); if (weightClass1 == weightClass2) { return Double.compare(rhs.getEntity().getWeight(), lhs.getEntity().getWeight()); } else { return weightClass2 - weightClass1; } }); } else if (weightClassSorted) { units.sort(Comparator.comparingInt(o -> o.getEntity().getWeightClass())); } else if (weightSorted) { units.sort(Comparator.comparingDouble(o -> o.getEntity().getWeight())); } if (unitTypeSorted) { units.sort(Comparator.comparingInt(e -> e.getEntity().getUnitType())); } } return units; }
Source:
<code><START> public Spliterator<TruthVersusEval> spliterator() { <END> return Spliterators.spliteratorUnknownSize(this, 0); }</code><technical_language>This method private</technical_language>

Target:
private Spliterator<TruthVersusEval> spliterator() { return Spliterators.spliteratorUnknownSize(this, 0); }
Source:
<code>public void validate() { if (attributes.attribute(SIMPLE_CACHE).get()) { validateSimpleCacheConfiguration(); } List<RuntimeException> validationExceptions = new ArrayList<>(); for (Builder<?> validatable: asList(clustering, customInterceptors, dataContainer, deadlockDetection, eviction, expiration, indexing, invocationBatching, jmxStatistics, persistence, locking, storeAsBinary, transaction, versioning, unsafe, sites, compatibility)) { try { validatable.validate(); } catch (RuntimeException e) { validationExceptions.add(e); } } for (Builder<?> m : modules) { try { m.validate(); <START> } catch (CacheConfigurationException e) { <END> validationExceptions.add(e); } } CacheConfigurationException.fromMultipleRuntimeExceptions(validationExceptions).ifPresent(e -> { throw e; }); }</code><technical_language>RuntimeException</technical_language>

Target:
public void validate() { if (attributes.attribute(SIMPLE_CACHE).get()) { validateSimpleCacheConfiguration(); } List<RuntimeException> validationExceptions = new ArrayList<>(); for (Builder<?> validatable: asList(clustering, customInterceptors, dataContainer, deadlockDetection, eviction, expiration, indexing, invocationBatching, jmxStatistics, persistence, locking, storeAsBinary, transaction, versioning, unsafe, sites, compatibility)) { try { validatable.validate(); } catch (RuntimeException e) { validationExceptions.add(e); } } for (Builder<?> m : modules) { try { m.validate(); } catch (RuntimeException e) { validationExceptions.add(e); } } CacheConfigurationException.fromMultipleRuntimeExceptions(validationExceptions).ifPresent(e -> { throw e; }); }
Source:
<code>public void outbound(SmppOutboundMessageEntity request) throws SmppInvalidArgumentException, IOException { byte[] textBytes; int smppTonNpiValue = Integer.parseInt(SmppService.getSmppTonNpiValue()); SubmitSm submit0 = new SubmitSm(); submit0.setSourceAddress(new Address((byte) smppTonNpiValue, (byte) smppTonNpiValue, request.getSmppFrom())); submit0.setDestAddress(new Address((byte) smppTonNpiValue, (byte) smppTonNpiValue, request.getSmppTo())); if (CharsetUtil.CHARSET_UCS_2 == request.getSmppEncoding()) { submit0.setDataCoding(DataCoding.DATA_CODING_UCS2); textBytes = CharsetUtil.encode(request.getSmppContent(), CharsetUtil.CHARSET_UCS_2); } else { submit0.setDataCoding(DataCoding.DATA_CODING_GSM7); <START> textBytes = CharsetUtil.encode(request.getSmppContent(), CharsetUtil.CHARSET_ISO_8859_1); <END> } submit0.setShortMessage(textBytes); TlvSet tlvSet = request.getTlvSet(); if (tlvSet != null) { for (Tlv tlv : (Collection<Tlv>) tlvSet.getOptionalParameters()) { submit0.setOptionalParameter(tlv); } } else if (logger.isInfoEnabled()) { logger.info("TlvSet is null"); } try { if (logger.isInfoEnabled()) { logger.info("Sending SubmitSM for " + request); } SmppClientOpsThread.getSmppSession().submit(submit0, 10000); } catch (RecoverablePduException | UnrecoverablePduException | SmppTimeoutException | SmppChannelException | InterruptedException e) { logger.error("SMPP message cannot be sent : " + e); } }</code><technical_language>this is mentioned is specific Provider/nexmo,right</technical_language>

Target:
public void outbound(SmppOutboundMessageEntity request) throws SmppInvalidArgumentException, IOException { byte[] textBytes; int smppTonNpiValue = Integer.parseInt(SmppService.getSmppTonNpiValue()); SubmitSm submit0 = new SubmitSm(); submit0.setSourceAddress(new Address((byte) smppTonNpiValue, (byte) smppTonNpiValue, request.getSmppFrom())); submit0.setDestAddress(new Address((byte) smppTonNpiValue, (byte) smppTonNpiValue, request.getSmppTo())); if (CharsetUtil.CHARSET_UCS_2 == request.getSmppEncoding()) { submit0.setDataCoding(SmppConstants.DATA_CODING_UCS2); textBytes = CharsetUtil.encode(request.getSmppContent(), CharsetUtil.CHARSET_UCS_2); } else { submit0.setDataCoding(SmppConstants.DATA_CODING_DEFAULT); textBytes = CharsetUtil.encode(request.getSmppContent(), SmppClientOpsThread.getOutboundDefaultEncoding()); } submit0.setShortMessage(textBytes); TlvSet tlvSet = request.getTlvSet(); if (tlvSet != null) { for (Tlv tlv : (Collection<Tlv>) tlvSet.getOptionalParameters()) { submit0.setOptionalParameter(tlv); } } else if (logger.isInfoEnabled()) { logger.info("TlvSet is null"); } try { if (logger.isInfoEnabled()) { logger.info("Sending SubmitSM for " + request); } SmppClientOpsThread.getSmppSession().submit(submit0, 10000); } catch (RecoverablePduException | UnrecoverablePduException | SmppTimeoutException | SmppChannelException | InterruptedException e) { logger.error("SMPP message cannot be sent : " + e); } }
Source:
<code>public void initializeContextTypeResolvers() { addResolver(new GlobalTemplateVariables.Cursor()); addResolver(new GlobalTemplateVariables.WordSelection()); addResolver(new <START> Selection(org.eclipse.jface.text.templates.GlobalTemplateVariables.LineSelection.NAME, <END> JavaTemplateMessages.CompilationUnitContextType_variable_description_line_selection)); addResolver(new GlobalTemplateVariables.Dollar()); addResolver(new GlobalTemplateVariables.Date()); addResolver(new GlobalTemplateVariables.Year()); addResolver(new GlobalTemplateVariables.Time()); addResolver(new GlobalTemplateVariables.User()); addResolver(new File()); addResolver(new PrimaryTypeName()); addResolver(new ReturnType()); addResolver(new Method()); addResolver(new Type()); addResolver(new Package()); addResolver(new Project()); addResolver(new Arguments()); addResolver(new Array()); addResolver(new ArrayType()); addResolver(new ArrayElement()); addResolver(new Index()); addResolver(new Iterator()); addResolver(new Collection()); addResolver(new Iterable()); addResolver(new IterableType()); addResolver(new IterableElement()); addResolver(new Todo()); }</code><technical_language>Please pattern other ones, i.e. GlobalTemplateVariables.Selection</technical_language>

Target:
public void initializeContextTypeResolvers() { addResolver(new GlobalTemplateVariables.Cursor()); addResolver(new GlobalTemplateVariables.WordSelection()); addResolver(new GlobalTemplateVariables.Selection(GlobalTemplateVariables.LineSelection.NAME, JavaTemplateMessages.CompilationUnitContextType_variable_description_line_selection)); addResolver(new GlobalTemplateVariables.Dollar()); addResolver(new GlobalTemplateVariables.Date()); addResolver(new GlobalTemplateVariables.Year()); addResolver(new GlobalTemplateVariables.Time()); addResolver(new GlobalTemplateVariables.User()); addResolver(new File()); addResolver(new PrimaryTypeName()); addResolver(new ReturnType()); addResolver(new Method()); addResolver(new Type()); addResolver(new Package()); addResolver(new Project()); addResolver(new Arguments()); addResolver(new Array()); addResolver(new ArrayType()); addResolver(new ArrayElement()); addResolver(new Index()); addResolver(new Iterator()); addResolver(new Collection()); addResolver(new Iterable()); addResolver(new IterableType()); addResolver(new IterableElement()); addResolver(new Todo()); }
Source:
<code>private Date getDateFromDiskDescription(Map<String, Object> map) { try { return new SimpleDateFormat(OvfParser.formatStrFromDiskDescription).parse(map.get(OvfInfoFileConstants.LastUpdated) .toString()); } catch (java.text.ParseException e) { log.errorFormat("LastUpdate Date could not be parsed from disk desscription"); <START> e.printStackTrace(); <END> return null; } }</code><technical_language>log exception in debug</technical_language>

Target:
private Date getDateFromDiskDescription(Map<String, Object> map) { try { return new SimpleDateFormat(OvfParser.formatStrFromDiskDescription).parse(map.get(OvfInfoFileConstants.LastUpdated) .toString()); } catch (java.text.ParseException e) { log.errorFormat("LastUpdate Date could not be parsed from disk desscription. Exception: {0}", e); return null; } }
Source:
<code>public static void execute(Runnable command) { try { es.submit(new InternalWrapperRunnable(command, ThreadLocalParamsContainer.getVdcUser(), ThreadLocalParamsContainer.getHttpSessionId())); } catch (RejectedExecutionException e) { log.error("The thread pool is out of limit. A submitted task was rejected"); throw e; <START> } <END> }</code><technical_language>message warnning level error</technical_language>

Target:
public static void execute(Runnable command) { try { es.submit(new InternalWrapperRunnable(command, ThreadLocalParamsContainer.getVdcUser(), ThreadLocalParamsContainer.getHttpSessionId())); } catch (RejectedExecutionException e) { log.warn("The thread pool is out of limit. A submitted task was rejected"); throw e; } }
Source:
<code>public int hashCode() { int result = bitSet; result = 31 * result + bitSet; <START> return result; <END> }</code><technical_language>@vilchik-elena simply returning bitSet</technical_language>

Target:
public int hashCode() { return bitSet; }
Source:
<code>protected boolean validate() { <START> DiskValidator diskValidator = new DiskValidator(getDiskImage()); <END> if (!validate(diskValidator.isDiskExists()) && !validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, vmsForDisk))) { return false; } if (getDiskImage().getVmEntityType().isTemplateType()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_AMEND_TEMPLATE_DISK); } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(Collections.singletonList(getDiskImage())); return validate(diskImagesValidator.diskImagesNotIllegal()) && validate(diskImagesValidator.diskImagesNotLocked()); }</code><technical_language>please add dc compatibility level</technical_language>

Target:
protected boolean validate() { DiskValidator diskValidator = new DiskValidator(getDiskImage()); if (!validate(diskValidator.isDiskExists()) && !validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, vmsForDisk))) { return false; } if (!FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_AMEND_NOT_SUPPORTED_BY_DC_VERSION, String.format("$dataCenterVersion %s", getStoragePool().getCompatibilityVersion().toString())); } if (getDiskImage().getVmEntityType().isTemplateType()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_AMEND_TEMPLATE_DISK); } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(Collections.singletonList(getDiskImage())); return validate(diskImagesValidator.diskImagesNotIllegal()) && validate(diskImagesValidator.diskImagesNotLocked()); }
Source:
<code>public void tearDown() { <START> System.out.println("In @After method"); <END> cacheManager.close(); }</code><technical_language>Please System.out.* calls. Thank you</technical_language>

Target:
public void tearDown() { cacheManager.close(); }
Source:
<code>public String getErrorLog() { StringBuilder errorBuilder = new StringBuilder(); int counter = 0; if (mErrorLines.size() > 0) { errorBuilder.append("In " + mFileName + "\n"); } <START> for(String log: mErrorLines) { <END> errorBuilder.append(log); counter++; if (counter > MAX_DISPLAY_ERROR_LOG_SIZE) { errorBuilder.append("Too long, skipping now ... \n"); break; } } return errorBuilder.toString(); }</code><technical_language>space "for"</technical_language>

Target:
public String getErrorLog() { StringBuilder errorBuilder = new StringBuilder(); int counter = 0; if (mErrorLines.size() > 0) { errorBuilder.append("In " + mFileName + ":\n"); } for (String log: mErrorLines) { errorBuilder.append(log); counter++; } return errorBuilder.toString(); }
Source:
<code>public void cancel(Account account) { Log_OC.d(TAG, "Account= " + account.name); if (mCurrentDownload != null) { Log_OC.d(TAG, "Current Download Account= " + mCurrentDownload.getAccount().name); if (mCurrentDownload.getAccount().name.equals(account.name)) { mCurrentDownload.cancel(); } } ConcurrentMap downloadsAccount = mPendingDownloads.get(account); Iterator<String> it = downloadsAccount.keySet().iterator(); Log_OC.d(TAG, "Number of pending downloads= " + downloadsAccount.size()); while (it.hasNext()) { String key = it.next(); Log_OC.d(TAG, "download CANCELLED " + key); <START> if (key.startsWith(account.name)) { <END> DownloadFileOperation download; synchronized (mPendingDownloads) { download = mPendingDownloads.get(key); if (download != null) { String remotePath = download.getRemotePath(); if (mPendingDownloads.contains(account, remotePath)) { mPendingDownloads.remove(account, remotePath); } } } } } }</code><technical_language>compare equals. EDIT: forget it, I misunderstood..</technical_language>

Target:
public void cancel(Account account) { Log_OC.d(TAG, "Account= " + account.name); if (mCurrentDownload != null) { Log_OC.d(TAG, "Current Download Account= " + mCurrentDownload.getAccount().name); if (mCurrentDownload.getAccount().name.equals(account.name)) { mCurrentDownload.cancel(); } } cancelDownloadsForAccount(account); }
Source:
<code>public void registerBookie(String bookieId, boolean readOnly) throws BookieException { if (registerFailed) { <START> throw BookieException.create(-100); <END> } super.registerBookie(bookieId, readOnly); }</code><technical_language>a meaning BookieException code constant a number -100</technical_language>

Target:
public void registerBookie(String bookieId, boolean readOnly) throws BookieException { if (registerFailed) { throw BookieException.create(MetadataStoreException); } super.registerBookie(bookieId, readOnly); }
Source:
<code>public static void main(String[] args) throws Exception { if (args.length < 2) { <START> System.err.println("Usage: StartClients <clients to start> <server file>"); <END> System.exit(1); } int clientsToStart = Integer.parseInt(args[0]); String serversFileName = args[1]; Scanner sc = new Scanner(new File(serversFileName)); int nrOfServers = sc.nextInt(); sc.nextLine(); String[] serverURLs = new String[nrOfServers]; for (int i = 0; i < nrOfServers; i++) { serverURLs[i] = sc.nextLine(); } System.out.println("Starting " + clientsToStart + " client(s) on host: "+InetAddress.getLocalHost().getHostAddress()); try { for (int i = 0; i < clientsToStart; i++) { ClientProcess client = new ClientProcess(); client.selectServer(serverURLs, false); new Thread(client).start(); Thread.sleep(250); } } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>I change 'clients start' 'nr of clients start' clearer</technical_language>

Target:
public static void main(String[] args) throws Exception { if (args.length < 2) { System.err.println("Usage: StartClients <nr of clients to start> <server file>"); System.exit(1); } int clientsToStart = Integer.parseInt(args[0]); String serversFileName = args[1]; Scanner sc = new Scanner(new File(serversFileName)); int nrOfServers = sc.nextInt(); sc.nextLine(); String[] serverURLs = new String[nrOfServers]; for (int i = 0; i < nrOfServers; i++) { serverURLs[i] = sc.nextLine(); } System.out.println("Starting " + clientsToStart + " client(s) on host: "+InetAddress.getLocalHost().getHostAddress()); try { for (int i = 0; i < clientsToStart; i++) { ClientProcess client = new ClientProcess(); client.selectServer(serverURLs, false); new Thread(client).start(); Thread.sleep(250); } } catch (Exception e) { e.printStackTrace(); } }
Source:
<code>Set<MavenProject> applyVersioningChanges( final Collection<MavenProject> projects, final Map<ProjectVersionRef, String> _versionsByGAV ) throws ManipulationException { final VersioningState state = new VersioningState( session.getUserProperties() ); state.setVersionsByGAVMap( _versionsByGAV ); final Set<MavenProject> changed = new HashSet<>(); for ( final MavenProject project : projects ) { if ( applyVersioningChanges( new Project ( project.getOriginalModel()), state ) ) { final String v = _versionsByGAV.get( SimpleProjectVersionRef.parse( gav( project ) ) ); logger.info( "{} ({}): VERSION MODIFIED{} New version: {}", <START> project.getName(), gav( project ), System.lineSeparator(), v ); <END> applyVersioningChanges( new Project ( project.getModel()), state ); changed.add( project ); if ( v != null ) { project.setVersion( v ); } } } return changed; }</code><technical_language>this part changed 2014/5 .... tempted remove logger line. need in tests (and if do logging / System.out.println I tend in conjunction <LINK_0> mute for success</technical_language>

Target:
Set<MavenProject> applyVersioningChanges( final Collection<MavenProject> projects, final Map<ProjectVersionRef, String> _versionsByGAV ) throws ManipulationException { final VersioningState state = new VersioningState( session.getUserProperties() ); state.setVersionsByGAVMap( _versionsByGAV ); final Set<MavenProject> changed = new HashSet<>(); for ( final MavenProject project : projects ) { if ( applyVersioningChanges( new Project ( project.getOriginalModel()), state ) ) { final String v = _versionsByGAV.get( SimpleProjectVersionRef.parse( gav( project ) ) ); applyVersioningChanges( new Project ( project.getModel()), state ); changed.add( project ); if ( v != null ) { project.setVersion( v ); } } } return changed; }
Source:
<code>public void checkData() { <START> logger.info("checkData(): totalCount: {}; minWinId: {}; committedWinId: {}; curWinId: {}", totalCount, <END> this.minWinId, committedWinId, this.windowId); for (long winId = Math.max(committedWinId + 1, minWinId); winId < this.windowId; ++winId) { Long count = this.windowToCount.get(winId); SpillableArrayListImpl<String> datas = (SpillableArrayListImpl<String>)multiMap.get("" + winId); if ((datas == null && count != null) || (datas != null && count == null)) { logger.error("datas: {}; count: {}", datas, count); } else if (datas == null && count == null) { logger.error("Both datas and count are null. probably something wrong."); } else { int dataSize = datas.size(); if ((long)count != (long)dataSize) { logger.error("data size not equal: window Id: {}; datas size: {}; count: {}", winId, dataSize, count); } } } }</code><technical_language>debug. Method name part of message. If necessary, change log4j config</technical_language>

Target:
public void checkData() { long startTime = System.currentTimeMillis(); logger.debug("check data: totalCount: {}; minWinId: {}; committedWinId: {}; curWinId: {}", totalCount, this.minWinId, committedWinId, this.windowId); for (long winId = Math.max(committedWinId + 1, minWinId); winId < this.windowId; ++winId) { Long count = this.windowToCount.get(winId); SpillableArrayListImpl<String> datas = (SpillableArrayListImpl<String>)multiMap.get("" + winId); String msg; if (((datas == null && count != null) || (datas != null && count == null)) || (datas == null && count == null)) { msg = "Invalid data/count. datas: " + datas + "; count: " + count; logger.error(msg); errorTrace = new RuntimeException(msg); throw new ShutdownException(); } else { int dataSize = datas.size(); if ((long)count != (long)dataSize) { msg = String.format("data size not equal: window Id: %d; datas size: %d; count: %d", winId, dataSize, count); logger.error(msg); errorTrace = new RuntimeException(msg); throw new ShutdownException(); } } } logger.info("check data took millis.", System.currentTimeMillis() - startTime); }
Source:
<code>public static String topoNameToId(String topoName, ILocalCluster cluster) throws TException { TopologySummary topoSum = cluster.getTopologySummaryByName(topoName); <START> if (topoSum.get_name().equals(topoName)) { <END> return topoSum.get_id(); } return null; }</code><technical_language>returned topologySummary.get_name != topoName</technical_language>

Target:
public static String topoNameToId(String topoName, ILocalCluster cluster) throws TException { try { TopologySummary topoSum = cluster.getTopologySummaryByName(topoName); return topoSum.get_id(); } catch (NotAliveException e) { LOG.error("Failed to getTopologySummaryByName from " + topoName, e); } return null; }
Source:
<code><START> public List<Pair<String, String>> getRenamesBetweenCommits( <END> String parentHash, String commitHash, String projectRoot) { ObjectId commitId = ObjectId.fromString(commitHash); ObjectId parentId = ObjectId.fromString(parentHash); RevCommit commit; RevCommit parent; List<Pair<String, String>> result = new ArrayList<>(); try (Git git = Git.open(new java.io.File(projectRoot))) { try (RevWalk revWalk = new RevWalk(git.getRepository())) { commit = revWalk.parseCommit(commitId); parent = revWalk.parseCommit(parentId); } RenameDetector renameDetector = new RenameDetector(git.getRepository()); try (TreeWalk treeWalk = new TreeWalk(git.getRepository())) { treeWalk.setFilter(TreeFilter.ANY_DIFF); treeWalk.setRecursive(true); treeWalk.reset(parent.getTree(), commit.getTree()); renameDetector.reset(); renameDetector.addAll(DiffEntry.scan(treeWalk)); for (DiffEntry ent : renameDetector.compute()) { if (ent.getChangeType() == DiffEntry.ChangeType.RENAME) result.add(new ImmutablePair<>(ent.getOldPath(), ent.getNewPath())); } } } catch (IOException e) { throw new UnableToGetCommitContentException(e.getMessage()); } return result; }</code><technical_language>Missing @Override annotation</technical_language>

Target:
public List<Pair<String, String>> getRenamesBetweenCommits( String parentHash, String commitHash, String projectRoot) { ObjectId commitId = ObjectId.fromString(commitHash); ObjectId parentId = ObjectId.fromString(parentHash); RevCommit commit; RevCommit parent; List<Pair<String, String>> result = new ArrayList<>(); try (Git git = Git.open(new java.io.File(projectRoot))) { try (RevWalk revWalk = new RevWalk(git.getRepository())) { commit = revWalk.parseCommit(commitId); parent = revWalk.parseCommit(parentId); } RenameDetector renameDetector = new RenameDetector(git.getRepository()); try (TreeWalk treeWalk = new TreeWalk(git.getRepository())) { treeWalk.setFilter(TreeFilter.ANY_DIFF); treeWalk.setRecursive(true); treeWalk.reset(parent.getTree(), commit.getTree()); renameDetector.reset(); renameDetector.addAll(DiffEntry.scan(treeWalk)); for (DiffEntry ent : renameDetector.compute()) { if (ent.getChangeType() == DiffEntry.ChangeType.RENAME) result.add(Pair.of(ent.getOldPath(), ent.getNewPath())); } } } catch (IOException e) { throw new UnableToGetCommitContentException(e.getMessage()); } return result; }
Source:
<code>public String getColumnText(Object element, int columnIndex) { Attribute<?> attribute = (Attribute<?>) element; if (columnIndex == 0) { return attribute.getAttributeType().getName(); } else if (columnIndex == 1) { try { return attribute.getDisplayableString(); } catch (OseeCoreException ex) { return Lib.exceptionToString(ex); } } else if (columnIndex == 2) { try { return String.valueOf(attribute.getId()); } catch (OseeCoreException ex) { return Lib.exceptionToString(ex); } } else if (columnIndex == 3) { try { <START> return String.valueOf(attribute.getAttributeType().getIdString()); <END> } catch (OseeCoreException ex) { return Lib.exceptionToString(ex); } } else { return String.valueOf(attribute.getGammaId()); } }</code><technical_language>Remove String.valueOf call</technical_language>

Target:
public String getColumnText(Object element, int columnIndex) { Attribute<?> attribute = (Attribute<?>) element; if (columnIndex == 0) { return attribute.getAttributeType().getName(); } else if (columnIndex == 1) { try { return attribute.getDisplayableString(); } catch (OseeCoreException ex) { return Lib.exceptionToString(ex); } } else if (columnIndex == 2) { try { return String.valueOf(attribute.getId()); } catch (OseeCoreException ex) { return Lib.exceptionToString(ex); } } else if (columnIndex == 3) { try { return attribute.getAttributeType().getIdString(); } catch (OseeCoreException ex) { return Lib.exceptionToString(ex); } } else { return String.valueOf(attribute.getGammaId()); } }
Source:
<code>public Map<String, Object> asMap() { Map<String, Object> toReturn = new TreeMap<>(); Map<String, Object> capsMap = super.asMap(); capsMap.forEach((key, value) -> { <START> if (key.equals("platformName")) { <END> toReturn.put(key, value); } else { toReturn.put(APPIUM_PREFIX + key, value); } }); return unmodifiableMap(toReturn); }</code><technical_language>I is platform name. W3C defines a bunch of keys, supplied prefixes Selenium this list in constants</technical_language>

Target:
public Map<String, Object> asMap() { AcceptedW3CCapabilityKeys acceptedW3CCapabilityKeys = new AcceptedW3CCapabilityKeys(); return unmodifiableMap(super.asMap().entrySet().stream().collect(Collectors.toMap( entry -> (acceptedW3CCapabilityKeys.test(entry.getKey()) || entry.getKey().startsWith(APPIUM_PREFIX)) ? entry.getKey() : APPIUM_PREFIX + entry.getKey(), Map.Entry::getValue))); }