auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ActivityPayload createActivityPayload(Duration deviceTimeOffset, AppActivityDTO.Activity appActivity) { Date correctedStartTime = correctTime(deviceTimeOffset, appActivity.getStartTime()); <START> Date correctedendTime = correctTime(deviceTimeOffset, appActivity.getEndTime()); <END> return new ActivityPayload(correctedStartTime, correctedendTime, appActivity.getApplication()); }</code><technical_language>correctedEndTime</technical_language>

Target:
private ActivityPayload createActivityPayload(Duration deviceTimeOffset, AppActivityDTO.Activity appActivity) { Date correctedStartTime = correctTime(deviceTimeOffset, appActivity.getStartTime()); Date correctedEndTime = correctTime(deviceTimeOffset, appActivity.getEndTime()); return new ActivityPayload(correctedStartTime, correctedEndTime, appActivity.getApplication()); }
Source:
<code>public static void addInvocationRateAndCountToSensor(final Sensor sensor, final String group, final Map<String, String> tags, final String operation) { addInvocationRateAndCountToSensor( sensor, group, tags, operation, <START> "The average per-second number of " + operation, <END> "The total number of " + operation ); }</code><technical_language>nit: this string static final</technical_language>

Target:
public static void addInvocationRateAndCountToSensor(final Sensor sensor, final String group, final Map<String, String> tags, final String operation) { addInvocationRateAndCountToSensor( sensor, group, tags, operation, RATE_DESCRIPTION + operation, TOTAL_DESCRIPTION + operation ); }
Source:
<code>public TestSuites parse(File report) { try (InputStream inputStream = new FileInputStream(report)) { final Object parsedObject = xstream().fromXML(inputStream); TestSuites testSuites = (TestSuites) parsedObject; <START> return testSuites; <END> } catch (IOException e) { throw new IllegalStateException("Can't read PhpUnit report : " + report.getAbsolutePath(), e); } }</code><technical_language>@inverno return (TestSuites) xstream().fromXML(inputStream) instead</technical_language>

Target:
public TestSuites parse(File report) { try (InputStream inputStream = new FileInputStream(report)) { final Object parsedObject = xstream().fromXML(inputStream); return (TestSuites) parsedObject; } catch (IOException e) { throw new IllegalStateException("Can't read PhpUnit report : " + report.getAbsolutePath(), e); } }
Source:
<code>private void validateProperty(ModelNode operation) { ModelNode addressModelNode = operation.get(CommonAttributes.ADDRESS); <START> if (!addressModelNode.getType().toString().equals("u")) { <END> List<Property> propertyListModelNode = addressModelNode.asPropertyList(); for (Property property : propertyListModelNode) { if (property.getName().equals(CommonAttributes.PROPERTY)) { ConnectorUtils.getAndValidateOption(property.getValue().asString()); } } } }</code><technical_language>This condition is hard understand. Do simply if (addressModelNode.isDefined())</technical_language>

Target:
private void validateProperty(ModelNode operation) throws OperationFailedException { ModelNode addressModelNode = operation.get(ModelDescriptionConstants.ADDRESS); final ClassLoader loader = WildFlySecurityManager.getClassLoaderPrivileged(ConnectorChildResource.class); if (addressModelNode.isDefined()) { List<Property> propertyListModelNode = addressModelNode.asPropertyList(); for (Property property : propertyListModelNode) { if (property.getName().equals(CommonAttributes.PROPERTY)) { ConnectorUtils.getAndValidateOption(loader, property.getValue().asString()); } } } }
Source:
<code>private void registerCustomCredential(final Props props, final Credentials hadoopCred, final String userToProxy, final Logger jobLogger) { String credentialClassName = "unknown class"; try { credentialClassName = props .getString(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME); logger.info("custom credential class name: " + credentialClassName); final Class credentialClass = Class.forName(credentialClassName); final Constructor[] constructors = credentialClass.getConstructors(); for (final Constructor constructor : constructors) { if (constructor.getParameterCount() == 3) { <START> final CredentialProvider customCredential = (CredentialProvider) constructors[1] <END> .newInstance(hadoopCred, props, jobLogger); customCredential.register(userToProxy); return; } } logger.error("cannot find the appropriate credential constructor."); throw new Exception("launching credential instance failed."); } catch (final Exception e) { logger.error("Encountered error while loading and instantiating " + credentialClassName, e); throw new IllegalStateException("Encountered error while loading and instantiating " + credentialClassName, e); } }</code><technical_language>(CredentialProvider) constructor instead of (CredentialProvider) constructors[1]? is point in comparing constructors in loop</technical_language>

Target:
private void registerCustomCredential(final Props props, final Credentials hadoopCred, final String userToProxy, final Logger jobLogger) { String credentialClassName = "unknown class"; try { credentialClassName = props .getString(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME); logger.info("custom credential class name: " + credentialClassName); final Class credentialClass = Class.forName(credentialClassName); Constructor constructor = credentialClass.getConstructor (new Class[] {Credentials.class, Props.class, Logger.class}); final CredentialProvider customCredential = (CredentialProvider) constructor .newInstance(hadoopCred, props, jobLogger); customCredential.register(userToProxy); } catch (final Exception e) { logger.error("Encountered error while loading and instantiating " + credentialClassName, e); throw new IllegalStateException("Encountered error while loading and instantiating " + credentialClassName, e); } }
Source:
<code>public void verifyCollapsibleCriteriaNoDefaultFocusWindow() throws IOException, InterruptedException { topologyUiPage.clearFocus(); String categoryName = "Servers"; topologyUiPage.search(categoryName).selectItemThatContains(categoryName); <START> topologyUiPage.testCase.findElementByXpath(" END> }</code><technical_language>This fail. id is generated vary. topologyUiPage.getVisibleVertices() method search for a vertex label Servers</technical_language>

Target:
public void verifyCollapsibleCriteriaNoDefaultFocusWindow() throws IOException, InterruptedException { topologyUiPage.clearFocus(); String categoryName = "Switches"; topologyUiPage.search(categoryName).selectItemThatContains(categoryName); topologyUiPage.testCase.findElementByXpath(" }
Source:
<code>protected void activateChannel(@Nullable BluetoothCharacteristic characteristic, ChannelTypeUID channelTypeUID, @Nullable String name) { if (characteristic != null) { String channelId = name != null ? name : characteristic.getGattCharacteristic().name(); if (channelId == null) { channelId = channelTypeUID.getId(); } if (getThing().getChannel(channelId) == null) { ThingBuilder updatedThing = editThing(); Channel channel = ChannelBuilder.create(new ChannelUID(getThing().getUID(), channelId), "Number") .withType(channelTypeUID).build(); updatedThing.withChannel(channel); updateThing(updatedThing.build()); logger.debug("Added channel '{}' to Thing '{}'", channelId, getThing().getUID()); } if (isLinked(channelId)) { <START> deviceCharacteristics.add(characteristic); <END> device.enableNotifications(characteristic); device.readCharacteristic(characteristic); } } else { logger.debug("Characteristic is null - not activating any channel."); } }</code><technical_language>necessary if a channel linked on</technical_language>

Target:
protected void activateChannel(@Nullable BluetoothCharacteristic characteristic, ChannelTypeUID channelTypeUID, @Nullable String name) { if (characteristic != null) { String channelId = name != null ? name : characteristic.getGattCharacteristic().name(); if (channelId == null) { channelId = channelTypeUID.getId(); } if (getThing().getChannel(channelId) == null) { ThingBuilder updatedThing = editThing(); Channel channel = ChannelBuilder.create(new ChannelUID(getThing().getUID(), channelId), "Number") .withType(channelTypeUID).build(); updatedThing.withChannel(channel); updateThing(updatedThing.build()); logger.debug("Added channel '{}' to Thing '{}'", channelId, getThing().getUID()); } deviceCharacteristics.add(characteristic); device.enableNotifications(characteristic); if (isLinked(channelId)) { device.readCharacteristic(characteristic); } } else { logger.debug("Characteristic is null - not activating any channel."); } }
Source:
<code>public Map<BundleDependency, List<BundleDependency>> resolveDependencies(List<BundleDependency> mulePlugins, Collection<ClassLoaderModel> mulePluginsClassLoaderModels) { Map<BundleDependency, List<BundleDependency>> pluginsWithAdditionalDeps = new LinkedHashMap<>(); for (Plugin pluginWithAdditionalDependencies : pluginsWithAdditionalDependencies) { BundleDependency pluginBundleDependency = getPluginBundleDependency(pluginWithAdditionalDependencies, mulePlugins); ClassLoaderModel pluginClassLoaderModel = getPluginClassLoaderModel(pluginWithAdditionalDependencies, mulePluginsClassLoaderModels); List<BundleDependency> additionalDependencies = new ArrayList<>(); pluginWithAdditionalDependencies.getAdditionalDependencies().stream() .filter(additionalDep -> !isPresentInClassLoaderModel(pluginClassLoaderModel, additionalDep)) .forEach( <START> dep -> { <END> additionalDependencies.add(aetherMavenClient .resolveBundleDescriptor(toBundleDescriptor(dep))); additionalDependencies.addAll(aetherMavenClient .resolveBundleDescriptorDependencies(false, false, toBundleDescriptor(dep))); }); if (!additionalDependencies.isEmpty()) { pluginsWithAdditionalDeps.put(pluginBundleDependency, additionalDependencies); } } return pluginsWithAdditionalDeps; }</code><technical_language>Please extract this a method</technical_language>

Target:
public Map<BundleDependency, List<BundleDependency>> resolveDependencies(List<BundleDependency> mulePlugins, Collection<ClassLoaderModel> mulePluginsClassLoaderModels) { Map<BundleDependency, List<BundleDependency>> pluginsWithAdditionalDeps = new LinkedHashMap<>(); for (Plugin pluginWithAdditionalDependencies : pluginsWithAdditionalDependencies) { BundleDependency pluginBundleDependency = getPluginBundleDependency(pluginWithAdditionalDependencies, mulePlugins); ClassLoaderModel pluginClassLoaderModel = getPluginClassLoaderModel(pluginWithAdditionalDependencies, mulePluginsClassLoaderModels); List<BundleDependency> additionalDependencies = new ArrayList<>(); pluginWithAdditionalDependencies.getAdditionalDependencies().stream() .filter(additionalDep -> !isPresentInClassLoaderModel(pluginClassLoaderModel, additionalDep)) .forEach(dep -> additionalDependencies.addAll(resolveDependency(dep))); if (!additionalDependencies.isEmpty()) { pluginsWithAdditionalDeps.put(pluginBundleDependency, additionalDependencies); } } return pluginsWithAdditionalDeps; }
Source:
<code>private KafkaStreams startStreams(final StreamsBuilder builder) { final KafkaStreams kafkaStreams = new KafkaStreams(builder.build(streamsConfiguration), streamsConfiguration); <START> kafkaStreams.start(); <END> kafkaStreamsInstances.add(kafkaStreams); return kafkaStreams; }</code><technical_language>consider: suggestion final CountDownLatch latch = new CountDownLatch(1); kafkaStreams.setStateListener((newState, oldState) -> { if (oldState == KafkaStreams.State.REBALANCING && newState == KafkaStreams.State.RUNNING) { latch.countDown(); } }); kafkaStreams.start(); try { latch.await(IntegrationTestUtils.DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS); } catch (final InterruptedException e) { throw new RuntimeException(e); } Then, this method return Streams is started, increase test stability</technical_language>

Target:
private KafkaStreams startStreams(final StreamsBuilder builder) throws InterruptedException { return startStreams(builder, REBALANCING, RUNNING, null); }
Source:
<code>private boolean process( final ReleaseRemovalRequest request, final ReleaseRemovalResult result, final Repository repository, final Target repositoryTarget ) { if ( !repository.getRepositoryContentClass().isCompatible( maven2ContentClass ) ) { getLogger().debug( "Skipping '{}' is not a maven 2 repository", repository.getId() ); return false; } if ( !repository.getLocalStatus().shouldServiceRequest() ) { getLogger().debug( "Skipping '{}' because the repository is out of service", repository.getId() ); return false; } if ( repository.getRepositoryKind().isFacetAvailable( ProxyRepository.class ) ) { getLogger().debug( "Skipping '{}' because it is a proxy repository", repository.getId() ); return false; } if ( repository.getRepositoryKind().isFacetAvailable( GroupRepository.class ) ) { getLogger().debug( "Skipping '{}' because it is a group repository", repository.getId() ); return false; } <START> MavenRepository mavenRepository = repository.adaptToFacet( MavenRepository.class ); <END> if ( !RepositoryPolicy.RELEASE.equals( mavenRepository.getRepositoryPolicy() ) ) { getLogger().debug( "Skipping '{}' because it is a snapshot or mixed repository", repository.getId() ); return false; } removeReleasesFromMavenRepository( mavenRepository, request, result, repositoryTarget ); return true; }</code><technical_language>adaptToFacet return null if facet is applicable. If facet MavenRepo is asserted before, nvm, extend IF a non-null-check</technical_language>

Target:
private boolean process( final ReleaseRemovalRequest request, final ReleaseRemovalResult result, final Repository repository, final Target repositoryTarget ) { if ( !repository.getRepositoryContentClass().isCompatible( maven2ContentClass ) ) { getLogger().debug( "Skipping '{}' is not a maven 2 repository", repository.getId() ); return false; } if ( !repository.getLocalStatus().shouldServiceRequest() ) { getLogger().debug( "Skipping '{}' because the repository is out of service", repository.getId() ); return false; } if ( repository.getRepositoryKind().isFacetAvailable( ProxyRepository.class ) ) { getLogger().debug( "Skipping '{}' because it is a proxy repository", repository.getId() ); return false; } if ( repository.getRepositoryKind().isFacetAvailable( GroupRepository.class ) ) { getLogger().debug( "Skipping '{}' because it is a group repository", repository.getId() ); return false; } MavenRepository mavenRepository = repository.adaptToFacet( MavenRepository.class ); if(mavenRepository == null) { getLogger().debug( "Skipping '{}' because it could not be adapted to MavenRepository", repository.getId() ); return false; } if ( !RepositoryPolicy.RELEASE.equals( mavenRepository.getRepositoryPolicy() ) ) { getLogger().debug( "Skipping '{}' because it is a snapshot or mixed repository", repository.getId() ); return false; } removeReleasesFromMavenRepository( mavenRepository, request, result, repositoryTarget ); return true; }
Source:
<code>public boolean acceptOutboundMessage(final Object message) { <START> return message instanceof RntbdContextRequest; <END> }</code><technical_language>Is future proofing a bug? Quick check show sub-classes</technical_language>

Target:
public boolean acceptOutboundMessage(final Object message) { return message.getClass() == RntbdContextRequest.class; }
Source:
<code>public static boolean isRemovableStorageAvailable(@NonNull Context context){ int currentapiVersion = android.os.Build.VERSION.SDK_INT; if (currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) { File[] fileList = context.getExternalFilesDirs("Android"); for (File extFile : fileList){ if (extFile != null && Environment.isExternalStorageRemovable(extFile)){ return true; } } } return false; <START> } <END></code><technical_language>avoid this build check, support library functions possible</technical_language>

Target:
public static boolean isRemovableStorageAvailable(@NonNull Context context){ return getRemovableStorageAppDir(context) != null; }
Source:
<code>public void testPersistentDiskCacheWithDefaultPersistentMode() { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder() .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES).disk(100, EntryUnit.ENTRIES).build()) .buildConfig(Long.class, String.class); PersistentCacheManager persistentCacheManager = CacheManagerBuilder.newCacheManagerBuilder() .with(new PersistenceConfiguration(new File(System.getProperty("java.io.tmpdir") + "/persistent-cache-data"))) .withCache("persistent-cache", cacheConfiguration) .build(true); Cache<Long, String> cache = persistentCacheManager.getCache("persistent-cache", Long.class, String.class); cache.put(42L, "That's the answer!"); <START> assertThat(cache.get(42L), is("That's the answer!")); <END> persistentCacheManager.close(); }</code><technical_language>assertion is comparing strings here. While is() works (it ==), more correct equalTo() (which calls equals())</technical_language>

Target:
public void testPersistentDiskCacheWithDefaultPersistentMode() { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder() .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES).disk(100, EntryUnit.ENTRIES).build()) .buildConfig(Long.class, String.class); PersistentCacheManager persistentCacheManager = CacheManagerBuilder.newCacheManagerBuilder() .with(new PersistenceConfiguration(new File(System.getProperty("java.io.tmpdir") + "/persistent-cache-data"))) .withCache("persistent-cache", cacheConfiguration) .build(true); Cache<Long, String> cache = persistentCacheManager.getCache("persistent-cache", Long.class, String.class); cache.put(42L, "That's the answer!"); assertThat(cache.get(42L), equalTo("That's the answer!")); persistentCacheManager.close(); }
Source:
<code>public Git(Repository repo) { <START> this.repo = repo; <END> }</code><technical_language>If setters in commands fail-fast single-execution, fail-fast a null pointer passed in for Repository. NPE right in constructor deferred: Git git = new Git(null); git.commit().setMessage("Test").call() NPE line of that, second</technical_language>

Target:
public Git(Repository repo) { if (repo == null) throw new NullPointerException(); this.repo = repo; }
Source:
<code>private void createOvertimeRecords(Person person) { <START> LocalDate now = ZonedDateTime.now(UTC).toLocalDate(); <END> LocalDate lastWeek = now.minusWeeks(1); LocalDate weekBeforeLast = now.minusWeeks(2); LocalDate lastYear = now.minusYears(1); overtimeRecordDataProvider.createOvertimeRecord(person, lastWeek.with(MONDAY), lastWeek.with(FRIDAY), new BigDecimal("2.5")); overtimeRecordDataProvider.createOvertimeRecord(person, weekBeforeLast.with(MONDAY), weekBeforeLast.with(FRIDAY), new BigDecimal("3")); overtimeRecordDataProvider.createOvertimeRecord(person, lastYear.with(MONDAY), lastYear.with(FRIDAY), new BigDecimal("4")); }</code><technical_language>LocalDate.now(UTC);</technical_language>

Target:
private void createOvertimeRecords(Person person) { LocalDate now = LocalDate.now(UTC); LocalDate lastWeek = now.minusWeeks(1); LocalDate weekBeforeLast = now.minusWeeks(2); LocalDate lastYear = now.minusYears(1); overtimeRecordDataProvider.createOvertimeRecord(person, lastWeek.with(MONDAY), lastWeek.with(FRIDAY), new BigDecimal("2.5")); overtimeRecordDataProvider.createOvertimeRecord(person, weekBeforeLast.with(MONDAY), weekBeforeLast.with(FRIDAY), new BigDecimal("3")); overtimeRecordDataProvider.createOvertimeRecord(person, lastYear.with(MONDAY), lastYear.with(FRIDAY), new BigDecimal("4")); }
Source:
<code>public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) { if (fAverageCharWidth == null) { fAverageCharWidth = gc.getFontMetrics().getAverageCharWidth(); } if (bounds.width <= <START> fAverageCharWidth * 4) { <END> return; } if (!(event instanceof CallStackEvent)) { return; } String name = nullToEmptyString(fTimeEventNames.getUnchecked((CallStackEvent) event)); if (name.isEmpty()) { return; } int textWidth = gc.stringExtent(name).x; String displayText = name; while (textWidth > bounds.width) { name = name.substring(0, name.length() - 1); displayText = name + ELLIPSIS; textWidth = gc.stringExtent(displayText).x; } gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); Utils.drawText(gc, displayText, bounds.x, bounds.y, bounds.width, bounds.height, true, true); }</code><technical_language>a bit arbitrary, setting threshold character string extent of ellipsis</technical_language>

Target:
public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) { if (fMinimumBarWidth == null) { fMinimumBarWidth = gc.getFontMetrics().getAverageCharWidth() + gc.stringExtent(ELLIPSIS).x; } if (bounds.width <= fMinimumBarWidth) { return; } if (!(event instanceof CallStackEvent)) { return; } String name = fTimeEventNames.getUnchecked((CallStackEvent) event).orElse(""); if (name.isEmpty()) { return; } int textWidth = gc.stringExtent(name).x; String displayText = name; while (textWidth > bounds.width) { name = name.substring(0, name.length() - 1); displayText = name + ELLIPSIS; textWidth = gc.stringExtent(displayText).x; } gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); Utils.drawText(gc, displayText, bounds.x, bounds.y, bounds.width, bounds.height, true, true); }
Source:
<code>public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); if (isSearching()) { searchFragment.closeSearch(); <START> } <END> }</code><technical_language>handle other CABs: Find in Page text selected</technical_language>

Target:
public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); if (isSearching()) { searchFragment.closeSearch(); } if (currentActionMode != null) { currentActionMode.finish(); } }
Source:
<code>public void initialize(ClassWhiteList classWhiteList) { <START> baseCfg.setClassResolver(new CheckedClassResolver(classWhiteList, this.getClass().getClassLoader())); <END> }</code><technical_language>some constructors a ClassLoader I classloader is here. Bug</technical_language>

Target:
public void initialize(ClassWhiteList classWhiteList) { ClassLoader classLoader = ((DefaultContextClassResolver) baseCfg.getClassResolver()).getClassLoader(); baseCfg.setClassResolver(new CheckedClassResolver(classWhiteList, classLoader)); }
Source:
<code>private boolean runVmAsStateless(VM vmToRunAsStateless) { log.infoFormat("Running Vm {0} as stateless", vmToRunAsStateless); RunVmParams runVmParams = new RunVmParams(vmToRunAsStateless.getId()); runVmParams.setEntityInfo(new EntityInfo(VdcObjectType.VM, vmToRunAsStateless.getId())); runVmParams.setRunAsStateless(true); VdcReturnValueBase vdcReturnValue = Backend.getInstance().runInternalAction(VdcActionType.RunVm, runVmParams, ExecutionHandler.createInternalJobContext()); boolean prestartingVmSucceeded = vdcReturnValue.getSucceeded(); if (!prestartingVmSucceeded) { AuditLogableBase log = new AuditLogableBase(); <START> log.setVmId(vmToRunAsStateless.getId()); <END> log.addCustomValue("VmName", vmToRunAsStateless.getName()); AuditLogDirector.log(log, AuditLogType.VM_CANNOT_BE_PRESTARTED_NOT_ENOUGH_RESOURCES); } log.infoFormat("Running Vm {0} as stateless {1}", vmToRunAsStateless, prestartingVmSucceeded ? "succeeded" : "failed"); return prestartingVmSucceeded; }</code><technical_language>i this a log vm pool specific vm, "some vms started due insufficient resources, system continue trying"</technical_language>

Target:
private boolean runVmAsStateless(VM vmToRunAsStateless) { log.infoFormat("Running Vm {0} as stateless", vmToRunAsStateless); RunVmParams runVmParams = new RunVmParams(vmToRunAsStateless.getId()); runVmParams.setEntityInfo(new EntityInfo(VdcObjectType.VM, vmToRunAsStateless.getId())); runVmParams.setRunAsStateless(true); VdcReturnValueBase vdcReturnValue = Backend.getInstance().runInternalAction(VdcActionType.RunVm, runVmParams, ExecutionHandler.createInternalJobContext()); boolean prestartingVmSucceeded = vdcReturnValue.getSucceeded(); if (!prestartingVmSucceeded) { AuditLogableBase log = new AuditLogableBase(); log.setVmId(vmToRunAsStateless.getId()); log.addCustomValue("VmName", vmToRunAsStateless.getName()); log.addCustomValue("VmPoolName", vmToRunAsStateless.getVmPoolName()); AuditLogDirector.log(log, AuditLogType.VM_FAILED_TO_PRESTART_IN_POOL); } log.infoFormat("Running Vm {0} as stateless {1}", vmToRunAsStateless, prestartingVmSucceeded ? "succeeded" : "failed"); return prestartingVmSucceeded; }
Source:
<code>public void refreshRoutingData(String namespace) { if (!_routingZkAddressMap.containsKey(namespace)) { LOG.error( "Failed to refresh internally-cached routing data! Namespace not found: " + namespace); return; } Map<String, List<String>> rawRoutingData; try { rawRoutingData = _routingDataReaderMap.get(namespace).getRoutingData(); } catch (InvalidRoutingDataException e) { LOG.error("Failed to refresh cached routing data for namespace {}", namespace, e); _realmToShardingKeysMap.remove(namespace); _routingDataMap.remove(namespace); return; } TrieRoutingData trieRoutingData; try { trieRoutingData = new TrieRoutingData(rawRoutingData); } catch (InvalidRoutingDataException e) { LOG.warn("TrieRoutingData is not created for namespace {}", namespace, e); <START> _realmToShardingKeysMap.remove(namespace); <END> _routingDataMap.remove(namespace); return; } _realmToShardingKeysMap.put(namespace, rawRoutingData); _routingDataMap.put(namespace, trieRoutingData); }</code><technical_language>raw data removed here. raw data is allowed invalid routing data</technical_language>

Target:
public void refreshRoutingData(String namespace) { if (!_routingZkAddressMap.containsKey(namespace)) { LOG.error( "Failed to refresh internally-cached routing data! Namespace not found: " + namespace); return; } Map<String, List<String>> rawRoutingData; try { rawRoutingData = _routingDataReaderMap.get(namespace).getRoutingData(); } catch (InvalidRoutingDataException e) { LOG.error("Failed to refresh cached routing data for namespace {}", namespace, e); _realmToShardingKeysMap.put(namespace, Collections.emptyMap()); _routingDataMap.remove(namespace); return; } _realmToShardingKeysMap.put(namespace, rawRoutingData); TrieRoutingData trieRoutingData; try { trieRoutingData = new TrieRoutingData(rawRoutingData); } catch (InvalidRoutingDataException e) { LOG.warn("TrieRoutingData is not created for namespace {}", namespace, e); _routingDataMap.remove(namespace); return; } _routingDataMap.put(namespace, trieRoutingData); }
Source:
<code><START> public Optional<HostAddress> getAddress() <END> { return address; }</code><technical_language>remove</technical_language>

Target:
public HostAddress getAddress() { return address.isPresent() ? address.get() : null; }
Source:
<code>public void testGetMemoryInBytes() throws Exception { <START> assertEquals(42l, AccumuloConfiguration.getFixedMemoryAsBytes("42")); <END> assertEquals(42l, AccumuloConfiguration.getFixedMemoryAsBytes("42b")); assertEquals(42l, AccumuloConfiguration.getFixedMemoryAsBytes("42B")); assertEquals(42l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42K")); assertEquals(42l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42k")); assertEquals(42l * 1024l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42M")); assertEquals(42l * 1024l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42m")); assertEquals(42l * 1024l * 1024l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42G")); assertEquals(42l * 1024l * 1024l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42g")); assertEquals(Runtime.getRuntime().maxMemory() / 10, AccumuloConfiguration.getMemoryAsBytes("10%")); assertEquals(Runtime.getRuntime().maxMemory() / 5, AccumuloConfiguration.getMemoryAsBytes("20%")); }</code><technical_language>apply of fixed memory string test functions. is do this in Java 8 I playing with. Is a shorter create list of functions? java List<Function<String,Long>> funcs = Arrays.asList(AccumuloConfiguration::getFixedMemoryAsBytes, AccumuloConfiguration::getMemoryAsBytes); for(Function<String,Long> memFunc : funcs) { assertEquals(42l, memFunc.apply("42")); //rest of asserts }</technical_language>

Target:
public void testGetMemoryInBytes() throws Exception { List<Function<String,Long>> funcs = Arrays.asList(AccumuloConfiguration::getFixedMemoryAsBytes, AccumuloConfiguration::getMemoryAsBytes); for(Function<String,Long> memFunc : funcs) { assertEquals(42l, memFunc.apply("42").longValue()); assertEquals(42l, memFunc.apply("42b").longValue()); assertEquals(42l, memFunc.apply("42B").longValue()); assertEquals(42l * 1024l, memFunc.apply("42K").longValue()); assertEquals(42l * 1024l, memFunc.apply("42k").longValue()); assertEquals(42l * 1024l * 1024l, memFunc.apply("42M").longValue()); assertEquals(42l * 1024l * 1024l, memFunc.apply("42m").longValue()); assertEquals(42l * 1024l * 1024l * 1024l, memFunc.apply("42G").longValue()); assertEquals(42l * 1024l * 1024l * 1024l, memFunc.apply("42g").longValue()); } assertEquals(Runtime.getRuntime().maxMemory() / 10, AccumuloConfiguration.getMemoryAsBytes("10%")); assertEquals(Runtime.getRuntime().maxMemory() / 5, AccumuloConfiguration.getMemoryAsBytes("20%")); }
Source:
<code>protected boolean isSourceNatAvailableForNetwork(Account owner, IPAddressVO ipToAssoc, Network network) { NetworkOffering offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); boolean sharedSourceNat = offering.isSharedSourceNat(); boolean isSourceNat = false; if (!sharedSourceNat) { if (getExistingSourceNatInNetwork(owner.getId(), network.getId()) == null) { if (network.getGuestType() == GuestType.Isolated && network.getVpcId() == null && !ipToAssoc.isPortable()) { if (network.getState() == Network.State.Allocated) { <START> throw new InvalidParameterValueException("Network is in allocated state, implement network first before acquiring an IP address"); <END> } isSourceNat = true; } } } return isSourceNat; }</code><technical_language>improve this message a bit? I mean, add network UUID in message inform, register in logs network generated this exception</technical_language>

Target:
protected boolean isSourceNatAvailableForNetwork(Account owner, IPAddressVO ipToAssoc, Network network) { NetworkOffering offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); boolean sharedSourceNat = offering.isSharedSourceNat(); boolean isSourceNat = false; if (!sharedSourceNat) { if (getExistingSourceNatInNetwork(owner.getId(), network.getId()) == null) { if (network.getGuestType() == GuestType.Isolated && network.getVpcId() == null && !ipToAssoc.isPortable()) { if (network.getState() == Network.State.Allocated) { String msg = String.format("Network with UUID:%s is in allocated and needs to be implemented first before acquiring an IP address", network.getUuid()); throw new InvalidParameterValueException(msg); } isSourceNat = true; } } } return isSourceNat; }
Source:
<code>void checkForMemoryLeaks(Supplier<List<QueryInfo>> queryInfoSupplier, Map<QueryId, Long> queryMemoryReservations) { requireNonNull(queryInfoSupplier); requireNonNull(queryMemoryReservations); Map<QueryId, Long> leakedQueryReservations = queryMemoryReservations.entrySet() .stream() <START> .filter(Objects::nonNull) <END> .filter(entry -> entry.getValue() > 0) .filter(entry -> isLeaked(queryInfoSupplier, entry.getKey())) .collect(toImmutableMap(Entry::getKey, Entry::getValue)); if (!leakedQueryReservations.isEmpty()) { log.warn("Memory leak detected. The following queries are already finished, " + "but they have memory reservations on some worker node(s): %s", leakedQueryReservations); } synchronized (this) { numberOfLeakedQueries.set(leakedQueryReservations.size()); leakedQueries.update(leakedQueryReservations.keySet()); } }</code><technical_language>map entry object null</technical_language>

Target:
void checkForMemoryLeaks(Supplier<List<QueryInfo>> queryInfoSupplier, Map<QueryId, Long> queryMemoryReservations) { requireNonNull(queryInfoSupplier); requireNonNull(queryMemoryReservations); Map<QueryId, QueryInfo> queryIdToInfo = Maps.uniqueIndex(queryInfoSupplier.get(), QueryInfo::getQueryId); Map<QueryId, Long> leakedQueryReservations = queryMemoryReservations.entrySet() .stream() .filter(entry -> entry.getValue() > 0) .filter(entry -> isLeaked(queryIdToInfo, entry.getKey())) .collect(toImmutableMap(Entry::getKey, Entry::getValue)); if (!leakedQueryReservations.isEmpty()) { log.warn("Memory leak detected. The following queries are already finished, " + "but they have memory reservations on some worker node(s): %s", leakedQueryReservations); } synchronized (this) { leakedQueries = ImmutableSet.copyOf(leakedQueryReservations.keySet()); } }
Source:
<code>public void initializeState(FunctionInitializationContext context) throws Exception { Preconditions.checkArgument(this.restoredBucketStates == null, "The operator has already been initialized."); try { initFileSystem(); } catch (IOException e) { LOG.error("Error while creating FileSystem when initializing the state of the BucketingSink.", e); throw new RuntimeException("Error while creating FileSystem when initializing the state of the BucketingSink.", e); } if (this.refTruncate == null) { this.refTruncate = reflectTruncate(fs); } OperatorStateStore stateStore = context.getOperatorStateStore(); <START> this.restoredBucketStates = stateStore.getListState(new ListStateDescriptor("bucket-states", State.class)); <END> int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask(); if (context.isRestored()) { LOG.info("Restoring state for the (taskIdx={}).", getClass().getSimpleName(), subtaskIndex); for (State<T> recoveredState : restoredBucketStates.get()) { handleRestoredBucketState(recoveredState); if (LOG.isDebugEnabled()) { LOG.debug("{} idx restored {}", getClass().getSimpleName(), subtaskIndex, recoveredState); } } } else { LOG.info("No state to restore for the (taskIdx={}).", getClass().getSimpleName(), subtaskIndex); } }</code><technical_language>This work getListState(..., State.class) created a GenericTypeInfo, is incompatible JavaSerializer internally here</technical_language>

Target:
public void initializeState(FunctionInitializationContext context) throws Exception { Preconditions.checkArgument(this.restoredBucketStates == null, "The operator has already been initialized."); try { initFileSystem(); } catch (IOException e) { LOG.error("Error while creating FileSystem when initializing the state of the BucketingSink.", e); throw new RuntimeException("Error while creating FileSystem when initializing the state of the BucketingSink.", e); } if (this.refTruncate == null) { this.refTruncate = reflectTruncate(fs); } OperatorStateStore stateStore = context.getOperatorStateStore(); this.restoredBucketStates = stateStore.getListState(new ListStateDescriptor<>("bucket-states", new JavaSerializer<>())); int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask(); if (context.isRestored()) { LOG.info("Restoring state for the (taskIdx={}).", getClass().getSimpleName(), subtaskIndex); for (State<T> recoveredState : restoredBucketStates.get()) { handleRestoredBucketState(recoveredState); if (LOG.isDebugEnabled()) { LOG.debug("{} idx restored {}", getClass().getSimpleName(), subtaskIndex, recoveredState); } } } else { LOG.info("No state to restore for the (taskIdx={}).", getClass().getSimpleName(), subtaskIndex); } }
Source:
<code>public void createDraft() throws Exception { PushOneCommit.Result r = createChange(); String changeId = r.getChangeId(); String revId = r.getCommit().getName(); ReviewInput.CommentInput comment = newCommentInfo( "file1", Comment.Side.REVISION, 1, "comment 1"); addDraft(changeId, revId, comment); Map<String, List<CommentInfo>> result = getDraftComments(changeId, revId); <START> assertThat(result.size()).isEqualTo(1); <END> CommentInfo actual = Iterables.getOnlyElement(result.get(comment.path)); assertCommentInfo(comment, actual); }</code><technical_language>assertThat(result).hasSize(1);</technical_language>

Target:
public void createDraft() throws Exception { PushOneCommit.Result r = createChange(); String changeId = r.getChangeId(); String revId = r.getCommit().getName(); ReviewInput.CommentInput comment = newCommentInfo( "file1", Comment.Side.REVISION, 1, "comment 1"); addDraft(changeId, revId, comment); Map<String, List<CommentInfo>> result = getDraftComments(changeId, revId); assertThat(result).hasSize(1); CommentInfo actual = Iterables.getOnlyElement(result.get(comment.path)); assertCommentInfo(comment, actual); }
Source:
<code>public void setDiscarded(boolean discarded) { <START> if (discarded) volume = new BigDecimal("0.0"); <END> this.discarded = discarded; }</code><technical_language>BigDecimal.ZERO match others</technical_language>

Target:
public void setDiscarded(boolean discarded) { if (discarded) volume = BigDecimal.ZERO; this.discarded = discarded; }
Source:
<code>String getRefreshRateItemKey() { <START> return GRID_REFRESH_RATE_PREFIX; <END> }</code><technical_language>refresh rate is shared for grids, I suggest rename GRID_REFRESH_RATE_PREFIX this: // Key store refresh rate of data grids private static final String GRID_REFRESH_RATE_KEY = "GridRefreshRate";</technical_language>

Target:
String getRefreshRateItemKey() { return GRID_REFRESH_RATE_KEY; }
Source:
<code>public static Row createRow(Map<String, Object> sourceMap, String documentId, DataSetHeader header) { final Object[] values = new Object[header.size()]; for (int i = 0; i < values.length; i++) { final SelectItem selectItem = header.getSelectItem(i); final Column column = selectItem.getColumn(); assert column != null; assert selectItem.getFunction() == null; if (column.isPrimaryKey()) { values[i] = documentId; } else { Object value = sourceMap.get(column.getName()); if (column.getType() == ColumnType.DATE) { <START> Date valueToDate = TimeComparator.toDate(value); <END> if (valueToDate == null) { values[i] = value; } else { values[i] = valueToDate; } } else { values[i] = value; } } } return new DefaultRow(header, values); }</code><technical_language>put in ES module time format ES uses. I guess TimeComparator is a bit more general purpose while I imagine (?) ES is specific date pattern</technical_language>

Target:
public static Row createRow(Map<String, Object> sourceMap, String documentId, DataSetHeader header) { final Object[] values = new Object[header.size()]; for (int i = 0; i < values.length; i++) { final SelectItem selectItem = header.getSelectItem(i); final Column column = selectItem.getColumn(); assert column != null; assert selectItem.getFunction() == null; if (column.isPrimaryKey()) { values[i] = documentId; } else { Object value = sourceMap.get(column.getName()); if (column.getType() == ColumnType.DATE) { Date valueToDate = ElasticSearchDateConverter.tryToConvert((String) value); if (valueToDate == null) { values[i] = value; } else { values[i] = valueToDate; } } else { values[i] = value; } } } return new DefaultRow(header, values); }
Source:
<code>protected boolean recreateDataSource() { <START> return true; <END> }</code><technical_language>this reverted</technical_language>

Target:
protected boolean recreateDataSource() { boolean recreate = previousProducerTimeZone != null && previousClientTimeZone != null && (!producerTimeZone.equals(previousProducerTimeZone) || !clientTimeZone.equals(previousClientTimeZone)); previousProducerTimeZone = producerTimeZone; previousClientTimeZone = clientTimeZone; return recreate; }
Source:
<code>private List<AXLPDFAIdentification> getIdentification() { VeraPDFMeta xmpMetadata = this.getXmpMetadata(); if (xmpMetadata != null) { for (VeraPDFXMPNode node : xmpMetadata.getProperties()) { if (XMPSchemaRegistryImpl.NS_PDFA_ID.equals(node.getNamespaceURI())) { List<AXLPDFAIdentification> res = new ArrayList<>(1); res.add(new AXLPDFAIdentification(xmpMetadata)); return res; } } } <START> return new ArrayList<>(0); <END> }</code><technical_language>Collections.emptyList();</technical_language>

Target:
private List<AXLPDFAIdentification> getIdentification() { VeraPDFMeta xmpMetadata = this.getXmpMetadata(); if (xmpMetadata != null) { for (VeraPDFXMPNode node : xmpMetadata.getProperties()) { if (XMPSchemaRegistryImpl.NS_PDFA_ID.equals(node.getNamespaceURI())) { List<AXLPDFAIdentification> res = new ArrayList<>(1); res.add(new AXLPDFAIdentification(xmpMetadata)); return res; } } } return Collections.emptyList(); }
Source:
<code>private boolean shouldRetry(IOException exception, Optional<Duration> backoff) { if (retryOnSocketException == ClientConfiguration.RetryOnSocketException.DANGEROUS_DISABLED) { return false; } switch (retryOnTimeout) { case DISABLED: if (exception instanceof SocketTimeoutException) { SocketTimeoutException socketTimeout = (SocketTimeoutException) exception; if (socketTimeout.getMessage() == null || !socketTimeout .getMessage() .toLowerCase(Locale.ENGLISH) <START> .contains("connect timed out")) { <END> return false; } } return backoff.isPresent(); case DANGEROUS_ENABLE_AT_RISK_OF_RETRY_STORMS: return backoff.isPresent(); } throw new SafeIllegalStateException( "Encountered unknown retry on timeout configuration", SafeArg.of("retryOnTimeout", retryOnTimeout)); }</code><technical_language>This is hilarious imho, in java 14 message is Connect timed out</technical_language>

Target:
private boolean shouldRetry(IOException exception, Optional<Duration> backoff) { if (retryOnSocketException == ClientConfiguration.RetryOnSocketException.DANGEROUS_DISABLED) { return false; } switch (retryOnTimeout) { case DISABLED: if (exception instanceof SocketTimeoutException) { SocketTimeoutException socketTimeout = (SocketTimeoutException) exception; if (socketTimeout.getMessage() == null || !socketTimeout.getMessage().contains("connect timed out") && !socketTimeout.getMessage().contains("Connect timed out")) { return false; } } return backoff.isPresent(); case DANGEROUS_ENABLE_AT_RISK_OF_RETRY_STORMS: return backoff.isPresent(); } throw new SafeIllegalStateException( "Encountered unknown retry on timeout configuration", SafeArg.of("retryOnTimeout", retryOnTimeout)); }
Source:
<code>void scheduleMessageWithTransaction() { long sequenceNumberReturned = 10; Instant instant = mock(Instant.class); ArgumentCaptor<Instant> instantCapture = ArgumentCaptor.forClass(Instant.class); ArgumentCaptor<Integer> lengthCapture = ArgumentCaptor.forClass(Integer.class); ArgumentCaptor<String> linkNameCapture = ArgumentCaptor.forClass(String.class); ArgumentCaptor<ServiceBusTransactionContext> transactionCapture = ArgumentCaptor.forClass(ServiceBusTransactionContext.class); when(connection.createSendLink(eq(ENTITY_NAME), eq(ENTITY_NAME), any(AmqpRetryOptions.class))) .thenReturn(Mono.just(sendLink)); when(sendLink.getLinkSize()).thenReturn(Mono.just(MAX_MESSAGE_LENGTH_BYTES)); when(managementNode.schedule(eq(message), eq(instant), any(Integer.class), any(), any(ServiceBusTransactionContext.class))) .thenReturn(just(sequenceNumberReturned)); StepVerifier.create(sender.scheduleMessage(message, instant, transactionContext)) .expectNext(sequenceNumberReturned) .verifyComplete(); verify(managementNode).schedule(singleSBMessageCaptor.capture(), instantCapture.capture(), lengthCapture.capture(), linkNameCapture.capture(), transactionCapture.capture()); <START> Assertions.assertEquals(message, singleSBMessageCaptor.getValue()); <END> Assertions.assertEquals(instant, instantCapture.getValue()); Assertions.assertEquals(MAX_MESSAGE_LENGTH_BYTES, lengthCapture.getValue()); Assertions.assertEquals(LINK_NAME, linkNameCapture.getValue()); Assertions.assertSame(transactionContext, transactionCapture.getValue()); }</code><technical_language>need capture them. if arguments match, return null fail teh tests</technical_language>

Target:
void scheduleMessageWithTransaction() { final long sequenceNumberReturned = 10; final Instant instant = mock(Instant.class); when(connection.createSendLink(eq(ENTITY_NAME), eq(ENTITY_NAME), any(AmqpRetryOptions.class))) .thenReturn(Mono.just(sendLink)); when(sendLink.getLinkSize()).thenReturn(Mono.just(MAX_MESSAGE_LENGTH_BYTES)); when(managementNode.schedule(eq(message), eq(instant), eq(MAX_MESSAGE_LENGTH_BYTES), eq(LINK_NAME), argThat(e -> e.getTransactionId().equals(transactionContext.getTransactionId())))) .thenReturn(just(sequenceNumberReturned)); StepVerifier.create(sender.scheduleMessage(message, instant, transactionContext)) .expectNext(sequenceNumberReturned) .verifyComplete(); verify(managementNode).schedule(eq(message), eq(instant), eq(MAX_MESSAGE_LENGTH_BYTES), eq(LINK_NAME), argThat(e -> e.getTransactionId().equals(transactionContext.getTransactionId()))); }
Source:
<code>RestartInformation getRestartInformationForStreamPos(long streamPos) { RestartInformation restartInfo = new RestartInformation(); for (int i = 0; i < streamPosOfFetches.size(); i++) { int index = streamPosOfFetches.size() - (i+1); Long fetchStreamPos = streamPosOfFetches.get(index); <START> if (fetchStreamPos <= streamPos) { <END> restartInfo.streamPos = fetchStreamPos; restartInfo.tokenBin = tokenBinOfFetches.get(index); break; } } return restartInfo; }</code><technical_language>minor format issue</technical_language>

Target:
RestartInformation getRestartInformationForStreamPos(long streamPos) { RestartInformation restartInfo = new RestartInformation(); for (int i = streamPosOfFetches.size()-1; i >= 0; i--) { Long fetchStreamPos = streamPosOfFetches.get(i); if (fetchStreamPos <= streamPos) { restartInfo.streamPos = fetchStreamPos; restartInfo.tokenBin = tokenBinOfFetches.get(i); break; } } return restartInfo; }
Source:
<code>private static BiConsumer<LoggingFunction, Stopwatch> logCellsAndSize(String method, TableReference tableRef, int numCells, long sizeInBytes) { return (logger, stopwatch) -> logger.log("Call to KVS.{} on table for cells of overall size bytes took ms.", <START> SafeArg.of("method", method), UnsafeArg.of("tableRef", tableRef), <END> SafeArg.of("numCells", numCells), SafeArg.of("sizeInBytes", sizeInBytes), stopwatch.elapsed(TimeUnit.MILLISECONDS)); }</code><technical_language>LoggingArgs.tableRef here, safe/unsafe depending table safe</technical_language>

Target:
private static BiConsumer<LoggingFunction, Stopwatch> logCellsAndSize(String method, TableReference tableRef, int numCells, long sizeInBytes) { return (logger, stopwatch) -> logger.log("Call to KVS.{} on table for cells of overall size bytes took ms.", LoggingArgs.method(method), LoggingArgs.tableRef(tableRef), LoggingArgs.cellCount(numCells), LoggingArgs.sizeInBytes(sizeInBytes), LoggingArgs.durationMillis(stopwatch)); }
Source:
<code><START> private Boolean isValidEntry(JarEntry entry) { <END> if (entry != null && entry.getSize() > 0) { return true; } return false; }</code><technical_language>s/B/b/</technical_language>

Target:
private boolean isValidEntry(JarEntry entry) { return entry != null && entry.getSize() > 0; }
Source:
<code>protected Type build(String name) { Preconditions.checkState(logicalTypeAnnotation == null, "MAP is already a logical type and can't be changed."); if (keyType == null) { keyType = STRING_KEY; } GroupBuilder<GroupType> builder = buildGroup(repetition).as(mapType()); if (id != null) { builder.id(id.intValue()); } if (valueType != null) { return builder <START> .repeatedGroup().addFields(keyType, valueType).named("key_value") <END> .named(name); } else { return builder .repeatedGroup().addFields(keyType).named("key_value") .named(name); } }</code><technical_language>I suggest ConverstionPatterns.MAP_REPEATED_NAME well</technical_language>

Target:
protected Type build(String name) { Preconditions.checkState(logicalTypeAnnotation == null, "MAP is already a logical type and can't be changed."); if (keyType == null) { keyType = STRING_KEY; } GroupBuilder<GroupType> builder = buildGroup(repetition).as(mapType()); if (id != null) { builder.id(id.intValue()); } if (valueType != null) { return builder .repeatedGroup().addFields(keyType, valueType).named(ConversionPatterns.MAP_REPEATED_NAME) .named(name); } else { return builder .repeatedGroup().addFields(keyType).named(ConversionPatterns.MAP_REPEATED_NAME) .named(name); } }
Source:
<code>public void onStepCountLimitInputChange( ChangeEvent event ) { try { Integer value = stepCountLimitInput.getValue().isEmpty() ? null : Integer.parseInt( stepCountLimitInput.getValue() ); presenter.onStepCountLimitChange( value ); } catch ( NumberFormatException e ) { <START> <END> } }</code><technical_language>Likewise.</technical_language>

Target:
public void onStepCountLimitInputChange( ChangeEvent event ) { boolean isNumeric = stepCountLimitInput.getValue().matches( "\\d+" ); if (isNumeric) { presenter.onStepCountLimitChange( Integer.parseInt( stepCountLimitInput.getValue() ) ); } else { presenter.onStepCountLimitChange( 0 ); stepCountLimitInput.setValue( "0" ); } }