auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ServerHttpRequest apply(ServerHttpRequest request) { if (hasForwardedHeaders(request)) { ServerHttpRequest.Builder builder = request.mutate(); if (!this.removeOnly) { URI uri = UriComponentsBuilder.fromHttpRequest(request).build(true).toUri(); builder.uri(uri); String prefix = getForwardedPrefix(request); if (prefix != null) { builder.path(prefix + uri.getRawPath()); builder.contextPath(prefix); } Optional<InetSocketAddress> remoteAddressO = Optional.ofNullable(request.getRemoteAddress()); String originalRemoteHost = remoteAddressO.map(InetSocketAddress::getHostName).orElse(null); UriComponents remoteUriComponents = UriComponentsBuilder.newInstance() .host(originalRemoteHost) .port(remoteAddressO.map(InetSocketAddress::getPort).orElse(-1)) .adaptFromForwardedForHeader(request.getHeaders()) .build(); <START> String remoteHost = remoteUriComponents.getHost(); <END> int remotePort = (remoteUriComponents.getPort() != -1 ? remoteUriComponents.getPort() : 0); if (remoteHost != null && !remoteHost.equals(originalRemoteHost)) { builder.remoteAddress(InetSocketAddress.createUnresolved(remoteHost, remotePort)); } else { remoteAddressO.ifPresent(builder::remoteAddress); } } removeForwardedHeaders(builder); request = builder.build(); } return request; }</code><technical_language>for ForwardedHeaderFilter, is worth applying a check if this needs done</technical_language>

Target:
public ServerHttpRequest apply(ServerHttpRequest request) { if (hasForwardedHeaders(request)) { ServerHttpRequest.Builder builder = request.mutate(); if (!this.removeOnly) { URI uri = UriComponentsBuilder.fromHttpRequest(request).build(true).toUri(); builder.uri(uri); String prefix = getForwardedPrefix(request); if (prefix != null) { builder.path(prefix + uri.getRawPath()); builder.contextPath(prefix); } InetSocketAddress remoteAddress = request.getRemoteAddress(); HttpHeaders headers = request.getHeaders(); boolean hasForwardedFor = StringUtils.hasText(headers.getFirst(X_FORWARDED_FOR_HEADER)) || (StringUtils.hasText(headers.getFirst(FORWARDED_HEADER)) && FORWARDED_FOR_PATTERN.matcher(headers.getFirst(FORWARDED_HEADER)).matches()); if (hasForwardedFor) { String originalRemoteHost = ((remoteAddress != null) ? remoteAddress.getHostName() : null); int originalRemotePort = ((remoteAddress != null) ? remoteAddress.getPort() : -1); UriComponents remoteUriComponents = UriComponentsBuilder.newInstance() .host(originalRemoteHost) .port(originalRemotePort) .adaptFromForwardedForHeader(headers) .build(); String remoteHost = remoteUriComponents.getHost(); int remotePort = (remoteUriComponents.getPort() != -1 ? remoteUriComponents.getPort() : 0); if (remoteHost != null) { builder.remoteAddress(InetSocketAddress.createUnresolved(remoteHost, remotePort)); } } else { builder.remoteAddress(remoteAddress); } } removeForwardedHeaders(builder); request = builder.build(); } return request; }
Source:
<code>public CruiseConfig loadForEditing() { <START> return currentConfigForEdit; <END> }</code><technical_language>I guess a time this is null. But, do check for null (like in currentConfig below). here? I loadConfigIfNull called ApplicationInitializer, if so, check in currentConfig</technical_language>

Target:
public CruiseConfig loadForEditing() { loadConfigIfNull(); return currentConfigForEdit; }
Source:
<code>private void importLdif(InMemoryDirectoryServer directoryServer) { checkFilePath(this.ldif); try { Resource[] resources = this.context.getResources(this.ldif); <START> if (resources.length > 0 && resources[0].exists() && resources[0].isFile() && resources[0].isReadable()) { <END> try (InputStream inputStream = resources[0].getInputStream()) { directoryServer.importFromLDIF(false, new LDIFReader(inputStream)); } } } catch (Exception ex) { throw new IllegalStateException("Unable to load LDIF " + this.ldif, ex); } }</code><technical_language>changes, is exception thrown file exist. need check if LDIF exists throw exception if not. add check for isFile() isReadable() verify exists. suggestion if (resources.length > 0) { if (!resources[0].exists()) { throw new IllegalArgumentException("Could find LDIF " + this.ldif); }</technical_language>

Target:
private void importLdif(InMemoryDirectoryServer directoryServer) { if (StringUtils.hasText(this.ldif)) { try { Resource resource = locateResource(); try (InputStream inputStream = resource.getInputStream()) { directoryServer.importFromLDIF(false, new LDIFReader(inputStream)); } } catch (Exception ex) { throw new IllegalStateException("Unable to load LDIF " + this.ldif, ex); } } }
Source:
<code>public int getSelectedQuestionNumber(int qnNumber) { if (isQuestionEnabled(qnNumber)) { Select qnNumSelect = new Select(getSelectQuestionNumberDropdown(qnNumber)); return Integer.parseInt(qnNumSelect.getFirstSelectedOption().getText().trim()); } <START> return Integer.parseInt(getSelectQuestionNumberStatic(qnNumber).getText().substring(0, 1)); <END> }</code><technical_language>This right. if >9 questions</technical_language>

Target:
public int getSelectedQuestionNumber(int qnNumber) { if (isQuestionEnabled(qnNumber)) { Select qnNumSelect = new Select(getSelectQuestionNumberDropdown(qnNumber)); return Integer.parseInt(qnNumSelect.getFirstSelectedOption().getText().trim()); } String questionNumber = getSelectQuestionNumberStatic(qnNumber).getText(); return Integer.parseInt(questionNumber.substring(0, questionNumber.length() - 1)); }
Source:
<code>private void updateSelectionText(IStructuredSelection sel, boolean uncheck) <START> { <END> Object[] obj = fCbtv.getCheckedElements(); obj.getClass(); if (fCbtv.getCheckedElements().length == 0) { t.setText(Messages.NoSelectionDescription); } else if (fCbtv.getCheckedElements().length != 1 && fCbtv.getCheckedElements().length != 0) { t.setText(Messages.TraceControl_MultipleSelectionDescription); } else { TreeParent checkedElement; boolean commentFound = false; if (uncheck) { checkedElement = (TreeParent) obj[0]; } else { checkedElement = (TreeParent) sel.getFirstElement(); } TreeParent currentParent = checkedElement.getParent(); String parentPath = currentParent.getName(); if (fCbtv.getChecked(checkedElement)) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder builder = factory.newDocumentBuilder(); factory.setIgnoringComments(false); String fullPath = parentPath + checkedElement.getName(); Document document = builder.parse(new File(fullPath)); document.getDocumentElement().normalize(); NodeList nl = document.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { if (nl.item(i).getNodeType() == Node.COMMENT_NODE) { commentFound = true; Comment comment = (Comment) nl.item(i); t.setText(comment.getData()); } } if (!commentFound) { t.setText(Messages.TraceControl_SingleSelectionDescription); } } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } }</code><technical_language>format: { line method declaration</technical_language>

Target:
private void updateSelectionText(IStructuredSelection sel, boolean uncheck) { Object[] obj = fCbtv.getCheckedElements(); obj.getClass(); if (fCbtv.getCheckedElements().length == 0) { descriptionText.setText(Messages.NoSelectionDescription); } else if (fCbtv.getCheckedElements().length != 1 && fCbtv.getCheckedElements().length != 0) { descriptionText.setText(Messages.TraceControl_MultipleSelectionDescription); } else { TreeParent checkedElement; boolean commentFound = false; if (uncheck) { checkedElement = (TreeParent) obj[0]; } else { checkedElement = (TreeParent) sel.getFirstElement(); } TreeParent currentParent = checkedElement.getParent(); String parentPath = currentParent.getName(); if (fCbtv.getChecked(checkedElement)) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder builder = factory.newDocumentBuilder(); factory.setIgnoringComments(false); String fullPath = parentPath + checkedElement.getName(); Document document = builder.parse(new File(fullPath)); document.getDocumentElement().normalize(); NodeList nl = document.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { if (nl.item(i).getNodeType() == Node.COMMENT_NODE) { commentFound = true; Comment comment = (Comment) nl.item(i); descriptionText.setText(comment.getData()); } } if (!commentFound) { descriptionText.setText(Messages.TraceControl_SingleSelectionDescription); } } catch (ParserConfigurationException e) { } catch (SAXException e) { } catch (IOException e) { } } } }
Source:
<code>ValueExpression(Object value) { <START> this.value = value; <END> }</code><technical_language>need validate type of Object here. Currently support String, Number, int, long, float, double, boolean, Date, null</technical_language>

Target:
ValueExpression(Object value) { if (!isSupportedType(value)) throw new IllegalArgumentException("The given value's type is not supported."); this.value = value; }
Source:
<code>public void pushSaveEvent(User user, Contentlet contentlet, boolean isNew){ SystemEventType systemEventType = getSystemEventType(contentlet, isNew); if (systemEventType != null) { Payload payload = new Payload(contentlet, Visibility.PERMISSION, String.valueOf(PermissionAPI.PERMISSION_READ), user.getUserId()); try { systemEventsAPI.push(new SystemEvent(systemEventType, payload)); } catch (DotDataException e) { <START> throw new BaseRuntimeInternationalizationException(e); <END> } } }</code><technical_language>a specific exception CanNotPushSystemEventException that</technical_language>

Target:
public void pushSaveEvent(User user, Contentlet contentlet, boolean isNew){ SystemEventType systemEventType = getSystemEventType(contentlet, isNew); if (systemEventType != null) { Payload payload = new Payload(contentlet, Visibility.PERMISSION, String.valueOf(PermissionAPI.PERMISSION_READ)); try { systemEventsAPI.push(new SystemEvent(systemEventType, payload)); } catch (DotDataException e) { throw new CanNotPushSystemEventException(e); } } }
Source:
<code>private static String getTempRepo(){ String tempDir = System.getProperty("java.io.tmpdir"); StringBuffer sb = new StringBuffer(); <START> sb.append(tempDir).append(tempDir.endsWith("/") ? "" : "/").append("maven/repository/"); <END> return sb.toString(); }</code><technical_language>separator constant here</technical_language>

Target:
private static String getTempRepo(){ String tempDir = System.getProperty("java.io.tmpdir"); StringBuffer sb = new StringBuffer(); sb.append(tempDir).append(tempDir.endsWith(CommonConstants.SEPARATOR) ? "" : CommonConstants.SEPARATOR).append("maven/repository/"); return sb.toString(); }
Source:
<code>private boolean noContentInTooltip() { String title = getTitle(); <START> return (title == null && options.getWidget() == null && options.getWidgetContentProvider() == null) <END> || (title != null && title.length() == 0); }</code><technical_language>happen if options.getWidgetContentProvider() returns null ? return true for this case</technical_language>

Target:
private boolean noContentInTooltip() { String title = getTitle(); return (title == null && widget == null) || (title != null && title.length() == 0); }
Source:
<code>public List<QueryError> update(Iterable<MonitorQuery> queries) throws IOException { if (commitTimeout == 0) { return monitor.update(queries); } else { List<QueryError> errors = new ArrayList<>(); for (MonitorQuery query : queries) { try { <START> for (QueryCacheEntry queryCacheEntry : monitor.decomposeQuery(query)) { <END> pendingDeletes.remove(query.getId()); Indexable update = new Indexable(query.getId(), queryCacheEntry, monitor.buildIndexableQuery(query.getId(), query, queryCacheEntry)); pendingUpdates.put(update.id, update); } } catch (Exception e) { errors.add(new QueryError(query.getId(), query.getQuery(), e.getMessage())); } } scheduleCommit(); return errors; } }</code><technical_language>Do need run decomposition here? call Monitor.update()</technical_language>

Target:
public void update(Iterable<MonitorQuery> queries) throws IOException, UpdateException { if (commitTimeout == 0) { monitor.update(queries); } else { List<QueryError> errors = new ArrayList<>(); for (MonitorQuery query : queries) { try { for (QueryCacheEntry queryCacheEntry : monitor.decomposeQuery(query)) { pendingDeletes.remove(query.getId()); Indexable update = new Indexable(query.getId(), queryCacheEntry, monitor.buildIndexableQuery(query.getId(), query, queryCacheEntry)); pendingUpdates.put(update.id, update); } } catch (Exception e) { errors.add(new QueryError(query, e)); } } scheduleCommit(); if (errors.isEmpty() == false) throw new UpdateException(errors); } }
Source:
<code>private List<Condition> convertCoreConditionsToEmrapiConditions(List<org.openmrs.Condition> coreConditions) { List<Condition> conditions = new ArrayList<Condition>(); for (org.openmrs.Condition coreCondition : coreConditions) { Condition condition = new Condition(); Concept concept = Context.getConceptService().getConceptByUuid(coreCondition.getCondition().getCoded().getUuid()); condition.setId(coreCondition.getId()); condition.setUuid(coreCondition.getUuid()); condition.setAdditionalDetail(coreCondition.getAdditionalDetail()); condition.setConcept(concept); condition.setPatient(coreCondition.getPatient()); <START> if(coreCondition.getCondition().getNonCoded() != null) <END> condition.setConditionNonCoded(coreCondition.getCondition().getNonCoded()); if(coreCondition.getOnsetDate() != null) condition.setOnsetDate(coreCondition.getOnsetDate()); condition.setVoided(coreCondition.getVoided()); condition.setVoidReason(coreCondition.getVoidReason()); condition.setEndDate(coreCondition.getEndDate()); condition.setCreator(coreCondition.getCreator()); condition.setDateCreated(coreCondition.getDateCreated()); condition.setStatus(convertClinicalStatus(coreCondition.getClinicalStatus())); if (coreCondition.getPreviousVersion() != null) { condition.setPreviousCondition(convertCoreConditionToEmrapiCondition(coreCondition.getPreviousVersion())); } conditions.add(condition); } return conditions; }</code><technical_language>a this? <LINK_0></technical_language>

Target:
private List<Condition> convertCoreConditionsToEmrapiConditions(List<org.openmrs.Condition> coreConditions) { List<Condition> conditions = new ArrayList<Condition>(); for (org.openmrs.Condition coreCondition : coreConditions) { Condition condition = new Condition(); Concept concept; if (coreCondition.getCondition().getCoded() != null) { concept = Context.getConceptService() .getConceptByUuid(coreCondition.getCondition().getCoded().getUuid()); } else { concept = new Concept(); concept.setFullySpecifiedName(new ConceptName(coreCondition.getCondition().getNonCoded(), Context.getLocale())); } condition.setId(coreCondition.getId()); condition.setUuid(coreCondition.getUuid()); condition.setAdditionalDetail(coreCondition.getAdditionalDetail()); condition.setConcept(concept); condition.setPatient(coreCondition.getPatient()); if (coreCondition.getCondition().getNonCoded() != null) { condition.setConditionNonCoded(coreCondition.getCondition().getNonCoded()); } if (coreCondition.getOnsetDate() != null) { condition.setOnsetDate(coreCondition.getOnsetDate()); } condition.setVoided(coreCondition.getVoided()); condition.setVoidReason(coreCondition.getVoidReason()); condition.setEndDate(coreCondition.getEndDate()); condition.setCreator(coreCondition.getCreator()); condition.setDateCreated(coreCondition.getDateCreated()); condition.setStatus(convertClinicalStatus(coreCondition.getClinicalStatus())); if (coreCondition.getPreviousVersion() != null) { condition.setPreviousCondition(convertCoreConditionToEmrapiCondition(coreCondition.getPreviousVersion())); } conditions.add(condition); } return conditions; }
Source:
<code>public void testFailureOnServerErrors() throws Exception { doPut(); <START> List<ServerErrorCode> serverErrors = new ArrayList<>(Arrays.asList(ServerErrorCode.values())); <END> serverErrors.remove(ServerErrorCode.Blob_Deleted); serverErrors.remove(ServerErrorCode.Blob_Expired); serverErrors.remove(ServerErrorCode.No_Error); serverErrors.remove(ServerErrorCode.Blob_Authorization_Failure); serverErrors.remove(ServerErrorCode.Blob_Not_Found); for (ServerErrorCode serverErrorCode : serverErrors) { mockServerLayout.getMockServers().forEach(server -> server.setServerErrorForAllRequests(serverErrorCode)); GetBlobOperation op = createOperationAndComplete(null); assertFailureAndCheckErrorCode(op, serverErrorCode == ServerErrorCode.Disk_Unavailable ? RouterErrorCode.AmbryUnavailable : RouterErrorCode.UnexpectedInternalError); } }</code><technical_language>EnumSet too, order is important</technical_language>

Target:
public void testFailureOnServerErrors() throws Exception { doPut(); EnumSet<ServerErrorCode> serverErrors = EnumSet.complementOf( EnumSet.of(ServerErrorCode.Blob_Deleted, ServerErrorCode.Blob_Expired, ServerErrorCode.No_Error, ServerErrorCode.Blob_Authorization_Failure, ServerErrorCode.Blob_Not_Found)); for (ServerErrorCode serverErrorCode : serverErrors) { mockServerLayout.getMockServers().forEach(server -> server.setServerErrorForAllRequests(serverErrorCode)); GetBlobOperation op = createOperationAndComplete(null); assertFailureAndCheckErrorCode(op, serverErrorCode == ServerErrorCode.Disk_Unavailable ? RouterErrorCode.AmbryUnavailable : RouterErrorCode.UnexpectedInternalError); } }
Source:
<code>public void map(BatchSource<InputRow> source, BatchSink<Collection<Object[]>> sink) { List<InputColumn<?>> cols = getUsedInputColumns(); int size = source.size(); Object[] rows = new Object[size]; for(int i = 0; i < size; i++) { InputRow inputRow = source.getInput(i); Object[] values = new Object[cols.size()]; int j = 0; for(InputColumn<?> col: cols) { values[j] = inputRow.getValue(col); j++; } rows[i] = values; } ProcessStatelessInput input = new ProcessStatelessInput(); input.configuration = getConfiguration(cols); input.data = mapper.valueToTree(rows); logger.debug("Processing remotely rows", size); if (client == null) { if (lastException != null) { throw lastException; <START> } <END> throw new RuntimeException("Remote transformer's connection has already been closed. "); } ProcessStatelessOutput out; try { out = client.processStateless(componentDisplayName, input); } catch (RuntimeException e) { lastException = e; throw e; } convertOutputRows(out.rows, sink, size); }</code><technical_language>.. I if (failed.get()) { throw new PreviousErrorsExistException(); }</technical_language>

Target:
public void map(BatchSource<InputRow> source, BatchSink<Collection<Object[]>> sink) { List<InputColumn<?>> cols = getUsedInputColumns(); int size = source.size(); Object[] rows = new Object[size]; for(int i = 0; i < size; i++) { InputRow inputRow = source.getInput(i); Object[] values = new Object[cols.size()]; int j = 0; for(InputColumn<?> col: cols) { values[j] = inputRow.getValue(col); j++; } rows[i] = values; } ProcessStatelessInput input = new ProcessStatelessInput(); input.configuration = getConfiguration(cols); input.data = mapper.valueToTree(rows); logger.debug("Processing remotely rows", size); if (client == null) { if (failed.get()) { throw new PreviousErrorsExistException(); } throw new RuntimeException("Remote transformer's connection has already been closed. "); } ProcessStatelessOutput out; try { out = client.processStateless(componentDisplayName, input); } catch (RuntimeException e) { boolean alreadyFailed = failed.getAndSet(true); if (!alreadyFailed) { throw e; } else { throw new PreviousErrorsExistException(); } } convertOutputRows(out.rows, sink, size); }
Source:
<code>public Owner updateOwner(@PathParam("owner_key") @Verify(Owner.class) String key, Owner owner) { Owner toUpdate = findOwner(key); EventBuilder eventBuilder = eventFactory.getEventBuilder(Target.OWNER, Type.MODIFIED) .setOldEntity(toUpdate); log.debug("Updating owner: " + key); if (owner.getDisplayName() != null) { toUpdate.setDisplayName(owner.getDisplayName()); } if (owner.getParentOwner() != null) { toUpdate.setParentOwner(owner.getParentOwner()); } if (owner.getDefaultServiceLevel() != null) { if (owner.getDefaultServiceLevel().equals("")) { toUpdate.setDefaultServiceLevel(null); } else { serviceLevelValidator.validate(toUpdate, owner.getDefaultServiceLevel()); toUpdate.setDefaultServiceLevel(owner.getDefaultServiceLevel()); } } if (owner.getContentAccessMode() != null) { <START> StringTokenizer st = new StringTokenizer(toUpdate.getContentAccessModeList(), ","); <END> boolean allowed = false; while (st.hasMoreElements()) { if (st.nextElement().equals(owner.getContentAccessMode()) || "".equals(owner.getContentAccessMode())) { allowed = true; break; } } if (allowed) { String before = toUpdate.getContentAccessMode(); String after = owner.getContentAccessMode(); toUpdate.setContentAccessMode(owner.getContentAccessMode()); } else { throw new BadRequestException( i18n.tr("The content access mode is not allowed for this owner.")); } } ownerCurator.merge(toUpdate); Event e = eventBuilder.setNewEntity(toUpdate).buildEvent(); sink.queueEvent(e); return toUpdate; }</code><technical_language>This NPE updating owner access mode list</technical_language>

Target:
public Owner updateOwner(@PathParam("owner_key") @Verify(Owner.class) String key, Owner owner) { Owner toUpdate = findOwner(key); EventBuilder eventBuilder = eventFactory.getEventBuilder(Target.OWNER, Type.MODIFIED) .setOldEntity(toUpdate); log.debug("Updating owner: " + key); if (owner.getDisplayName() != null) { toUpdate.setDisplayName(owner.getDisplayName()); } if (owner.getParentOwner() != null) { toUpdate.setParentOwner(owner.getParentOwner()); } if (owner.getDefaultServiceLevel() != null) { if (owner.getDefaultServiceLevel().equals("")) { toUpdate.setDefaultServiceLevel(null); } else { serviceLevelValidator.validate(toUpdate, owner.getDefaultServiceLevel()); toUpdate.setDefaultServiceLevel(owner.getDefaultServiceLevel()); } } if (owner.getContentAccessMode() != null) { if (toUpdate.isAllowedContentAccessMode(owner.contentAccessMode())) { toUpdate.setContentAccessMode(owner.getContentAccessMode()); } else { throw new BadRequestException( i18n.tr("The content access mode is not allowed for this owner.")); } } ownerCurator.merge(toUpdate); Event e = eventBuilder.setNewEntity(toUpdate).buildEvent(); sink.queueEvent(e); return toUpdate; }
Source:
<code>public StreamingRuntimeContext( AbstractStreamOperator<?> operator, Environment env, Map<String, Accumulator<?, ?>> accumulators) { this( env, accumulators, operator.getMetricGroup(), operator.getOperatorID(), operator.getProcessingTimeService(), operator.getKeyedStateStore(), <START> Collections.emptyMap()); <END> }</code><technical_language>derive external resources env, instead of passing in empty map here</technical_language>

Target:
public StreamingRuntimeContext( AbstractStreamOperator<?> operator, Environment env, Map<String, Accumulator<?, ?>> accumulators) { this( env, accumulators, operator.getMetricGroup(), operator.getOperatorID(), operator.getProcessingTimeService(), operator.getKeyedStateStore(), env.getExternalResourceInfoProvider()); }
Source:
<code>ColumnIndices updateSchemaCache(ColumnIndices[] globalCacheArray) { final long currentSchemaVersion = sharedRealm.getSchemaVersion(); final long cacheSchemaVersion = schema.getSchemaVersion(); if (currentSchemaVersion == cacheSchemaVersion) { return null; } ColumnIndices createdGlobalCache = null; final RealmProxyMediator mediator = getConfiguration().getSchemaMediator(); ColumnIndices cacheForCurrentVersion = RealmCache.findColumnIndices(globalCacheArray, currentSchemaVersion); if (cacheForCurrentVersion == null) { final Set<Class<? extends RealmModel>> modelClasses = mediator.getModelClasses(); final Map<Class<? extends RealmModel>, ColumnInfo> map; map = new HashMap<>(modelClasses.size()); try { for (Class<? extends RealmModel> clazz : modelClasses) { final ColumnInfo columnInfo = mediator.validateTable(clazz, sharedRealm, true); map.put(clazz, columnInfo); } } catch (RealmMigrationNeededException e) { <START> throw e; END> } cacheForCurrentVersion = createdGlobalCache = new ColumnIndices(currentSchemaVersion, map); } schema.updateColumnIndices(cacheForCurrentVersion, mediator); return createdGlobalCache; }</code><technical_language>this catch removed</technical_language>

Target:
ColumnIndices updateSchemaCache(ColumnIndices[] globalCacheArray) { final long currentSchemaVersion = sharedRealm.getSchemaVersion(); final long cacheSchemaVersion = schema.getSchemaVersion(); if (currentSchemaVersion == cacheSchemaVersion) { return null; } ColumnIndices createdGlobalCache = null; ColumnIndices cacheForCurrentVersion = RealmCache.findColumnIndices(globalCacheArray, currentSchemaVersion); if (cacheForCurrentVersion == null) { final RealmProxyMediator mediator = getConfiguration().getSchemaMediator(); final Set<Class<? extends RealmModel>> modelClasses = mediator.getModelClasses(); final Map<Class<? extends RealmModel>, ColumnInfo> map; map = new HashMap<>(modelClasses.size()); try { for (Class<? extends RealmModel> clazz : modelClasses) { final ColumnInfo columnInfo = mediator.validateTable(clazz, sharedRealm, true); map.put(clazz, columnInfo); } } catch (RealmMigrationNeededException e) { throw e; } cacheForCurrentVersion = createdGlobalCache = new ColumnIndices(currentSchemaVersion, map); } schema.updateColumnIndices(cacheForCurrentVersion); return createdGlobalCache; }
Source:
<code>public void afterJob(JobExecution jobExecution) { <START> if (!deleteFiles) { <END> return; } if (resources != null) { deleteResources(); } else { deleteFilePath(jobExecution); } }</code><technical_language>Do care if job completed successfully? assume want check status deleting..</technical_language>

Target:
public void afterJob(JobExecution jobExecution) { if (!deleteFiles) { return; } if (jobExecution.getStatus().equals(BatchStatus.STOPPED) || jobExecution.getStatus().isUnsuccessful()) { logger.warn("Job is stopped, or failed to complete successfully. File deletion will be skipped"); return; } if (resources != null) { deleteResources(); } else { deleteFilePath(jobExecution.getJobParameters().getString(ExpandedJobParametersConverter.ABSOLUTE_FILE_PATH)); } }
Source:
<code>private boolean waitForFinalization() { long startCount = FinalizerDaemon.INSTANCE.progressCounter.get(); sleepFor(MAX_FINALIZE_NANOS); <START> return !(getNeedToWork() && FinalizerDaemon.INSTANCE.progressCounter.get() == startCount && FinalizerDaemon.INSTANCE.finalizingObject != null); <END> }</code><technical_language>I this hard understand. more clear as: !getNeedToWork() || FinalizerDaemon.INSTANCE.progressCounter.get() != startCount || FinalizerDaemon.INSTANCE.finalizingObject == null</technical_language>

Target:
private FinalizerReference<?> waitForFinalization() { long startCount = FinalizerDaemon.INSTANCE.progressCounter.get(); sleepFor(MAX_FINALIZE_NANOS); if (getNeedToWork() && FinalizerDaemon.INSTANCE.progressCounter.get() == startCount) { return FinalizerDaemon.INSTANCE.finalizingObject; } else { return null; } }
Source:
<code>public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); byte[] valueBytes = StringUtils.toUtf8(value); return ByteBuffer.allocate(2 + dimensionBytes.length + valueBytes.length) .put(DimFilterCacheHelper.EXTRACTION_CACHE_ID) .put(dimensionBytes) <START> .put((byte) 0xF) <END> .put(valueBytes) .array(); }</code><technical_language>0xF is a valid control character. other cache keys 0xFF separator is guaranteed show in valid UTF-8 stream</technical_language>

Target:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); byte[] valueBytes = StringUtils.toUtf8(value); return ByteBuffer.allocate(2 + dimensionBytes.length + valueBytes.length) .put(DimFilterCacheHelper.EXTRACTION_CACHE_ID) .put(dimensionBytes) .put(DimFilterCacheHelper.STRING_SEPARATOR) .put(valueBytes) .array(); }
Source:
<code>private static BCFluid defineFluid(int[] data, int heat, String name) { final int density = data[0]; final int baseViscosity = data[1]; final int boilPoint = data[2]; final int baseQuanta = data[3]; final int texLight = data[4]; final int texDark = data[5]; final boolean sticky = data[6] == 1; String fullName = name + (heat == 0 ? "" : "_heat_" + heat); int tempAdjustedViscosity = baseViscosity * (4 - heat) / 4; int boilAdjustedDensity = density * (heat >= boilPoint ? -1 : 1); String fluidTexture = "buildcraftenergy:blocks/fluids/" + name + "_heat_" + heat; BCFluid def = new BCFluid(fullName, new ResourceLocation(fluidTexture + "_still"), new ResourceLocation(fluidTexture + "_flow")); def.setBlockName(name + "_heat_" + heat); def.setMapColour(getMapColor(texDark)); <START> def.setFlammable(BCEnergyConfig.enableOilBurn); <END> def.setHeat(heat); def.setUnlocalizedName(name); def.setTemperature(300 + 20 * heat); def.setViscosity(tempAdjustedViscosity); def.setDensity(boilAdjustedDensity); def.setGaseous(def.getDensity() < 0); def.setColour(texLight, texDark); def.setHeatable(true); FluidManager.register(def); BCFluidBlock block = (BCFluidBlock) def.getBlock(); block.setLightOpacity(3); block.setSticky(sticky); block.setQuantaPerBlock(baseQuanta + (baseQuanta > 6 ? heat : heat / 2)); allFluids.add(def); return def; }</code><technical_language>noticed current core *every* BC fluid burn, includes residue. Instead fix adding another element data array declare top of method, sticky? config in this method in data array</technical_language>

Target:
private static BCFluid defineFluid(int[] data, int heat, String name) { final int density = data[0]; final int baseViscosity = data[1]; final int boilPoint = data[2]; final int baseQuanta = data[3]; final int texLight = data[4]; final int texDark = data[5]; final boolean sticky = data[6] == 1; final boolean flammable = BCEnergyConfig.enableOilBurn ? data[7] == 1 : false; String fullName = name + (heat == 0 ? "" : "_heat_" + heat); int tempAdjustedViscosity = baseViscosity * (4 - heat) / 4; int boilAdjustedDensity = density * (heat >= boilPoint ? -1 : 1); String fluidTexture = "buildcraftenergy:blocks/fluids/" + name + "_heat_" + heat; BCFluid def = new BCFluid(fullName, new ResourceLocation(fluidTexture + "_still"), new ResourceLocation(fluidTexture + "_flow")); def.setBlockName(name + "_heat_" + heat); def.setMapColour(getMapColor(texDark)); def.setFlammable(flammable); def.setHeat(heat); def.setUnlocalizedName(name); def.setTemperature(300 + 20 * heat); def.setViscosity(tempAdjustedViscosity); def.setDensity(boilAdjustedDensity); def.setGaseous(def.getDensity() < 0); def.setColour(texLight, texDark); def.setHeatable(true); FluidManager.register(def); BCFluidBlock block = (BCFluidBlock) def.getBlock(); block.setLightOpacity(3); block.setSticky(sticky); block.setQuantaPerBlock(baseQuanta + (baseQuanta > 6 ? heat : heat / 2)); allFluids.add(def); return def; }
Source:
<code>private void doRun() { boolean strictInterval = Boolean.getBoolean("org.opennms.netmgt.collectd.strictInterval"); if (processUpdates() == ABORT_COLLECTION) { LOG.debug("run: Aborting because processUpdates returned ABORT_COLLECTION (probably marked for deletion) for {}", this); return; } if (m_lastScheduledCollectionTime == 0 || !strictInterval) m_lastScheduledCollectionTime = System.currentTimeMillis(); else m_lastScheduledCollectionTime += m_spec.getInterval(); if (!m_spec.scheduledOutage(m_agent)) { try { doCollection(m_lastScheduledCollectionTime); updateStatus(ServiceCollector.COLLECTION_SUCCEEDED, null); } catch (CollectionTimedOut e) { LOG.info(e.getMessage()); updateStatus(ServiceCollector.COLLECTION_FAILED, e); } catch (CollectionWarning e) { LOG.warn(e.getMessage(), e); updateStatus(ServiceCollector.COLLECTION_FAILED, e); } catch (CollectionUnknown e) { LOG.warn(e.getMessage(), e); } catch (CollectionException e) { LOG.error(e.getMessage(), e); updateStatus(ServiceCollector.COLLECTION_FAILED, e); } catch (Throwable e) { LOG.error(e.getMessage(), e); updateStatus(ServiceCollector.COLLECTION_FAILED, new CollectionException("Collection failed unexpectedly: " + e.getClass().getSimpleName() + ": " + e.getMessage(), e)); } } long diff = 0; if (strictInterval) diff = System.currentTimeMillis() - m_lastScheduledCollectionTime; <START> m_scheduler.schedule(m_spec.getInterval() - diff, getReadyRunnable()); <END> }</code><technical_language>if/when diff > m_spec.getInterval()</technical_language>

Target:
private void doRun() { boolean strictInterval = Boolean.getBoolean("org.opennms.netmgt.collectd.strictInterval"); if (processUpdates() == ABORT_COLLECTION) { LOG.debug("run: Aborting because processUpdates returned ABORT_COLLECTION (probably marked for deletion) for {}", this); return; } if (m_lastScheduledCollectionTime == 0 || !strictInterval) m_lastScheduledCollectionTime = System.currentTimeMillis(); else m_lastScheduledCollectionTime += m_spec.getInterval(); if (!m_spec.scheduledOutage(m_agent)) { try { doCollection(); updateStatus(ServiceCollector.COLLECTION_SUCCEEDED, null); } catch (CollectionTimedOut e) { LOG.info(e.getMessage()); updateStatus(ServiceCollector.COLLECTION_FAILED, e); } catch (CollectionWarning e) { LOG.warn(e.getMessage(), e); updateStatus(ServiceCollector.COLLECTION_FAILED, e); } catch (CollectionUnknown e) { LOG.warn(e.getMessage(), e); } catch (CollectionException e) { LOG.error(e.getMessage(), e); updateStatus(ServiceCollector.COLLECTION_FAILED, e); } catch (Throwable e) { LOG.error(e.getMessage(), e); updateStatus(ServiceCollector.COLLECTION_FAILED, new CollectionException("Collection failed unexpectedly: " + e.getClass().getSimpleName() + ": " + e.getMessage(), e)); } } long diff = 0; if (strictInterval) { diff = System.currentTimeMillis() - m_lastScheduledCollectionTime; diff = Math.min(diff, m_spec.getInterval()); } m_scheduler.schedule(m_spec.getInterval() - diff, getReadyRunnable()); }
Source:
<code>public File(final File file) throws IllegalArgumentException { Objects.requireNonNull(file); <START> if (file.getSize() <= 0) { <END> throw new IllegalArgumentException("File(): Error - size <= 0."); } datacenter = Datacenter.NULL; setName(file.getName()); transactionTime = 0; createAttribute(file.getSize()); this.setDatacenter(file.getDatacenter()); this.deleted = file.deleted; file.getAttribute().copyValue(this.attribute); this.attribute.setMasterCopy(false); }</code><technical_language>constructor call another avoid code duplication bugs. This constructor call one</technical_language>

Target:
public File(final File file) throws IllegalArgumentException { this(file.getName(),file.getSize()); Objects.requireNonNull(file); this.setDatacenter(file.getDatacenter()); this.deleted = file.deleted; file.getAttribute().copyValue(this.attribute); this.attribute.setMasterCopy(false); }
Source:
<code>private Optional<String> checkForExistingFile(byte[] uploadedFile) throws IOException { try (Stream<java.nio.file.Path> walk = Files.walk(Paths.get(runtimeOptions.getImportsBaseDir()), 1)) { return walk <START> .filter(p -> p.toFile().isFile()) .filter(p -> p.toString().toLowerCase().endsWith(DASHBOARD_EXTENSION)) .filter(p -> isContentEquals(uploadedFile, p)) <END> .map(p -> p.getFileName().toString().replace(DASHBOARD_EXTENSION, "")) .findFirst(); } catch (Exception e) { logger.info("Error checking for duplicated file contents."); logger.debug("Error checking for duplicated file contents.", e); return Optional.empty(); } }</code><technical_language>merge filter operations a single one</technical_language>

Target:
private Optional<String> checkForExistingFile(byte[] uploadedFile) throws IOException { try (Stream<java.nio.file.Path> walk = Files.walk(Paths.get(runtimeOptions.getImportsBaseDir()), 1)) { return walk .filter(p -> p.toFile().isFile() && p.toString().toLowerCase().endsWith(DASHBOARD_EXTENSION) && isContentEquals(uploadedFile, p)) .map(p -> p.getFileName().toString().replace(DASHBOARD_EXTENSION, "")) .findFirst(); } catch (Exception e) { logger.info("Error checking for duplicated file contents."); logger.debug("Error checking for duplicated file contents.", e); return Optional.empty(); } }
Source:
<code>ParquetWriter( OutputFile file, ParquetFileWriter.Mode mode, WriteSupport<T> writeSupport, CompressionCodecName compressionCodecName, int rowGroupSize, boolean validating, Configuration conf, int maxPaddingSize, ParquetProperties encodingProps, FileEncryptionProperties encryptionProperties) throws IOException { WriteSupport.WriteContext writeContext = writeSupport.init(conf); MessageType schema = writeContext.getSchema(); if (encryptionProperties == null) { <START> encryptionProperties = ParquetOutputFormat.createEncryptionProperties(conf, new Path(file.toString()), writeContext); <END> } ParquetFileWriter fileWriter = new ParquetFileWriter( file, schema, mode, rowGroupSize, maxPaddingSize, encodingProps.getColumnIndexTruncateLength(), encodingProps.getStatisticsTruncateLength(), encodingProps.getPageWriteChecksumEnabled(), encryptionProperties); fileWriter.start(); this.codecFactory = new CodecFactory(conf, encodingProps.getPageSizeThreshold()); CodecFactory.BytesCompressor compressor = codecFactory.getCompressor(compressionCodecName); this.writer = new InternalParquetRecordWriter<T>( fileWriter, writeSupport, schema, writeContext.getExtraMetaData(), rowGroupSize, compressor, validating, encodingProps); }</code><technical_language>This assumes file.toString() returns full file path. However, file is a public abstract interface org.apache.parquet.io.OutputFile, method, toString() is implementation; guarantees return path. Also, new Path(string full_path) is aware of right filesystem (?) handled upcast a implementing class - preferably a Path getPath() method. of course, this general</technical_language>

Target:
ParquetWriter( OutputFile file, ParquetFileWriter.Mode mode, WriteSupport<T> writeSupport, CompressionCodecName compressionCodecName, int rowGroupSize, boolean validating, Configuration conf, int maxPaddingSize, ParquetProperties encodingProps, FileEncryptionProperties encryptionProperties) throws IOException { WriteSupport.WriteContext writeContext = writeSupport.init(conf); MessageType schema = writeContext.getSchema(); if (encryptionProperties == null) { encryptionProperties = ParquetOutputFormat.createEncryptionProperties(conf, new Path(file.getPath()), writeContext); } ParquetFileWriter fileWriter = new ParquetFileWriter( file, schema, mode, rowGroupSize, maxPaddingSize, encodingProps.getColumnIndexTruncateLength(), encodingProps.getStatisticsTruncateLength(), encodingProps.getPageWriteChecksumEnabled(), encryptionProperties); fileWriter.start(); this.codecFactory = new CodecFactory(conf, encodingProps.getPageSizeThreshold()); CodecFactory.BytesCompressor compressor = codecFactory.getCompressor(compressionCodecName); this.writer = new InternalParquetRecordWriter<T>( fileWriter, writeSupport, schema, writeContext.getExtraMetaData(), rowGroupSize, compressor, validating, encodingProps); }
Source:
<code>private void storeChecksum(String basePath, Repository repository, boolean forceRegeneration) throws ProviderImplementationException, NoSuchAlgorithmException, IOException, ArtifactTransportException { File file = new File(basePath); LayoutProvider layoutProvider = getLayoutProvider(repository, layoutProviderRegistry); List<File> list = Arrays.asList(file.listFiles()); list.stream() .filter(File::isFile) .filter(e -> !ArtifactUtils.isChecksum(e.getPath())) <START> .forEach(e -> <END> { if (!layoutProvider.isExistChecksum(repository, e.getPath()) || forceRegeneration) { ArtifactInputStream is = null; try { String artifactPath = e.getPath() .substring(repository.getBasedir() .length() + 1); is = layoutProvider.getInputStream(repository.getStorage() .getId(), repository.getId(), artifactPath); } catch (IOException | NoSuchAlgorithmException | ArtifactTransportException e1) { e1.printStackTrace(); } writeChecksum(layoutProvider, is, e.getPath()); } }); }</code><technical_language>![MAJOR](<LINK_1> Reduce this lambda expression number of lines 23 20. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void storeChecksum(String basePath, Repository repository, boolean forceRegeneration) throws ProviderImplementationException, NoSuchAlgorithmException, IOException, ArtifactTransportException { File file = new File(basePath); LayoutProvider layoutProvider = getLayoutProvider(repository, layoutProviderRegistry); List<File> list = Arrays.asList(file.listFiles()); list.stream() .filter(File::isFile) .filter(e -> !ArtifactUtils.isChecksum(e.getPath())) .forEach(e -> { if (!layoutProvider.isExistChecksum(repository, e.getPath()) || forceRegeneration) { ArtifactInputStream is = null; try { String artifactPath = e.getPath() .substring(repository.getBasedir() .length() + 1); is = layoutProvider.getInputStream(repository.getStorage() .getId(), repository.getId(), artifactPath); } catch (IOException | NoSuchAlgorithmException | ArtifactTransportException e1) { logger.error(e1.getMessage(), e1); } writeChecksum(layoutProvider, is, e.getPath()); } }); }
Source:
<code>public String runTask(String[] args) throws Exception { int res = ToolRunner.run(new JobClient(), args); <START> return res == 0 ? "Sucess" : "Fail"; <END> }</code><technical_language>Sucess -> Success</technical_language>

Target:
public String runTask(String[] args) throws Exception { int res = ToolRunner.run(new JobClient(), args); return res == 0 ? "Success" : "Fail"; }
Source:
<code>private void writeEntityTypes(Iterable<EntityType> entityTypes, ExcelWriter writer) throws IOException { if (!writer.hasSheet(EMX_ENTITIES)) { writer.createSheet(EMX_ENTITIES, newArrayList(ENTITIES_ATTRS.keySet())); } writer.writeRows( <START> StreamSupport.stream(entityTypes.spliterator(), false) <END> .map(entityType -> EntityTypeMapper.map(entityType)), EMX_ENTITIES); }</code><technical_language>Guava Streams.stream(myStream) instead of StreamSupport.stream(myStream.spliterator(), false)</technical_language>

Target:
private void writeEntityTypes(Iterable<EntityType> entityTypes, ExcelWriter writer) throws IOException { if (!writer.hasSheet(EMX_ENTITIES)) { writer.createSheet(EMX_ENTITIES, newArrayList(ENTITIES_ATTRS.keySet())); } writer.writeRows(Streams.stream(entityTypes).map(EntityTypeMapper::map), EMX_ENTITIES); }
Source:
<code>public static String getConvoKeyAsJsonString(FlowDocument document) { <START> if (document.isInitiator() == null) { <END> return null; } final ConversationKey convoKey = document.isInitiator() ? egressKeyFor(document) : ingressKeyFor(document); return toJsonString(convoKey); }</code><technical_language>call this, if isInitiator() == null returns true</technical_language>

Target:
public static String getConvoKeyAsJsonString(FlowDocument document) { final ConversationKey convoKey = document.isInitiator() ? egressKeyFor(document) : ingressKeyFor(document); return toJsonString(convoKey); }
Source:
<code>public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); <START> searchView.setVisibility(isVisibleToUser ? View.VISIBLE : View.GONE); <END> onFragmentVisibilityChange(isVisibleToUser); }</code><technical_language>SearchView's visibility dependent of discovery fragments, visibility controlled MainDiscoveryFragment'</technical_language>

Target:
public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); onFragmentVisibilityChange(isVisibleToUser); }
Source:
<code>private void initLocalBuildPipeline( ) { final Stage< Input, SourceConfig > sourceConfigStage = config( "Local Source Config", ( Function< Input, SourceConfig > ) ( s ) -> { return new LocalSourceConfig( ) { }; } ); final Stage< SourceConfig, ProjectConfig > projectConfigStage = config( "Local Project Config", ( Function< SourceConfig, ProjectConfig > ) ( s ) -> { return new LocalProjectConfig( ) { }; } ); final Stage< ProjectConfig, BuildConfig > localBuildConfigStage = config( "Local Build Config", ( Function< ProjectConfig, BuildConfig > ) ( s ) -> { return new LocalBuildConfigImpl( ) { }; } ); final Stage< BuildConfig, BinaryConfig > localBuildExecStage = config( "Local Build Exec", ( Function< BuildConfig, BinaryConfig > ) ( s ) -> { return new LocalBuildExecConfig( ) { }; } ); final Pipeline localBuildPipeline = PipelineFactory .startFrom( sourceConfigStage ) .andThen( projectConfigStage ) .andThen( localBuildConfigStage ) .andThen( localBuildExecStage ) .buildAs( LOCAL_BUILD_PIPELINE ); <START> pipelineRegistry.registerPipeline( localBuildPipeline ); <END> }</code><technical_language>a need test this pipeline. ps: I BuildPipelineInvokerTest.java - stil test provided pipeline</technical_language>

Target:
private void initLocalBuildPipeline( ) { final Stage< Input, SourceConfig > sourceConfigStage = config( "Local Source Config", ( s ) -> new LocalSourceConfig( ) { } ); final Stage< SourceConfig, ProjectConfig > projectConfigStage = config( "Local Project Config", ( s ) -> new LocalProjectConfig( ) { } ); final Stage< ProjectConfig, BuildConfig > localBuildConfigStage = config( "Local Build Config", ( s ) -> new LocalBuildConfigImpl( ) ); final Stage< BuildConfig, BinaryConfig > localBuildExecStage = config( "Local Build Exec", ( s ) -> new LocalBuildExecConfig( ) { } ); final Pipeline localBuildPipeline = PipelineFactory .startFrom( sourceConfigStage ) .andThen( projectConfigStage ) .andThen( localBuildConfigStage ) .andThen( localBuildExecStage ) .buildAs( LOCAL_BUILD_PIPELINE ); pipelineRegistry.registerPipeline( localBuildPipeline ); }
Source:
<code>public void testJvmPauseMonitorConfigured() throws IOException, ConfigException { final Long sleepTime = 444L; final Long warnTH = 5555L; final Long infoTH = 555L; <START> QuorumPeerConfig quorumPeerConfig = new MockQuorumPeerConfig(1); <END> Properties zkProp = getDefaultZKProperties(); zkProp.setProperty("dataDir", new File("myDataDir").getAbsolutePath()); zkProp.setProperty("jvm.pause.monitor", "true"); zkProp.setProperty("jvm.pause.sleep.time.ms", sleepTime.toString()); zkProp.setProperty("jvm.pause.warn-threshold.ms", warnTH.toString()); zkProp.setProperty("jvm.pause.info-threshold.ms", infoTH.toString()); quorumPeerConfig.parseProperties(zkProp); assertEquals(sleepTime, Long.valueOf(quorumPeerConfig.getJvmPauseSleepTimeMs())); assertEquals(warnTH, Long.valueOf(quorumPeerConfig.getJvmPauseWarnThresholdMs())); assertEquals(infoTH, Long.valueOf(quorumPeerConfig.getJvmPauseInfoThresholdMs())); assertTrue(quorumPeerConfig.isJvmPauseMonitorToRun()); }</code><technical_language>Please "mocked" version here, needed</technical_language>

Target:
public void testJvmPauseMonitorConfigured() throws IOException, ConfigException { final Long sleepTime = 444L; final Long warnTH = 5555L; final Long infoTH = 555L; QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig(); Properties zkProp = getDefaultZKProperties(); zkProp.setProperty("dataDir", new File("myDataDir").getAbsolutePath()); zkProp.setProperty("jvm.pause.monitor", "true"); zkProp.setProperty("jvm.pause.sleep.time.ms", sleepTime.toString()); zkProp.setProperty("jvm.pause.warn-threshold.ms", warnTH.toString()); zkProp.setProperty("jvm.pause.info-threshold.ms", infoTH.toString()); quorumPeerConfig.parseProperties(zkProp); assertEquals(sleepTime, Long.valueOf(quorumPeerConfig.getJvmPauseSleepTimeMs())); assertEquals(warnTH, Long.valueOf(quorumPeerConfig.getJvmPauseWarnThresholdMs())); assertEquals(infoTH, Long.valueOf(quorumPeerConfig.getJvmPauseInfoThresholdMs())); assertTrue(quorumPeerConfig.isJvmPauseMonitorToRun()); }