auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Leased<Set<LockToken>> filter(Set<LockToken> tokens, Predicate<HeldLocks> predicate) { Set<LockToken> filtered = Sets.newHashSetWithExpectedSize(tokens.size()); Optional<NanoTime> minStartTime = Optional.empty(); for (LockToken token : tokens) { AsyncResult<HeldLocks> lockResult = heldLocksById.get(token.getRequestId()); if (lockResult != null && lockResult.test(predicate)) { filtered.add(token); NanoTime lastRefreshTime = lockResult.get().lastRefreshTime(); <START> minStartTime = minStartTime.map(t -> lastRefreshTime.isBefore(t) ? lastRefreshTime : t); <END> } } return Leased.of(filtered, leaseWithStart(minStartTime.orElse(NanoTime.now()))); }</code><technical_language>this... right (and a test catch this bug). Right now, empty end of loop pick time. java minStartTime = reduce(minStartTime, lastRefreshTime, Ordering.natural()::min); private static <T> Optional<T> reduce(Optional<T> left, Optional<T> right, BinaryOperator<T> combiner) { return Stream.concat(Streams.stream(left), Streams.stream(right)).reduce(combiner); }</technical_language>

Target:
private Set<LockToken> filter(Set<LockToken> tokens, Predicate<HeldLocks> predicate) { Set<LockToken> filtered = Sets.newHashSetWithExpectedSize(tokens.size()); for (LockToken token : tokens) { AsyncResult<HeldLocks> lockResult = heldLocksById.get(token.getRequestId()); if (lockResult != null && lockResult.test(predicate)) { filtered.add(token); } } return filtered; }
Source:
<code>public void testJoinedSubclassUpdateWithCorrelation() { doInJPA( this::entityManagerFactory, entityManager -> { Master m1 = new SubMaster( 1, null ); entityManager.persist( m1 ); Detail d11 = new Detail( 10, m1 ); entityManager.persist( d11 ); } ); doInJPA( this::entityManagerFactory, entityManager -> { String d = "update SubMaster m set name = (select 'test' from Detail d where d.master = m)"; Query del = entityManager.createQuery( d ); <START> del.executeUpdate(); <END> CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery<Master> query = builder.createQuery( Master.class ); query.select( query.from( Master.class ) ); List<Master> masters = entityManager.createQuery( query ).getResultList(); Assert.assertEquals( 1, masters.size() ); Assert.assertEquals( "test", ((SubMaster) masters.get(0)).name ); } ); }</code><technical_language>copied a test deletes d, del. change that</technical_language>

Target:
public void testJoinedSubclassUpdateWithCorrelation() { doInJPA( this::entityManagerFactory, entityManager -> { Master m1 = new SubMaster( 1, null ); entityManager.persist( m1 ); Detail d11 = new Detail( 10, m1 ); entityManager.persist( d11 ); } ); doInJPA( this::entityManagerFactory, entityManager -> { String u = "update SubMaster m set name = (select 'test' from Detail d where d.master = m)"; Query updateQuery = entityManager.createQuery( u ); updateQuery.executeUpdate(); CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery<Master> query = builder.createQuery( Master.class ); query.select( query.from( Master.class ) ); List<Master> masters = entityManager.createQuery( query ).getResultList(); Assert.assertEquals( 1, masters.size() ); Assert.assertEquals( "test", ((SubMaster) masters.get(0)).name ); } ); }
Source:
<code>public static void logMbps(final long startTime, final long endTime, final long totalBytes, final String objName, final boolean isPutCommand) { final double time = (endTime - startTime == 0)? 1.0: (endTime - startTime)/1000D; final double content = totalBytes/1024D/1024D; final double mbps = content / time; <START> if (isPutCommand) { <END> LOG.info(String.format("Putting %s statistics: Length (%.03f MB), Time (%.03f sec), Mbps (%.03f)", objName, content, time, mbps)); } else { LOG.info(String.format("Getting %s statistics: Length (%.03f MB), Time (%.03f sec), Mbps (%.03f)", objName, content, time, mbps)); } }</code><technical_language>duplicate strings. do this: java final String messagePrefix; if (isPutCommand) { messagePrefix = "Putting"; } else { messagePrefix = "Getting"; } LOG.info(String.format(messagePrefix + " %s".....));</technical_language>

Target:
public static void logMbps(final long startTime, final long endTime, final long totalBytes, final String objName, final boolean isPutCommand) { final double time = (endTime - startTime == 0)? 1.0: (endTime - startTime)/1000D; final double content = totalBytes/1024D/1024D; final double mbps = content / time; final String messagePrefix; if (isPutCommand) { messagePrefix = "Putting"; } else { messagePrefix = "Getting"; } LOG.info(String.format("%s %s statistics: Length (%.03f MB), Time (%.03f sec), Mbps (%.03f)", messagePrefix, objName, content, time, mbps)); }
Source:
<code>public Flux<ByteBuf> body() { <START> return bodyAsByteArray().flatMapMany(bytes -> Flux.just(Unpooled.wrappedBuffer(bytes).retain())); <END> }</code><technical_language>searching for Unpooled.wrappedBuffer other places retain well. this consistent board</technical_language>

Target:
public Flux<ByteBuf> body() { return bodyAsByteArray().flatMapMany(bytes -> Flux.just(Unpooled.wrappedBuffer(bytes))); }
Source:
<code>public void test () throws Exception { final String pillId = "whateva"; final Integer firmwareVersion = 4; final byte[] encryptedMotionData = bytes(0x0F, 0xFB, 0x55, 0x0A, 0xC4, 0x2C, 0x53, 0x03, 0x59, 0x79, 0x0E, 0xC4, 0x5C, 0xD1, 0x43, 0x28, 0xA2, 0x87); final byte[] key = bytes(0xD4, 0xD9, 0xEC, 0x79, 0xC9, 0x24, 0xB6, 0xC1, 0x23, 0xA2, 0x82, 0x4F, 0x47, 0x8A, 0x5E, 0xCB); final SenseCommandProtos.pill_data pillData = SenseCommandProtos.pill_data.newBuilder() .setDeviceId(pillId) .setBatteryLevel(100) .setFirmwareVersion(firmwareVersion) .setMotionDataEntrypted(ByteString.copyFrom(encryptedMotionData)) .setTimestamp(1L) .build(); final TrackerMotion.PillPayloadV2 payloadV2 = TrackerMotion.data(pillData, key, pillId); <START> assertThat(payloadV2.maxAcceleration, is((1072L-383L)*2)); <END> assertThat(payloadV2.onDurationInSeconds, is(2L)); assertThat(payloadV2.motionMask.get(), is(3377699720527872L)); assertThat(payloadV2.cosTheta.get(), is(109L)); }</code><technical_language>constant</technical_language>

Target:
public void test () throws Exception { final String pillId = "whateva"; final Integer firmwareVersion = 4; final byte[] encryptedMotionData = bytes(0x0F, 0xFB, 0x55, 0x0A, 0xC4, 0x2C, 0x53, 0x03, 0x59, 0x79, 0x0E, 0xC4, 0x5C, 0xD1, 0x43, 0x28, 0xA2, 0x87); final byte[] key = bytes(0xD4, 0xD9, 0xEC, 0x79, 0xC9, 0x24, 0xB6, 0xC1, 0x23, 0xA2, 0x82, 0x4F, 0x47, 0x8A, 0x5E, 0xCB); final SenseCommandProtos.pill_data pillData = SenseCommandProtos.pill_data.newBuilder() .setDeviceId(pillId) .setBatteryLevel(100) .setFirmwareVersion(firmwareVersion) .setMotionDataEntrypted(ByteString.copyFrom(encryptedMotionData)) .setTimestamp(1L) .build(); final TrackerMotion.PillPayloadV2 payloadV2 = TrackerMotion.data(pillData, key, pillId); assertThat(payloadV2.maxAcceleration, is((1072L-PILL_1P5_OFFSET) * PILL_1P5_MOTION_MULTIPLIER)); assertThat(payloadV2.onDurationInSeconds, is(2L)); assertThat(payloadV2.motionMask.get(), is(3377699720527872L)); assertThat(payloadV2.cosTheta.get(), is(109L)); }
Source:
<code>private String getDefaultSharedConfigLocation(ILaunchConfiguration config) { String path = IInternalDebugCoreConstants.EMPTY_STRING; try { IResource[] <START> resourcea = <END> config.getMappedResources(); if(resourcea != null) { IProject proj; for (IResource resource : resourcea) { proj = resource.getProject(); if(proj != null && proj.isAccessible()) { return proj.getFullPath().toOSString(); } } } } catch (CoreException e) {DebugUIPlugin.log(e);} return path; }</code><technical_language>rename mappedResources</technical_language>

Target:
private String getDefaultSharedConfigLocation(ILaunchConfiguration config) { String path = IInternalDebugCoreConstants.EMPTY_STRING; try { IResource[] mappedResources = config.getMappedResources(); if(mappedResources != null) { IProject proj; for (IResource resource : mappedResources) { proj = resource.getProject(); if(proj != null && proj.isAccessible()) { return proj.getFullPath().toOSString(); } } } } catch (CoreException e) {DebugUIPlugin.log(e);} return path; }
Source:
<code>private static boolean isValidRevision(String revision) { <START> return revision.indexOf(':') < 0 <END> && !revision.contains("^{") && revision.indexOf('@') < 0; }</code><technical_language>Granting this CL consists of automated refactorings, consider revising other lines of this computation for consistency revised middle</technical_language>

Target:
private static boolean isValidRevision(String revision) { return !revision.contains(":") && !revision.contains("^{") && !revision.contains("@"); }
Source:
<code>public DisksViewRadioGroup() { <START> HorizontalPanel panel = new HorizontalPanel(); <END> Label label = new Label(); label.setText(constants.diskType()); label.getElement().getStyle().setProperty("marginRight", "10px"); label.getElement().getStyle().setProperty("marginBottom", "4px"); panel.add(label); panel.add(getRadioGroupPanel()); initWidget(panel); }</code><technical_language>Please Horizontal panels</technical_language>

Target:
public DisksViewRadioGroup() { FlowPanel panel = new FlowPanel(); Label label = new Label(); label.setText(constants.diskType() + ":"); label.addStyleName("disk-storage-type-group-label"); panel.add(label); panel.add(getRadioGroupPanel()); initWidget(panel); }
Source:
<code>public boolean ipMatchesDomain(String forwardedAddress, String domain) { try { String ipAddress = extractForwardedIp(forwardedAddress); <START> Optional<String> host = reverseDnsLookup.lookup(ipAddress); <END> if (host.isEmpty()) { throw new Exception(format("Host not found for ip address '%s'", ipAddress)); } if (!host.get().endsWith(domain + ".")) { logger.error("Reverse DNS lookup on ip '{}' - resolved domain '{}' does not match '{}'", ipAddress, host.get(), domain); return false; } return true; } catch (Exception e) { logger.error("Reverse DNS Lookup failed: {}", e.getLocalizedMessage()); return false; } }</code><technical_language>I this this a bit more functional. this: java return reverseDnsLookup(ipAddress).map(host -> { if (!host.endsWith(domain + ".")) { logger.error("Reverse DNS lookup ip '{}' - resolved domain '{}' match '{}'", ipAddress, host, domain); return false; } return true; }).orElseThrow(() -> new Exception(format("Host for ip address '%s'", ipAddress)));</technical_language>

Target:
public boolean ipMatchesDomain(String forwardedAddress, String domain) { try { String ipAddress = extractForwardedIp(forwardedAddress); return reverseDnsLookup.lookup(new DnsPointerResourceRecord(ipAddress)).map(host -> { if (!host.endsWith(domain + ".")) { LOGGER.error("Reverse DNS lookup on ip '{}' - resolved domain '{}' does not match '{}'", ipAddress, host, domain); return false; } return true; }).orElseThrow(() -> new Exception(format("Host not found for ip address '%s'", ipAddress))); } catch (Exception e) { LOGGER.error("Reverse DNS Lookup failed: {}", e.getLocalizedMessage()); return false; } }
Source:
<code>public void incrementValue(ITmfEvent event, int quark, long timestamp) throws StateValueTypeException, TimeRangeException, AttributeNotFoundException { <START> ITmfStateSystemBuilder ss = fProvider.getAssignedStateSystem(); <END> int increment = 0; ITmfStateValue incrementValue = getValue(event); if (incrementValue.getType() == ITmfStateValue.Type.INTEGER) { increment = incrementValue.unboxInt(); } else if (incrementValue.getType() == ITmfStateValue.Type.LONG) { increment = (int) incrementValue.unboxLong(); } else { Activator.logWarning("TmfXmlStateValue: The query result increment is not a number type"); } int currentValue = ss.queryOngoingState(quark).unboxInt(); ITmfStateValue value = TmfStateValue.newValueInt(increment + currentValue); processValue(quark, timestamp, value); }</code><technical_language>ITmfStateSystem</technical_language>

Target:
public void incrementValue(ITmfEvent event, int quark, long timestamp) throws StateValueTypeException, TimeRangeException, AttributeNotFoundException { ITmfStateSystem ss = fProvider.getAssignedStateSystem(); ITmfStateValue incrementValue = getValue(event); switch (incrementValue.getType()) { case INTEGER: { int increment = incrementValue.unboxInt(); int currentValue = ss.queryOngoingState(quark).unboxInt(); ITmfStateValue value = TmfStateValue.newValueInt(increment + currentValue); processValue(quark, timestamp, value); break; } case LONG: { long incrementLong = incrementValue.unboxLong(); long currentValue = ss.queryOngoingState(quark).unboxLong(); ITmfStateValue value = TmfStateValue.newValueLong(incrementLong + currentValue); processValue(quark, timestamp, value); break; } case DOUBLE: case NULL: case STRING: default: Activator.logWarning("TmfXmlStateValue: The query result increment is not a number type"); break; } }
Source:
<code>private int extractEntryCodePart(String lawJournalEntryCode, int partNumber) { try { return Integer.parseInt(StringUtils.split(lawJournalEntryCode, LawJournalEntry.ENTRY_CODE_PARTS_SEPARATOR)[partNumber]); } catch (NumberFormatException | IndexOutOfBoundsException e) { <START> throw new IllegalArgumentException(lawJournalEntryCode + " is invalid law journal entry code"); <END> } }</code><technical_language>a method checking correctness of lawJournalEntryCode class</technical_language>

Target:
private int extractEntryCodePart(String lawJournalEntryCode, int partNumber) { return Integer.parseInt(StringUtils.split(lawJournalEntryCode, LawJournalEntry.ENTRY_CODE_PARTS_SEPARATOR)[partNumber]); }
Source:
<code>public Map<Locator, MetricData> getDatapointsForRange( List<Locator> locators, Range range, Granularity gran ) throws IOException { <START> Timer.Context ctx = Instrumentation.getReadTimerContext( "DBasicMetricsRW.getDatapointsForRange" ); <END> try { List<Locator> unknowns = new ArrayList<Locator>(); List<Locator> strings = new ArrayList<Locator>(); List<Locator> booleans = new ArrayList<Locator>(); List<Locator> numerics = new ArrayList<Locator>(); for ( Locator locator : locators ) { Object type; try { type = metadataCache.get( locator, DATA_TYPE_CACHE_KEY ); } catch ( CacheException e ) { LOG.error( "Unable to read cache", e ); unknowns.add( locator ); continue; } DataType metricType = new DataType( (String) type ); if ( type == null || !DataType.isKnownMetricType( metricType ) ) { unknowns.add( locator ); continue; } else if ( metricType.equals( DataType.STRING ) ) { strings.add( locator ); continue; } else if ( metricType.equals( DataType.BOOLEAN ) ) { booleans.add( locator ); continue; } else { numerics.add( locator ); } } Map<Locator, MetricData> metrics = new HashMap<Locator, MetricData>(); String columnFamily = CassandraModel.getBasicColumnFamilyName( gran ); metrics.putAll( super.getDatapointsForRange( numerics, range, columnFamily, gran ) ); metrics.putAll( getBooleanDataForRange( booleans, range ) ); metrics.putAll( getStringDataForRange( strings, range ) ); metrics.putAll( getNumericOrStringDataForRange( unknowns, range, columnFamily, gran ) ); return metrics; } finally { ctx.stop(); } }</code><technical_language>Instrumentation.getReadTimerContext() is meant ColumnFamily name</technical_language>

Target:
public Map<Locator, MetricData> getDatapointsForRange( List<Locator> locators, Range range, Granularity gran ) throws IOException { List<Locator> unknowns = new ArrayList<Locator>(); List<Locator> strings = new ArrayList<Locator>(); List<Locator> booleans = new ArrayList<Locator>(); List<Locator> numerics = new ArrayList<Locator>(); for ( Locator locator : locators ) { Object type; try { type = metadataCache.get( locator, DATA_TYPE_CACHE_KEY ); } catch ( CacheException e ) { LOG.error(String.format("Error looking up locator %s in cache", locator), e); unknowns.add( locator ); continue; } DataType metricType = new DataType( (String) type ); if ( type == null || !DataType.isKnownMetricType( metricType ) ) { unknowns.add( locator ); continue; } else if ( metricType.equals( DataType.STRING ) ) { strings.add( locator ); continue; } else if ( metricType.equals( DataType.BOOLEAN ) ) { booleans.add( locator ); continue; } else { numerics.add( locator ); } } Map<Locator, MetricData> metrics = new HashMap<Locator, MetricData>(); String columnFamily = CassandraModel.getBasicColumnFamilyName( gran ); metrics.putAll( super.getDatapointsForRange( locators, range, columnFamily, gran ) ); metrics.putAll( getBooleanDataForRange( booleans, range ) ); metrics.putAll( getStringDataForRange( strings, range ) ); metrics.putAll( getNumericOrStringDataForRange( unknowns, range, columnFamily, gran ) ); return metrics; }
Source:
<code>public AccountId channelSignIn(ChannelType channelType, CriteriaContext context, SignIn signIn, <START> Validator validator) { <END> Validate.entityThrowingException(validator, signIn); String cacheKey = (channelType == ChannelType.EMAIL) ? getPhoneSignInCacheKey(signIn.getPhone(), signIn.getStudyId()) : getEmailSignInCacheKey(signIn.getEmail(), signIn.getStudyId()); String storedToken = cacheProvider.getObject(cacheKey, String.class); if (storedToken == null || !storedToken.equals(signIn.getToken())) { throw new AuthenticationFailedException(); } cacheProvider.removeObject(cacheKey); return signIn.getAccountId(); }</code><technical_language>unit tests for channelSignIn</technical_language>

Target:
public AccountId channelSignIn(ChannelType channelType, CriteriaContext context, SignIn signIn, Validator validator) { Validate.entityThrowingException(validator, signIn); String cacheKey = (channelType == ChannelType.EMAIL) ? getEmailSignInCacheKey(signIn.getEmail(), signIn.getStudyId()) : getPhoneSignInCacheKey(signIn.getPhone(), signIn.getStudyId()); String storedToken = cacheProvider.getObject(cacheKey, String.class); if (storedToken == null || !storedToken.equals(signIn.getToken())) { throw new AuthenticationFailedException(); } cacheProvider.removeObject(cacheKey); return signIn.getAccountId(); }
Source:
<code>private void verifyPersonConsumer(ConsumerDTO consumer, ConsumerType type, Owner owner, String username, Principal principal) { UserInfo user = null; try { user = userService.findByLogin(username); } catch (UnsupportedOperationException e) { log.warn("User service does not allow user lookups, cannot verify person consumer."); } if (user == null) { <START> throw new NotFoundException(i18n.tr(this.i18n.tr("User not found: {0}", username))); <END> } if (!principal.canAccess(owner, SubResource.NONE, Access.ALL) && !principal.hasFullAccess()) { throw new ForbiddenException(i18n.tr("User \"{0}\" has no roles for organization \"{1}\"", user.getUsername(), owner.getKey())); } if (type.isType(ConsumerTypeEnum.PERSON)) { Consumer existing = consumerCurator.findByUsername(user.getUsername()); if (existing != null && this.consumerTypeCurator.getConsumerType(existing).isType(ConsumerTypeEnum.PERSON)) { throw new BadRequestException( i18n.tr("User \"{0}\" has already registered a personal consumer", user.getUsername())); } consumer.setName(user.getUsername()); } }</code><technical_language>nested calls i18n.tr now</technical_language>

Target:
private void verifyPersonConsumer(ConsumerDTO consumer, ConsumerType type, Owner owner, String username, Principal principal) { UserInfo user = null; try { user = userService.findByLogin(username); } catch (UnsupportedOperationException e) { log.warn("User service does not allow user lookups, cannot verify person consumer."); } if (user == null) { throw new NotFoundException(this.i18n.tr("User not found: {0}", username)); } if (!principal.canAccess(owner, SubResource.NONE, Access.ALL) && !principal.hasFullAccess()) { throw new ForbiddenException(i18n.tr("User \"{0}\" has no roles for organization \"{1}\"", user.getUsername(), owner.getKey())); } if (type.isType(ConsumerTypeEnum.PERSON)) { Consumer existing = consumerCurator.findByUsername(user.getUsername()); if (existing != null && this.consumerTypeCurator.getConsumerType(existing).isType(ConsumerTypeEnum.PERSON)) { throw new BadRequestException( i18n.tr("User \"{0}\" has already registered a personal consumer", user.getUsername())); } consumer.setName(user.getUsername()); } }
Source:
<code><START> private static Integer getRunTimeForAllTests( Map<String, List<WrappedReportEntry>> methodRunHistoryMap ) <END> { Integer totalTimeForSuite = 0; for ( Map.Entry<String, List<WrappedReportEntry>> entry : methodRunHistoryMap.entrySet() ) { List<WrappedReportEntry> methodEntryList = entry.getValue(); if ( methodEntryList == null ) { throw new IllegalStateException( "Get null test method run history" ); } if ( methodEntryList.size() == 0 ) { continue; } TestResultType resultType = getTestResultType( methodEntryList ); switch ( resultType ) { case success: case error: case failure: totalTimeForSuite = totalTimeForSuite + methodEntryList.get( 0 ).getElapsed(); break; case flake: for ( WrappedReportEntry singleRunEntry : methodEntryList ) { if ( singleRunEntry.getReportEntryType() == ReportEntryType.success ) { totalTimeForSuite = totalTimeForSuite + singleRunEntry.getElapsed(); break; } } break; case skipped: break; default: throw new IllegalStateException( "Get unknown test result type" ); } } return totalTimeForSuite; }</code><technical_language>wrapper type here? int do well? Btw, great if finally sum positive values :wink:</technical_language>

Target:
private static int getRunTimeForAllTests( Map<String, List<WrappedReportEntry>> methodRunHistoryMap ) { int totalTimeForSuite = 0; for ( Map.Entry<String, List<WrappedReportEntry>> entry : methodRunHistoryMap.entrySet() ) { List<WrappedReportEntry> methodEntryList = entry.getValue(); if ( methodEntryList == null ) { throw new IllegalStateException( "Get null test method run history" ); } if ( methodEntryList.size() == 0 ) { continue; } TestResultType resultType = getTestResultType( methodEntryList ); switch ( resultType ) { case success: case error: case failure: totalTimeForSuite = totalTimeForSuite + methodEntryList.get( 0 ).getElapsed(); break; case flake: for ( WrappedReportEntry singleRunEntry : methodEntryList ) { if ( singleRunEntry.getReportEntryType() == ReportEntryType.success ) { totalTimeForSuite = totalTimeForSuite + singleRunEntry.getElapsed(); break; } } break; case skipped: break; default: throw new IllegalStateException( "Get unknown test result type" ); } } return totalTimeForSuite; }
Source:
<code>public void shouldGetOrderGroupByUuid() throws Exception { <START> MockHttpServletRequest post_req = newPostRequest(getURI(), json); <END> SimpleObject result = deserialize(handle(post_req)); String uuid = (String) PropertyUtils.getProperty(result, "uuid"); MockHttpServletRequest req = request(RequestMethod.GET, getURI() + "/"+uuid); SimpleObject response = deserialize(handle(req)); Assert.assertEquals(patient_uuid, Util.getByPath(response, "patient/uuid")); Assert.assertEquals(encounter_uuid,Util.getByPath(response, "encounter/uuid")); Assert.assertEquals(orderSet_uuid,Util.getByPath(response, "orderSet/uuid")); Assert.assertEquals(display, Util.getByPath(response, "display")); }</code><technical_language>If testing a Get, a POST</technical_language>

Target:
public void shouldGetOrderGroupByUuid() throws Exception { OrderGroup orderGroup = Context.getOrderService().getOrderGroupByUuid(RestTestConstants1_12.ORDER_GROUP_UUID); Patient patient = orderGroup.getPatient(); Encounter encounter = orderGroup.getEncounter(); OrderSet orderSet = orderGroup.getOrderSet(); Order order = Context.getOrderService().getOrder(1); Order order2 = Context.getOrderService().getOrder(3); List<Order> orders = new ArrayList<Order>(); orders.add(order); orders.add(order2); orderGroup.setOrders(orders); order.setOrderGroup(orderGroup); order2.setOrderGroup(orderGroup); MockHttpServletRequest req = request(RequestMethod.GET, getURI() + "/" + RestTestConstants1_12.ORDER_GROUP_UUID); SimpleObject response = deserialize(handle(req)); Assert.assertEquals(patient.getUuid(), Util.getByPath(response, "patient/uuid")); Assert.assertEquals(encounter.getUuid(), Util.getByPath(response, "encounter/uuid")); Assert.assertEquals(orderSet.getUuid(), Util.getByPath(response, "orderSet/uuid")); Assert.assertEquals(RestTestConstants1_12.ORDER_GROUP_DISPLAY, Util.getByPath(response, "display")); List<Order> orderList = (List<Order>) PropertyUtils.getProperty(response, "orders"); Assert.assertEquals(2, orderList.size()); }
Source:
<code>public boolean isRecommendationEnabled(String tenantDomain) { if (recommendationEnvironment != null) { if (recommendationEnvironment.isApplyForAllTenants()) { return true; } else { JSONObject apiTenantConfig = null; try { String content = apimRegistryService .getConfigRegistryResourceContent(tenantDomain, APIConstants.API_TENANT_CONF_LOCATION); if (content != null) { JSONParser parser = new JSONParser(); apiTenantConfig = (JSONObject) parser.parse(content); } return getTenantConfigValue(tenantDomain, apiTenantConfig, APIConstants.API_TENANT_CONF_ENABLE_RECOMMENDATION_KEY); } catch (UserStoreException e) { log.error("UserStoreException thrown when getting API tenant config from registry", e); } catch (RegistryException e) { log.error("RegistryException thrown when getting API tenant config from registry", e); } catch (ParseException e) { log.error("ParseException thrown when passing API tenant config from registry", e); } catch (APIManagementException e) { <START> log.debug(e.getMessage()); <END> } } } return false; }</code><technical_language>log a message</technical_language>

Target:
public boolean isRecommendationEnabled(String tenantDomain) { if (recommendationEnvironment != null) { if (recommendationEnvironment.isApplyForAllTenants()) { return true; } else { try { org.json.JSONObject tenantConfig = null; Cache tenantConfigCache = APIUtil.getCache( APIConstants.API_MANAGER_CACHE_MANAGER, APIConstants.TENANT_CONFIG_CACHE_NAME, APIConstants.TENANT_CONFIG_CACHE_MODIFIED_EXPIRY, APIConstants.TENANT_CONFIG_CACHE_ACCESS_EXPIRY); String cacheName = tenantDomain + "_" + APIConstants.TENANT_CONFIG_CACHE_NAME; if (tenantConfigCache.containsKey(cacheName)) { tenantConfig = (org.json.JSONObject) tenantConfigCache.get(cacheName); } else { String content = apimRegistryService .getConfigRegistryResourceContent(tenantDomain, APIConstants.API_TENANT_CONF_LOCATION); tenantConfig = new org.json.JSONObject(content); tenantConfigCache.put(cacheName, tenantConfig); } if (tenantConfig.has(APIConstants.API_TENANT_CONF_ENABLE_RECOMMENDATION_KEY)) { Object value = tenantConfig.get(APIConstants.API_TENANT_CONF_ENABLE_RECOMMENDATION_KEY); return Boolean.parseBoolean(value.toString()); } } catch (UserStoreException | RegistryException | NullPointerException e) { log.error("Error occurred when getting API tenant config from registry", e); } } } return false; }
Source:
<code>private boolean evaluateNode(TreeMapState state, String[] pathValues, DataTreeNode reference) { boolean updated = false; if (reference != null) { FieldValueList valueList = new FieldValueList(state.getFormat()); if (values.update(valueList, reference, state) == 0) { return false; } switch (childMatch) { case AS_LIST: updated = valueList.updateBundleWithListAppend(state.getBundle()); break; case AS_MAP: updated = valueList.updateBundleWithMapAppend(state.getBundle()); break; case NONE: updated = valueList.updateBundle(state.getBundle()); break; default: <START> throw new IllegalStateException("Known childMatch value " + childMatch); <END> } if (updated) { if (debug > 0) { debug(true); } } } else { logFailure(pathValues); } return updated; }</code><technical_language>supposed "Unknown" "Known"</technical_language>

Target:
private boolean evaluateNode(TreeMapState state, String[] pathValues, DataTreeNode reference) { boolean updated = false; if (reference != null) { FieldValueList valueList = new FieldValueList(state.getFormat()); if (values.update(valueList, reference, state) == 0) { return false; } updated = childMatch.updateBundle(valueList, state.getBundle()); if (updated) { if (debug > 0) { debug(true); } } } else { logFailure(pathValues); } return updated; }
Source:
<code>private void doFormating(StringBuilder buffer, String substring, Object... args) { String selector; String pattern; int colonPos = substring.indexOf(':'); if (colonPos == -1) { selector = substring; pattern = null; } else { selector = substring.substring(0, colonPos); pattern = substring.substring(colonPos + 1); } int pointPos = selector.indexOf('.'); Object object; try { if (pointPos == -1) { object = args[Integer.parseInt(selector)]; } else { int lastPointPos = pointPos; object = args[Integer.parseInt(selector.substring(0, pointPos))]; pointPos = selector.indexOf('.', pointPos + 1); while (pointPos != -1) { object = extractField(object, selector.substring(lastPointPos + 1, pointPos)); lastPointPos = pointPos; pointPos = selector.indexOf('.', pointPos + 1); } object = extractField(object, selector.substring(lastPointPos + 1)); } } catch (FormatterException e) { throw e; } catch (Throwable e) { throw new FormatterException( <START> "An error while extracting field occured", e); <END> } if (pattern == null) { if (object != null) { buffer.append(object.toString()); } } else { boolean thereIsNoGoodFormatter = true; for (StringFormatterExtension ext : extensions) { if (ext.supports(object.getClass())) { ext.format(buffer, object, pattern); thereIsNoGoodFormatter = false; break; } } if (thereIsNoGoodFormatter) { throw new FormatterException( "There is no good formatter for class " + object.getClass().getName()); } } }</code><technical_language>occurred</technical_language>

Target:
private void doFormating(StringBuilder buffer, String substring, Object... args) { String selector; String pattern; int colonPos = substring.indexOf(':'); if (colonPos == -1) { selector = substring; pattern = null; } else { selector = substring.substring(0, colonPos); pattern = substring.substring(colonPos + 1); } int pointPos = selector.indexOf('.'); Object object; try { if (pointPos == -1) { object = args[Integer.parseInt(selector)]; } else { int lastPointPos = pointPos; object = args[Integer.parseInt(selector.substring(0, pointPos))]; pointPos = selector.indexOf('.', pointPos + 1); while (pointPos != -1) { object = extractField(object, selector.substring(lastPointPos + 1, pointPos)); lastPointPos = pointPos; pointPos = selector.indexOf('.', pointPos + 1); } object = extractField(object, selector.substring(lastPointPos + 1)); } } catch (FormatterException e) { throw e; } catch (Throwable e) { throw new FormatterException( "An error while extracting field occurred", e); } if (pattern == null) { if (object != null) { buffer.append(object.toString()); } } else { boolean thereIsNoGoodFormatter = true; for (StringFormatterExtension ext : extensions) { if (ext.supports(object.getClass())) { ext.format(buffer, object, pattern); thereIsNoGoodFormatter = false; break; } } if (thereIsNoGoodFormatter) { throw new FormatterException( "There is no good formatter for class " + object.getClass().getName()); } } }
Source:
<code>public ReconcilerRegistry() { Platform.getExtensionRegistry().addRegistryChangeListener(new IRegistryChangeListener() { @Override public void registryChanged(IRegistryChangeEvent event) { outOfSync = true; <START> highlightOutOfSync = true; <END> } }, EXTENSION_POINT_ID); Platform.getExtensionRegistry().addRegistryChangeListener(new IRegistryChangeListener() { @Override public void registryChanged(IRegistryChangeEvent event) { outOfSync = true; highlightOutOfSync = true; } }, HIGHLIGHT_EXTENSION_POINT_ID); }</code><technical_language>a change regular reconcilier extension point mark highlight outofsync</technical_language>

Target:
public ReconcilerRegistry() { Platform.getExtensionRegistry().addRegistryChangeListener(event -> { outOfSync = true; }, EXTENSION_POINT_ID); Platform.getExtensionRegistry().addRegistryChangeListener(event -> { highlightOutOfSync = true; }, HIGHLIGHT_EXTENSION_POINT_ID); }
Source:
<code>public Term parse(NonTerminal nt, int position) { assert nt != null : "Start symbol cannot be null."; activateStateCall(s.stateCalls.get(new StateCall.Key(s.ntCalls.get( new NonTerminalCall.Key(nt, position)), position, nt.entryState)), Function.IDENTITY); for (StateReturn stateReturn; (stateReturn = s.stateReturnWorkList.dequeue()) != null;) { this.workListStep(stateReturn); } Ambiguity result = Ambiguity.apply(new HashSet<>()); for(StateReturn stateReturn : s.ntCalls.get(new NonTerminalCall.Key(nt,position)).exitStateReturns) { if (stateReturn.key.stateEnd == s.input.length()) { result.items().add(KList.apply(ConsPStack.singleton(Ambiguity.apply(stateReturn.function.values)))); } } if(result.equals(Ambiguity.apply())) { CharSequence content = s.input; ParseError perror = getErrors(); String msg = content.length() == perror.position ? "Parse error: unexpected end of file." : "Parse error: unexpected character '" + content.charAt(perror.position) + "'."; <START> if (content.toString().indexOf('`')>=0) msg += "Please use '(' or ')' instead of '`'"; <END> Location loc = new Location(perror.line, perror.column, perror.line, perror.column + 1); Source source = perror.source; throw new ParseFailedException(new KException( ExceptionType.ERROR, KExceptionGroup.INNER_PARSER, msg, source, loc)); } return result; }</code><technical_language>This fail badly, error message misleading in some cases. If language includes a terminal backtick, user a proper error location, suggest parenthesis instead of fixing problem</technical_language>

Target:
public Term parse(NonTerminal nt, int position) { assert nt != null : "Start symbol cannot be null."; activateStateCall(s.stateCalls.get(new StateCall.Key(s.ntCalls.get( new NonTerminalCall.Key(nt, position)), position, nt.entryState)), Function.IDENTITY); for (StateReturn stateReturn; (stateReturn = s.stateReturnWorkList.dequeue()) != null;) { this.workListStep(stateReturn); } Ambiguity result = Ambiguity.apply(new HashSet<>()); for(StateReturn stateReturn : s.ntCalls.get(new NonTerminalCall.Key(nt,position)).exitStateReturns) { if (stateReturn.key.stateEnd == s.input.length()) { result.items().add(KList.apply(ConsPStack.singleton(Ambiguity.apply(stateReturn.function.values)))); } } if(result.equals(Ambiguity.apply())) { CharSequence content = s.input; ParseError perror = getErrors(); String msg = content.length() == perror.position ? "Parse error: unexpected end of file." : "Parse error: unexpected character '" + content.charAt(perror.position) + "'."; if (content.toString().indexOf('`')>=0) msg += "Using backtick, '`', for K brackets is deprecated. If you are using it for this purpose, please use regular parenthesis, '(' and ')', instead."; Location loc = new Location(perror.line, perror.column, perror.line, perror.column + 1); Source source = perror.source; throw new ParseFailedException(new KException( ExceptionType.ERROR, KExceptionGroup.INNER_PARSER, msg, source, loc)); } return result; }
Source:
<code>public void testSolveSymbolInTypeCantResolveNonExistantField() { SymbolReference<? extends ResolvedValueDeclaration> solvedSymbol = symbolSolver.solveSymbolInType(classDeclarationConcreteClass, "FIELD_THAT_DOES_NOT_EXIST"); assertFalse(solvedSymbol.isSolved()); try { solvedSymbol.getCorrespondingDeclaration(); } catch (Exception e) { assertTrue(e instanceof UnsupportedOperationException); <START> assertNull(e.getMessage()); <END> return; } fail("Expected UnsupportedOperationException when requesting CorrespondingDeclaration on unsolved SymbolRefernce"); }</code><technical_language>if message null in future</technical_language>

Target:
public void testSolveSymbolInTypeCantResolveNonExistantField() { SymbolReference<? extends ResolvedValueDeclaration> solvedSymbol = symbolSolver.solveSymbolInType(classDeclarationConcreteClass, "FIELD_THAT_DOES_NOT_EXIST"); assertFalse(solvedSymbol.isSolved()); try { solvedSymbol.getCorrespondingDeclaration(); } catch (Exception e) { assertTrue(e instanceof UnsupportedOperationException); assertEquals("CorrespondingDeclaration not available for unsolved symbol.", e.getMessage()); return; } fail("Expected UnsupportedOperationException when requesting CorrespondingDeclaration on unsolved SymbolRefernce"); }
Source:
<code>public String getHelpText() { <START> return EMPTY_STRING; <END> }</code><technical_language>I thought idea abstract class hide this method, implementer forced effort write text..</technical_language>

Target:
public String getHelpText() { return Messages.getMessage(Messages.AspectHelpText_Channel); }
Source:
<code>private static void updateOption(VdcOption option) { Map<String, Object> values = _vdcOptionCache.get(option.getoption_name()); if (values == null) { values = new HashMap<String, Object>(); _vdcOptionCache.put(option.getoption_name(), values); } <START> log.info("In updateOption decrypting and saving option "+option.getoption_name()+" version = "+option.getversion()); <END> values.put(option.getversion(), GetValue(option)); }</code><technical_language>This more a debug me. please remove this one, log.debug</technical_language>

Target:
private static void updateOption(VdcOption option) { Map<String, Object> values = _vdcOptionCache.get(option.getoption_name()); if (values == null) { values = new HashMap<String, Object>(); _vdcOptionCache.put(option.getoption_name(), values); } values.put(option.getversion(), GetValue(option)); }
Source:
<code>public void setup() throws Exception { super.setup(); final DB dbx = db; dbx.createCollection(COLL_NAME, null); controller = new MongoCRUDController(null, new DBResolver() { @Override public DB get(MongoDataStore store) { return dbx; } @Override public MongoConfiguration getConfiguration(MongoDataStore store) { return null; } <START> @Override <END> public List<MongoConfiguration> getConfigurations() { return null; } }); }</code><technical_language>Whats lightblue project standard tabs v space? of esb do 4 spaces for a tab everywhere. I dont care is long consistent a project. standard great, ill settle</technical_language>

Target:
public void setup() throws Exception { super.setup(); final DB dbx = db; dbx.createCollection(COLL_NAME, null); controller = new MongoCRUDController(null, new DBResolver() { @Override public DB get(MongoDataStore store) { return dbx; } @Override public MongoConfiguration getConfiguration(MongoDataStore store) { return null; } @Override public Collection<MongoConfiguration> getConfigurations() { return null; } }); }
Source:
<code>protected List<String> getHostNames(Label label) { <START> ArrayList<String> hostNames = new ArrayList<>(); <END> if (!entitiesNameMap.isEmpty() && !label.getHosts().isEmpty()) { label.getHosts().forEach(id -> { String hostName = entitiesNameMap.get(id); if (hostName != null && !hostName.isEmpty()) { hostNames.add(hostName); } }); Collections.sort(hostNames); } return hostNames; }</code><technical_language>List</technical_language>

Target:
protected List<String> getHostNames(Label label) { List<String> hostNames = new ArrayList<>(); if (!entitiesNameMap.isEmpty() && !label.getHosts().isEmpty()) { label.getHosts().forEach(id -> { String hostName = entitiesNameMap.get(id); if (hostName != null && !hostName.isEmpty()) { hostNames.add(hostName); } }); Collections.sort(hostNames); } return hostNames; }
Source:
<code>public void setupJetifier(String version) { if (!version.equals(JetifierExtension.JETIFIER_VERSION)) { LOG.warn("Using jetifier version other than %s; This might result in problems with the tool", JetifierExtension.JETIFIER_VERSION); } Configuration jetifierConfig = project.getConfigurations().maybeCreate(JETIFIER_DEPS_CONFIG); DependencyHandler handler = project.getDependencies(); JETIFIER_MODULES .stream() .map(module -> String.format("%s:%s:%s", JETIFIER_GROUP, module, version)) .forEach(dependency -> handler.add(JETIFIER_DEPS_CONFIG, dependency)); <START> handler.add(JETIFIER_DEPS_CONFIG, "commons-cli:commons-cli:1.3.1"); <END> dependencies = new DependencyCache(project, ProjectUtil.getDependencyManager(project)).build(jetifierConfig); }</code><technical_language>lets move commons cli a constant</technical_language>

Target:
public void setupJetifier(String version) { if (!version.equals(JetifierExtension.DEFAULT_JETIFIER_VERSION)) { LOG.warn("Using jetifier version other than %s; This might result in problems with the tool", JetifierExtension.DEFAULT_JETIFIER_VERSION); } Configuration jetifierConfig = project.getConfigurations().maybeCreate(JETIFIER_DEPS_CONFIG); DependencyHandler handler = project.getDependencies(); JETIFIER_MODULES .stream() .map(module -> String.format("%s:%s:%s", JETIFIER_GROUP, module, version)) .forEach(dependency -> handler.add(JETIFIER_DEPS_CONFIG, dependency)); handler.add(JETIFIER_DEPS_CONFIG, COMMONS_CLI_DEP); dependencies = new DependencyCache(project, ProjectUtil.getDependencyManager(project)).build(jetifierConfig); }
Source:
<code>public Tuple(Object... values) { <START> this.values = Arrays.asList(values); <END> }</code><technical_language>minor point: I prefer a static import of org.assertj.core.util.Lists.list for conciseness (feel free ignore me)</technical_language>

Target:
public Tuple(Object... values) { this.values = list(values); }
Source:
<code>private void validateListenerConfig() { if (!eventListenerConfigurations.isEmpty() && eventNotifier instanceof DisabledCacheEventNotificationService) { if (orderedExecutor == null && unOrderedExecutor == null) { <START> throw new IllegalArgumentException("Listeners will not work unless exceutors or EventDispatcher is configured."); <END> } } }</code><technical_language>typo in exception message</technical_language>

Target:
private void validateListenerConfig() { if (!eventListenerConfigurations.isEmpty() && eventDispatcher instanceof DisabledCacheEventNotificationService) { if (orderedExecutor == null && unOrderedExecutor == null) { throw new IllegalArgumentException("Listeners will not work unless Executors or EventDispatcher is configured."); } } }
Source:
<code>protected static boolean canAttachPrestartedVmToUser(Guid vmId, boolean isStatefulPool, List<String> messages) { <START> return !vmAssignedToUser(vmId, messages) && (isStatefulPool || vmIsRunningStateless(vmId)); <END> }</code><technical_language>a distinguish VM pool is running for installation purpose VM is running part of pool - do in case of stateful pools? some time I thought changing this mechanism VM pool started a part of pool run-once (but breaks API..), apply approach</technical_language>

Target:
protected static boolean canAttachPrestartedVmToUser(Guid vmId, boolean isStatefulPool, List<String> messages) { return !vmAssignedToUser(vmId, messages) && (isStatefulPool && !vmIsStartedByRunOnce(vmId) || vmIsRunningStateless(vmId)); }
Source:
<code>public boolean hit(World world, int x, int y, int z, Direction side, GameProfile profile) { <START> EntityPlayerMP player = setUpPlayer(profile, world, x, y, z, null); <END> EnumFacing facing = DirectionFacingProvider.directionMap.get(side); boolean result = onBlockClicked(player, new BlockPos(x, y, z), facing); tearDownPlayer(player); return result; }</code><technical_language>I imagine this PR is this contained good try catch blocks so: java try (SpongeFakePlayer player = setUpPlayer(profile, world, x, y, z null)) { EnumFacing..... // yadda yadda yadda } In sense SpongeFakePlayer AutoCloseable call tearDownPlayer properly. This play pushing CauseStackManager for game profile object etc</technical_language>

Target:
public boolean hit(World world, int x, int y, int z, Direction side, GameProfile profile) { return setUpPlayer(profile, world, x, y, z, null, player -> { EnumFacing facing = DirectionFacingProvider.directionMap.get(side); return onBlockClicked(player, new BlockPos(x, y, z), facing); }); }
Source:
<code>public static void registerServerLifeCycleOperationsTransformers(ResourceTransformationDescriptionBuilder builder) { builder.addOperationTransformationOverride(SUSPEND_SERVERS).setReject().end() .addOperationTransformationOverride(RESUME_SERVERS).setReject().end() .addOperationTransformationOverride(STOP_SERVERS) .setCustomOperationTransformer((context, address, operation) -> { <START> if (operation.hasDefined(ModelDescriptionConstants.TIMEOUT)) { END> return new OperationTransformer.TransformedOperation(operation, new OperationRejectionPolicy() { @Override public boolean rejectOperation(ModelNode preparedResult) { return true; } @Override public String getFailureDescription() { return ControllerLogger.ROOT_LOGGER.rejectedOperationAttributes(operation, Collections.singleton(TIMEOUT.getName())); } }, OperationResultTransformer.ORIGINAL_RESULT); } return new OperationTransformer.TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); }) .end(); }</code><technical_language>builder for this .addRejectCheck() works similar for attributes, called OperationTransformationOverrideBuilder applies operation parameters</technical_language>

Target:
public static void registerServerLifeCycleOperationsTransformers(ResourceTransformationDescriptionBuilder builder) { builder.addOperationTransformationOverride(SUSPEND_SERVERS).setReject().end() .discardOperations(RESUME_SERVERS) .addOperationTransformationOverride(STOP_SERVERS) .addRejectCheck(RejectAttributeChecker.DEFINED, TIMEOUT) .end(); }
Source:
<code>public void locatorLauncherUsesLog4jConfigurationFile() throws Exception { ProcessBuilder processBuilder = new ProcessBuilder() .redirectErrorStream(true) .redirectOutput(stdoutFile.toFile()) .directory(temporaryFolder.getRoot()) <START> .command("java", <END> "-Dgemfire.enable-cluster-configuration=false", "-Dgemfire.jmx-manager=false", "-Dgemfire.jmx-manager-start=false", "-Djava.awt.headless=true", "-Dlog4j.configurationFile=" + configFile.toAbsolutePath(), "-cp", geodeDependencies.toFile().getAbsolutePath(), "org.apache.geode.distributed.LocatorLauncher", "start", LOCATOR_NAME, "--port", String.valueOf(locatorPort)); System.out.println("Environment: " + System.getenv()); System.out.println("Launching command: " + processBuilder.command()); locator = processBuilder .start(); assertThat(locator.isAlive()).isTrue(); await().untilAsserted(() -> { assertThat(locatorLogFile) .doesNotExist(); assertThat(pulseLogFile) .doesNotExist(); LogFileAssert.assertThat(stdoutFile.toFile()) .exists() .contains( "Unable to start management service: Could not start the manager because the gemfire property \"jmx-manager\" is false.") .contains("Starting server location for Distribution Locator") .doesNotContain("geode-pulse war file was not found") .doesNotContain("java.lang.IllegalStateException: No factory method found for class"); }); }</code><technical_language>If system property java.home is defined, please System.getProperty("java.home")+"/bin/java" instead. java if system property java.home is defined</technical_language>

Target:
public void locatorLauncherUsesLog4jConfigurationFile() throws Exception { ProcessBuilder processBuilder = new ProcessBuilder() .redirectErrorStream(true) .redirectOutput(stdoutFile.toFile()) .directory(temporaryFolder.getRoot()) .command(javaBin.toFile().getAbsolutePath(), "-Dgemfire.enable-cluster-configuration=false", "-Dgemfire.jmx-manager=false", "-Dgemfire.jmx-manager-start=false", "-Djava.awt.headless=true", "-Dlog4j.configurationFile=" + configFile.toAbsolutePath(), "-cp", geodeDependencies.toFile().getAbsolutePath(), "org.apache.geode.distributed.LocatorLauncher", "start", LOCATOR_NAME, "--port", String.valueOf(locatorPort)); System.out.println("Environment: " + System.getenv()); System.out.println("Launching command: " + processBuilder.command()); locator = processBuilder .start(); assertThat(locator.isAlive()).isTrue(); await().untilAsserted(() -> { assertThat(locatorLogFile) .as(locatorLogFile.toFile().getAbsolutePath()) .doesNotExist(); assertThat(pulseLogFile) .as(pulseLogFile.toFile().getAbsolutePath()) .doesNotExist(); LogFileAssert.assertThat(stdoutFile.toFile()) .as(stdoutFile.toFile().getAbsolutePath()) .exists() .contains( "Unable to start management service: Could not start the manager because the gemfire property \"jmx-manager\" is false.") .contains("Starting server location for Distribution Locator") .doesNotContain("geode-pulse war file was not found") .doesNotContain("java.lang.IllegalStateException: No factory method found for class"); }); }
Source:
<code>public RelationshipView(String type, Doi doi, String title) { this.type = Objects.requireNonNull(type); <START> this.doi = Objects.requireNonNull(doi).getName(); <END> this.title = title; }</code><technical_language>This doi.getName(), serves purpose Objects.requireNonNull: throwing NPE if doi is null</technical_language>

Target:
public RelationshipView(String type, Doi doi, String title) { this.type = Objects.requireNonNull(type); this.doi = doi.getName(); this.title = Objects.requireNonNull(title); }