auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void init(FilterConfig filterConfig) throws ServletException { String filterName = filterConfig.getFilterName(); ObjectName name = null; try { name = new <START> ObjectName(((Filter) this).getClass().getName(), <END> "filterName", filterName); MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer(); platformMBeanServer.registerMBean(this, name); log.info("ThrottlingFilter MBean registered as {}.", name); } catch (MalformedObjectNameException e) { log.error("filter name is invalid as an MBean property.", filterName, e); } catch (InstanceAlreadyExistsException e) { log.error("MBean for {}} has already been registered.", filterName, e); } catch (NotCompliantMBeanException | MBeanRegistrationException e) { log.error("Could not register MBean for Filter {}.", filterName, e); } objectName = name; }</code><technical_language>unnecessary cast</technical_language>

Target:
public void init(FilterConfig filterConfig) throws ServletException { String filterName = filterConfig.getFilterName(); ObjectName name = null; try { name = new ObjectName(this.getClass().getName(), "filterName", filterName); MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer(); platformMBeanServer.registerMBean(this, name); log.info("ThrottlingFilter MBean registered as {}.", name); } catch (MalformedObjectNameException e) { log.error("filter name is invalid as an MBean property.", filterName, e); } catch (InstanceAlreadyExistsException e) { log.error("MBean for {}} has already been registered.", filterName, e); } catch (NotCompliantMBeanException | MBeanRegistrationException e) { log.error("Could not register MBean for Filter {}.", filterName, e); } objectName = name; }
Source:
<code>public static String getShortMessage() { <START> return "Gradient too steep, changes too quickly"; <END> }</code><technical_language>This is kind of redundant - twice. I mind :) for long message</technical_language>

Target:
public static String getShortMessage() { return "Changes too quickly"; }
Source:
<code>public void theAuditTrailContainsMultipleRetryLogRecords(final Map<String, String> settings) throws Throwable { <START> final String pattern = PATTERN_RETRY_OPERATION; <END> final String deviceIdentification = getString(settings, PlatformKeys.KEY_DEVICE_IDENTIFICATION, PlatformDefaults.DEFAULT_DEVICE_IDENTIFICATION); assertTrue("DeviceLogItems are not found in the database", this.responseNotifier.waitForLog(deviceIdentification, 1000, 600000)); final List<DeviceLogItem> deviceLogItems = this.deviceLogItemRepository .findByDeviceIdentification(deviceIdentification, new PageRequest(0, 2)).getContent(); for (int i = 0; i < deviceLogItems.size(); i++) { final DeviceLogItem item = deviceLogItems.get(i); LOGGER.info("CreationTime: {}", item.getCreationTime().toString()); LOGGER.info("DecodedMessage: {}", item.getDecodedMessage()); final boolean isMatchRetryOperation = Pattern.matches(pattern, item.getDecodedMessage()); assertTrue("No retry log item found.", isMatchRetryOperation); } }</code><technical_language>If String constant is transformed a Pattern anymore, is need a local variable store in</technical_language>

Target:
public void theAuditTrailContainsMultipleRetryLogRecords(final Map<String, String> settings) throws Throwable { final String deviceIdentification = getString(settings, PlatformKeys.KEY_DEVICE_IDENTIFICATION, PlatformDefaults.DEFAULT_DEVICE_IDENTIFICATION); assertTrue("DeviceLogItems are not found in the database", this.responseNotifier.waitForLog(deviceIdentification, 1000, 600000)); final List<DeviceLogItem> deviceLogItems = this.deviceLogItemRepository .findByDeviceIdentification(deviceIdentification, new PageRequest(0, 2)).getContent(); for (final DeviceLogItem deviceLogItem : deviceLogItems) { LOGGER.info("CreationTime: {}", deviceLogItem.getCreationTime().toString()); LOGGER.info("DecodedMessage: {}", deviceLogItem.getDecodedMessage()); final boolean isMatchRetryOperation = Pattern.matches(PATTERN_RETRY_OPERATION, deviceLogItem.getDecodedMessage()); assertTrue("No retry log item found.", isMatchRetryOperation); } }
Source:
<code>public boolean isHealthy(ServiceEndPoint endPoint) { <START> throw new RuntimeException("This should not get executed"); <END> }</code><technical_language>this message a more descriptive? nice able differentiate isRetriableException throws check stack trace</technical_language>

Target:
public boolean isHealthy(ServiceEndPoint endPoint) { throw new RuntimeException("isHealthy() should not get executed as part the performance test suite"); }
Source:
<code>public void writeVersion(final String version) { if (null == version || version.isEmpty()) { return; } final XTextDocument document = odtEditor.getXTextDocument(); final XDocumentPropertiesSupplier xsDocProp = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, document); final XDocumentProperties props = xsDocProp.getDocumentProperties(); XPropertyContainer userDefined = props.getUserDefinedProperties(); try { userDefined.removeProperty(CustomFields.VERSION); } catch (UnknownPropertyException | NotRemoveableException e) { } try { userDefined.addProperty(CustomFields.VERSION, <START> com.sun.star.beans.PropertyAttribute.REMOVABLE, <END> version); } catch (IllegalArgumentException | PropertyExistException | IllegalTypeException e) { Activator.log.error(e); } }</code><technical_language>Suspicious</technical_language>

Target:
public void writeVersion(final String version) { if (null == version || version.isEmpty()) { return; } final XTextDocument document = odtEditor.getXTextDocument(); final XDocumentPropertiesSupplier xsDocProp = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, document); final XDocumentProperties props = xsDocProp.getDocumentProperties(); XPropertyContainer userDefined = props.getUserDefinedProperties(); try { userDefined.removeProperty(CustomFields.VERSION); } catch (UnknownPropertyException | NotRemoveableException e) { } try { userDefined.addProperty(CustomFields.VERSION, PropertyAttribute.REMOVABLE, version); } catch (IllegalArgumentException | PropertyExistException | IllegalTypeException e) { Activator.log.error(e); } }
Source:
<code>public void setForeground (Color color) { super.setForeground(color); foreground = color; for (Sash <START> sashe : <END> sashes) { sashe.setForeground(foreground); } }</code><technical_language>rename sash</technical_language>

Target:
public void setForeground (Color color) { super.setForeground(color); foreground = color; for (Sash sash : sashes) { sash.setForeground(foreground); } }
Source:
<code>public static org.ovirt.engine.core.common.job.Step map(Step step, org.ovirt.engine.core.common.job.Step entity) { org.ovirt.engine.core.common.job.Step target = entity != null ? entity : new org.ovirt.engine.core.common.job.Step(); <START> target.setId(new Guid(step.getId())); <END> if (step.isSetParentStep()) { target.setParentStepId(Guid.createGuidFromString(step.getParentStep().getId())); } target.setJobId(Guid.createGuidFromString(step.getJob().getId())); if (step.isSetType()) { target.setStepType(map(step.getType())); } if (step.isSetDescription()) { target.setDescription(step.getDescription()); } if (step.isSetNumber()) { target.setStepNumber(step.getNumber()); } if (step.isSetStatus()) { target.setStatus(JobMapper.map(step.getStatus(), null)); } target.setStartTime(step.isSetStartTime() ? step.getStartTime().toGregorianCalendar().getTime() : new Date((Calendar.getInstance().getTimeInMillis()))); target.setEndTime(step.isSetEndTime() ? step.getEndTime().toGregorianCalendar().getTime() : new Date((Calendar.getInstance().getTimeInMillis()))); target.setExternal(step.isSetExternal() ? step.isExternal() : true); return target; }</code><technical_language>GuidUtils.asGuid() formats BAD_REQUEST format exception, while new Guid() throws runtime exception</technical_language>

Target:
public static org.ovirt.engine.core.common.job.Step map(Step step, org.ovirt.engine.core.common.job.Step entity) { org.ovirt.engine.core.common.job.Step target = entity != null ? entity : new org.ovirt.engine.core.common.job.Step(); target.setId(new Guid(step.getId())); if (step.isSetParentStep()) { target.setParentStepId(Guid.createGuidFromString(step.getParentStep().getId())); } target.setJobId(GuidUtils.asGuid(step.getJob().getId())); if (step.isSetType()) { StepEnum type = StepEnum.fromValue(step.getType()); if (type != null) { target.setStepType(map(type)); } } if (step.isSetDescription()) { target.setDescription(step.getDescription()); } if (step.isSetNumber()) { target.setStepNumber(step.getNumber()); } if (step.isSetStatus()) { target.setStatus(JobMapper.map(step.getStatus(), null)); } target.setStartTime(step.isSetStartTime() ? step.getStartTime().toGregorianCalendar().getTime() : new Date((Calendar.getInstance().getTimeInMillis()))); target.setEndTime(step.isSetEndTime() ? step.getEndTime().toGregorianCalendar().getTime() : new Date((Calendar.getInstance().getTimeInMillis()))); target.setExternal(step.isSetExternal() ? step.isExternal() : true); return target; }
Source:
<code>protected ITmfTreeViewerEntry updateElements(long start, long end, boolean isSelection) { ITmfTrace trace = getTrace(); if (trace == null) { return null; } ITmfTreeDataProvider<@NonNull TmfTreeDataModel> provider = DataProviderManager.getInstance().getDataProvider(trace, fId, ITmfTreeDataProvider.class); if (provider == null) { return null; } TmfModelResponse<List<@NonNull TmfTreeDataModel>> tree = provider.fetchTree(new TimeQueryFilter(0l, Long.MAX_VALUE, 2), null); List<@NonNull TmfTreeDataModel> model = tree.getModel(); if (model == null) { return null; } TmfTreeViewerEntry root = new TmfTreeViewerEntry(StringUtils.EMPTY); Map<Long, TmfTreeViewerEntry> map = new HashMap<>(); map.put(-1L, root); for <START> (@NonNull TmfTreeDataModel <END> entry : model) { TmfGenericTreeEntry<@NonNull TmfTreeDataModel> viewerEntry = new TmfGenericTreeEntry<>(entry); map.put(entry.getId(), viewerEntry); TmfTreeViewerEntry parent = map.get(entry.getParentId()); if (parent != null && !parent.getChildren().contains(viewerEntry)) { parent.addChild(viewerEntry); } } return root; }</code><technical_language>hmm</technical_language>

Target:
protected ITmfTreeViewerEntry updateElements(long start, long end, boolean isSelection) { throw new UnsupportedOperationException("This method should not be called for AbstractSelectTreeViewers"); }
Source:
<code>public void shouldReturnBadRequestOnMissingSchemaAtSpecifiedVersion() { Topic topic = randomTopic("avro", "topicWithoutSchemaAtSpecifiedVersion").withContentType(AVRO).build(); operations.buildTopicWithSchema(topicWithSchema(topic, user.getSchemaAsString())); HermesMessage message = hermesMessage(topic.getQualifiedName(), user.asBytes()) .avro(2) .build(); Response response = publisher.publishAvro(topic.getQualifiedName(), message.getBody(), message.getHeaders()); assertThat(response.getStatus()).isEqualTo(BAD_REQUEST.getStatusCode()); assertThat(response.readEntity(String.class)) <START> .isEqualTo("{\"message\":\"Given schema version does not exist\",\"code\":\"SCHEMA_VERSION_DOES_NOT_EXIST\"}"); <END> }</code><technical_language>return schema version exist in http response? This information useful for clients</technical_language>

Target:
public void shouldReturnBadRequestOnMissingSchemaAtSpecifiedVersion() { Topic topic = randomTopic("avro", "topicWithoutSchemaAtSpecifiedVersion").withContentType(AVRO).build(); operations.buildTopicWithSchema(topicWithSchema(topic, user.getSchemaAsString())); HermesMessage message = hermesMessage(topic.getQualifiedName(), user.asBytes()) .avro(2) .build(); Response response = publisher.publishAvro(topic.getQualifiedName(), message.getBody(), message.getHeaders()); assertThat(response.getStatus()).isEqualTo(BAD_REQUEST.getStatusCode()); assertThat(response.readEntity(String.class)) .isEqualTo("{\"message\":\"Given schema version '2' does not exist\",\"code\":\"SCHEMA_VERSION_DOES_NOT_EXIST\"}"); }
Source:
<code>public DeployitCommunicator getCommunicator() { LOCK.enter(); try { if (null == communicator) { try { communicator = RemoteBooter.getCommunicator(booterConfig); LOG.debug("Reusing existing communicator for config: {}.", safeBooterConfigKey()); } catch (IllegalStateException ex) { <START> LOG.warn("No communicator found for config: {}. Creating new DeployitCommunicator. Cause: {}.", safeBooterConfigKey(), ex.getMessage(), ex); <END> DescriptorRegistry.remove(booterConfig); communicator = RemoteBooter.boot(booterConfig); } } } finally { LOCK.leave(); } return communicator; }</code><technical_language>argument unnecessary</technical_language>

Target:
public DeployitCommunicator getCommunicator() { LOCK.enter(); try { if (null == communicator) { try { communicator = RemoteBooter.getCommunicator(booterConfig); LOG.debug("Reusing existing communicator for config: {}.", safeBooterConfigKey()); } catch (IllegalStateException ex) { LOG.warn("No communicator found for config: {}. Creating new DeployitCommunicator. Cause: {}.", safeBooterConfigKey(), ex.getMessage(), ex); DescriptorRegistry.remove(booterConfig); communicator = RemoteBooter.boot(booterConfig); fixVersionDepl6949(); } } } finally { LOCK.leave(); } return communicator; }
Source:
<code>public Publisher<CoreEvent> apply(Publisher<CoreEvent> publisher) { return from(publisher) .flatMap(event -> Mono.from(processWithChildContextDontComplete(event, nestedChain, ofNullable(getLocation()))) <START> .transform(p -> policyTemplate.orElseGet(() -> createRetryPolicyTemplate(event)).applyPolicy(p, getRetryPredicate(), <END> e -> { }, getThrowableFunction(event), timer))); }</code><technical_language>extract logic fetch/build retry policy a provate method, for code readability</technical_language>

Target:
public Publisher<CoreEvent> apply(Publisher<CoreEvent> publisher) { return from(publisher) .flatMap(event -> Mono.from(processWithChildContextDontComplete(event, nestedChain, ofNullable(getLocation()))) .transform(p -> fetchPolicyTemplate(event).applyPolicy(p, getRetryPredicate(), e -> { }, getThrowableFunction(event), timer))); }
Source:
<code>public MigratableTableTranslation<DBOColumnModel, DBOColumnModel> getTranslator() { return new BasicMigratableTableTranslation<DBOColumnModel>(){ @TemporaryCode(author="ziming", comment = "one-time migration change. remove after stack 309") @Override public DBOColumnModel createDatabaseObjectFromBackup(DBOColumnModel backup) { <START> ColumnModel columnModel = ColumnModelUtils.createDTOFromDBO(backup); <END> if(ColumnTypeListMappings.isList(columnModel.getColumnType())){ columnModel.setMaximumListLength(ColumnConstants.MAX_ALLOWED_LIST_LENGTH); } DBOColumnModel modifiedDBO = ColumnModelUtils.createDBOFromDTO(columnModel, StackConfigurationSingleton.singleton().getTableMaxEnumValues()); return modifiedDBO; } }; }</code><technical_language>ColumnModelUtils.createDTOFromDBO(backup); handle set default (not setting here)</technical_language>

Target:
public MigratableTableTranslation<DBOColumnModel, DBOColumnModel> getTranslator() { return new BasicMigratableTableTranslation<DBOColumnModel>(){ @TemporaryCode(author="ziming", comment = "one-time migration change. remove after stack 309") @Override public DBOColumnModel createDatabaseObjectFromBackup(DBOColumnModel backup) { ColumnModel columnModel = ColumnModelUtils.createDTOFromDBO(backup); DBOColumnModel modifiedDBO = ColumnModelUtils.createDBOFromDTO(columnModel, StackConfigurationSingleton.singleton().getTableMaxEnumValues()); return modifiedDBO; } }; }
Source:
<code>public MessageHeader_Format_V2(ByteBuffer input) { <START> this.buffer = input; <END> }</code><technical_language>minor: this required</technical_language>

Target:
public MessageHeader_Format_V2(ByteBuffer input) { buffer = input; }
Source:
<code>protected IStructuredSelection getSelection(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelectionChecked(event); <START> if (selection instanceof IStructuredSelection) <END> return (IStructuredSelection) selection; else return StructuredSelection.EMPTY; }</code><technical_language>4 lines of this method extracted new method, a duplication (see 10 lines above)</technical_language>

Target:
protected IStructuredSelection getSelection(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelectionChecked(event); return getStructuredSelection(selection); }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SetRangerCloudIdentityMappingRequest that = (SetRangerCloudIdentityMappingRequest) o; <START> return azureUserMapping.equals(that.azureUserMapping) && <END> azureGroupMapping.equals(that.azureGroupMapping); }</code><technical_language>Objects.equals for this safe? current code assumes fields null. I fields annotated @NotNull, affects validation</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SetRangerCloudIdentityMappingRequest that = (SetRangerCloudIdentityMappingRequest) o; return Objects.equals(azureUserMapping, that.azureUserMapping) && Objects.equals(azureGroupMapping, that.azureGroupMapping); }
Source:
<code><START> private String setPropertyAndGetString(String name, String category, String defaultValue, String comment, String[] validValues, String[] validValuesDisplay, String langKey) <END> { Property prop = this.get(category, name, defaultValue); prop.setValidValues(validValues); if (validValuesDisplay != null) prop.setValidValuesDisplay(validValuesDisplay); prop.setLanguageKey(langKey); prop.setComment(comment + " [default: " + defaultValue + "]"); return prop.getString(); }</code><technical_language>I accurately describe current behavior, solution is good. I simple fix work more consistently breaking things</technical_language>

Target:
private String setPropertyAndGetString(String name, String category, String defaultValue, String comment, String[] validValues, String[] validValuesDisplay, String langKey) { Property prop = this.get(category, name, defaultValue); prop.setValidValues(validValues); prop.setValidValuesDisplay(validValuesDisplay); prop.setLanguageKey(langKey); prop.setComment(comment + " [default: " + defaultValue + "]"); return prop.getString(); }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); for (IActivityResult f : activityResultListeners) { try { f.onActivityResult(requestCode, resultCode, data); } catch (Exception e) { <START> Log.e(Tag.TAG, "Error executing onActivityResult subscriber"); <END> } } }</code><technical_language>e is</technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); for (IActivityResult f : activityResultListeners) { try { f.onActivityResult(requestCode, resultCode, data); } catch (Exception e) { Log.e(Tag.TAG, "Error executing onActivityResult subscriber " + f, e); } } }
Source:
<code>private void markAllBelowAsUnread() { <START> if (listView.getSelectedIndex() >= 0) { <END> for (int i = listView.getSelectedIndex(); i < listView.getItems().size(); i++){ TurboIssue issue = listView.getItems().get(i).getIssue(); issue.markAsUnread(UI.prefs); } parentPanelControl.refresh(); } }</code><technical_language>is this negative</technical_language>

Target:
private void markAllBelowAsUnread() { Optional<GuiElement> item = listView.getSelectedItem(); if (item.isPresent()) { for(int i = listView.getSelectedIndex(); i < listView.getItems().size(); i++){ TurboIssue issue = listView.getItems().get(i).getIssue(); issue.markAsUnread(UI.prefs); } parentPanelControl.refresh(); } }
Source:
<code>public void teardown() { <START> super.teardown(); <END> windowDataManager.teardown(); }</code><technical_language>unnecessary</technical_language>

Target:
public void teardown() { windowDataManager.teardown(); }
Source:
<code>public Optional<ConnectorPartitioningHandle> getCommonPartitioningHandle(ConnectorSession session, ConnectorPartitioningHandle left, ConnectorPartitioningHandle right) { HivePartitioningHandle leftHandle = (HivePartitioningHandle) left; HivePartitioningHandle rightHandle = (HivePartitioningHandle) right; if (!leftHandle.getHiveTypes().equals(rightHandle.getHiveTypes())) { return Optional.empty(); } if (!isOptimizedMismatchedBucketCount(session) && leftHandle.getBucketCount() != rightHandle.getBucketCount()) { } int largerBucketCount = Math.max(leftHandle.getBucketCount(), rightHandle.getBucketCount()); int smallerBucketCount = Math.min(leftHandle.getBucketCount(), rightHandle.getBucketCount()); if (largerBucketCount % smallerBucketCount != 0) { return Optional.empty(); } if (Integer.bitCount(largerBucketCount / smallerBucketCount) != 1) { return Optional.empty(); } <START> <END> OptionalInt maxCompatibleBucketCount = min(leftHandle.getMaxCompatibleBucketCount(), rightHandle.getMaxCompatibleBucketCount()); if (maxCompatibleBucketCount.isPresent() && maxCompatibleBucketCount.getAsInt() < smallerBucketCount) { return Optional.empty(); } return Optional.of(new HivePartitioningHandle( smallerBucketCount, leftHandle.getHiveTypes(), maxCompatibleBucketCount)); }</code><technical_language>This necessary</technical_language>

Target:
public Optional<ConnectorPartitioningHandle> getCommonPartitioningHandle(ConnectorSession session, ConnectorPartitioningHandle left, ConnectorPartitioningHandle right) { HivePartitioningHandle leftHandle = (HivePartitioningHandle) left; HivePartitioningHandle rightHandle = (HivePartitioningHandle) right; if (!leftHandle.getHiveTypes().equals(rightHandle.getHiveTypes())) { return Optional.empty(); } if (leftHandle.getBucketCount() == rightHandle.getBucketCount()) { return Optional.of(leftHandle); } if (!isOptimizedMismatchedBucketCount(session)) { return Optional.empty(); } int largerBucketCount = Math.max(leftHandle.getBucketCount(), rightHandle.getBucketCount()); int smallerBucketCount = Math.min(leftHandle.getBucketCount(), rightHandle.getBucketCount()); if (largerBucketCount % smallerBucketCount != 0) { return Optional.empty(); } if (Integer.bitCount(largerBucketCount / smallerBucketCount) != 1) { return Optional.empty(); } OptionalInt maxCompatibleBucketCount = min(leftHandle.getMaxCompatibleBucketCount(), rightHandle.getMaxCompatibleBucketCount()); if (maxCompatibleBucketCount.isPresent() && maxCompatibleBucketCount.getAsInt() < smallerBucketCount) { return Optional.empty(); } return Optional.of(new HivePartitioningHandle( smallerBucketCount, leftHandle.getHiveTypes(), maxCompatibleBucketCount)); }
Source:
<code>private void validateNotRemovingGlusterBrickNetworks() { for (String network : removedNetworks) { Network removedNetwork = getExistingClusterNetworks().get(network); if (removedNetwork == null || <START> removedNetwork.getCluster() == null <END> || !removedNetwork.getCluster().isGluster()) { continue; } List<GlusterBrickEntity> bricks = getDbFacade().getGlusterBrickDao().getAllByClusterAndNetworkId(vds.getVdsGroupId(), removedNetwork.getId()); if (!bricks.isEmpty()) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_NETWORK_FROM_BRICK, network); } } }</code><technical_language>removedNetwork.getCluster() == null occur</technical_language>

Target:
private void validateNotRemovingGlusterBrickNetworks() { for (String network : removedNetworks) { Network removedNetwork = getExistingClusterNetworks().get(network); if (removedNetwork == null || !removedNetwork.getCluster().isGluster()) { continue; } List<GlusterBrickEntity> bricks = getDbFacade().getGlusterBrickDao().getAllByClusterAndNetworkId(vds.getVdsGroupId(), removedNetwork.getId()); if (!bricks.isEmpty()) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_NETWORK_FROM_BRICK, network); } } }
Source:
<code>public DaysOfMonthSelector() { selectedItems = initSelectionList(); initWidget(wrapperPanel); <START> daysOfMonth.setBorderWidth(2); <END> showDaysOfMonth(); daysOfMonth.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Cell cellClicked = daysOfMonth.getCellForEvent(event); int cellColumn = cellClicked.getCellIndex(); int cellRow = cellClicked.getRowIndex(); int actualCellIndex = cellRow * DAYS_IN_WEEK + cellColumn + 1; if (!clickedMap.get(actualCellIndex)) { selectedItems.add(Integer.toString(actualCellIndex)); } else { selectedItems.remove(Integer.toString(actualCellIndex)); } } }); }</code><technical_language>CSS</technical_language>

Target:
public DaysOfMonthSelector() { selectedItems = initSelectionList(); initWidget(wrapperPanel); daysOfMonth.setStyleName("daysOfMonthWidget"); showDaysOfMonth(); daysOfMonth.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Cell cellClicked = daysOfMonth.getCellForEvent(event); int cellColumn = cellClicked.getCellIndex(); int cellRow = cellClicked.getRowIndex(); int actualCellIndex = cellRow * DAYS_IN_WEEK + cellColumn + 1; if (!clickedMap.get(actualCellIndex)) { selectedItems.add(Integer.toString(actualCellIndex)); } else { selectedItems.remove(Integer.toString(actualCellIndex)); } } }); }
Source:
<code>private void downloadDir(String bucketName, String keyPrefix, String dirPath, boolean pause, AmazonS3 s3Client) { getOut().println("downloading to directory: " + dirPath + (pause ? " (pause)" : "")); TransferManager transferManager = TransferManagerBuilder.standard().withS3Client(s3Client).build(); try { MultipleFileDownload xfer = transferManager.downloadDirectory(bucketName, keyPrefix, new File(dirPath)); SchedulerExamplesUtils.showTransferProgress(xfer); SchedulerExamplesUtils.waitForCompletion(xfer); } catch (AmazonServiceException e) { getErr().println(e.getMessage()); System.exit(1); } <START> transferManager.shutdownNow(); <END> }</code><technical_language>this in finally block</technical_language>

Target:
private void downloadDir(String bucketName, String keyPrefix, String dirPath, boolean pause, AmazonS3 s3Client) { getOut().println("downloading to directory: " + dirPath + (pause ? " (pause)" : "")); TransferManager transferManager = TransferManagerBuilder.standard().withS3Client(s3Client).build(); try { MultipleFileDownload xfer = transferManager.downloadDirectory(bucketName, keyPrefix, new File(dirPath)); SchedulerExamplesUtils.showTransferProgress(xfer); SchedulerExamplesUtils.waitForCompletion(xfer); } catch (AmazonServiceException e) { getErr().println(e.getMessage()); System.exit(1); } finally { transferManager.shutdownNow(); } }
Source:
<code>public double referencePrice(IborFutureTrade trade, LocalDate valuationDate, double lastMarginPrice) { ArgChecker.notNull(valuationDate, "valuation date"); Optional<LocalDate> tradeDate = trade.getTradeInfo().getTradeDate(); <START> ArgChecker.isTrue(tradeDate.isPresent(), "trade date should be populated"); <END> double referencePrice; if (tradeDate.get().equals(valuationDate)) { referencePrice = trade.getInitialPrice(); } else { referencePrice = lastMarginPrice; } return referencePrice; }</code><technical_language>This written LocalDate tradeDate = trade.getTradeInfo().getTradeDate() .orElseThrow(() -> new IllegalArgumentException("Trade date populated"));</technical_language>

Target:
public double referencePrice(IborFutureTrade trade, LocalDate valuationDate, double lastMarginPrice) { ArgChecker.notNull(valuationDate, "valuation date"); LocalDate tradeDate = trade.getTradeInfo().getTradeDate() .orElseThrow(() -> new IllegalArgumentException("Trade date should be populated")); return (tradeDate.equals(valuationDate) ? trade.getInitialPrice() : lastMarginPrice); }
Source:
<code>public static double getHoursSpentStateTotal(IAtsObject atsObject) throws OseeCoreException { if (atsObject instanceof IAtsAction) { double hours = 0; for (IAtsTeamWorkflow team : AtsCore.getWorkItemService().getTeams((IAtsAction) atsObject)) { if (!AtsCore.getWorkItemService().getWorkData(team).isCancelled()) { hours += getHoursSpentStateTotal(team); } } <START> return hours; <END> } if (atsObject instanceof IAtsWorkItem) { IAtsWorkItem workItem = (IAtsWorkItem) atsObject; return getHoursSpentStateTotal(workItem, AtsCore.getWorkItemService().getCurrentState(workItem)); } return 0; }</code><technical_language>atsObject IAtsAction IAtsWorkItem time? If need this return. If need more return in a method</technical_language>

Target:
public static double getHoursSpentStateTotal(IAtsObject atsObject) throws OseeCoreException { double hours = 0.0; if (atsObject instanceof IAtsAction) { for (IAtsTeamWorkflow team : AtsCore.getWorkItemService().getTeams((IAtsAction) atsObject)) { if (!AtsCore.getWorkItemService().getWorkData(team).isCancelled()) { hours += getHoursSpentStateTotal(team); } } } else if (atsObject instanceof IAtsWorkItem) { IAtsWorkItem workItem = (IAtsWorkItem) atsObject; hours = getHoursSpentStateTotal(workItem, AtsCore.getWorkItemService().getCurrentState(workItem)); } return hours; }
Source:
<code>public IFileRevision[] getContributors(IProgressMonitor monitor) { if (null == svnRemResource) { return null; } SVNRevision firstRevision = new SVNRevision.Number(1L); <START> SVNRevision.Number previousRevision = new SVNRevision.Number(svnRemResource.getLastChangedRevision() <END> .getNumber()); GetLogsCommand logCmd = new GetLogsCommand(svnRemResource, null, previousRevision, firstRevision, false, 2L, null, true); try { logCmd.run(monitor); } catch (SVNException e) { return null; } final ILogEntry[] entries = logCmd.getLogEntries(); if (entries.length < 2) { return null; } final ISVNRemoteResource remoteResource = entries[entries.length - 1].getRemoteResource(); final IFileRevision[] contributors = new IFileRevision[1]; contributors[0] = new FileRevision() { public IFileRevision withAllProperties(IProgressMonitor monitor) throws CoreException { return this; } public boolean isPropertyMissing() { return false; } public IStorage getStorage(IProgressMonitor monitor) throws CoreException { if (null != remoteResource) { return remoteResource.getStorage(monitor); } return null; } @Override public String getContentIdentifier() { if (null != remoteResource) { return remoteResource.getLastChangedRevision().toString(); } return null; } public String getName() { return remoteResource.getName(); } }; return contributors; }</code><technical_language>version number stored a field variable "id" artifact created. resolve this filed variable clear</technical_language>

Target:
public IFileRevision[] getContributors(IProgressMonitor monitor) { if (null == svnRemResource) { return null; } SVNRevision firstRevision = new SVNRevision.Number(1L); SVNRevision.Number previousRevision = new SVNRevision.Number(Long.parseLong(getId())); GetLogsCommand logCmd = new GetLogsCommand(svnRemResource, null, previousRevision, firstRevision, false, 2L, null, true); try { logCmd.run(monitor); } catch (SVNException e) { return null; } final ILogEntry[] entries = logCmd.getLogEntries(); if (entries.length < 2) { return null; } final ISVNRemoteResource remoteResource = entries[entries.length - 1].getRemoteResource(); final IFileRevision[] contributors = new IFileRevision[1]; contributors[0] = new FileRevision() { public IFileRevision withAllProperties(IProgressMonitor monitor) throws CoreException { return this; } public boolean isPropertyMissing() { return false; } public IStorage getStorage(IProgressMonitor monitor) throws CoreException { if (null != remoteResource) { return remoteResource.getStorage(monitor); } return null; } @Override public String getContentIdentifier() { if (null != remoteResource) { return remoteResource.getLastChangedRevision().toString(); } return null; } public String getName() { return remoteResource.getName(); } }; return contributors; }
Source:
<code>public void loadFileContents_fromEmptyFile_emptyString() { createEmptyTestFile(); try { assertEquals("", FileHelper.loadFileContents(TEST_FOLDER, TEST_FILE_NAME)); } catch (IOException e) { fail(e.toString()); <START> } <END> }</code><technical_language>need catch-and-fail. declare method throws IOException</technical_language>

Target:
public void loadFileContents_fromEmptyFile_emptyString() throws IOException { createEmptyTestFile(); assertEquals("", FileHelper.getFileContents(TEST_FOLDER, TEST_FILE_NAME)); }
Source:
<code>public void testQuotedColumnNames() { String message = "message IntMessage {" + " required int32 `foo bar`;" + " required int32 `foo.bar`;" + " required int32 `foo``bar`;" + " required int64 `foo@#$bar`;" + "}\n"; MessageType parsed = MessageTypeParser.parseMessageType(message); MessageType expected = Types.buildMessage() .required(INT32).as(INT_8).named("foo bar") .required(INT32).as(INT_16).named("foo.bar") .required(INT32).as(INT_32).named("foo`bar") .required(INT64).as(INT_64).named("foo@#$bar") .named("IntMessage"); assertEquals(expected, parsed); MessageType reparsed = MessageTypeParser.parseMessageType(parsed.toString()); assertEquals(expected, reparsed); <START> } <END></code><technical_language>add checks column names worked do get quoted generating schema now. older versions of parquet able read files</technical_language>

Target:
public void testQuotedColumnNames() { String message = "message IntMessage {" + " required int32 `foo bar`;" + " required int32 foo.bar;" + " required int32 `foo``bar`;" + " required int64 foo@#$bar;" + "}\n"; MessageType parsed = MessageTypeParser.parseMessageType(message); MessageType expected = Types.buildMessage() .required(INT32).as(INT_8).named("foo bar") .required(INT32).as(INT_16).named("foo.bar") .required(INT32).as(INT_32).named("foo`bar") .required(INT64).as(INT_64).named("foo@#$bar") .named("IntMessage"); assertEquals(expected, parsed); MessageType reparsed = MessageTypeParser.parseMessageType(parsed.toString()); assertEquals(expected, reparsed); }
Source:
<code>public String getPercentageString() { <START> return dataFormat.format(getPercentageFloat()); <END> }</code><technical_language>Jira ticket asked render 99% (or 99.5%) 100% 99+% (or similar). do here? good able difference actual 99% rounded 99% > 99 < 100</technical_language>

Target:
public String getPercentageString() { float floatPercentage = getPercentageFloat(); if (Float.compare(floatPercentage, 99.995f) >= 0) { return roundDownDataFormat.format(floatPercentage); } else { return dataFormat.format(floatPercentage); } }
Source:
<code>public void onBlockCompletion(ExportRow row) throws RestartBlockException { if (m_ctx.invokes > 0) { try { <START> m_ctx.m_done.tryAcquire(m_ctx.invokes, ACQUIRE_TIMEOUT_MS,TimeUnit.MILLISECONDS); <END> } catch (InterruptedException e) { throw new LoopbackExportException("failed to wait for block callback", e); } } m_restarted = !m_ctx.m_rq.isEmpty(); if (m_restarted) { m_failed = new BitSet(m_ctx.recs); m_resubmit = new BitSet(m_ctx.recs); Reject rj = m_ctx.m_rq.poll(); while (rj != null) { m_failed.set(rj.bix); if (rj.status == ClientResponse.RESPONSE_UNKNOWN) { m_resubmit.set(rj.bix); } rj = m_ctx.m_rq.poll(); } throw new RestartBlockException(true); } else { m_failed = new BitSet(m_ctx.recs); m_resubmit = new BitSet(m_ctx.recs); } }</code><technical_language>This handle timeout occurs want handle acquiring semaphore differently timing out waiting for semaphore</technical_language>

Target:
public void onBlockCompletion(ExportRow row) throws RestartBlockException { synchronized (this) { if (m_ctx.m_outstandingTransactions.get() > 0 && !m_isShutDown) { try { wait(); } catch (InterruptedException e) { throw new LoopbackExportException("failed to wait for block callback", e); } } } if (m_isShutDown) { return; } m_restarted = !m_ctx.m_rq.isEmpty(); if (m_restarted) { m_failed = new BitSet(m_ctx.recs); m_resubmit = new BitSet(m_ctx.recs); Reject rj = m_ctx.m_rq.poll(); while (rj != null) { m_failed.set(rj.bix); if (rj.status == ClientResponse.RESPONSE_UNKNOWN) { m_resubmit.set(rj.bix); } rj = m_ctx.m_rq.poll(); } throw new RestartBlockException(true); } else { m_failed = new BitSet(m_ctx.recs); m_resubmit = new BitSet(m_ctx.recs); } }
Source:
<code>public void setPortParameters(int baudRate, int dataBits, int stopBits, <START> int parity, int flowControl) throws OperationNotSupportedException { <END> parameters = new SerialPortParameters(baudRate, dataBits, stopBits, parity, flowControl); if (serialPort != null) { try { serialPort.setSerialPortParams(baudRate, dataBits, stopBits, parity); serialPort.setFlowControlMode(flowControl); } catch (UnsupportedCommOperationException e) { throw new OperationNotSupportedException(e.getMessage()); } } }</code><technical_language>before, this is InvalidConfigurationException UnsupportedCommOperationException is thrown configuration of port is invalid (serialPort.setSerialPortParams(baudRate, dataBits, stopBits, parity);). need add this exception method header</technical_language>

Target:
public void setPortParameters(int baudRate, int dataBits, int stopBits, int parity, int flowControl) throws InvalidConfigurationException { parameters = new SerialPortParameters(baudRate, dataBits, stopBits, parity, flowControl); if (serialPort != null) { try { serialPort.setSerialPortParams(baudRate, dataBits, stopBits, parity); serialPort.setFlowControlMode(flowControl); } catch (UnsupportedCommOperationException e) { throw new InvalidConfigurationException(e.getMessage(), e); } } }
Source:
<code>public Principal validate(String sessionId) { Principal principal = null; VdcQueryParametersBase params = new VdcQueryParametersBase(); params.setSessionId(sessionId); VdcQueryReturnValue queryReturnValue = backend.RunPublicQuery(VdcQueryType.ValidateSession, params); if (queryReturnValue != null) { VdcUser vdcUser = (VdcUser) queryReturnValue.getReturnValue(); if (vdcUser != null) { <START> principal = new Principal(vdcUser.getUserName(), null, vdcUser.getDomainControler()); <END> sessionHelper.setSessionId(sessionId); current.set(vdcUser); } } if (principal != null) { validateSessionSucceeded(queryReturnValue); } else { validateSessionFailed(queryReturnValue); } return principal; }</code><technical_language>secrete is LoginValidator#validate, set null? if changes address behaviour, please mention it/them in patch dependant change. thanks</technical_language>

Target:
public Principal validate(String sessionId) { Principal principal = null; VdcQueryParametersBase params = new VdcQueryParametersBase(); params.setSessionId(sessionId); VdcQueryReturnValue queryReturnValue = backend.RunPublicQuery(VdcQueryType.ValidateSession, params); if (queryReturnValue != null) { VdcUser vdcUser = queryReturnValue.getReturnValue(); if (vdcUser != null) { principal = new Principal(vdcUser.getUserName(), null, vdcUser.getDomainControler()); sessionHelper.setSessionId(sessionId); current.set(vdcUser); } } if (principal != null) { validateSessionSucceeded(queryReturnValue); } else { validateSessionFailed(queryReturnValue); } return principal; }
Source:
<code>public void removeRelationMembers(PerunSession sess, Group resultGroup, List<Member> changedMembers, int sourceGroupId) throws WrongReferenceAttributeValueException, NotGroupMemberException, WrongAttributeValueException, AlreadyMemberException, InternalErrorException, GroupNotExistsException { List<Member> members; try{ members = removeIndirectMembers(sess, resultGroup, changedMembers, sourceGroupId); if(members.isEmpty()){ return; } List<Integer> relations = groupsManagerImpl.getResultGroupsIds(sess, resultGroup.getId()); for (Integer groupId : relations) { removeRelationMembers(sess, groupsManagerImpl.getGroupById(sess, groupId), members, resultGroup.getId()); } } catch (WrongReferenceAttributeValueException | NotGroupMemberException | WrongAttributeValueException | AlreadyMemberException | GroupNotExistsException | InternalErrorException ex) { <START> log.info("Can't remove member. Cause: {}", ex); <END> } }</code><technical_language>remove this catch exception thrown this method. this moment skipping exceptions all</technical_language>

Target:
public void removeRelationMembers(PerunSession sess, Group resultGroup, List<Member> changedMembers, int sourceGroupId) throws WrongReferenceAttributeValueException, NotGroupMemberException, WrongAttributeValueException, InternalErrorException, GroupNotExistsException { List<Member> members; members = removeIndirectMembers(sess, resultGroup, changedMembers, sourceGroupId); if(members.isEmpty()){ return; } List<Integer> relations = groupsManagerImpl.getResultGroupsIds(sess, resultGroup.getId()); for (Integer groupId : relations) { removeRelationMembers(sess, groupsManagerImpl.getGroupById(sess, groupId), members, resultGroup.getId()); } }
Source:
<code>public synchronized void register(KalturaMediaServerIndex serverIndex, String appName) { logger.debug("Register [" + liveEntry.id + "]"); <START> if(entryRegistered) <END> return; index = serverIndex; TimerTask setMediaServerTaskBroadcasting = new TimerTask() { @Override public void run() { logger.info("Initial timer task running [" + liveEntry.id + "] - BROADCASTING"); setEntryMediaServer(liveEntry, index, KalturaLiveEntryStatus.BROADCASTING); } }; timer = new Timer("register-" + liveEntry.id, true); timer.schedule(setMediaServerTaskBroadcasting, 0); logger.debug("Scheduled initial timer [" + liveEntry.id + "]"); entryRegistered = true; }</code><technical_language>!isRegistered()</technical_language>

Target:
public synchronized void register(KalturaMediaServerIndex serverIndex, String appName) { logger.debug("Register [" + liveEntry.id + "]"); if(isEntryRegistered()) return; index = serverIndex; TimerTask setMediaServerTaskBroadcasting = new TimerTask() { @Override public void run() { logger.info("Initial timer task running [" + liveEntry.id + "] - BROADCASTING"); setEntryMediaServer(liveEntry, index, KalturaLiveEntryStatus.BROADCASTING); } }; timer = new Timer("register-" + liveEntry.id, true); timer.schedule(setMediaServerTaskBroadcasting, 0); logger.debug("Scheduled initial timer [" + liveEntry.id + "]"); entryRegistered = true; }
Source:
<code>public long getBytesRequiredForTemplate(TemplateInfo templateInfo, StoragePool storagePool) { <START> return 0; <END> }</code><technical_language>Minor Nit: 0 is integer value. 0L is a long value. Java automatically widens value, is more hygienic match type for a constant value</technical_language>

Target:
public long getBytesRequiredForTemplate(TemplateInfo templateInfo, StoragePool storagePool) { return 0L; }
Source:
<code>public void testPrimaryOwnerChangingDuringReplace() throws Exception { <START> doTest(TestWriteOperation.REPLACE_EXACT); <END> }</code><technical_language>this _EXACT</technical_language>

Target:
public void testPrimaryOwnerChangingDuringReplace() throws Exception { doTest(TestWriteOperation.REPLACE); }
Source:
<code><START> protected long obtainEntityId() { <END> return nextEntityId++; }</code><technical_language>This private right</technical_language>

Target:
private long obtainEntityId() { return nextEntityId++; }
Source:
<code>public KTable<Windowed<K>, V> aggregate(final Initializer<V> initializer, final Merger<? super K, V> sessionMerger) { <START> return aggregate(initializer, sessionMerger, Materialized.with(keySerde, null)); <END> }</code><technical_language>keySerde is set null in constructor, hence, I wondering if pass in null, here, too? (similar question for TimeWindowedCogroupedKStreamImpl)</technical_language>

Target:
public KTable<Windowed<K>, V> aggregate(final Initializer<V> initializer, final Merger<? super K, V> sessionMerger) { return aggregate(initializer, sessionMerger, Materialized.with(null, null)); }
Source:
<code>public int compareTo(CTFCallsite o) { <START> final long mask32 = 0x00000000ffffffffL; <END> long other = o.ip; long otherHigh = (other >> 32) & mask32; long otherLow = other & mask32; long ownHigh = (ip >> 32) & mask32; long ownLow = ip & mask32; if (ownHigh > otherHigh) { return 1; } if (ownHigh < otherHigh ) { return -1; } if (ownLow > otherLow) { return 1; } if (ownLow < otherLow) { return -1; } return 0; }</code><technical_language>This a private static final class member</technical_language>

Target:
public int compareTo(CTFCallsite o) { long other = o.ip; long otherHigh = (other >> 32) & MASK32; long otherLow = other & MASK32; long ownHigh = (ip >> 32) & MASK32; long ownLow = ip & MASK32; if (ownHigh > otherHigh) { return 1; } if (ownHigh < otherHigh ) { return -1; } if (ownLow > otherLow) { return 1; } if (ownLow < otherLow) { return -1; } return 0; }
Source:
<code>public void onCartographyTable(InventoryClickEvent e) { <START> if (e.getRawSlot() == 2 && e.getInventory().getType() == InventoryType.CARTOGRAPHY && e.getWhoClicked() instanceof Player) { <END> ItemStack item1 = e.getInventory().getContents()[0]; ItemStack item2 = e.getInventory().getContents()[1]; if (checkForUnallowedItems(item1, item2)) { e.setResult(Result.DENY); SlimefunPlugin.getLocalization().sendMessage((Player) e.getWhoClicked(), "cartography_table.not-working", true); } } }</code><technical_language>I this is a bit long of if statement</technical_language>

Target:
public void onCartographyTable(InventoryClickEvent e) { if (!SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { return; } if (e.getRawSlot() == 2 && e.getInventory().getType() == InventoryType.CARTOGRAPHY && e.getWhoClicked() instanceof Player) { ItemStack item1 = e.getInventory().getContents()[0]; ItemStack item2 = e.getInventory().getContents()[1]; if (checkForUnallowedItems(item1, item2)) { e.setResult(Result.DENY); SlimefunPlugin.getLocalization().sendMessage((Player) e.getWhoClicked(), "cartography_table.not-working", true); } } }
Source:
<code><START> private synchronized Compute createComputeService() <END> throws IOException, GeneralSecurityException, InterruptedException, GceServiceException { final int maxRetries = 5; int retries = 0; while (cachedComputeService == null && retries < maxRetries) { if (retries > 0) { Thread.sleep(POLL_INTERVAL_MS); } log.info("Creating new ComputeService [%d/%d]", retries + 1, maxRetries); try { HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); GoogleCredential credential = GoogleCredential.getApplicationDefault( httpTransport, jsonFactory ); if (credential.createScopedRequired()) { List<String> scopes = new ArrayList<>(); scopes.add(ComputeScopes.CLOUD_PLATFORM); scopes.add(ComputeScopes.COMPUTE); credential = credential.createScoped(scopes); } if (credential.getClientAuthentication() != null) { throw new GceServiceException("Not using a service account"); } cachedComputeService = new Compute.Builder(httpTransport, jsonFactory, credential) .setApplicationName("DruidAutoscaler") .build(); retries++; } catch (Throwable e) { log.error(e, "Got Exception in creating the ComputeService"); throw e; } } return cachedComputeService; }</code><technical_language>Is cover this method of unit tests</technical_language>

Target:
private synchronized Compute createComputeService() throws IOException, GeneralSecurityException, InterruptedException, GceServiceException { final int maxRetries = 5; int retries = 0; while (cachedComputeService == null && retries < maxRetries) { if (retries > 0) { Thread.sleep(POLL_INTERVAL_MS); } log.info("Creating new ComputeService [%d/%d]", retries + 1, maxRetries); try { cachedComputeService = createComputeServiceImpl(); retries++; } catch (Throwable e) { log.error(e, "Got Exception in creating the ComputeService"); throw e; } } return cachedComputeService; }
Source:
<code>public void goToGroupActivity(){ <START> Log.i("Debug", "Kapoue"); <END> Intent intent = new Intent(this, GroupActivity.class); startActivity(intent); }</code><technical_language>Unnecessary log</technical_language>

Target:
public void goToGroupActivity(){ Intent intent = new Intent(this, GroupActivity.class); startActivity(intent); }
Source:
<code>public void handleSecondsSpentInputChange( ChangeEvent event ) { try { Long value = secondsSpentInput.getValue().isEmpty() ? null : Long.parseLong( secondsSpentInput.getValue() ); presenter.onSecondsSpentChange( value ); } catch ( NumberFormatException e ) { <START> <END> } }</code><technical_language>Likewise.</technical_language>

Target:
public void handleSecondsSpentInputChange( ChangeEvent event ) { boolean isNumeric = secondsSpentInput.getValue().matches( "\\d+" ); if (isNumeric) { presenter.onSecondsSpentChange( Long.parseLong( secondsSpentInput.getValue() ) ); } else { presenter.onSecondsSpentChange( 0l ); secondsSpentInput.setValue( "0" ); } }