auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testUnixEncodeProxyV2() { HAProxyMessageEncoder encoder = new HAProxyMessageEncoder(); EmbeddedChannel ch = new EmbeddedChannel(encoder); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V2, HAProxyCommand.PROXY, HAProxyProxiedProtocol.UNIX_STREAM, "/var/run/src.sock", "/var/run/dst.sock", 0, 0); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); byte[] headerBytes = ByteBufUtil.getBytes(byteBuf, 0, 12); assertArrayEquals(BINARY_PREFIX, headerBytes); byte commandByte = byteBuf.getByte(12); assertEquals(0x02, (commandByte & 0xf0) >> 4); assertEquals(0x01, commandByte & 0x0f); byte transportByte = byteBuf.getByte(13); assertEquals(0x03, (transportByte & 0xf0) >> 4); assertEquals(0x01, transportByte & 0x0f); int sourceAddrLength = byteBuf.getUnsignedShort(14); assertEquals(216, sourceAddrLength); int srcAddrEnd = byteBuf.forEachByte(16, 108, ByteProcessor.FIND_NUL); assertEquals("/var/run/src.sock", byteBuf.slice(16, srcAddrEnd - 16).toString(CharsetUtil.US_ASCII)); int dstAddrEnd = byteBuf.forEachByte(124, 108, ByteProcessor.FIND_NUL); assertEquals("/var/run/dst.sock", <START> byteBuf.slice(124, dstAddrEnd - 124).toString(CharsetUtil.US_ASCII)); <END> }</code><technical_language>call byteBuf.release() add assertFalse(ch.finish());</technical_language>

Target:
public void testUnixEncodeProxyV2() { EmbeddedChannel ch = new EmbeddedChannel(INSTANCE); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V2, HAProxyCommand.PROXY, HAProxyProxiedProtocol.UNIX_STREAM, "/var/run/src.sock", "/var/run/dst.sock", 0, 0); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); byte[] headerBytes = ByteBufUtil.getBytes(byteBuf, 0, 12); assertArrayEquals(BINARY_PREFIX, headerBytes); byte commandByte = byteBuf.getByte(12); assertEquals(0x02, (commandByte & 0xf0) >> 4); assertEquals(0x01, commandByte & 0x0f); byte transportByte = byteBuf.getByte(13); assertEquals(0x03, (transportByte & 0xf0) >> 4); assertEquals(0x01, transportByte & 0x0f); int addrLength = byteBuf.getUnsignedShort(14); assertEquals(TOTAL_UNIX_ADDRESS_BYTES_LENGTH, addrLength); int srcAddrEnd = byteBuf.forEachByte(16, 108, ByteProcessor.FIND_NUL); assertEquals("/var/run/src.sock", byteBuf.slice(16, srcAddrEnd - 16).toString(CharsetUtil.US_ASCII)); int dstAddrEnd = byteBuf.forEachByte(124, 108, ByteProcessor.FIND_NUL); assertEquals("/var/run/dst.sock", byteBuf.slice(124, dstAddrEnd - 124).toString(CharsetUtil.US_ASCII)); byteBuf.release(); assertFalse(ch.finish()); }
Source:
<code>public Iterator<ObjectNode> convertObject(InputStream csvSource) throws IOException { <START> CountInputStream countInputStream = new CountInputStream(csvSource); <END> setCountInputStream(countInputStream); CsvSchema firstLineSchema = CsvSchema.emptySchema().withHeader(); Iterator<ObjectNode> objectItr = csvMapper.readerFor(ObjectNode.class).with(firstLineSchema) .readValues(csvSource); return objectItr; }</code><technical_language>method countInputStream field instead of a local variable? in: countInputStream = new CountInputStream(csvSource);</technical_language>

Target:
public Iterator<ObjectNode> convertObject(InputStream csvSource) throws IOException { CsvSchema firstLineSchema = CsvSchema.emptySchema().withHeader(); Iterator<ObjectNode> objectItr = csvMapper .readerFor(ObjectNode.class) .with(firstLineSchema) .readValues(csvSource); return objectItr; }
Source:
<code>public AddPinComponentObject placePinInMap() { waitForElementByElement(mapFrame); driver.switchTo().frame(mapFrame); waitForElementVisibleByElement(addPinButton); addPinButton.click(); Actions actions = new Actions(driver); actions.moveToElement(mapImagesCollection.get(0)); actions.click().perform(); <START> driver.switchTo().defaultContent(); <END> return new AddPinComponentObject(driver); }</code><technical_language>Add Pagelogging</technical_language>

Target:
public AddPinComponentObject placePinInMap() { waitForElementByElement(mapFrame); driver.switchTo().frame(mapFrame); waitForElementVisibleByElement(addPinButton); addPinButton.click(); Actions actions = new Actions(driver); actions.moveToElement(mapImagesCollection.get(0)); actions.click().perform(); driver.switchTo().defaultContent(); PageObjectLogging.log("placePinInMap", "Pin was placed in map", true); return new AddPinComponentObject(driver); }
Source:
<code>public Collection<E> get() { <START> return container; <END> }</code><technical_language>this immutable allow manipulation CaffeineCache class</technical_language>

Target:
Collection<E> get() { return container; }
Source:
<code>protected void setUpLayout(Context context) { setDisplayValueFromModel(); Resources resources = context.getResources(); <START> int marginStandard = dpFromPx(context, resources.getDimension(R.dimen.margin_standard)); <END> int margin = marginStandard - FIELD_HORIZONTAL_MARGIN_MODIFIER; addAnswerView(answerText, margin); }</code><technical_language>getDimensionPixelSize more obvious pixels returned. I remembered rightfully complained this method in Slack</technical_language>

Target:
protected void setUpLayout(Context context) { setDisplayValueFromModel(); Resources resources = context.getResources(); int marginStandard = dpFromPx(context, resources.getDimensionPixelSize(R.dimen.margin_standard)); int margin = marginStandard - FIELD_HORIZONTAL_MARGIN_MODIFIER; addAnswerView(answerText, margin); }
Source:
<code>public void saveOrUpdateShouldReturnUserId() { given(userRepository.save(userEntity)).willReturn(userEntity); Long result = userService.saveOrUpdate(detailedUserDTO); assertThat(result, is(USER_ID)); <START> } <END></code><technical_language>modelMapper userRepository invocations verified</technical_language>

Target:
public void saveOrUpdateShouldReturnUserId() { given(userRepository.save(userEntity)).willReturn(userEntity); Long result = userService.saveOrUpdate(detailedUserDTO); then(modelMapper).should().map(detailedUserDTO, UserEntity.class); then(userRepository).should().save(userEntity); assertThat(result, is(USER_ID)); }
Source:
<code>private static void throwIfTabLayoutIsMissing(int tabLayoutId) { if (tabLayoutId != MISSING_TAB_LAYOUT_ID) { return; } <START> throw new MissingTabLayoutId(); <END> }</code><technical_language>new MissingTabLayoutId**Exception**()</technical_language>

Target:
private static void throwIfTabLayoutIsMissing(int tabLayoutId) { if (tabLayoutId != MISSING_TAB_LAYOUT_ID) { return; } throw new MissingTabLayoutIdException(); }
Source:
<code>protected void bootstrap() { if (config != null) { <START> PayaraConfiguredNotifier.class.cast(notifier).setConfiguration(config); <END> } notifier.bootstrap(); }</code><technical_language>This is kind of _set_ coming this behave expected start looking. I if is a config notifier interact a bit more obvious other</technical_language>

Target:
protected synchronized void bootstrap() { if (config != null) { PayaraConfiguredNotifier.class.cast(notifier).setConfiguration(config); } if (isEnabled()) { notifier.bootstrap(); taskResult = executor.scheduleWithFixedDelay(this::run, 0, 5, TimeUnit.MILLISECONDS); } }
Source:
<code>public boolean isValidValue(final MeasurementVariable var, final String value, final String cValueId, final boolean validateDateForDB) { if (value == null || "".equals(value.trim())) { return true; } if (var.getMinRange() != null && var.getMaxRange() != null) { if (ValidationServiceImpl.MISSING_VAL.equals(value.trim())) { return true; } return NumberUtils.isNumber(value); } else if (validateDateForDB && var != null && var.getDataTypeId() != null && var.getDataTypeId() == TermId.DATE_VARIABLE.getId()) { return DateUtil.isValidDate(value); } else if (var.getDataType() != null && var.getDataType().equalsIgnoreCase(ValidationServiceImpl.DATA_TYPE_NUMERIC)) { <START> if (ValidationServiceImpl.MISSING_VAL.equals(value.trim())) { <END> return true; } return NumberUtils.isNumber(value.trim()); } return true; }</code><technical_language>Potential null pointer exception remove != null check. check valid string values StringUtils.isNotBlank method</technical_language>

Target:
public boolean isValidValue(final MeasurementVariable var, final String value, final String cValueId, final boolean validateDateForDB) { if (StringUtils.isBlank(value)) { return true; } if (var.getMinRange() != null && var.getMaxRange() != null) { return this.validateIfValueIsMissingOrNumber(value.trim()); } else if (validateDateForDB && var != null && var.getDataTypeId() != null && var.getDataTypeId() == TermId.DATE_VARIABLE.getId()) { return DateUtil.isValidDate(value); } else if (StringUtils.isNotBlank(var.getDataType()) && var.getDataType().equalsIgnoreCase(ValidationServiceImpl.DATA_TYPE_NUMERIC)) { return this.validateIfValueIsMissingOrNumber(value.trim()); } return true; }
Source:
<code>public SegmentMetadataQueryQueryToolChest( SegmentMetadataQueryConfig config ) { <START> this.config = config; <END> defaultHistory = this.config.getDefaultHistory(); }</code><technical_language>Storing config defaultHistory period enough- a need store</technical_language>

Target:
public SegmentMetadataQueryQueryToolChest( SegmentMetadataQueryConfig config ) { this.config = config; }
Source:
<code>public void execute(JobExecutionContext context) throws JobExecutionException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Starting a deadline job"); } JobDetail jobDetail = context.getJobDetail(); JobDataMap jobData = jobDetail.getJobDataMap(); try { SchedulerContext schedulerContext = context.getScheduler().getContext(); Serializer serializer = (Serializer) schedulerContext.get(JOB_DATA_SERIALIZER); TransactionManager transactionManager = (TransactionManager) schedulerContext.get(TRANSACTION_MANAGER_KEY); ScopeAwareProvider scopeAwareComponents = (ScopeAwareProvider) schedulerContext.get(SCOPE_AWARE_RESOLVER); DeadlineMessage<?> deadlineMessage = deadlineMessage(serializer, jobData); ScopeDescriptor deadlineScope = deadlineScope(serializer, jobData); DefaultUnitOfWork<DeadlineMessage<?>> unitOfWork = DefaultUnitOfWork.startAndGet(deadlineMessage); unitOfWork.attachTransaction(transactionManager); unitOfWork.execute(() -> executeScheduledDeadline(scopeAwareComponents, deadlineMessage, deadlineScope)); if (LOGGER.isInfoEnabled()) { LOGGER.info("Job successfully executed. Deadline message processed.", deadlineMessage.getPayloadType().getSimpleName()); } } catch (Exception e) { LOGGER.error("Exception occurred during processing a deadline job [{}]", jobDetail.getDescription(), e); <START> throw new JobExecutionException(e, true); <END> } }</code><technical_language>I prefer a named constant instead of putting true in there. I suggesting is adding a private static final Boolean REFIRE_IMMEDIATELY = true, i.o. true</technical_language>

Target:
public void execute(JobExecutionContext context) throws JobExecutionException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Starting a deadline job"); } JobDetail jobDetail = context.getJobDetail(); JobDataMap jobData = jobDetail.getJobDataMap(); try { SchedulerContext schedulerContext = context.getScheduler().getContext(); Serializer serializer = (Serializer) schedulerContext.get(JOB_DATA_SERIALIZER); TransactionManager transactionManager = (TransactionManager) schedulerContext.get(TRANSACTION_MANAGER_KEY); ScopeAwareProvider scopeAwareComponents = (ScopeAwareProvider) schedulerContext.get(SCOPE_AWARE_RESOLVER); DeadlineMessage<?> deadlineMessage = deadlineMessage(serializer, jobData); ScopeDescriptor deadlineScope = deadlineScope(serializer, jobData); DefaultUnitOfWork<DeadlineMessage<?>> unitOfWork = DefaultUnitOfWork.startAndGet(deadlineMessage); unitOfWork.attachTransaction(transactionManager); unitOfWork.execute(() -> executeScheduledDeadline(scopeAwareComponents, deadlineMessage, deadlineScope)); if (LOGGER.isInfoEnabled()) { LOGGER.info("Job successfully executed. Deadline message processed.", deadlineMessage.getPayloadType().getSimpleName()); } } catch (Exception e) { if (findException(e, t -> t instanceof AxonNonTransientException).isPresent()) { LOGGER.error("Non transient exception occurred during processing a deadline job [{}]", jobDetail.getDescription(), e); throw new JobExecutionException(e); } LOGGER.warn("Transient exception occurred during processing a deadline job [{}]", jobDetail.getDescription(), e); throw new JobExecutionException(e, REFIRE_IMMEDIATELY); } }
Source:
<code>Map<String, Object> getAvailableTypes() { List<Map<String, String>> availableTypes = this.userCreatableMetacardTypesList .stream() .map(UserCreatableMetacardTypes::getAvailableTypes) .flatMap(Collection::stream) .distinct() <START> .map(s -> Collections.singletonMap("metacardType", s)) <END> .collect(Collectors.toList()); return Collections.singletonMap("availabletypes", availableTypes); }</code><technical_language>return a list of strings instead of a list of single-item maps key</technical_language>

Target:
Map<String, Object> getAvailableTypes() { List<Map<String, Object>> availableTypes = this.userCreatableMetacardTypeList .stream() .map(this::convertUserCreatableMetacardTypeToMap) .collect(Collectors.toList()); return Collections.singletonMap("availabletypes", availableTypes); }
Source:
<code>protected void configureServlets() { install(new FactoryModule() { @Override protected void configure() { <START> factory(ChangeDetailFactory.Factory.class); <END> factory(PatchSetDetailFactory.Factory.class); } }); rpc(ChangeDetailServiceImpl.class); }</code><technical_language>Remove this line. ChangeDetailFactory needed more deleted. files PatchDetailServiceImpl.java, is removed</technical_language>

Target:
protected void configureServlets() { install(new FactoryModule() { @Override protected void configure() { factory(PatchSetDetailFactory.Factory.class); } }); rpc(ChangeDetailServiceImpl.class); }
Source:
<code>public static void writeJavaScriptUrl(final Response response, final CharSequence url, final String id, boolean defer, String charset, boolean async) { response.write("<script "); HeaderItemAttributeMap attributes = new HeaderItemAttributeMap(); attributes.add(HeaderItemAttribute.TYPE, "text/javascript"); attributes.add(HeaderItemAttribute.SCRIPT_SRC, url.toString()); if (id != null) { attributes.add(HeaderItemAttribute.ID, String.valueOf(Strings.escapeMarkup(id))); } if (defer) { attributes.add(HeaderItemAttribute.SCRIPT_DEFER, "defer"); } <START> <END> if (async) { attributes.add(HeaderItemAttribute.SCRIPT_ASYNC, "async"); } if (charset != null) { attributes.add("charset", Strings.escapeMarkup(charset).toString()); } response.write(attributes.toString()); response.write("></script>"); response.write("\n"); }</code><technical_language>method arguments already: give IValueMap write out tag</technical_language>

Target:
public static void writeJavaScriptUrl(final Response response, final CharSequence url, final String id, boolean defer, String charset, boolean async) { response.write("<script "); AttributeMap attributes = new AttributeMap(); attributes.put(ATTR_TYPE, "text/javascript"); attributes.put(ATTR_SCRIPT_SRC, UrlEncoder.FULL_URL_INSTANCE.encode(String.valueOf(url), "UTF-8")); if (id != null) { attributes.put(ATTR_ID, id); } if (defer) { attributes.put(ATTR_SCRIPT_DEFER, "defer"); } if (async) { attributes.put(ATTR_SCRIPT_ASYNC, "async"); } if (charset != null) { attributes.put("charset", charset); } response.write(attributes.toString()); response.write("></script>"); response.write("\n"); }
Source:
<code>private void comparePlanTree(AbstractPlanNode calcitePlanNode, AbstractPlanNode voltdbPlanNode, Map<String, String> ignoreMap) { PlanNodeTree calcitePlanTree = new PlanNodeTree(calcitePlanNode); PlanNodeTree voltdbPlanTree = new PlanNodeTree(voltdbPlanNode); String calcitePlanTreeJSON = calcitePlanTree.toJSONString(); String voltdbPlanTreeJSON = voltdbPlanTree.toJSONString(); <START> if (ignoreMap != null) { <END> for (Map.Entry<String, String> ignore : ignoreMap.entrySet()) { calcitePlanTreeJSON = calcitePlanTreeJSON.replace(ignore.getKey(), ignore.getValue()); } } assertEquals(voltdbPlanTreeJSON, calcitePlanTreeJSON); }</code><technical_language>spare this null check</technical_language>

Target:
private void comparePlanTree(AbstractPlanNode calcitePlanNode, AbstractPlanNode voltdbPlanNode, Map<String, String> ignoreMap) { PlanNodeTree calcitePlanTree = new PlanNodeTree(calcitePlanNode); PlanNodeTree voltdbPlanTree = new PlanNodeTree(voltdbPlanNode); String calcitePlanTreeJSON = calcitePlanTree.toJSONString(); String voltdbPlanTreeJSON = voltdbPlanTree.toJSONString(); for (Map.Entry<String, String> ignore : ignoreMap.entrySet()) { calcitePlanTreeJSON = calcitePlanTreeJSON.replace(ignore.getKey(), ignore.getValue()); } assertEquals(voltdbPlanTreeJSON, calcitePlanTreeJSON); }
Source:
<code>public static void main(String[] arg){ int lport; String rhost; int rport; try{ JSch jsch=new JSch(); <START> String host; <END> if(arg.length>0){ host=arg[0]; } else{ host=JOptionPane.showInputDialog("Enter username@hostname", System.getProperty("user.name")+ "@localhost"); } String user=host.substring(0, host.indexOf('@')); host=host.substring(host.indexOf('@')+1); Session session=jsch.getSession(user, host, 22); String foo=JOptionPane.showInputDialog("Enter -L port:host:hostport", "port:host:hostport"); lport=Integer.parseInt(foo.substring(0, foo.indexOf(':'))); foo=foo.substring(foo.indexOf(':')+1); rhost=foo.substring(0, foo.indexOf(':')); rport=Integer.parseInt(foo.substring(foo.indexOf(':')+1)); UserInfo ui=new MyUserInfo(); session.setUserInfo(ui); session.connect(); int assigned_port=session.setPortForwardingL(lport, rhost, rport); System.out.println("localhost:"+assigned_port+" -> "+rhost+":"+rport); } catch(Exception e){ System.out.println(e); } }</code><technical_language>please dont remove explicit initialization</technical_language>

Target:
public static void main(String[] arg){ int lport; String rhost; int rport; try{ JSch jsch=new JSch(); String host = null; if(arg.length>0){ host=arg[0]; } else{ host=JOptionPane.showInputDialog("Enter username@hostname", System.getProperty("user.name")+ "@localhost"); } String user=host.substring(0, host.indexOf('@')); host=host.substring(host.indexOf('@')+1); Session session=jsch.getSession(user, host, 22); String foo=JOptionPane.showInputDialog("Enter -L port:host:hostport", "port:host:hostport"); lport=Integer.parseInt(foo.substring(0, foo.indexOf(':'))); foo=foo.substring(foo.indexOf(':')+1); rhost=foo.substring(0, foo.indexOf(':')); rport=Integer.parseInt(foo.substring(foo.indexOf(':')+1)); UserInfo ui=new MyUserInfo(); session.setUserInfo(ui); session.connect(); int assigned_port=session.setPortForwardingL(lport, rhost, rport); System.out.println("localhost:"+assigned_port+" -> "+rhost+":"+rport); } catch(Exception e){ System.out.println(e); } }
Source:
<code>public void ensureIdFieldTest() throws Exception { EntityMetadata e = new EntityMetadata("testEntity"); e.setVersion(new Version("1.0.0", null, "some text blah blah")); e.setStatus(MetadataStatus.ACTIVE); e.setDataStore(new MongoDataStore(null, null, "testCollectionIndex2")); e.getFields().put(new SimpleField("field1", StringType.TYPE)); ObjectField o = new ObjectField("field2"); o.getFields().put(new SimpleField("x", IntegerType.TYPE)); e.getFields().put(o); e.getEntityInfo().setDefaultVersion("1.0.0"); Assert.assertNull(e.getFields().getField("_id")); controller.beforeCreateNewSchema(null,e); SimpleField id=(SimpleField)e.getFields().getField("_id"); Assert.assertNotNull(id); Assert.assertEquals(StringType.TYPE,id.getType()); <START> } <END></code><technical_language>verify constraints instead of removing this row</technical_language>

Target:
public void ensureIdFieldTest() throws Exception { EntityMetadata e = new EntityMetadata("testEntity"); e.setVersion(new Version("1.0.0", null, "some text blah blah")); e.setStatus(MetadataStatus.ACTIVE); e.setDataStore(new MongoDataStore(null, null, "testCollectionIndex2")); e.getFields().put(new SimpleField("field1", StringType.TYPE)); ObjectField o = new ObjectField("field2"); o.getFields().put(new SimpleField("x", IntegerType.TYPE)); e.getFields().put(o); e.getEntityInfo().setDefaultVersion("1.0.0"); Assert.assertNull(e.getFields().getField("_id")); controller.beforeCreateNewSchema(null,e); SimpleField id=(SimpleField)e.getFields().getField("_id"); Assert.assertNotNull(id); Assert.assertEquals(StringType.TYPE,id.getType()); Assert.assertEquals(0,id.getConstraints().size()); }
Source:
<code><START> public void testListLocations() { <END> assertFalse(Iterables.isEmpty(adapter.listLocations())); }</code><technical_language>Formatting</technical_language>

Target:
public void testListLocations() { assertFalse(Iterables.isEmpty(adapter.listLocations()), "locations must not be empty"); }
Source:
<code>void handleCallback(final Callback[] callbacks, final int index) throws UnsupportedCallbackException, IOException { Callback callback = callbacks[index]; <START> if (callback instanceof ExtendedChoiceCallback) { <END> ExtendedChoiceCallback extendedChoiceCallback = (ExtendedChoiceCallback) callback; if (choice == null) { extendedChoiceCallback.setSelectedIndex(extendedChoiceCallback.getDefaultChoice()); return; } else { String[] choices = extendedChoiceCallback.getChoices(); for (int i = 0; i < choices.length; i++) { if (choice.equals(choices[i])) { extendedChoiceCallback.setSelectedIndex(i); return; } } } } super.handleCallback(callbacks, index); }</code><technical_language>..the base ChoiceCallback a mechanism tested for; furthermore, other subclasses of ChoiceCallback (like RealmChoiceCallback) interfere correct operation of realm selection if is type-based check involved</technical_language>

Target:
void handleCallback(final Callback[] callbacks, final int index) throws UnsupportedCallbackException, IOException { Callback callback = callbacks[index]; if (callback instanceof ChoiceCallback) { ChoiceCallback choiceCallback = (ChoiceCallback) callback; if (matchPredicate.test(choiceCallback.getClass(), choiceCallback.getPrompt())) { if (choice == null) { choiceCallback.setSelectedIndex(choiceCallback.getDefaultChoice()); return; } else { String[] choices = choiceCallback.getChoices(); for (int i = 0; i < choices.length; i++) { if (choice.equals(choices[i])) { choiceCallback.setSelectedIndex(i); return; } } } } } super.handleCallback(callbacks, index); }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { <START> delegate.doFilter(request, response, chain); <END> }</code><technical_language>need a passthrough filter, null do delegate == null ? chain.doFilter(request, response) : delegate.doFilter(request, response, chain) avoid adding more delegation stack levels</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { controller.onNewRequest(); try { chain.doFilter(request, response); } finally { controller.onRequestEnd(); } }
Source:
<code>public static PcapFile getPcapFile(Path filePath) throws IOException, BadPcapFileException { SeekableByteChannel <START> fFileChannel; <END> if (Files.notExists(filePath) || !Files.isRegularFile(filePath) || Files.size(filePath) < PcapFileValues.GLOBAL_HEADER_SIZE) { throw new BadPcapFileException("Bad Pcap File."); } if (!Files.isReadable(filePath)) { throw new BadPcapFileException("File is not readable."); } try { fFileChannel = checkNotNull(Files.newByteChannel(filePath)); FileChannel f = (FileChannel) fFileChannel; ByteBuffer header = ByteBuffer.allocate(PcapFileValues.PCAPNG_BLOCK_HEADER_SIZE); header.clear(); header.order(ByteOrder.LITTLE_ENDIAN); f.read(header); header.flip(); int blockType = header.getInt(); f.close(); if (blockType == PcapFileValues.PCAPNG_SHB) { return new PcapNgFile(filePath); } return new PcapOldFile(filePath); } catch (Exception e) { return new PcapOldFile(filePath); } }</code><technical_language>local variable camelCase fCamelCase</technical_language>

Target:
public static PcapFile getPcapFile(Path filePath) throws IOException, BadPcapFileException { if (Files.notExists(filePath) || !Files.isRegularFile(filePath) || Files.size(filePath) < PcapFileValues.GLOBAL_HEADER_SIZE) { throw new BadPcapFileException("Bad Pcap File."); } if (!Files.isReadable(filePath)) { throw new BadPcapFileException("File is not readable."); } FileChannel f; try { f = (FileChannel) checkNotNull(Files.newByteChannel(filePath)); ByteBuffer header = ByteBuffer.allocate(PcapFileValues.PCAPNG_BLOCK_HEADER_SIZE); header.order(ByteOrder.LITTLE_ENDIAN); f.read(header); header.flip(); int blockType = header.getInt(); f.close(); if (blockType == PcapFileValues.PCAPNG_SHB) { return new PcapNgFile(filePath); } return new PcapOldFile(filePath); } catch (Exception e) { throw new BadPcapFileException("Bad Pcap File."); } }
Source:
<code>private UndertowRootDefinition() { super(UndertowExtension.SUBSYSTEM_PATH, UndertowExtension.getResolver(), UndertowSubsystemAdd.INSTANCE, new ReloadRequiredRemoveStepHandler(){ @Override protected void performRemove(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { DefaultDeploymentMappingProvider.instance().clear(); super.performRemove(context, operation, model); } <START> }); <END> }</code><technical_language>I this change made. This is host remove discussion chatted I realized host remove require reload: 1) Deployment is deployed is hosts. 2) User removes subsystem; change runtime, report reload is required. 3) User triggers redeploy. mappings deployment available. Now, in reality, removing subsystem is recursively remove hosts too, away, requiring reload, this matter. this a of future bugs, clearing in subsystem add is enough deal reload case, I is sufficient</technical_language>

Target:
private UndertowRootDefinition() { super(UndertowExtension.SUBSYSTEM_PATH, UndertowExtension.getResolver(), new UndertowSubsystemAdd(APPLICATION_SECURITY_DOMAIN.getKnownSecurityDomainPredicate()), ReloadRequiredRemoveStepHandler.INSTANCE); }
Source:
<code>public void validate(List<String> errors) { for (int i=0; i < getRowCount(); ++i) { String error = errors.get(i); Element element = getRowElement(i); boolean valid = StringUtils.isEmpty(error); element.setTitle(valid ? null : error); <START> element.getStyle().setOutlineStyle(valid ? OutlineStyle.NONE : OutlineStyle.SOLID); <END> element.getStyle().setOutlineColor("red"); element.getStyle().setOutlineWidth(1, Unit.PX); } }</code><technical_language>Instead of setting styles element this I suggest css classes. For instance create a .css src/main/resources/org/ovirt/engine/ui/common/css lets 'Validation.css'. In css file do this: .validationError { border: 1px solid red; } in EntityModelCellTable class define resource style this: public interface ValidationCss extends CssResource { String validationError(); } public interface EntityModelCellTableResources extends ClientBundle { @Source("org/ovirt/engine/ui/common/css/Validation.css") ValidationCss validationCss(); } private static final EntityModelCellTableResources ENTITY_MODEL_CELL_TABLE_RESOURCES = GWT.create(EntityModelCellTableResources.class); private final ValidationCss style; In constructor: style = ENTITY_MODEL_CELL_TABLE_RESOURCES.validationCss(); style.ensureInjected(); finally in validate do following: if (!valid) { element.addClassName(style.validationError()); } else { element.removeClassName(style.validationError()); } This is a lot of work, this easier change style in .css file alter code. easy externalize style class, brand a time</technical_language>

Target:
public void validate(List<String> errors) { for (int i=0; i < getRowCount(); ++i) { String error = errors.get(i); Element element = getRowElement(i); boolean valid = StringUtils.isEmpty(error); element.setTitle(valid ? null : error); if (!valid) { element.addClassName(style.invalidRow()); } else { element.removeClassName(style.invalidRow()); } } }
Source:
<code>public ErlangAppCompletionContributor() { extend(CompletionType.BASIC, psiElement().inFile(instanceOf(ErlangFile.class)), new CompletionProvider<CompletionParameters>() { @Override protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet result) { PsiElement position = parameters.getPosition(); PsiFile file = position.getContainingFile(); if (file == null || file.getFileType() != ErlangFileType.APP <START> || PsiTreeUtil.getParentOfType(position, ErlangTupleExpression.class) == null) return; <END> if (PsiTreeUtil.getParentOfType(position, ErlangListExpression.class) == null) { result.addElement(PrioritizedLookupElement.withPriority(LookupElementBuilder.create("application"), ErlangCompletionContributor.KEYWORD_PRIORITY)); } else { for (String keyword : KEYWORDS) { result.addElement(PrioritizedLookupElement.withPriority(LookupElementBuilder.create(keyword), ErlangCompletionContributor.KEYWORD_PRIORITY)); } } } }); }</code><technical_language>express in pattern argument of extend</technical_language>

Target:
public ErlangAppCompletionContributor() { PsiElementPattern.Capture<PsiElement> psiElementInAppFile = psiElement(ErlangTypes.ERL_ATOM_NAME).inFile(instanceOf(ErlangFile.class)) .inVirtualFile(virtualFile().ofType(ErlangFileType.APP)); PsiElementPattern.Capture<PsiElement> placeForAppKeyword = psiElementInAppFile .withParents(ErlangAtom.class, ErlangQAtom.class, ErlangConfigExpression.class, ErlangTupleExpression.class, ErlangFile.class).with(positionInTuple(0)); PsiElementPattern.Capture<PsiElement> placeForParameterKeywords = psiElementInAppFile .withParents(ErlangAtom.class, ErlangQAtom.class, ErlangConfigExpression.class, ErlangTupleExpression.class, ErlangListExpression.class, ErlangTupleExpression.class, ErlangFile.class).with(positionInTuple(0)); extend(CompletionType.BASIC, placeForAppKeyword, getProvider(ContainerUtil.list(APPLICATION_KEYWORD))); extend(CompletionType.BASIC, placeForParameterKeywords, getProvider(KEYWORDS)); }
Source:
<code>public void testBothOwnersSuspected(Method m) throws ExecutionException, InterruptedException { initAndCheck(m); CountDownLatch arrival = new CountDownLatch(2); CountDownLatch release = new CountDownLatch(1); AtomicInteger thrown = new AtomicInteger(); AtomicInteger retried = new AtomicInteger(); cache(0).getAdvancedCache().getAsyncInterceptorChain().addInterceptorAfter(new CheckOTEInterceptor(thrown, retried), StateTransferInterceptor.class); cache(1).getAdvancedCache().getAsyncInterceptorChain().addInterceptor(new DelayingInterceptor(arrival, release), 0); cache(2).getAdvancedCache().getAsyncInterceptorChain().addInterceptor(new DelayingInterceptor(arrival, release), 0); Future<Object> future = fork(() -> cache(0).get(key)); <START> assertTrue(arrival.await(20, TimeUnit.SECONDS)); <END> installNewView(cache(0), cache(0)); assertNull(future.get()); assertEquals(1, thrown.get()); assertEquals(0, retried.get()); release.countDown(); }</code><technical_language>hiding issue</technical_language>

Target:
public void testBothOwnersSuspected(Method m) throws ExecutionException, InterruptedException { initAndCheck(m); CountDownLatch arrival = new CountDownLatch(2); CountDownLatch release = new CountDownLatch(1); AtomicInteger thrown = new AtomicInteger(); AtomicInteger retried = new AtomicInteger(); cache(0).getAdvancedCache().getAsyncInterceptorChain().addInterceptorAfter(new CheckOTEInterceptor(thrown, retried), StateTransferInterceptor.class); cache(1).getAdvancedCache().getAsyncInterceptorChain().addInterceptor(new DelayingInterceptor(arrival, release), 0); cache(2).getAdvancedCache().getAsyncInterceptorChain().addInterceptor(new DelayingInterceptor(arrival, release), 0); Future<Object> future = fork(() -> cache(0).get(key)); assertTrue(arrival.await(10, TimeUnit.SECONDS)); installNewView(cache(0), cache(0)); assertNull(future.get()); assertEquals(1, thrown.get()); assertEquals(0, retried.get()); release.countDown(); }
Source:
<code>public TrackingToken createTokenAt(Instant dateTime) { return events.values() .stream() .filter(event -> event.getTimestamp().equals(dateTime) || event.getTimestamp().isAfter(dateTime)) .min(Comparator.comparingLong(e -> ((GlobalSequenceTrackingToken) e.trackingToken()) .getGlobalIndex())) .map(TrackedEventMessage::trackingToken) .map(tt -> (GlobalSequenceTrackingToken) tt) .map(tt -> new GlobalSequenceTrackingToken(tt.getGlobalIndex() - 1)) .map(tt -> (TrackingToken) tt) <START> .orElse(createHeadToken()); <END> }</code><technical_language>This construct "createHeadToken" called call of "createTokenAt". expensive operation. Please orElseGet(this::createHeadToken) instead</technical_language>

Target:
public TrackingToken createTokenAt(Instant dateTime) { return events.values() .stream() .filter(event -> event.getTimestamp().equals(dateTime) || event.getTimestamp().isAfter(dateTime)) .min(Comparator.comparingLong(e -> ((GlobalSequenceTrackingToken) e.trackingToken()) .getGlobalIndex())) .map(TrackedEventMessage::trackingToken) .map(tt -> (GlobalSequenceTrackingToken) tt) .map(tt -> new GlobalSequenceTrackingToken(tt.getGlobalIndex() - 1)) .map(tt -> (TrackingToken) tt) .orElseGet(this::createHeadToken); }
Source:
<code>private boolean needParseContainerPrefix(final Container container, final String uniqueId) { String containerIdOrPath = null; if (FileAssetContainerUtil.getInstance().isFileAssetContainer(container)) { final Host host; try { host = APILocator.getHostAPI().findParentHost(container, APILocator.systemUser(), false); containerIdOrPath = this.site.getIdentifier().equals(host.getIdentifier()) ? ((FileAssetContainer) container).getPath() : FileAssetContainerUtil.getInstance().getFullPath((FileAssetContainer) container); <START> } catch (DotDataException | DotSecurityException e) { <END> Logger.debug(PageRenderUtil.class, e.getMessage()); containerIdOrPath = container.getIdentifier(); } } else { containerIdOrPath = container.getIdentifier(); } return !ParseContainer.isParserContainerUUID(uniqueId) && (templateLayout == null || !templateLayout.existsContainer(containerIdOrPath, uniqueId)); }</code><technical_language>Is this case exceptions control statements</technical_language>

Target:
private boolean needParseContainerPrefix(final Container container, final String uniqueId) { String containerIdOrPath = null; if (FileAssetContainerUtil.getInstance().isFileAssetContainer(container)) { containerIdOrPath = getRelativePathFromSite((FileAssetContainer) container); } else { containerIdOrPath = container.getIdentifier(); } return !ParseContainer.isParserContainerUUID(uniqueId) && (templateLayout == null || !templateLayout.existsContainer(containerIdOrPath, uniqueId)); }
Source:
<code>public synchronized void serialize( DataTree dt, Map<Long, Integer> sessions, File snapShot, boolean fsync) throws IOException { if (!close) { try (CheckedOutputStream snapOS = SnapStream.getOutputStream(snapShot, fsync)) { OutputArchive oa = BinaryOutputArchive.getArchive(snapOS); FileHeader header = new FileHeader(SNAP_MAGIC, VERSION, dbId); serialize(dt, sessions, oa, header); SnapStream.sealStream(snapOS, oa); if (dt.serializeZxidDigest(oa)) { SnapStream.sealStream(snapOS, oa); } lastSnapshotInfo = new SnapshotInfo( Util.getZxidFromName(snapShot.getName(), SNAPSHOT_FILE_PREFIX), snapShot.lastModified() / 1000); } } else { <START> throw new IllegalStateException("FileSnap has already been closed"); <END> } }</code><technical_language>existing code handle this RuntimeException properly ? throwing a IOException</technical_language>

Target:
public synchronized void serialize( DataTree dt, Map<Long, Integer> sessions, File snapShot, boolean fsync) throws IOException { if (!close) { try (CheckedOutputStream snapOS = SnapStream.getOutputStream(snapShot, fsync)) { OutputArchive oa = BinaryOutputArchive.getArchive(snapOS); FileHeader header = new FileHeader(SNAP_MAGIC, VERSION, dbId); serialize(dt, sessions, oa, header); SnapStream.sealStream(snapOS, oa); if (dt.serializeZxidDigest(oa)) { SnapStream.sealStream(snapOS, oa); } lastSnapshotInfo = new SnapshotInfo( Util.getZxidFromName(snapShot.getName(), SNAPSHOT_FILE_PREFIX), snapShot.lastModified() / 1000); } } else { throw new IOException("FileSnap has already been closed"); } }
Source:
<code>public void testCreateSnapshot() throws Exception { IgniteEx ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE); SnapshotMXBean mxBean = getMBean(ignite.name()); mxBean.createSnapshot(SNAPSHOT_NAME); MetricRegistry mreg = ignite.context().metric().registry(SNAPSHOT_METRICS); <START> LongMetric endTime = mreg.findMetric("LastSnapshotEndTime"); <END> assertEquals("Snapshot end time must be undefined on first snapshot operation starts.", 0, endTime.value()); assertTrue("Waiting for snapshot operation failed.", GridTestUtils.waitForCondition(() -> endTime.value() > 0, 10_000)); stopAllGrids(); IgniteEx snp = startGridsFromSnapshot(2, SNAPSHOT_NAME); assertSnapshotCacheKeys(snp.cache(dfltCacheCfg.getName())); }</code><technical_language>Please test this metric registry, JMX</technical_language>

Target:
public void testCreateSnapshot() throws Exception { IgniteEx ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE); DynamicMBean snpMBean = metricRegistry(ignite.name(), null, SNAPSHOT_METRICS); assertEquals("Snapshot end time must be undefined on first snapshot operation starts.", 0, getLastSnapshotEndTime(snpMBean)); SnapshotMXBean mxBean = getMxBean(ignite.name(), "Snapshot", SnapshotMXBeanImpl.class, SnapshotMXBean.class); mxBean.createSnapshot(SNAPSHOT_NAME); assertTrue("Waiting for snapshot operation failed.", GridTestUtils.waitForCondition(() -> getLastSnapshotEndTime(snpMBean) > 0, 10_000)); stopAllGrids(); IgniteEx snp = startGridsFromSnapshot(2, SNAPSHOT_NAME); assertSnapshotCacheKeys(snp.cache(dfltCacheCfg.getName())); }
Source:
<code>public void stop() { <START> run = false; <END> }</code><technical_language>good info message listener is stopping</technical_language>

Target:
public void stop() { log.debug("Namespace listener shutting down."); run = false; }
Source:
<code>synchronized void saveSettings() { executableRampMap .getAll() .stream() .filter(ramp -> !ramp.getState().isSynchronized()) .forEach(this::updateExecutableRamp); executableRampExceptionalFlowItemsMap .entrySet() .stream() .forEach(this::updateExecutedRampFlows); <START> rampDataModel.resetFlowCountsAfterSave(); <END> LOGGER.info("Ramp Settings had been successfully saved."); }</code><technical_language>resetFlowCountAfterSave, "s" is needed</technical_language>

Target:
synchronized void saveSettings() { executableRampMap .getAll() .stream() .filter(ramp -> !ramp.getState().isSynchronized()) .forEach(this::updateExecutableRamp); executableRampExceptionalFlowItemsMap .entrySet() .stream() .forEach(this::updateExecutedRampFlows); rampDataModel.resetFlowCountAfterSave(); LOGGER.info("Ramp Settings had been successfully saved."); }
Source:
<code>public ModelAdapter read(JsonDeserializationContext deserializationContext, JsonObject modelContents) { if (!modelContents.has("model")) throw new RuntimeException("ModelLoaderAdapter requires a 'model' key that points to a model file."); String modelLocation = modelContents.get("model").getAsString(); try { <START> IUnbakedModel model = parent.loadModel(new ResourceLocation(modelLocation)); <END> ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); if (modelContents.has("custom")) { for (Map.Entry<String, JsonElement> e : modelContents.get("custom").getAsJsonObject().entrySet()) { if (e.getValue().isJsonNull()) builder.put(e.getKey(), null); else builder.put(e.getKey(), e.getValue().toString()); } } return new ModelAdapter(model, builder.build()); } catch (Exception e) { throw new RuntimeException("Error loading model from legacy model loader", e); } }</code><technical_language>This check accepts strange problems</technical_language>

Target:
public ModelAdapter read(JsonDeserializationContext deserializationContext, JsonObject modelContents) { if (!modelContents.has("model")) throw new RuntimeException("ModelLoaderAdapter requires a 'model' key that points to a model file."); String modelLocation = modelContents.get("model").getAsString(); boolean forceLoad = JSONUtils.getBoolean(modelContents,"force", false); try { ResourceLocation loc = new ResourceLocation(modelLocation); if (!forceLoad && !parent.accepts(loc)) throw new IllegalStateException("The loader does not accept the requested model."); IUnbakedModel model = parent.loadModel(loc); ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); if (modelContents.has("custom")) { for (Map.Entry<String, JsonElement> e : modelContents.get("custom").getAsJsonObject().entrySet()) { if (e.getValue().isJsonNull()) builder.put(e.getKey(), null); else builder.put(e.getKey(), e.getValue().toString()); } } return new ModelAdapter(model, builder.build()); } catch (Exception e) { throw new RuntimeException("Error loading model from legacy model loader", e); } }
Source:
<code>public void displayMatchingAttributeName(JMXAttribute jmxAttribute, int rank, int limit) { <START> LOGGER.debug(" Matching: " + rank + "/" + limit + ". " + jmxAttribute); <END> }</code><technical_language>methods commands in datadog-agent (stuff datadog-agent jmxfetch list-matching) is expected print stdout always, a debugging command. LOGGER.debug changes, missing something, subject log level, potentially breaking agent commands. If this, info warning - preferable print stdout...</technical_language>

Target:
public void displayMatchingAttributeName(JMXAttribute jmxAttribute, int rank, int limit) { LOGGER.info(" Matching: " + rank + "/" + limit + ". " + jmxAttribute); }
Source:
<code>public void notifyLock(LlapCacheableBuffer buffer) { <START> if (buffer.cacheAttribute == null || buffer.cacheAttribute.getIndex() != IN_LIST || !listLock.tryLock()) { <END> return; } removeFromListAndUnlock(buffer); }</code><technical_language>Question: scenario lead a null cacheAttribute</technical_language>

Target:
public void notifyLock(LlapCacheableBuffer buffer) { if (buffer.cacheAttribute.getIndex() != IN_LIST || !listLock.tryLock()) { return; } removeFromListAndUnlock(buffer); }
Source:
<code>public void init() { dataTypeComboBox.init(this, false, dataType, customDataType, false, true, CUSTOM_PROMPT, ENTER_TYPE_PROMPT); processVarComboBox.init(this, false, processVar, constant, true, true, CONSTANT_PROMPT, ENTER_CONSTANT_PROMPT); <START> name.setRegExp("^[a-zA-Z0-9\\-\\_]*$", <END> StunnerFormsClientFieldsConstants.INSTANCE.Removed_invalid_characters_from_name(), StunnerFormsClientFieldsConstants.INSTANCE.Invalid_character_in_name()); customDataType.addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { int iChar = event.getNativeKeyCode(); if (iChar == ' ') { event.preventDefault(); } } }); name.addBlurHandler(new BlurHandler() { @Override public void onBlur(BlurEvent event) { if (!allowDuplicateNames) { String value = name.getText(); if (isDuplicateName(value)) { notification.fire(new NotificationEvent(duplicateNameErrorMessage, NotificationEvent.NotificationType.ERROR)); name.setValue(""); ValueChangeEvent.fire(name, ""); } } } }); }</code><technical_language>I guess pattern shared public static final field other classes/tests prevent copy/pasting issues in future</technical_language>

Target:
public void init() { dataTypeComboBox.init(this, false, dataType, customDataType, false, true, CUSTOM_PROMPT, ENTER_TYPE_PROMPT); processVarComboBox.init(this, false, processVar, constant, true, true, CONSTANT_PROMPT, ENTER_CONSTANT_PROMPT); name.setRegExp(StringUtils.ALPHA_NUM_REGEXP, StunnerFormsClientFieldsConstants.INSTANCE.Removed_invalid_characters_from_name(), StunnerFormsClientFieldsConstants.INSTANCE.Invalid_character_in_name()); customDataType.addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { int iChar = event.getNativeKeyCode(); if (iChar == ' ') { event.preventDefault(); } } }); name.addBlurHandler(new BlurHandler() { @Override public void onBlur(BlurEvent event) { if (!allowDuplicateNames) { String value = name.getText(); if (isDuplicateName(value)) { notification.fire(new NotificationEvent(duplicateNameErrorMessage, NotificationEvent.NotificationType.ERROR)); name.setValue(""); ValueChangeEvent.fire(name, ""); } } } }); }
Source:
<code>public CallbackHandler(HelixManager manager, RealmAwareZkClient client, PropertyKey propertyKey, Object listener, EventType[] eventTypes, ChangeType changeType, HelixCallbackMonitor monitor, long periodicTriggerInterval) { if (listener == null) { throw new HelixException("listener could not be null"); } if (monitor != null && !monitor.getChangeType().equals(changeType)) { throw new HelixException("The specified callback monitor is for different change type: " + monitor.getChangeType().name()); } _manager = manager; _accessor = manager.getHelixDataAccessor(); _zkClient = client; _propertyKey = propertyKey; _path = propertyKey.getPath(); _listener = listener; _eventTypes = new HashSet<>(Arrays.asList(eventTypes)); _changeType = changeType; _lastNotificationTimeStamp = new AtomicLong(System.nanoTime()); _monitor = monitor; if (_changeType == MESSAGE || _changeType == MESSAGES_CONTROLLER || _changeType == CONTROLLER) { _watchChild = false; } else { _watchChild = true; } parseListenerProperties(); init(); _periodicTriggerInterval = periodicTriggerInterval; if (_periodicTriggerInterval > 0) { <START> initRefreshTask(); <END> } }</code><technical_language>nit, pass periodicTriggerInterval initRefreshTask() do branch inside. this code cleaner</technical_language>

Target:
public CallbackHandler(HelixManager manager, RealmAwareZkClient client, PropertyKey propertyKey, Object listener, EventType[] eventTypes, ChangeType changeType, HelixCallbackMonitor monitor, long periodicTriggerInterval) { if (listener == null) { throw new HelixException("listener could not be null"); } if (monitor != null && !monitor.getChangeType().equals(changeType)) { throw new HelixException("The specified callback monitor is for different change type: " + monitor.getChangeType().name()); } _manager = manager; _accessor = manager.getHelixDataAccessor(); _zkClient = client; _propertyKey = propertyKey; _path = propertyKey.getPath(); _listener = listener; _eventTypes = new HashSet<>(Arrays.asList(eventTypes)); _changeType = changeType; _lastNotificationTimeStamp = new AtomicLong(System.nanoTime()); _monitor = monitor; if (_changeType == MESSAGE || _changeType == MESSAGES_CONTROLLER || _changeType == CONTROLLER) { _watchChild = false; } else { _watchChild = true; } _periodicTriggerInterval = periodicTriggerInterval; _periodicTriggerEnabled = _periodicTriggerInterval > 0; parseListenerProperties(); init(); }
Source:
<code>public void testGetValidGuidsAndHrids_valid() { MultipleHridSearchData data = new MultipleHridSearchData("test", AtsEditor.WorldEditor); String guid1 = GUID.create(); String guid2 = GUID.create(); String hrid1 = HumanReadableId.generate(); data.setEnteredIds(String.format("%s, %s,%s, PCR 1234", guid1, guid2, hrid1)); List<String> validGuidsAndHrids = data.getValidGuidsAndHrids(); assertTrue(validGuidsAndHrids.contains(guid1)); assertTrue(validGuidsAndHrids.contains(guid2)); <START> assertTrue(validGuidsAndHrids.contains(hrid1)); <END> }</code><technical_language>need check invalid part in</technical_language>

Target:
public void testGetValidGuidsAndHrids_valid() { MultipleHridSearchData data = new MultipleHridSearchData("test", AtsEditor.WorldEditor); String guid1 = GUID.create(); String guid2 = GUID.create(); String hrid1 = HumanReadableId.generate(); data.setEnteredIds(String.format("%s, %s,%s, PCR 1234", guid1, guid2, hrid1)); List<String> validGuidsAndHrids = data.getValidGuidsAndHrids(); assertEquals(3, validGuidsAndHrids.size()); assertTrue(validGuidsAndHrids.contains(guid1)); assertTrue(validGuidsAndHrids.contains(guid2)); assertTrue(validGuidsAndHrids.contains(hrid1)); }