auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Set<IMarketplaceRating> getAllRatingsInLastXDays(int numberOfDaysBack) { final Calendar queryDate = Calendar.getInstance(); <START> queryDate.add(Calendar.DAY_OF_YEAR, 0 - numberOfDaysBack); <END> final TypedQuery<MarketplaceRatingImpl> query = this.createQuery( this.createCriteriaQuery( new Function< CriteriaBuilder, CriteriaQuery<MarketplaceRatingImpl>>() { @Override public CriteriaQuery<MarketplaceRatingImpl> apply( CriteriaBuilder input) { final CriteriaQuery<MarketplaceRatingImpl> criteriaQuery = input.createQuery(MarketplaceRatingImpl.class); final Root<MarketplaceRatingImpl> definitionRoot = criteriaQuery.from(MarketplaceRatingImpl.class); Predicate ratingDatePredicate = input.greaterThanOrEqualTo( definitionRoot.<java.util.Date>get( "ratingDate"), queryDate.getTime()); criteriaQuery .select(definitionRoot) .where(ratingDatePredicate); return criteriaQuery; } })); return new HashSet<IMarketplaceRating>(query.getResultList()); }</code><technical_language>question: Java 8 Time processing utils simplify/clarify code? <LINK_1> continued <LINK_0></technical_language>

Target:
public Set<IMarketplaceRating> getAllRatingsInLastXDays(int numberOfDaysBack) { LocalDateTime todayMinusNumberOfDaysBack = LocalDateTime.now().minusDays(numberOfDaysBack); final TypedQuery<MarketplaceRatingImpl> query = this.createQuery( this.createCriteriaQuery( new Function< CriteriaBuilder, CriteriaQuery<MarketplaceRatingImpl>>() { @Override public CriteriaQuery<MarketplaceRatingImpl> apply( CriteriaBuilder input) { final CriteriaQuery<MarketplaceRatingImpl> criteriaQuery = input.createQuery(MarketplaceRatingImpl.class); final Root<MarketplaceRatingImpl> definitionRoot = criteriaQuery.from(MarketplaceRatingImpl.class); Predicate ratingDatePredicate = input.greaterThanOrEqualTo( definitionRoot.<java.util.Date>get( "ratingDate"), todayMinusNumberOfDaysBack.toDate()); criteriaQuery .select(definitionRoot) .where(ratingDatePredicate); return criteriaQuery; } })); return new HashSet<IMarketplaceRating>(query.getResultList()); }
Source:
<code><START> private void addTaskByName(Project p, String name, List<Task> allCompileTasks) { <END> try { allCompileTasks.add(p.getTasks().getByName(name)); } catch (UnknownTaskException e) { } }</code><technical_language>![MAJOR](<LINK_1> "addTaskByName" a "static" method. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private static void addTaskByName(Project p, String name, List<Task> allCompileTasks) { try { allCompileTasks.add(p.getTasks().getByName(name)); } catch (UnknownTaskException e) { } }
Source:
<code>public void serializeCollectionsSingletonMap() { MoveOrCopyParameters params = new MoveOrCopyParameters( <START> Guid.createGuidFromString("f455686a-79cc-11e6-8c65-54ee755c6cc7"), <END> Guid.createGuidFromString("f970c5f6-79cc-11e6-bc8f-54ee755c6cc7")); params.setImageToDestinationDomainMap( Collections.singletonMap(Guid.createGuidFromString("9edb6526-7ab5-11e6-b829-54ee755c6cc7"), Guid.createGuidFromString("c097a788-7ab5-11e6-849b-54ee755c6cc7"))); JsonObjectSerializer serializer = new JsonObjectSerializer(); String json = serializer.serialize(params); assertTrue(json.length() > 0); MoveOrCopyParameters deserializedParams = new JsonObjectDeserializer().deserialize( json, MoveOrCopyParameters.class); assertEquals(params.getContainerId(), deserializedParams.getContainerId()); assertEquals(params.getExecutionReason(), deserializedParams.getExecutionReason()); }</code><technical_language>actual Guid important 'Guid.newGuid()' for this for next test</technical_language>

Target:
public void serializeCollectionsSingletonMap() { MoveOrCopyParameters params = new MoveOrCopyParameters(Guid.newGuid(), Guid.newGuid()); params.setImageToDestinationDomainMap( Collections.singletonMap(Guid.createGuidFromString("9edb6526-7ab5-11e6-b829-54ee755c6cc7"), Guid.createGuidFromString("c097a788-7ab5-11e6-849b-54ee755c6cc7"))); JsonObjectSerializer serializer = new JsonObjectSerializer(); String json = serializer.serialize(params); assertTrue(json.length() > 0); MoveOrCopyParameters deserializedParams = new JsonObjectDeserializer().deserialize( json, MoveOrCopyParameters.class); assertEquals(params.getContainerId(), deserializedParams.getContainerId()); assertEquals(params.getExecutionReason(), deserializedParams.getExecutionReason()); }
Source:
<code>public void handle(OutgoingSms sms, String response, Header[] headers) { String messageId = getTemplateOutgoingResponse().extractSingleSuccessMessageId(response); if (messageId == null) { Integer failureCount = sms.getFailureCount() + 1; String failureMessage = getTemplateOutgoingResponse().extractSingleFailureMessage(response); if (failureMessage == null) { failureMessage = response; } getEvents().add(outboundEvent(getConfig().retryOrAbortSubject(failureCount), getConfig().getName(), sms.getRecipients(), sms.getMessage(), sms.getMotechId(), null, failureCount, null, null, sms.getCustomParams())); getLogger().info("Failed to send SMS: {}", failureMessage); getAuditRecords().add(new SmsRecord(getConfig().getName(), OUTBOUND, sms.getRecipients().get(0), sms.getMessage(), now(), getConfig().retryOrAbortStatus(failureCount), null, sms.getMotechId(), null, failureMessage)); } else { getLogger().info(String.format("Sent messageId %s '%s' to %s", messageId, messageForLog(sms), sms.getRecipients().get(0))); getAuditRecords().add(new SmsRecord(getConfig().getName(), OUTBOUND, sms.getRecipients().get(0), <START> sms.getMessage(), now(), DISPATCHED, null, sms.getMotechId(), messageId, null)); <END> getEvents().add(outboundEvent(SmsEventSubjects.DISPATCHED, getConfig().getName(), sms.getRecipients(), sms.getMessage(), sms.getMotechId(), messageId, null, null, null, sms.getCustomParams())); } }</code><technical_language>provider status here</technical_language>

Target:
public void handle(OutgoingSms sms, String response, Header[] headers) { String messageId = getTemplateOutgoingResponse().extractSingleSuccessMessageId(response); if (messageId == null) { Integer failureCount = sms.getFailureCount() + 1; String failureMessage = getTemplateOutgoingResponse().extractSingleFailureMessage(response); if (failureMessage == null) { failureMessage = response; } getEvents().add(outboundEvent(getConfig().retryOrAbortSubject(failureCount), getConfig().getName(), sms.getRecipients(), sms.getMessage(), sms.getMotechId(), null, failureCount, null, null, sms.getCustomParams())); getLogger().info("Failed to send SMS: {}", failureMessage); getAuditRecords().add(new SmsRecord(getConfig().getName(), OUTBOUND, sms.getRecipients().get(0), sms.getMessage(), now(), getConfig().retryOrAbortStatus(failureCount), null, sms.getMotechId(), null, failureMessage)); } else { getLogger().info(String.format("Sent messageId %s '%s' to %s", messageId, messageForLog(sms), sms.getRecipients().get(0))); getAuditRecords().add(new SmsRecord(getConfig().getName(), OUTBOUND, sms.getRecipients().get(0), sms.getMessage(), now(), DeliveryStatuses.DISPATCHED, null, sms.getMotechId(), messageId, null)); getEvents().add(outboundEvent(SmsEventSubjects.DISPATCHED, getConfig().getName(), sms.getRecipients(), sms.getMessage(), sms.getMotechId(), messageId, null, null, null, sms.getCustomParams())); } }
Source:
<code>public PreviousPeriodDateDataSet( @JsonProperty("dataSet") final ObjQualifier dataSet, @JsonProperty("periodsAgo") final Integer periodsAgo) { <START> this.dataSet = notNull(dataSet, "'dataSet' must not be null!"); <END> this.periodsAgo = notNull(periodsAgo, "'periodsAgo' must not be null!"); }</code><technical_language>validation..</technical_language>

Target:
public PreviousPeriodDateDataSet( @JsonProperty("dataSet") final ObjQualifier dataSet, @JsonProperty("periodsAgo") final Integer periodsAgo) { this.dataSet = notNull(dataSet, "dataSet"); this.periodsAgo = notNull(periodsAgo, "periodsAgo"); }
Source:
<code>public void setup() { MockLogAppender.setupLogging(); <START> System.setProperty("opennms.home", "src/test/resources"); <END> categoryMap = new HashMap<>(); addCategory("Foo"); addCategory("Bar"); addCategory("Xyz"); nodeMap = new HashMap<>(); addNode(1, "Node1", "Foo"); addNode(2, "Node2", "Foo", "Bar"); addNode(3, "Node3", "Bar"); addNode(4, "Node4", "Foo", "Bar"); addNode(5, "Node5", "Bar"); addNode(6, "Node6", "Xyz"); alarmMap = new HashMap<>(); addAlarm(1, 1, OnmsSeverity.NORMAL); addAlarm(2, 2, OnmsSeverity.INDETERMINATE); addAlarm(3, 3, OnmsSeverity.MINOR); addAlarm(4, 4, OnmsSeverity.WARNING); addAlarm(5, 5, OnmsSeverity.CLEARED); addAlarm(6, 6, OnmsSeverity.CRITICAL); addAlarm(7, 1, OnmsSeverity.MINOR); addAlarm(8, 2, OnmsSeverity.WARNING); addAlarm(9, 3, OnmsSeverity.MINOR); addAlarm(10, null, OnmsSeverity.CRITICAL); addAlarm(11, 2, OnmsSeverity.CRITICAL, true); }</code><technical_language>enhance Daemon allow setting config file instead of system property</technical_language>

Target:
public void setup() { MockLogAppender.setupLogging(); categoryMap = new HashMap<>(); addCategory("Foo"); addCategory("Bar"); addCategory("Xyz"); nodeMap = new HashMap<>(); addNode(1, "Node1", "Foo"); addNode(2, "Node2", "Foo", "Bar"); addNode(3, "Node3", "Bar"); addNode(4, "Node4", "Foo", "Bar"); addNode(5, "Node5", "Bar"); addNode(6, "Node6", "Xyz"); alarmMap = new HashMap<>(); addAlarm(1, 1, OnmsSeverity.NORMAL); addAlarm(2, 2, OnmsSeverity.INDETERMINATE); addAlarm(3, 3, OnmsSeverity.MINOR); addAlarm(4, 4, OnmsSeverity.WARNING); addAlarm(5, 5, OnmsSeverity.CLEARED); addAlarm(6, 6, OnmsSeverity.CRITICAL); addAlarm(7, 1, OnmsSeverity.MINOR); addAlarm(8, 2, OnmsSeverity.WARNING); addAlarm(9, 3, OnmsSeverity.MINOR); addAlarm(10, null, OnmsSeverity.CRITICAL); addAlarm(11, 2, OnmsSeverity.CRITICAL, true); }
Source:
<code>public String dumpState() { int num = state.get(); String routeState = stateAsString(num); if (failures.get() > 0) { <START> return String.format("*** State %s, failures %d, last failure %d ms ago", routeState, failures.get(), System.currentTimeMillis() - lastFailure); <END> } else { return String.format("*** State %s, failures %d", routeState, failures.get()); } }</code><technical_language>remove ***</technical_language>

Target:
public String dumpState() { int num = state.get(); String routeState = stateAsString(num); if (failures.get() > 0) { return String.format("State %s, failures %d, last failure %d ms ago", routeState, failures.get(), System.currentTimeMillis() - lastFailure); } else { return String.format("State %s, failures %d", routeState, failures.get()); } }
Source:
<code><START> public List<String> getNames() <END> { return Lists.newArrayList(name); }</code><technical_language>this a list iterable</technical_language>

Target:
public List<String> getNames() { return Arrays.asList(name); }
Source:
<code>private TestingLabEntity getAtlEntityById(final Long entityId) throws EntityRetrievalException { TestingLabEntity entity = null; String queryStr = "SELECT atl from TestingLabEntity atl " + "LEFT OUTER JOIN FETCH atl.address " + "WHERE (atl.id = :entityid)" + " AND (atl.deleted = false)"; Query query = entityManager.createQuery(queryStr, TestingLabEntity.class); query.setParameter("entityid", entityId); List<TestingLabEntity> result = query.getResultList(); if (result == null || result.size() == 0) { <START> String msg = String.format(messageSource.getMessage(new DefaultMessageSourceResolvable("acb.notFound"), <END> LocaleContextHolder.getLocale())); throw new EntityRetrievalException(msg); } else if (result.size() > 1) { throw new EntityRetrievalException("Data error. Duplicate certificaiton body id in database."); } else if (result.size() == 1) { entity = result.get(0); } return entity; }</code><technical_language>ErrorMessageUtil here? message atl instead of acb.notFound</technical_language>

Target:
private TestingLabEntity getAtlEntityById(final Long entityId) throws EntityRetrievalException { TestingLabEntity entity = null; String queryStr = "SELECT atl from TestingLabEntity atl " + "LEFT OUTER JOIN FETCH atl.address " + "WHERE (atl.id = :entityid)" + " AND (atl.deleted = false)"; Query query = entityManager.createQuery(queryStr, TestingLabEntity.class); query.setParameter("entityid", entityId); List<TestingLabEntity> result = query.getResultList(); if (result == null || result.size() == 0) { String msg = errorMessageUtil.getMessage("atl.notFound"); throw new EntityRetrievalException(msg); } else if (result.size() > 1) { throw new EntityRetrievalException("Data error. Duplicate certificaiton body id in database."); } else if (result.size() == 1) { entity = result.get(0); } return entity; }
Source:
<code>Field encodeField( String name, Value value ) { <START> return stringField( name, value.prettyPrint() ); <END> }</code><technical_language>worried current pretty print version of points is verbose more space in index, prettyPrinting is change easily, result in need for index recreation. another method Point for index printing do need change. current PointValue.toString is a choice, copied a method for indexing only</technical_language>

Target:
Field encodeField( String name, Value value ) { return new DoubleField( name, Values.coerceToDouble(value), NO ); }
Source:
<code><START> public void ok() { <END> new OkButton(this).click(); new WaitWhile(new ShellIsAvailable(SHELL_TITLE)); new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false); }</code><technical_language>please add method ok(TimePeriod waitForJobs). TimePeriod.LONG enough for cases</technical_language>

Target:
public void ok() { ok(TimePeriod.LONG); }
Source:
<code>public void onEvent(CarbonDisruptorEvent carbonDisruptorEvent, long l, boolean b) throws Exception { CarbonMessage carbonMessage = (CarbonMessage) carbonDisruptorEvent.getEvent(); Lock lock = carbonMessage.getLock(); if (carbonMessage.getProperty(Constants.DIRECTION) == null) { if (lock.tryLock()) { CarbonCallback carbonCallback = (CarbonCallback) carbonMessage.getProperty(Constants.CALL_BACK); <START> int port = Integer.parseInt(carbonMessage.getHeader("Host").split(":")[1]); <END> NettyTransportContextHolder.getInstance().getMessageProcessor(port) .receive(carbonMessage, carbonCallback); } } else if (carbonMessage.getProperty(Constants.DIRECTION).equals(Constants.DIRECTION_RESPONSE)) { if (lock.tryLock()) { CarbonCallback carbonCallback = (CarbonCallback) carbonMessage.getProperty(Constants.CALL_BACK); carbonCallback.done(carbonMessage); } } }</code><technical_language>if request port null pointers</technical_language>

Target:
public void onEvent(CarbonDisruptorEvent carbonDisruptorEvent, long l, boolean b) throws Exception { CarbonMessage carbonMessage = (CarbonMessage) carbonDisruptorEvent.getEvent(); Lock lock = carbonMessage.getLock(); if (carbonMessage.getProperty(Constants.DIRECTION) == null) { if (lock.tryLock()) { CarbonCallback carbonCallback = (CarbonCallback) carbonMessage.getProperty(Constants.CALL_BACK); int port = Integer.parseInt(carbonMessage.getProperty(Constants.LISTENER_PORT).toString()); NettyTransportContextHolder.getInstance().getMessageProcessor(port) .receive(carbonMessage, carbonCallback); } } else if (carbonMessage.getProperty(Constants.DIRECTION).equals(Constants.DIRECTION_RESPONSE)) { if (lock.tryLock()) { CarbonCallback carbonCallback = (CarbonCallback) carbonMessage.getProperty(Constants.CALL_BACK); carbonCallback.done(carbonMessage); } } }
Source:
<code>public ResponseEntity addRole(@RequestBody @Validated RoleForm roleForm, BindingResult bindingResult, @RequestHeader(HttpHeaders.ACCEPT) String acceptHeader) { <START> if (roleForm == null) <END> { throw new RequestBodyValidationException("Empty request body", bindingResult); } if (bindingResult.hasErrors()) { throw new RequestBodyValidationException(FAILED_ADD_ROLE, bindingResult); } Role role = conversionService.convert(roleForm, Role.class); return processConfig(config -> addRole(config, role), () -> SUCCESSFUL_ADD_ROLE, acceptHeader); }</code><technical_language>happen, org.springframework.web.bind.annotation.RequestBody#required is default true</technical_language>

Target:
public ResponseEntity addRole(@RequestBody @Validated RoleForm roleForm, BindingResult bindingResult, @RequestHeader(HttpHeaders.ACCEPT) String acceptHeader) { if (bindingResult.hasErrors()) { throw new RequestBodyValidationException(FAILED_ADD_ROLE, bindingResult); } Role role = conversionService.convert(roleForm, Role.class); return processConfig(config -> addRole(config, role), () -> SUCCESSFUL_ADD_ROLE, acceptHeader); }
Source:
<code><START> public LabelSchemaDescriptor( int labelId, int... propertyIds ) <END> { this.labelId = labelId; this.propertyIds = propertyIds; }</code><technical_language>This public, construct factory</technical_language>

Target:
LabelSchemaDescriptor( int labelId, int... propertyIds ) { this.labelId = labelId; this.propertyIds = propertyIds; }
Source:
<code>public void postProcessing() { if (sortGraph) { if (ghStorage.isCHPossible() && isCHPrepared()) throw new IllegalArgumentException("Sorting a prepared CHGraph is not possible yet. See #12"); GraphHopperStorage newGraph = GHUtility.newStorage(ghStorage); GHUtility.sortDFS(ghStorage, newGraph); logger.info("graph sorted (" + Helper.getMemInfo() + ")"); ghStorage = newGraph; } if (hasElevation()) { interpolateBridgesAndOrTunnels(); } initLocationIndex(); if (chFactoryDecorator.isEnabled()) createCHPreparations(); if (!isCHPrepared()) prepareCH(); if (lmFactoryDecorator.isEnabled()) lmFactoryDecorator.createPreparations(ghStorage, traversalMode); <START> prepareLM(); <END> }</code><technical_language>need check if LMs prepared</technical_language>

Target:
public void postProcessing() { if (sortGraph) { if (ghStorage.isCHPossible() && isCHPrepared()) throw new IllegalArgumentException("Sorting a prepared CHGraph is not possible yet. See #12"); GraphHopperStorage newGraph = GHUtility.newStorage(ghStorage); GHUtility.sortDFS(ghStorage, newGraph); logger.info("graph sorted (" + Helper.getMemInfo() + ")"); ghStorage = newGraph; } if (hasElevation()) { interpolateBridgesAndOrTunnels(); } initLocationIndex(); if (chFactoryDecorator.isEnabled()) chFactoryDecorator.createPreparations(ghStorage, traversalMode); if (!isCHPrepared()) prepareCH(); if (lmFactoryDecorator.isEnabled()) lmFactoryDecorator.createPreparations(ghStorage, traversalMode, locationIndex); loadOrPrepareLM(); }
Source:
<code>public void whenListSubscriptionsThenOk() throws ServiceUnavailableException { <START> final List<Subscription> testSubscriptions = ImmutableList.of( <END> randomSubscription().build(), randomSubscription().build()) .stream() .sorted(SUBSCRIPTION_CREATION_DATE_DESC_COMPARATOR) .collect(toList()); testSubscriptions.forEach(this::insertSubscriptionToDB); final List<Subscription> subscriptions = repository.listSubscriptions(); assertThat(subscriptions, equalTo(testSubscriptions)); }</code><technical_language>simpler sort method collection</technical_language>

Target:
public void whenListSubscriptionsThenOk() throws ServiceUnavailableException { final List<Subscription> testSubscriptions = Lists.newArrayList( randomSubscription().build(), randomSubscription().build()); testSubscriptions.sort(SUBSCRIPTION_CREATION_DATE_DESC_COMPARATOR); testSubscriptions.forEach(this::insertSubscriptionToDB); final List<Subscription> subscriptions = repository.listSubscriptions(); assertThat(subscriptions, equalTo(testSubscriptions)); }
Source:
<code>public void contextInitialized(final ServletContextEvent servletContextEvent) { LOGGER.info("===================================================="); LOGGER.info("Scenarioo Viewer is starting up ..."); LOGGER.info("===================================================="); initializeApplicationVersion(servletContextEvent.getServletContext()); loadConfiguration(servletContextEvent); <START> initializeApplicationContext(servletContextEvent.getServletContext()); <END> LOGGER.info(" Updating documentation content directory (will be done asynchronously ...)"); ScenarioDocuBuildsManager.INSTANCE.updateAllBuildsAndSubmitNewBuildsForImport(); LOGGER.info("===================================================="); LOGGER.info("Scenarioo Viewer started succesfully."); LOGGER.info("===================================================="); }</code><technical_language>I inline this method, give a more precise name, initializeContextPath</technical_language>

Target:
public void contextInitialized(final ServletContextEvent servletContextEvent) { LOGGER.info("===================================================="); LOGGER.info("Scenarioo Viewer is starting up ..."); LOGGER.info("===================================================="); initializeApplicationVersion(servletContextEvent.getServletContext()); loadConfiguration(servletContextEvent); initializeContextPath(servletContextEvent.getServletContext()); LOGGER.info(" Updating documentation content directory (will be done asynchronously ...)"); ScenarioDocuBuildsManager.INSTANCE.updateAllBuildsAndSubmitNewBuildsForImport(); LOGGER.info("===================================================="); LOGGER.info("Scenarioo Viewer started succesfully."); LOGGER.info("===================================================="); }
Source:
<code>public void run() { log.info("bulk audit logger started"); while (!stopped) { lock.lock(); try { isFilled.await(timeout, TimeUnit.MILLISECONDS); if (queue.isEmpty()) { continue; } try { int count = drain(); if (log.isDebugEnabled()) { log.debug("flushed " + count + " events"); } } catch (RuntimeException cause) { <START> log.error("caught error while draining audit queue", cause); <END> } } catch (InterruptedException cause) { Thread.currentThread().interrupt(); return; } finally { isEmpty.signalAll(); lock.unlock(); } } log.info("bulk audit logger stopped"); }</code><technical_language>kind of exceptions expecting here? queue forcibly cleared if drain throws exception invariants (isEmpty) true</technical_language>

Target:
public void run() { log.info("bulk audit logger started"); while (!stopped) { lock.lock(); try { isFilled.await(timeout, TimeUnit.MILLISECONDS); if (queue.isEmpty()) { continue; } int count = drain(); if (log.isDebugEnabled()) { log.debug("flushed " + count + " events"); } } catch (InterruptedException cause) { Thread.currentThread().interrupt(); return; } finally { isEmpty.signalAll(); lock.unlock(); } } log.info("bulk audit logger stopped"); }
Source:
<code>public void testImplicitCoercions() throws Exception { assertions.assertQuery( "SELECT GROUPING(k), SUM(v) + 1.0 FROM (VALUES (1, 1)) AS t(k,v) GROUP BY k", "VALUES (0, 2.0)"); assertions.assertQuery( "SELECT\n" + " 1.0 * count(*),\n" + " grouping(x)\n" + <START> "FROM (VALUES 1) t(x)\n" + <END> "GROUP BY GROUPING SETS ((x), ())", "VALUES (1.0, 1), (1.0, 0)"); }</code><technical_language>(and i notice earlier) replace \n (and fold a bit), e.g. assertions.assertQuery( "SELECT 1.0 * count(*), grouping(x) " + "FROM (VALUES 1) t(x) " + "GROUP GROUPING SETS ((x), ())", "VALUES (1.0, 1), (1.0, 0)");</technical_language>

Target:
public void testImplicitCoercions() throws Exception { assertions.assertQuery( "SELECT GROUPING(k), SUM(v) + 1.0 FROM (VALUES (1, 1)) AS t(k,v) GROUP BY k", "VALUES (0, 2.0)"); assertions.assertQuery( "SELECT\n" + " 1.0 * count(*), " + " grouping(x) " + "FROM (VALUES 1) t(x) " + "GROUP BY GROUPING SETS ((x), ()) ", "VALUES (1.0, 1), (1.0, 0)"); }
Source:
<code>protected void execute(Context context) throws SQLException { long now = system2.now(); MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select u.id from users u " + "where u.active = " + falseValue + " and " + "( email is not null or " + " crypted_password is not null or " + " salt is not null or " + " external_identity is not null or " + " external_identity_provider is not null ) "); massUpdate.update("update users set " + " email = null, " + " crypted_password = null, " + " salt = null, " + " external_identity = null, " + " external_identity_provider = null, " + " updated_at = ? " + " where id = ?"); <START> massUpdate.rowPluralName("deactivated users with remaining data"); <END> massUpdate.execute((row, update) -> { update.setLong(1, now); update.setLong(2, row.getLong(1)); return true; }); }</code><technical_language>IMO "deactivated users" is enough</technical_language>

Target:
protected void execute(Context context) throws SQLException { long now = system2.now(); MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select u.id from users u " + "where u.active = " + falseValue + " and " + "( email is not null or " + " crypted_password is not null or " + " salt is not null or " + " external_identity is not null or " + " external_identity_provider is not null ) "); massUpdate.update("update users set " + " email = null, " + " crypted_password = null, " + " salt = null, " + " external_identity = null, " + " external_identity_provider = null, " + " updated_at = ? " + " where id = ?"); massUpdate.rowPluralName("deactivated users"); massUpdate.execute((row, update) -> { update.setLong(1, now); update.setLong(2, row.getLong(1)); return true; }); }
Source:
<code>public List<Map<String, Object>> getAllDefinitions() throws IOException { PersistentAnalysis getAllDefsRequest = new SavedQueryRequest(HttpMethods.GET, true , null ); List<Object> response = queryClient.getListResponse(getAllDefsRequest); for (Object defObj : response) { <START> if (!(defObj instanceof LinkedHashMap)) { <END> throw new ServerException("Expected list of definitions to be JSON Array of JSON " + "Objects, but encountered this: " + defObj.toString()); } } @SuppressWarnings("unchecked") List<Map<String, Object>> responseMaps = (List)response; return responseMaps; }</code><technical_language>specific Map</technical_language>

Target:
public List<Map<String, Object>> getAllDefinitions() throws IOException { PersistentAnalysis getAllDefsRequest = new SavedQueryRequest(HttpMethods.GET, true , null ); List<Object> response = queryClient.getListResponse(getAllDefsRequest); for (Object defObj : response) { if (!(defObj instanceof Map)) { throw new ServerException("Expected list of definitions to be JSON Array of JSON " + "Objects, but encountered this: " + defObj.toString()); } } @SuppressWarnings("unchecked") List<Map<String, Object>> responseMaps = (List)response; return responseMaps; }
Source:
<code>public DruidQueryGeneratorContext withLimit(long limit) { if (limit <= 0 || limit > Long.MAX_VALUE) { throw new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Invalid limit: " + limit); } <START> checkArgument(!hasLimit(), "Limit already exists. Druid doesn't support limit on top of another limit"); <END> return new DruidQueryGeneratorContext( selections, from, filter, OptionalLong.of(limit)); }</code><technical_language>checkState</technical_language>

Target:
public DruidQueryGeneratorContext withLimit(long limit) { if (limit <= 0 || limit > Long.MAX_VALUE) { throw new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Invalid limit: " + limit); } checkState(!hasLimit(), "Limit already exists. Druid doesn't support limit on top of another limit"); return new DruidQueryGeneratorContext( selections, from, filter, OptionalLong.of(limit)); }
Source:
<code>public static ApplicationInfo getApplication( Identifier identifier ) { if ( identifier == null ) { return null; } if ( !isApplicationAdmin() && !isApplicationUser() ) { return null; } String applicationName = null; UUID applicationId = null; BiMap<UUID, String> applications = getApplications(); Set<String> values= applications.values(); if ( applications == null ) { return null; } if ( identifier.isName() ) { applicationName = identifier.getName().toLowerCase(); <START> for (String value: values ){ <END> if(value.toLowerCase().equals( applicationName )){ applicationId = applications.inverse().get( value ); break; } } } else if ( identifier.isUUID() ) { applicationId = identifier.getUUID(); applicationName = applications.get( identifier.getUUID() ); } if ( ( applicationId != null ) && ( applicationName != null ) ) { return new ApplicationInfo( applicationId, applicationName ); } return null; }</code><technical_language>Dumb question, get bi-map normalizing string. O(1) lookup O(n)</technical_language>

Target:
public static ApplicationInfo getApplication( Identifier identifier ) { if ( identifier == null ) { return null; } if ( !isApplicationAdmin() && !isApplicationUser() ) { return null; } String applicationName = null; UUID applicationId = null; BiMap<UUID, String> applications = getApplications(); if ( applications == null ) { return null; } if ( identifier.isName() ) { applicationName = identifier.getName().toLowerCase(); applicationId = applications.inverse().get( applicationName ); } else if ( identifier.isUUID() ) { applicationId = identifier.getUUID(); applicationName = applications.get( identifier.getUUID() ); } if ( ( applicationId != null ) && ( applicationName != null ) ) { return new ApplicationInfo( applicationId, applicationName ); } return null; }
Source:
<code>public STGroup getTemplates() { if (templates == null) { templates = loadTemplates(); <START> String version = getVersion(); <END> if (version == null || !version.equals(Tool.VERSION)) { gen.tool.errMgr.toolError(ErrorType.INCOMPATIBLE_TOOL_AND_TEMPLATES, version, Tool.VERSION, language); } } return templates; }</code><technical_language>version check call loadTemplates()</technical_language>

Target:
public STGroup getTemplates() { if (templates == null) { String version = getVersion(); if (version == null || !version.equals(Tool.VERSION)) { gen.tool.errMgr.toolError(ErrorType.INCOMPATIBLE_TOOL_AND_TEMPLATES, version, Tool.VERSION, language); } templates = loadTemplates(); } return templates; }
Source:
<code>public void setUp() { n = new CacheManagerNotifierImpl(); cl = new CacheManagerListener(); <START> TestingUtil.inject(n, TestingUtil.named(KnownComponentNames.ASYNC_NOTIFICATION_EXECUTOR, new WithinThreadExecutor())); <END> n.start(); n.addListener(cl); }</code><technical_language>executor needed</technical_language>

Target:
public void setUp() { n = new CacheManagerNotifierImpl(); cl = new CacheManagerListener(); n.start(); n.addListener(cl); }
Source:
<code>void handleDataReceived(Buffer data) { if (dataHandler != null) { setContext(); try { <START> if (pause) { <END> if (pendingData == null) { pendingData = new ArrayDeque<>(); } pendingData.add(data); return; } dataHandler.handle(data); } catch (Throwable t) { handleHandlerException(t); } } }</code><technical_language>This block top of method check if (dataHandler != null) - need set context in this case want lose data in case socket paused user resume called data handler set null</technical_language>

Target:
void handleDataReceived(Buffer data) { if (paused) { if (pendingData == null) { pendingData = new ArrayDeque<>(); } pendingData.add(data); return; } if (dataHandler != null) { setContext(); try { dataHandler.handle(data); } catch (Throwable t) { handleHandlerException(t); } } }
Source:
<code>public int hashCode() { int result = hosts != null ? hosts.hashCode() : 0; result = 31 * result + (configurations != null ? configurations.hashCode() : 0); <START> result = 31 * result + (dependentConfigurations != null ? dependentConfigurations.hashCode() : 0); <END> return result; }</code><technical_language>Simplify Objects.hash</technical_language>

Target:
public int hashCode() { return Objects.hash(hosts, configurations, dependentConfigurations); }
Source:
<code>public static void gatherWithBlockCopying(final List<File> bams, final File output, final boolean createIndex, final boolean createMd5) { try { OutputStream out = new FileOutputStream(output); if (createMd5) out = new Md5CalculatingOutputStream(out, new File(output.getAbsolutePath() + ".md5")); File indexFile = null; if (createIndex) { indexFile = new File(output.getParentFile(), IOUtil.basename(output) + BAMIndex.BAMIndexSuffix); out = new StreamInflatingIndexingOutputStream(out, indexFile); } boolean isFirstFile = true; for (final File f : bams) { blockCopyBamFile(f, out, !isFirstFile, true); isFirstFile = false; } out.write(BlockCompressedStreamConstants.EMPTY_GZIP_BLOCK); out.close(); <START> if (createIndex && (output.lastModified() < indexFile.lastModified())) { <END> final boolean success = indexFile.setLastModified(System.currentTimeMillis()); if (!success) { System.err.print(String.format("Index file is newer than BAM file for %s and unable to resolve this", output.getAbsolutePath())); } } } catch (final IOException ioe) { throw new RuntimeIOException(ioe); } }</code><technical_language>@geoffjentry I < > , no</technical_language>

Target:
public static void gatherWithBlockCopying(final List<File> bams, final File output, final boolean createIndex, final boolean createMd5) { try { OutputStream out = new FileOutputStream(output); if (createMd5) out = new Md5CalculatingOutputStream(out, new File(output.getAbsolutePath() + ".md5")); File indexFile = null; if (createIndex) { indexFile = new File(output.getParentFile(), IOUtil.basename(output) + BAMIndex.BAMIndexSuffix); out = new StreamInflatingIndexingOutputStream(out, indexFile); } boolean isFirstFile = true; for (final File f : bams) { blockCopyBamFile(f, out, !isFirstFile, true); isFirstFile = false; } out.write(BlockCompressedStreamConstants.EMPTY_GZIP_BLOCK); out.close(); if (createIndex && (output.lastModified() > indexFile.lastModified())) { final boolean success = indexFile.setLastModified(System.currentTimeMillis()); if (!success) { System.err.print(String.format("Index file is older than BAM file for %s and unable to resolve this", output.getAbsolutePath())); } } } catch (final IOException ioe) { throw new RuntimeIOException(ioe); } }
Source:
<code>void throwsExceptionWhenParameterizedTestIsNotInvokedAtLeastOnce() { ExtensionContext extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( new TestCaseWithAnnotatedMethod()); Stream<TestTemplateInvocationContext> stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts( extensionContextWithAnnotatedTestMethod); <START> Object[] unused = stream.toArray(); <END> JUnitException exception = assertThrows(JUnitException.class, stream::close); assertThat(exception).hasMessage( "Configuration error: You must provide at least one argument for this @ParameterizedTest"); }</code><technical_language>Hmmmm.... warnings unused variable _unused_</technical_language>

Target:
void throwsExceptionWhenParameterizedTestIsNotInvokedAtLeastOnce() { ExtensionContext extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( new TestCaseWithAnnotatedMethod()); Stream<TestTemplateInvocationContext> stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts( extensionContextWithAnnotatedTestMethod); stream.toArray(); JUnitException exception = assertThrows(JUnitException.class, stream::close); assertThat(exception).hasMessage( "Configuration error: You must provide at least one argument for this @ParameterizedTest"); }
Source:
<code>private void validateMediumDutySdxEnablement(SdxClusterRequest sdxClusterRequest, DetailedEnvironmentResponse environment) { ValidationResultBuilder validationBuilder = new ValidationResultBuilder(); if (SdxClusterShape.MEDIUM_DUTY_HA.equals(sdxClusterRequest.getClusterShape())) { boolean mediumDutySdxEntitlementEnabled = entitlementService.mediumDutySdxEnabled(environment.getCreator(), Crn.safeFromString(environment.getCreator()).getAccountId()); if (!mediumDutySdxEntitlementEnabled) { validationBuilder.error("Provisioning a Medium Duty SDX shape is not enabled for this account."); } if (!isMediumDutySdxSupported(sdxClusterRequest.getRuntime())) { <START> validationBuilder.error("Provisioning a Medium Duty SDX shape is only valid for CM version > 7.2.2 and not " + sdxClusterRequest.getRuntime()); <END> } } ValidationResult validationResult = validationBuilder.build(); if (validationResult.hasError()) { throw new BadRequestException(validationResult.getFormattedErrors()); } }</code><technical_language>Is 7.2.2 supported? If so, ">=" ">"</technical_language>

Target:
private void validateMediumDutySdxEnablement(SdxClusterRequest sdxClusterRequest, DetailedEnvironmentResponse environment) { ValidationResultBuilder validationBuilder = new ValidationResultBuilder(); if (SdxClusterShape.MEDIUM_DUTY_HA.equals(sdxClusterRequest.getClusterShape())) { boolean mediumDutySdxEntitlementEnabled = entitlementService.mediumDutySdxEnabled(environment.getCreator(), Crn.safeFromString(environment.getCreator()).getAccountId()); if (!mediumDutySdxEntitlementEnabled) { validationBuilder.error("Provisioning a medium duty data lake cluster is not enabled for this account. " + "Contact Cloudera support to enable CDP_MEDIUM_DUTY_SDX entitlement for the account."); } if (!isMediumDutySdxSupported(sdxClusterRequest.getRuntime())) { validationBuilder.error("Provisioning a Medium Duty SDX shape is only valid for CM version >= 7.2.2 and not " + sdxClusterRequest.getRuntime()); } } ValidationResult validationResult = validationBuilder.build(); if (validationResult.hasError()) { throw new BadRequestException(validationResult.getFormattedErrors()); } }
Source:
<code>protected void processCommunication(String tenantId, TraceCompletionInformation item, Communication c, CommunicationDetails cd) { long targetFragmentBaseDuration = c.getBaseDuration() + cd.getLatency(); long durationWithTargetFragment = targetFragmentBaseDuration + cd.getTargetFragmentDuration(); if (durationWithTargetFragment > item.getCompletionTime().getDuration()) { item.getCompletionTime().setDuration(durationWithTargetFragment); } if (!cd.getProperties().isEmpty()) { item.getCompletionTime().getProperties().addAll(cd.getProperties()); } for (int j = 0; j < cd.getOutbound().size(); j++) { CommunicationDetails.Outbound ob = cd.getOutbound().get(j); Communication newc = new Communication(); newc.setIds(ob.getIds()); newc.setMultipleConsumers(ob.isMultiConsumer()); newc.setBaseDuration(targetFragmentBaseDuration + ob.getProducerOffset()); <START> if (ob.isMultiConsumer()) { <END> newc.setExpire(cd.getTimestamp() + TraceCompletionInformation.Communication.DEFAULT_EXPIRY_WINDOW); } else { newc.setExpire(System.currentTimeMillis() + TraceCompletionInformation.Communication.DEFAULT_EXPIRY_WINDOW); } if (log.isLoggable(Level.FINEST)) { log.finest("Completion info " + item + ": new communication = " + newc); } item.getCommunications().add(newc); } }</code><technical_language>long baseExpireTime = ob.isMultiConsumer() ? cd.getTimestamp() : System.currentTimeMillis(); newc.setExpire(baseTime + TraceCompletionInformation.Communication.DEFAULT_EXPIRY_WINDOW);</technical_language>

Target:
protected void processCommunication(String tenantId, TraceCompletionInformation item, Communication c, CommunicationDetails cd) { long targetFragmentBaseDuration = c.getBaseDuration() + cd.getLatency(); long durationWithTargetFragment = targetFragmentBaseDuration + cd.getTargetFragmentDuration(); if (durationWithTargetFragment > item.getCompletionTime().getDuration()) { item.getCompletionTime().setDuration(durationWithTargetFragment); } if (!cd.getProperties().isEmpty()) { item.getCompletionTime().getProperties().addAll(cd.getProperties()); } for (int j = 0; j < cd.getOutbound().size(); j++) { CommunicationDetails.Outbound ob = cd.getOutbound().get(j); Communication newc = new Communication(); newc.setIds(ob.getIds()); newc.setMultipleConsumers(ob.isMultiConsumer()); newc.setBaseDuration(targetFragmentBaseDuration + ob.getProducerOffset()); long baseTimeStamp = ob.isMultiConsumer() ? cd.getTimestamp() : System.currentTimeMillis(); newc.setExpire(baseTimeStamp + TraceCompletionInformation.Communication.DEFAULT_EXPIRY_WINDOW); if (log.isLoggable(Level.FINEST)) { log.finest("Completion info " + item + ": new communication = " + newc); } item.getCommunications().add(newc); } }
Source:
<code>private static Iterable<Expression> pullNullableConjunctsThroughOuterJoin(List<Expression> conjuncts, Collection<Symbol> outputSymbols, Predicate<Symbol>... nullSymbolScopes) { return conjuncts.stream() .map(expression -> pullExpressionThroughSymbols(expression, outputSymbols)) <START> .map(expression -> SymbolsExtractor.extractAll(expression).anyMatch(alwaysTrue()) ? TRUE_LITERAL : expression) <END> .map(expressionOrNullSymbols(nullSymbolScopes)) .collect(toImmutableList()); }</code><technical_language>This is wrong. isEmpty() migrated count() == 1</technical_language>

Target:
private static Iterable<Expression> pullNullableConjunctsThroughOuterJoin(List<Expression> conjuncts, Collection<Symbol> outputSymbols, Predicate<Symbol>... nullSymbolScopes) { return conjuncts.stream() .map(expression -> pullExpressionThroughSymbols(expression, outputSymbols)) .map(expression -> isEmpty(SymbolsExtractor.extractAll(expression)) ? TRUE_LITERAL : expression) .map(expressionOrNullSymbols(nullSymbolScopes)) .collect(toImmutableList()); }
Source:
<code>public IItemDescriptor<T> add(IItemDescriptor<T> itemDescriptor) { Preconditions.checkArgument(itemDescriptor != null); <START> Preconditions.checkArgument(itemDescriptor.getID() != null); <END> return registry.put(itemDescriptor.getID(), itemDescriptor); }</code><technical_language>"checkNotNull" instead of "checkArgument"</technical_language>

Target:
public IItemDescriptor<T> add(IItemDescriptor<T> itemDescriptor) { Preconditions.checkNotNull(itemDescriptor); Preconditions.checkNotNull(itemDescriptor.getID()); return registry.put(itemDescriptor.getID(), itemDescriptor); }
Source:
<code>public boolean equals(Object obj) { if (!(obj instanceof SerializableProtobuf<?>)) { return false; } SerializableProtobuf<?> other = ((SerializableProtobuf<?>) obj); if (hash != other.hash) { return false; } if (object != null && other.object != null) { return object.equals(other.object); } <START> return Arrays.equals(buf, other.buf); <END> }</code><technical_language>buf null discard in toObject. more aggressive converting buf object format. T thisObject = toObject(this, this.codec, other.codec); T otherObject = toObject(other, this.codec, other.codec); if (thisObject != null && otherObject != null) { return thisObject.equals(otherObject); } else if (this.buf != null && other.buf != null) { return Arrays.equals(this.buf, other.buf); } else { return false; } private <T> static Object toObject(SerializableProtobuf<T> sp, ProtobufCodec<T> codec1, ProtobufCodec<T> codec2) { if (sp.object != null) { return sp.object; } ProtobufCodec<T> codec = codec1 != null ? codec1 : codec2; if (codec != null) { sp.object = codec.decode(sp.buf); sp.buf = null; return sp.object; } else { return null; } }</technical_language>

Target:
public boolean equals(Object obj) { if (!(obj instanceof SerializableProtobuf<?>)) { return false; } SerializableProtobuf<T> other = ((SerializableProtobuf<T>) obj); if (hash != other.hash) { return false; } T thisObject = toObject(this, this.codec, other.codec); T otherObject = toObject(other, this.codec, other.codec); if (thisObject != null && otherObject != null) { return thisObject.equals(otherObject); } else if (this.buf != null && other.buf != null) { return Arrays.equals(this.buf, other.buf); } else { return false; } }
Source:
<code>public static void main(String[] args) throws Exception{ if (args.length != 4) { System.out.println("Usage: CliClient <endpoing> <username> <password> <command>"); } String endpoint = args[0]; String username = args[1]; String password = args[2]; String cmd = args[3]; WinRmTool client = WinRmTool.Builder.builder(endpoint, username, password) .disableCertificateChecks(true) .workingDirectory("C:\\") .build(); int exitCode = 999; try { WinRmToolResponse response = client.executeCommand(cmd); System.err.print(response.getStdErr()); System.out.println(response.getStdOut()); exitCode = response.getStatusCode(); <START> } finally { <END> CXFBusFactory.clearDefaultBusForAnyThread(CXFBusFactory.getDefaultBus()); } System.exit(exitCode); }</code><technical_language>This, in theory, allows for interleaving stdout & stderr output, similar in console. output visible soon poll call completes, end of command. convinced worth WinRmTool here</technical_language>

Target:
public static void main(String[] args) throws Exception{ if (args.length != 4) { System.out.println("Usage: CliClient <endpoing> <username> <password> <command>"); System.exit(1); } String endpoint = args[0]; String username = args[1]; String password = args[2]; String cmd = args[3]; WinRmTool client = WinRmTool.Builder.builder(endpoint, username, password) .disableCertificateChecks(true) .workingDirectory("C:\\") .disableCertificateChecks(true) .build(); int exitCode = 999; try { WinRmToolResponse response = client.executeCommand(cmd); System.err.print(response.getStdErr()); System.out.println(response.getStdOut()); exitCode = response.getStatusCode(); } finally { CXFBusFactory.clearDefaultBusForAnyThread(CXFBusFactory.getDefaultBus()); } System.exit(exitCode); }
Source:
<code>public void setLeftPortletWidthPercent(int percent) { <START> if (percent < 0) { <END> throw new IllegalArgumentException("Width can't be negative!"); } useCssStyle(true); this.cssLeftPortletWidth.set(percent + "%"); }</code><technical_language>70-75: extract method (see methods)</technical_language>

Target:
public void setLeftPortletWidthPercent(int percent) { setPortletWidthOnControl(cssLeftPortletWidth, percent, PERCENTAGE_SYMBOL); }
Source:
<code>public void setTradSpiderEnabled(boolean isTradSpiderEnabled) { this.isTradSpiderEnabled = isTradSpiderEnabled; getConfig().setProperty(PARAM_TRAD_SPIDER_ENABLED, isTradSpiderEnabled); try { <START> getConfig().save(); <END> QuickStartHelper.raiseOptionsChangedEvent(); } catch (ConfigurationException e) { LOGGER.error("Failed to save the \"Quick Start\" configuration", e); } }</code><technical_language>need save? do in other params (ZAP saves shutdown)</technical_language>

Target:
public void setTradSpiderEnabled(boolean isTradSpiderEnabled) { this.isTradSpiderEnabled = isTradSpiderEnabled; getConfig().setProperty(PARAM_TRAD_SPIDER_ENABLED, isTradSpiderEnabled); QuickStartHelper.raiseOptionsChangedEvent(); }
Source:
<code>public void testEditVLAN() throws Exception { Map<String, String> meta = Maps.newHashMap(); meta.put("test", "test data"); VLANInfo vlanInfo = new VLANInfo.Builder() .meta(meta) .build(); <START> if (api.listVLANs().concat().size() > 0) { <END> checkVlAN(vlanInfo, api.editVLAN(api.listVLANs().concat().get(0).getUuid(), vlanInfo)); } }</code><technical_language>check this isEmpty instead</technical_language>

Target:
public void testEditVLAN() throws Exception { Map<String, String> meta = Maps.newHashMap(); meta.put("test", "test data"); VLANInfo vlanInfo = new VLANInfo.Builder() .meta(meta) .build(); if (!api.listVLANs().concat().isEmpty()) { checkVlAN(vlanInfo, api.editVLAN(api.listVLANs().concat().get(0).getUuid(), vlanInfo)); } }
Source:
<code>protected HealthCheckResult getOrRunHealthCheck(String probe) { if (StringUtils.isEmpty(probe)) { return Framework.getService(ProbeManager.class).getOrRunHealthCheck(); } <START> return Framework.getService(ProbeManager.class).getOrRunHealthCheckSingleProbe(probe); <END> }</code><technical_language>Framework.getService(ProbeManager.class) method start</technical_language>

Target:
protected HealthCheckResult getOrRunHealthCheck(String probe) { ProbeManager pm = Framework.getService(ProbeManager.class); if (StringUtils.isEmpty(probe)) { return pm.getOrRunHealthChecks(); } else { return pm.getOrRunHealthCheck(probe); } }