auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Slice stLineString(@SqlType("array(" + GEOMETRY_TYPE_NAME + ")") Block input) { if (input.getPositionCount() == 1) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "LineString cannot have one point"); } MultiPath multipath = new Polyline(); for (int i = 0; i < input.getPositionCount(); i++) { <START> Slice slice = input.getSlice(i, 0, input.getSliceLength(i)); <END> validateType("ST_Point", deserialize(slice), EnumSet.of(POINT)); OGCPoint point = (OGCPoint) deserialize(slice); if (i == 0) { multipath.startPath(point.X(), point.Y()); } else { multipath.lineTo(point.X(), point.Y()); } } OGCLineString linestring = new OGCLineString(multipath, 0, null); return serialize(linestring); }</code><technical_language>is safer type extract element Block: import static com.facebook.presto.plugin.geospatial.GeometryType.GEOMETRY; ... Slice slice = GEOMETRY.getSlice(input, i);</technical_language>

Target:
public static Slice stLineString(@SqlType("array(" + GEOMETRY_TYPE_NAME + ")") Block input) { int addedPoints = 0; MultiPath multipath = new Polyline(); for (int i = 0; i < input.getPositionCount(); i++) { Slice slice = GEOMETRY.getSlice(input, i); if (slice.getInput().available() == 0) { continue; } OGCGeometry geometry = deserialize(slice); if (!(geometry instanceof OGCPoint)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("ST_LineString takes only an array of valid points, %s was passed", geometry.geometryType())); } OGCPoint point = (OGCPoint) geometry; if (point.isEmpty()) { continue; } if (addedPoints == 0) { multipath.startPath(point.X(), point.Y()); } else { multipath.lineTo(point.X(), point.Y()); } addedPoints++; } OGCLineString linestring = new OGCLineString(multipath, 0, null); return serialize(linestring); }
Source:
<code>public void tearDown() throws PatientNotFoundException { List<Encounter> encounters = encounterService.getEncountersByEncounterType(DEFAULT_CONFIG_NAME, MOTECH_ID, createdEncounterType.getName()); for (Encounter encounter : encounters) { encounterService.deleteEncounter(DEFAULT_CONFIG_NAME, encounter.getUuid()); } encounterService.deleteEncounterType(DEFAULT_CONFIG_NAME, createdEncounterType.getUuid()); providerService.deleteProvider(DEFAULT_CONFIG_NAME, createdProvider.getUuid()); patientService.deletePatient(DEFAULT_CONFIG_NAME, createdPatient.getUuid()); Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, String.format("%staskCreated", MOTECH_ID)); if (patient != null) { patientService.deletePatient(DEFAULT_CONFIG_NAME, patient.getUuid()); } <START> patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "Robert Kowalski"); <END> if (patient != null) { patientService.deletePatient(DEFAULT_CONFIG_NAME, patient.getUuid()); } patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "Jan Nowak"); if (patient != null) { patientService.deletePatient(DEFAULT_CONFIG_NAME, patient.getUuid()); } patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, TEST_MOTECH_ID); if (patient != null) { patientService.deletePatient(DEFAULT_CONFIG_NAME, patient.getUuid()); } }</code><technical_language>change Robert Kowalski Jan Nowak</technical_language>

Target:
public void tearDown() throws PatientNotFoundException { List<Encounter> encounters = encounterService.getEncountersByEncounterType(DEFAULT_CONFIG_NAME, MOTECH_ID, createdEncounterType.getName()); for (Encounter encounter : encounters) { encounterService.deleteEncounter(DEFAULT_CONFIG_NAME, encounter.getUuid()); } encounterService.deleteEncounterType(DEFAULT_CONFIG_NAME, createdEncounterType.getUuid()); providerService.deleteProvider(DEFAULT_CONFIG_NAME, createdProvider.getUuid()); patientService.deletePatient(DEFAULT_CONFIG_NAME, createdPatient.getUuid()); Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, String.format("%staskCreated", MOTECH_ID)); if (patient != null) { patientService.deletePatient(DEFAULT_CONFIG_NAME, patient.getUuid()); } patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "John Smith"); if (patient != null) { patientService.deletePatient(DEFAULT_CONFIG_NAME, patient.getUuid()); } patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "Jacob Lee"); if (patient != null) { patientService.deletePatient(DEFAULT_CONFIG_NAME, patient.getUuid()); } patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, TEST_MOTECH_ID); if (patient != null) { patientService.deletePatient(DEFAULT_CONFIG_NAME, patient.getUuid()); } }
Source:
<code>public void started(List<String> initialNames) { <START> if(started != null) <END> { this.started = new TranscriptEvent(Instant.now()); this.initialParticipantNames.addAll(initialNames); } }</code><technical_language>this started==null</technical_language>

Target:
public void started(List<String> initialNames) { if(started == null) { this.started = new TranscriptEvent(Instant.now()); this.initialParticipantNames.addAll(initialNames); } }
Source:
<code>public void useDefaultMTU() { Set<ConstraintViolation<MtuContainer>> validate = validate(new MtuContainer(0)); <START> Assert.assertEquals(0, validate.size()); <END> }</code><technical_language>change above, expect this as: assertTrue(validate.isEmpty())</technical_language>

Target:
public void useDefaultMTU() { Set<ConstraintViolation<MtuContainer>> validate = validate(new MtuContainer(0)); assertTrue(validate.isEmpty()); }
Source:
<code><START> void createContext() { <END> BoundedContextBuilder contextBuilder = contextBuilder(); checkNotNull(contextBuilder, "`contextBuilder()` must return a non-null `BoundedContextBuilder`."); context = BlackBoxBoundedContext.from(contextBuilder); }</code><technical_language>I this protected mark @OverridingMethodsMustInvokeSuper. reason is in test cases more actions Bounded Context is created, setting mocks</technical_language>

Target:
protected void createContext() { BoundedContextBuilder contextBuilder = contextBuilder(); checkNotNull(contextBuilder, "`contextBuilder()` must return a non-null `BoundedContextBuilder`."); context = BlackBoxBoundedContext.from(contextBuilder); }
Source:
<code>protected Provider[] loadServices(final Class<Provider> service, final ClassLoader classLoader) { ArrayList<Provider> list = new ArrayList<>(); ServiceLoader<Provider> loader = ServiceLoader.load(service, classLoader); <START> Iterator<Provider> iterator = loader.iterator(); <END> for (;;) try { if (! iterator.hasNext()) { return list.toArray(Arrays2.createArray(service, list.size())); } Provider provider = iterator.next(); if (! INSTALLED_PROVIDERS_SET.contains(provider.getClass())) { list.add(provider); } } catch (ServiceConfigurationError ignored) { } }</code><technical_language>I remember if @darranl a recommendation here, AFAIK accepted practice is pass in a constant 0-sized array Collection.<T>toArray(T[] array) methods</technical_language>

Target:
Provider[] loadServices(final Class<Provider> service, final ClassLoader classLoader) { Provider[] providers = INSTALLED_PROVIDERS.get(); Set<Class<?>> installedProvidersSet = new HashSet<>((providers != null ? providers.length : 0) + (elytronProviderStaticallyAdded ? 1 : 0)); if (elytronProviderStaticallyAdded) { installedProvidersSet.add(WildFlyElytronProvider.class); } if (providers != null) { for (int i = 0; i < providers.length; i++) { installedProvidersSet.add(providers[i].getClass()); } } ArrayList<Provider> list = new ArrayList<>(); ServiceLoader<Provider> loader = ServiceLoader.load(service, classLoader); Iterator<Provider> iterator = loader.iterator(); for (;;) try { if (! iterator.hasNext()) { return list.toArray(new Provider[list.size()]); } Provider provider = iterator.next(); if (! installedProvidersSet.contains(provider.getClass())) { list.add(provider); } } catch (ServiceConfigurationError ignored) { } }
Source:
<code>public void fastSyncCleanUp() { byte[] fastsyncStageBytes = blockchainDB().get(FastSyncManager.FASTSYNC_DB_KEY_SYNC_STAGE); if (fastsyncStageBytes == null) return; if (!systemProperties().blocksLoader().isEmpty()) return; EthereumListener.SyncState syncStage = EthereumListener.SyncState.values()[fastsyncStageBytes[0]]; <START> if ((systemProperties().isSyncEnabled() && !systemProperties().isFastSyncEnabled()) || syncStage == EthereumListener.SyncState.UNSECURE) { <END> logger.warn("Last fastsync was interrupted. Removing inconsistent DBs..."); DbSource bcSource = blockchainDB(); resetDataSource(bcSource); } }</code><technical_language>add this check beginning of method method call sense if sync is</technical_language>

Target:
public void fastSyncCleanUp() { if (!systemProperties().isSyncEnabled()) return; byte[] fastsyncStageBytes = blockchainDB().get(FastSyncManager.FASTSYNC_DB_KEY_SYNC_STAGE); if (fastsyncStageBytes == null) return; if (!systemProperties().blocksLoader().isEmpty()) return; EthereumListener.SyncState syncStage = EthereumListener.SyncState.values()[fastsyncStageBytes[0]]; if (!systemProperties().isFastSyncEnabled() || syncStage == EthereumListener.SyncState.UNSECURE) { logger.warn("Last fastsync was interrupted. Removing inconsistent DBs..."); DbSource bcSource = blockchainDB(); resetDataSource(bcSource); } }
Source:
<code>protected boolean validate() { if (getParameters().getSchedule() == null || (getParameters().getSchedule().getFrequency() != StorageSyncSchedule.Frequency.NONE && <START> StringUtils.isEmpty(getParameters().getSchedule().getCronExpression()))) <END> { return failValidation(EngineMessage.VALIDATION_INVALID_SCHEDULE); } if (getStorageDomainId() == null || getStorageDomain() == null) { return failValidation(EngineMessage.STORAGE_DOMAIN_DOES_NOT_EXIST); } if (getGeoRepSession() == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_GEOREP_SESSION_INVALID); } return super.validate(); }</code><technical_language>iinw, cron expression is validated can-do-action, means execution fail in a stage, while failed here</technical_language>

Target:
protected boolean validate() { if (getParameters().getSchedule() == null || (getParameters().getSchedule().getFrequency() != StorageSyncSchedule.Frequency.NONE && StringUtils.isEmpty(getParameters().getSchedule().toCronExpression()))) { return failValidation(EngineMessage.VALIDATION_INVALID_SCHEDULE); } if (getStorageDomain() == null) { return failValidation(EngineMessage.STORAGE_DOMAIN_DOES_NOT_EXIST); } if (getGeoRepSession() == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_GEOREP_SESSION_INVALID); } return super.validate(); }
Source:
<code>public InstanceAdapter insert(SQLiteDatabase db, InstanceAdapter entityAdapter, boolean isSyncAdapter) { TaskAdapter taskResult = mDelegate.insert(db, entityAdapter.taskAdapter(), false); Cursor c = db.query(TaskDatabaseHelper.Tables.INSTANCES, new String[] { TaskContract.Instances._ID }, TaskContract.Instances.TASK_ID + "=" + taskResult.id(), null, null, null, null); <START> try <END> { c.moveToFirst(); return new ContentValuesInstanceAdapter(c.getLong(0), new ContentValues()); } finally { c.close(); } }</code><technical_language>try-with-resource opportunity (and another below)</technical_language>

Target:
public InstanceAdapter insert(SQLiteDatabase db, InstanceAdapter entityAdapter, boolean isSyncAdapter) { TaskAdapter taskResult = mDelegate.insert(db, entityAdapter.taskAdapter(), false); try (Cursor c = db.query(TaskDatabaseHelper.Tables.INSTANCES, new String[] { TaskContract.Instances._ID }, TaskContract.Instances.TASK_ID + "=" + taskResult.id(), null, null, null, null)) { c.moveToFirst(); return new ContentValuesInstanceAdapter(c.getLong(0), new ContentValues()); } }
Source:
<code>public void testFederateLatencyMetrics() throws Exception { QueryRequest fedQueryRequest = new QueryRequestImpl(mockQuery, false, null, properties); when(mockResponse.getProperties()).thenReturn(properties); Source mockSource1 = getMockSource(); Source mockSource2 = getMockSource(); Source mockSource3 = getMockSource(); List<Source> sourceList = ImmutableList.of(mockSource1, mockSource2, mockSource3); QueryResponse federateResponse = federateStrategy.federate(sourceList, fedQueryRequest); List<Map.Entry<String, Serializable>> metrics = federateResponse .getProperties() .entrySet() .stream() <START> .filter(entry -> entry.getKey().startsWith("metrics.source.elapsed.")) <END> .collect(Collectors.toList()); assertThat(metrics.size(), is(sourceList.size())); }</code><technical_language>above, consider SourceMetricsImpl.METRICS_SOURCE_ELAPSED for metrics.source.elapsed. if consider moving this const a common class</technical_language>

Target:
public void testFederateLatencyMetrics() throws Exception { QueryRequest fedQueryRequest = new QueryRequestImpl(mockQuery, false, null, properties); when(mockResponse.getProperties()).thenReturn(properties); Source mockSource1 = getMockSource(); Source mockSource2 = getMockSource(); Source mockSource3 = getMockSource(); List<Source> sourceList = ImmutableList.of(mockSource1, mockSource2, mockSource3); QueryResponse federateResponse = federateStrategy.federate(sourceList, fedQueryRequest); List<Map.Entry<String, Serializable>> metrics = federateResponse .getProperties() .entrySet() .stream() .filter(entry -> entry.getKey().startsWith(METRICS_SOURCE_ELAPSED_PREFIX)) .collect(Collectors.toList()); assertThat(metrics.size(), is(sourceList.size())); }
Source:
<code>public DefaultTopologyService(long cacheTimeout) { graphProviderCache = CacheBuilder .newBuilder() .expireAfterWrite(Math.max(0, cacheTimeout), TimeUnit.SECONDS) .maximumSize(50) .build(new CacheLoader<GraphProviderKey, GraphProvider>() { @Override public GraphProvider load(GraphProviderKey key) throws Exception { final MetaTopologyProvider metaTopologyProvider = getMetaTopologyProvider(key.getMetaTopologyId()); <START> metaTopologyProvider.reload(key.getNamespace()); <END> return Optional.ofNullable(metaTopologyProvider.getGraphProviderBy(key.getNamespace())) .orElseThrow(() -> new NoSuchElementException("No GraphProvider with namespace '" + key.getNamespace() + "' found.")); } }); }</code><technical_language>do handle concurrency MetaTopologyProvider instances shared? GraphMLMetaTopologyProvider, is cleared in part of reload() function. means accessing graph while reloaded end edges/vertices, existing session end in some inconsistent state</technical_language>

Target:
public DefaultTopologyService(long cacheTimeout) { graphProviderCache = CacheBuilder .newBuilder() .expireAfterWrite(Math.max(0, cacheTimeout), TimeUnit.SECONDS) .maximumSize(50) .build(new CacheLoader<GraphProviderKey, GraphProvider>() { @Override public GraphProvider load(GraphProviderKey key) throws Exception { final MetaTopologyProvider metaTopologyProvider = getMetaTopologyProvider(key.getMetaTopologyId()); final GraphProvider graphProvider = Optional.ofNullable(metaTopologyProvider.getGraphProviderBy(key.getNamespace())) .orElseThrow(() -> new NoSuchGraphProviderException(key.getMetaTopologyId(), key.getNamespace())); graphProvider.refresh(); return graphProvider; } }); }
Source:
<code>public void linkExposedInfantToMotherViaARTNumber(Person infant, String motherARTNumber) { log.debug("Linking infant with ID " + infant.getPersonId() + " to mother with ART Number " + motherARTNumber); List<Patient> mothers = patientService.getPatients(null, motherARTNumber, Arrays.asList(Context.getPatientService().getPatientIdentifierTypeByUuid(PatientIdentifierTypes.ART_PATIENT_NUMBER.uuid())), true); if (mothers.size() != 0) { Person potentialMother = mothers.get(0).getPerson(); <START> if (potentialMother.getAge() != null && potentialMother.getAge() > 12 & potentialMother.getGender().equals("F")) { <END> Relationship relationship = new Relationship(); relationship.setRelationshipType(personService.getRelationshipTypeByUuid("8d91a210-c2cc-11de-8d13-0010c6dffd0f")); relationship.setPersonA(potentialMother); relationship.setPersonB(infant); personService.saveRelationship(relationship); log.debug("Infant with ID " + infant.getPersonId() + " linked to mother with ID " + potentialMother.getPersonId()); } } }</code><technical_language>@ssmusoke is this change tied upgrade</technical_language>

Target:
public void linkExposedInfantToMotherViaARTNumber(Person infant, String motherARTNumber) { log.debug("Linking infant with ID " + infant.getPersonId() + " to mother with ART Number " + motherARTNumber); List<PatientIdentifierType> artNumberPatientidentifierTypes = new ArrayList<>(); artNumberPatientidentifierTypes.add(Context.getPatientService().getPatientIdentifierTypeByUuid(PatientIdentifierTypes.ART_PATIENT_NUMBER.uuid())); artNumberPatientidentifierTypes.add(Context.getPatientService().getPatientIdentifierTypeByUuid(PatientIdentifierTypes.HIV_CARE_NUMBER.uuid())); List<Patient> mothers = patientService.getPatients(null, motherARTNumber, artNumberPatientidentifierTypes, true); if (mothers.size() != 0) { Person potentialMother = mothers.get(0).getPerson(); if (potentialMother.getAge() != null && potentialMother.getAge() > 12 & potentialMother.getGender().equals("F")) { Relationship relationship = new Relationship(); relationship.setRelationshipType(personService.getRelationshipTypeByUuid("8d91a210-c2cc-11de-8d13-0010c6dffd0f")); relationship.setPersonA(potentialMother); relationship.setPersonB(infant); personService.saveRelationship(relationship); log.debug("Infant with ID " + infant.getPersonId() + " linked to mother with ID " + potentialMother.getPersonId()); } } }
Source:
<code>public Response clear() { try { final IPluginCacheManager iPluginCacheManager = PentahoSystem.get( IPluginCacheManager.class ); final IReportContentCache cache = iPluginCacheManager.getCache(); cache.cleanup(); final ICacheManager cacheManager = PentahoSystem.get( ICacheManager.class ); <START> cacheManager.clearRegionCache( "report-dataset-cache" ); <END> cacheManager.clearRegionCache( "report-output-handlers" ); return Response.ok().build(); } catch ( final Exception e ) { return Response.serverError().build(); } }</code><technical_language>add a call "DataCacheFactory.getCache().getCacheManager().clearAll()" well? In default configuration clear cache "report-dataset-cache", if OEM replaces DataCache-implementation, cover implementation too</technical_language>

Target:
public Response clear() { try { final IPluginCacheManager iPluginCacheManager = PentahoSystem.get( IPluginCacheManager.class ); final IReportContentCache cache = iPluginCacheManager.getCache(); cache.cleanup(); final ICacheManager cacheManager = PentahoSystem.get( ICacheManager.class ); cacheManager.clearRegionCache( "report-dataset-cache" ); cacheManager.clearRegionCache( "report-output-handlers" ); DataCacheFactory.getCache().getCacheManager().clearAll(); return Response.ok().build(); } catch ( final Exception e ) { return Response.serverError().build(); } }
Source:
<code>public void testThreeResourceCyclicImportThrowsException() throws Exception { String xmlWithCyclicImport = createFilesWithCycleImports( createFileWithContent("hz1", "xml", ""), createFileWithContent("hz2", "xml", ""), createFileWithContent("hz3", "xml", "") ); <START> buildConfig(xmlWithCyclicImport, null); <END> }</code><technical_language>Nice cleanup :+1:</technical_language>

Target:
public void testThreeResourceCyclicImportThrowsException() throws Exception { String xmlWithCyclicImport = helper.createFilesWithCycleImports( this::xmlContentWithImportResource, helper.givenConfigFileInWorkDir("hz1.xml", "").getAbsolutePath(), helper.givenConfigFileInWorkDir("hz2.xml", "").getAbsolutePath(), helper.givenConfigFileInWorkDir("hz3.xml", "").getAbsolutePath() ); buildConfig(xmlWithCyclicImport, null); }
Source:
<code>public void testDefaultTheme() { SalesforceSDKTestManager.init(getInstrumentation().getTargetContext(), MainActivity.class); <START> Assert.assertFalse(SalesforceSDKTestManager.getInstance().isDarkTheme()); <END> }</code><technical_language>If I run test a device dark theme, fail</technical_language>

Target:
public void testDefaultTheme() { int currentNightMode = getInstrumentation().getContext().getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; Boolean isDarkTheme = currentNightMode == Configuration.UI_MODE_NIGHT_YES; SalesforceSDKTestManager.init(getInstrumentation().getTargetContext(), MainActivity.class); Assert.assertEquals("Default theme does not match OS value.", isDarkTheme, SalesforceSDKTestManager.getInstance().isDarkTheme()); }
Source:
<code>private SynchronizationModel resolveModelsWithLocal(IStorageProviderAccessor storageAccessor, IFile left, IStorage right, IStorage origin, IProgressMonitor monitor) throws InterruptedException { resolvedResources = new LinkedHashSet<URI>(); diagnostic = new BasicDiagnostic(); if (getResolutionScope() != CrossReferenceResolutionScope.SELF) { final SynchronizedResourceSet resourceSet = new SynchronizedResourceSet(); updateDependencies(resourceSet, left, monitor); updateChangedResources(resourceSet, monitor); } final Set<IStorage> leftTraversal = resolveTraversal(left, Collections.<URI> emptySet(), storageAccessor, monitor); while (!currentlyResolving.isEmpty()) { resolutionEnd.await(); } final Set<IStorage> rightTraversal = resolveRemoteTraversal(storageAccessor, right, leftTraversal, DiffSide.REMOTE, monitor); final Set<IStorage> originTraversal; if (origin != null) { originTraversal = resolveRemoteTraversal(storageAccessor, origin, leftTraversal, DiffSide.ORIGIN, monitor); } else { originTraversal = Collections.emptySet(); } final SynchronizationModel synchronizationModel = new SynchronizationModel(new StorageTraversal( leftTraversal), new StorageTraversal(rightTraversal), new StorageTraversal(originTraversal), diagnostic); diagnostic = null; <START> resolvedResources = null; <END> return synchronizationModel; }</code><technical_language>moved finally clause of calling "resolveModels(...)"</technical_language>

Target:
private SynchronizationModel resolveModelsWithLocal(IStorageProviderAccessor storageAccessor, IFile left, IStorage right, IStorage origin, IProgressMonitor monitor) throws InterruptedException { if (getResolutionScope() != CrossReferenceResolutionScope.SELF) { final SynchronizedResourceSet resourceSet = new SynchronizedResourceSet(); updateDependencies(resourceSet, left, monitor); updateChangedResources(resourceSet, monitor); } final Set<IStorage> leftTraversal = resolveTraversal(left, Collections.<URI> emptySet(), storageAccessor); while (!currentlyResolving.isEmpty()) { resolutionEnd.await(); } final Set<IStorage> rightTraversal = resolveRemoteTraversal(storageAccessor, right, leftTraversal, DiffSide.REMOTE, monitor); final Set<IStorage> originTraversal; if (origin != null) { originTraversal = resolveRemoteTraversal(storageAccessor, origin, leftTraversal, DiffSide.ORIGIN, monitor); } else { originTraversal = Collections.emptySet(); } final SynchronizationModel synchronizationModel = new SynchronizationModel(new StorageTraversal( leftTraversal), new StorageTraversal(rightTraversal), new StorageTraversal(originTraversal), diagnostic); return synchronizationModel; }
Source:
<code>protected boolean isQuerySatisfied(IntermediateResultsBlock resultsBlock) { if (_queryContext.getOrderByExpressions() == null) { <START> List<Object> result = resultsBlock.getAggregationResult(); <END> assert result != null && result.size() == 1 && result.get(0) instanceof DistinctTable; DistinctTable distinctTable = (DistinctTable) result.get(0); return distinctTable.size() >= _queryContext.getLimit(); } else { return false; } }</code><technical_language>stash order presence in a boolean instance variable avoid method call getOrderByExpressions() I called combine thread for segment is processing in a loop. Simply check for instance variable</technical_language>

Target:
protected boolean isQuerySatisfied(IntermediateResultsBlock resultsBlock) { if (_hasOrderBy) { return false; } List<Object> result = resultsBlock.getAggregationResult(); assert result != null && result.size() == 1 && result.get(0) instanceof DistinctTable; DistinctTable distinctTable = (DistinctTable) result.get(0); return distinctTable.size() >= _queryContext.getLimit(); }
Source:
<code>public PlanNode replaceChildren(List<PlanNode> newChildren) { <START> return new SortNode(getId(), Iterables.getOnlyElement(newChildren), orderingScheme, false); <END> }</code><technical_language>this isPartial</technical_language>

Target:
public PlanNode replaceChildren(List<PlanNode> newChildren) { return new SortNode(getId(), Iterables.getOnlyElement(newChildren), orderingScheme, isPartial); }
Source:
<code>private CloseableResource<BlockWorkerClient> acquireBlockWorkerClientInternal( final WorkerNetAddress workerNetAddress, final ClientContext context) throws IOException { SocketAddress address = NetworkAddressUtils .getDataPortSocketAddress(workerNetAddress, context.getClusterConf()); GrpcServerAddress serverAddress = GrpcServerAddress.create(workerNetAddress.getHost(), address); ClientPoolKey key = new ClientPoolKey(address, AuthenticationUserUtils .getImpersonationUser(context.getSubject(), context.getClusterConf())); return new CloseableResource<BlockWorkerClient>(mBlockWorkerClientPool.computeIfAbsent(key, k -> new BlockWorkerClientPool(context.getSubject(), serverAddress, context.getClusterConf().getInt(PropertyKey.USER_BLOCK_WORKER_CLIENT_POOL_SIZE), context.getClusterConf(), mWorkerGroup)) .acquire()) { ConcurrentHashMap<ClientPoolKey, BlockWorkerClientPool> mPoolMap = mBlockWorkerClientPool; @Override public void close() { releaseBlockWorkerClient(workerNetAddress, get(), context, mPoolMap); <START> } <END> }; }</code><technical_language>Hrmmm, avoid explicitly defining it, define a local final var for it? get captured right</technical_language>

Target:
private CloseableResource<BlockWorkerClient> acquireBlockWorkerClientInternal( final WorkerNetAddress workerNetAddress, final ClientContext context) throws IOException { SocketAddress address = NetworkAddressUtils .getDataPortSocketAddress(workerNetAddress, context.getClusterConf()); GrpcServerAddress serverAddress = GrpcServerAddress.create(workerNetAddress.getHost(), address); ClientPoolKey key = new ClientPoolKey(address, AuthenticationUserUtils .getImpersonationUser(context.getSubject(), context.getClusterConf())); final ConcurrentHashMap<ClientPoolKey, BlockWorkerClientPool> poolMap = mBlockWorkerClientPool; return new CloseableResource<BlockWorkerClient>(poolMap.computeIfAbsent(key, k -> new BlockWorkerClientPool(context.getSubject(), serverAddress, context.getClusterConf().getInt(PropertyKey.USER_BLOCK_WORKER_CLIENT_POOL_SIZE), context.getClusterConf(), mWorkerGroup)) .acquire()) { @Override public void close() { releaseBlockWorkerClient(workerNetAddress, get(), context, poolMap); } }; }
Source:
<code>private String getTargetOptions(final String path) { <START> if (!Strings.isNullOrEmpty(agentVolumeOptions)) { <END> return path + CONTAINER_TARGET + ":" + agentVolumeOptions; } else { return path + CONTAINER_TARGET; } }</code><technical_language>Please create constructor put this code in LocalCheInfrastructureProvisioner</technical_language>

Target:
private String getTargetOptions(final String path) { return path + CONTAINER_TARGET + agentVolumeOptions; }
Source:
<code>private void fire( final String stepName, final List<FiringGroup> firingGroups, final Collection<Unit> allEnemyUnitsAliveOrWaitingToDie, final Collection<Unit> allFriendlyUnitsAliveOrWaitingToDie, final boolean defender, final ReturnFire returnFire, final String text) { final GamePlayer firingPlayer = defender ? this.defender : attacker; final GamePlayer hitPlayer = !defender ? this.defender : attacker; for (final FiringGroup firingGroup : firingGroups) { stack.push( new Fire( <START> firingGroup.getValidTargets(), <END> returnFire, firingPlayer, hitPlayer, firingGroup.getFiringGroup(), stepName, text, this, defender, dependentUnits, headless, battleSite, territoryEffects, allEnemyUnitsAliveOrWaitingToDie, allFriendlyUnitsAliveOrWaitingToDie)); } }</code><technical_language>constructor firingGroup? Then, eliminate some of other params</technical_language>

Target:
private void fire( final String stepName, final List<FiringGroup> firingGroups, final Collection<Unit> allEnemyUnitsAliveOrWaitingToDie, final Collection<Unit> allFriendlyUnitsAliveOrWaitingToDie, final boolean defender, final ReturnFire returnFire, final String text) { final GamePlayer firingPlayer = defender ? this.defender : attacker; final GamePlayer hitPlayer = !defender ? this.defender : attacker; for (final FiringGroup firingGroup : firingGroups) { stack.push( new Fire( firingGroup, returnFire, firingPlayer, hitPlayer, stepName, text, this, defender, dependentUnits, headless, battleSite, territoryEffects, allEnemyUnitsAliveOrWaitingToDie, allFriendlyUnitsAliveOrWaitingToDie)); } }
Source:
<code>public Pod create(Pod pod) throws InfrastructureException { putLabel(pod, CHE_WORKSPACE_ID_LABEL, workspaceId); ObjectMeta metadata = pod.getMetadata(); PodSpec podSpec = pod.getSpec(); <START> podSpec.setRestartPolicy("Always"); END> try { Deployment deployment = clientFactory .create(workspaceId) .extensions() .deployments() .createNew() .withMetadata(metadata) .withNewSpec() .withReplicas(1) .withNewTemplate() .withMetadata(metadata) .withSpec(podSpec) .endTemplate() .endSpec() .done(); return awaitAndGetPod(deployment); } catch (KubernetesClientException e) { throw new KubernetesInfrastructureException(e); } }</code><technical_language>restart a pod if a container exits exit code 0? sure. is kinda a situation happen, right? sense OnFailure? I a strong opinion that, thinking a case</technical_language>

Target:
public Pod create(Pod pod) throws InfrastructureException { putLabel(pod, CHE_WORKSPACE_ID_LABEL, workspaceId); try { return clientFactory.create(workspaceId).pods().inNamespace(namespace).create(pod); } catch (KubernetesClientException e) { throw new KubernetesInfrastructureException(e); } }
Source:
<code>public boolean isParentOf(Beacon other) { <START> return FastByteComparisons.equal(this.getHash(), other.getHash()); <END> }</code><technical_language>equals, parent of</technical_language>

Target:
public boolean isParentOf(Beacon other) { return FastByteComparisons.equal(this.getParentHash(), other.getHash()); }
Source:
<code>private void checkText(Node textNode) { NodeList childNodes = textNode.getChildNodes(); <START> for (int j = 0; j < childNodes.getLength(); j++) { <END> Node childNode = childNodes.item(j); if (childNode.getNodeType() != Node.TEXT_NODE) { continue; } String text = childNode.getNodeValue(); while (StringUtils.contains(text, POM_PROPERTY_PREFIX)) { String property = extractPropertyName(text); reportIssue(childNode, "Replace \"pom." + property + "\" with \"project." + property + "\"."); text = skipFirstProperty(text); } } }</code><technical_language>In previous version, checked child of node. In this version, iterate children of node -> is normal</technical_language>

Target:
private void checkText(Node textNode) { asList(textNode.getChildNodes()).stream() .filter(node -> node.getNodeType() == Node.TEXT_NODE) .forEach(node -> { String text = node.getNodeValue(); while (StringUtils.contains(text, POM_PROPERTY_PREFIX)) { String property = extractPropertyName(text); reportIssue(node, "Replace \"pom." + property + "\" with \"project." + property + "\"."); text = skipFirstProperty(text); } }); }
Source:
<code>void warnOnPrivateHandlers(){ ModelVerifier verifier = new ModelVerifier(project); <START> Queue<SubstituteLoggingEvent> loggedMessages = redirectLogging(); <END> CommandHandlers model = CommandHandlers .newBuilder() .addCommandHandlingTypes(InvalidRestoreAggregate.class.getName()) .build(); verifier.verify(model); assertEquals(1, loggedMessages.size()); }</code><technical_language>This operation reset. Otherwise, affects other test cases</technical_language>

Target:
void warnOnPrivateHandlers(){ ModelVerifier verifier = new ModelVerifier(project); Queue<SubstituteLoggingEvent> loggedMessages = redirectLogging(); CommandHandlers model = CommandHandlers .newBuilder() .addCommandHandlingTypes(InvalidRestoreAggregate.class.getName()) .build(); verifier.verify(model); assertEquals(1, loggedMessages.size()); SubstituteLoggingEvent event = loggedMessages.poll(); assertEquals(event.getLevel(), Level.WARN); }
Source:
<code>public void install() { log.info("Waiting till the database is up"); entity.getConfig(Drupal.DATABASE_UP); log.info("Database is up and running"); String version = getVersion(); List<String> commands = new LinkedList<String>(); commands.add(CommonCommands.INSTALL_TAR); commands.add(CommonCommands.INSTALL_WGET); commands.add("apt-get update"); <START> commands.add(installPackage(of("yum", "httpd", "apt", "apache2"), null)); <END> commands.add(installPackage(of("yum", "php", "apt", "php5"), null)); commands.add(installPackage(of("yum", "php-mysql", "apt", "php5-mysql"), null)); commands.add(installPackage(of("yum", "php-gd", "apt", "php5-gd"), null)); commands.add(installPackage(of("apt", "libapache2-mod-php5"), null)); commands.add("/etc/init.d/apache2 stop"); commands.add(format("wget <LINK_0>", version)); commands.add(format("tar -xvf drupal-%s.tar.gz", version)); commands.add(format("cp -R drupal-%s/* /var/www/", version)); commands.add("cd /var/www"); commands.add("cp sites/default/default.settings.php sites/default/settings.php"); commands.add("chmod o+w sites/default/settings.php"); commands.add("chmod o+w sites/default"); commands.add("chown -R www-data.www-data /var/www"); commands.add("rm index.html"); newScript(INSTALLING). failOnNonZeroResultCode(). body.append(commands).execute(); }</code><technical_language>static import of "of" is confusing I think. Other method names intuitive do, "of" is classname well</technical_language>

Target:
public void install() { log.info("Waiting till the database is up"); entity.getConfig(Drupal.DATABASE_UP); log.info("Database is up and running"); String version = getVersion(); List<String> commands = new LinkedList<String>(); commands.add(CommonCommands.INSTALL_TAR); commands.add(CommonCommands.INSTALL_WGET); commands.add(installPackage(of("yum", "httpd", "apt", "apache2"), null)); commands.add(installPackage(of("yum", "php", "apt", "php5"), null)); commands.add(installPackage(of("yum", "php-mysql", "apt", "php5-mysql"), null)); commands.add(installPackage(of("yum", "php-gd", "apt", "php5-gd"), null)); commands.add(installPackage(of("apt", "libapache2-mod-php5"), null)); commands.add("/etc/init.d/apache2 stop"); commands.add(format("wget <LINK_0>", version)); commands.add(format("tar -xvf drupal-%s.tar.gz", version)); commands.add(format("cp -R drupal-%s/* /var/www/", version)); commands.add("cd /var/www"); commands.add("cp sites/default/default.settings.php sites/default/settings.php"); commands.add("mkdir -p /var/www/sites/default/files"); commands.add("chmod o+w sites/default/settings.php"); commands.add("chmod o+w sites/default"); commands.add("chown -R www-data.www-data /var/www"); commands.add("chgrp -R www-data /var/www/sites/default/files"); commands.add("chmod -R g+u /var/www/sites/default/files"); commands.add("rm index.html"); newScript(INSTALLING). failOnNonZeroResultCode(). body.append(commands).execute(); }
Source:
<code>protected void setPatterns() { String[] patterns = <START> currentPattern.split(";"); END> this.validPatterns = new StringMatcher[patterns.length]; int i = 0; for (String pattern : patterns) { if (!strict) { pattern = "*" + pattern.trim() + "*"; } validPatterns[i++] = new StringMatcher(pattern, ignoreCase, false); } clearCache(); }</code><technical_language>extract constant start of class</technical_language>

Target:
protected void setPatterns() { String[] patterns = currentPattern.split(SEMI_COLON); this.validPatterns = new StringMatcher[patterns.length]; int i = 0; for (String pattern : patterns) { if (!strict) { pattern = ASTERISK + pattern.trim() + ASTERISK; } validPatterns[i++] = new StringMatcher(pattern, ignoreCase, false); } clearCache(); }
Source:
<code><START> public JacksonSearchSerializer build() { <END> return (objectMapper == null) ? new JacksonSearchSerializer(new ObjectMapper()) : new JacksonSearchSerializer(objectMapper); }</code><technical_language>Azure Core implementation renamed? prototyping</technical_language>

Target:
public JacksonJsonSerializer build() { ObjectMapper mapper = objectMapper == null ? new ObjectMapper() : objectMapper; if (options != null && options.getJsonInclusion() == JsonInclusion.ALWAYS) { mapper.setSerializationInclusion(JsonInclude.Include.ALWAYS); } return new JacksonJsonSerializer(mapper); }
Source:
<code>public void testImportBreakpoints() throws Exception { createProject(); contextManager.activateContext("contextWithBreakpoints"); IInteractionContext testContext = contextManager.getActiveContext(); List<IBreakpoint> breakpoints = BreakpointsContextUtil.importBreakpoints(testContext); <START> assertTrue(breakpoints.size() == 2); <END> assertTrue(breakpoints.get(0) instanceof JavaLineBreakpoint); assertTrue(breakpoints.get(1) instanceof JavaLineBreakpoint); }</code><technical_language>this replaced assertEquals() constructing expected breakpoints exactly</technical_language>

Target:
public void testImportBreakpoints() throws Exception { BreakpointsTestUtil.createProject(); contextManager.activateContext("contextWithBreakpoints"); IInteractionContext testContext = contextManager.getActiveContext(); List<IBreakpoint> breakpoints = BreakpointsContextUtil.importBreakpoints(testContext, null); assertTrue(breakpoints.size() == 2); assertTrue(breakpoints.get(0) instanceof JavaLineBreakpoint); IMarker marker = breakpoints.get(0).getMarker(); assertEquals("test.java", marker.getResource().getName()); assertEquals(11, marker.getAttribute(IMarker.LINE_NUMBER, 0)); assertTrue(breakpoints.get(1) instanceof JavaLineBreakpoint); marker = breakpoints.get(1).getMarker(); assertEquals("test.java", marker.getResource().getName()); assertEquals(10, marker.getAttribute(IMarker.LINE_NUMBER, 0)); }
Source:
<code>boolean isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { <START> return (node.getMaxPartition() < 0 || node.getAssignedReplicaCount() < node.getMaxPartition()) <END> && (replica.getResourceMaxPartitionsPerInstance() < 0 || node.getAssignedPartitionsByResource(replica.getResourceName()).size() < replica .getResourceMaxPartitionsPerInstance()); }</code><technical_language>I prefer break long & nested conditions boolean values easier read</technical_language>

Target:
boolean isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { boolean exceedMaxPartitionLimit = node.getMaxPartition() < 0 || node.getAssignedReplicaCount() < node.getMaxPartition(); boolean exceedResourceMaxPartitionLimit = replica.getResourceMaxPartitionsPerInstance() < 0 || node.getAssignedPartitionsByResource(replica.getResourceName()).size() < replica .getResourceMaxPartitionsPerInstance(); return exceedMaxPartitionLimit && exceedResourceMaxPartitionLimit; }
Source:
<code>public List<String> getVanishedPlayers() { List<String> list = new ArrayList<>(); <START> list.addAll(vanishedPlayers); <END> return list; }</code><technical_language>This replaced by: java return new ArrayList<>(this.vanishedPlayers); question validity of returning a modifiable collection. While changes this collection changes, returning a modifiable collection in getVanishedPlayersSet() *would*, confuse some people. I recommend Collections#unmodifiableXYZ(...) wrap result instead</technical_language>

Target:
public List<String> getVanishedPlayers() { return Collections.unmodifiableList(new ArrayList<>(vanishedPlayers)); }
Source:
<code>private void setEnrichResultToBody(MessageContext synapseContext, SynapseJsonPath synapseJsonPath, Object sourceNode) { String expression = synapseJsonPath.getJsonPath().getPath(); if (expression.endsWith(".")) { expression = expression.substring(0, expression.length() - 1); } boolean isRootPath = "$".equals(expression); org.apache.axis2.context.MessageContext context = ((Axis2MessageContext) synapseContext) .getAxis2MessageContext(); assert JsonUtil.hasAJsonPayload(context) : "Message Context does not contain a JSON payload"; String jsonString = JsonUtil.jsonPayloadToString(context); String newJsonString = ""; if (action.equalsIgnoreCase(ACTION_REPLACE)) { if (isRootPath) { <START> log.error("Acting replace is not supported for root path in type custom. " + <END> "Please use type body action replace instead"); } else { newJsonString = JsonPath.parse(jsonString).set(expression, sourceNode).jsonString(); } } else if (action.equalsIgnoreCase(ACTION_ADD_CHILD)) { newJsonString = getNewJSONString(sourceNode, expression, jsonString, isRootPath); } else if (action.equalsIgnoreCase(ACTION_ADD_SIBLING)) { log.error("Action sibling is not supported. Please use child action instead"); } else { log.error("Invalid action set: " + action); } try { if (!newJsonString.trim().isEmpty()) { JsonUtil.getNewJsonPayload(context, newJsonString, true, true); } } catch (AxisFault axisFault) { log.error("Error occurred while setting new JSON payload", axisFault); } }</code><technical_language>check possibility move this validation deployment</technical_language>

Target:
private void setEnrichResultToBody(MessageContext synapseContext, SynapseJsonPath synapseJsonPath, Object sourceNode) { String expression = synapseJsonPath.getJsonPath().getPath(); if (expression.endsWith(".")) { expression = expression.substring(0, expression.length() - 1); } boolean isRootPath = "$".equals(expression); org.apache.axis2.context.MessageContext context = ((Axis2MessageContext) synapseContext) .getAxis2MessageContext(); assert JsonUtil.hasAJsonPayload(context) : "Message Context does not contain a JSON payload"; String jsonString = JsonUtil.jsonPayloadToString(context); String newJsonString = ""; if (action.equalsIgnoreCase(ACTION_REPLACE)) { newJsonString = JsonPath.parse(jsonString).set(expression, sourceNode).jsonString(); } else if (action.equalsIgnoreCase(ACTION_ADD_CHILD)) { newJsonString = getNewJSONString(sourceNode, expression, jsonString, isRootPath); } else if (action.equalsIgnoreCase(ACTION_ADD_SIBLING)) { log.error("Action sibling is not supported. Please use child action instead"); } else { log.error("Invalid action set: " + action); } try { if (!newJsonString.trim().isEmpty()) { JsonUtil.getNewJsonPayload(context, newJsonString, true, true); } } catch (AxisFault axisFault) { log.error("Error occurred while setting new JSON payload", axisFault); } }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> Boolean isDarkTheme = SalesforceSDKManager.getInstance().isDarkTheme(getActivity()); <END> setRetainInstance(true); setStyle(DialogFragment.STYLE_NORMAL, (isDarkTheme ? R.style.SalesforceSDK_Dialog_Dark : R.style.SalesforceSDK_Dialog)); }</code><technical_language>Lowercase boolean - primitive type</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); boolean isDarkTheme = SalesforceSDKManager.getInstance().isDarkTheme(getActivity()); setRetainInstance(true); setStyle(DialogFragment.STYLE_NORMAL, (isDarkTheme ? R.style.SalesforceSDK_Dialog_Dark : R.style.SalesforceSDK_Dialog)); }
Source:
<code>private static LockAndTimestampServices createRawServicesFromTimeLock( AtlasDbConfig config, TimestampStoreInvalidator invalidator, String userAgent) { Preconditions.checkState(config.timelock().isPresent(), <START> "Cannot create raw services from a config without a timelock block!"); <END> TimeLockClientConfig clientConfig = config.timelock().get(); String resolvedClient = OptionalResolver.resolve(clientConfig.client(), config.namespace()); TimeLockClientConfig timeLockClientConfig = TimeLockClientConfigs.copyWithClient(config.timelock().get(), resolvedClient); TimeLockMigrator.create(timeLockClientConfig, invalidator, userAgent).migrate(); return createNamespacedRawRemoteServices(timeLockClientConfig, userAgent); }</code><technical_language>a config -> timelock</technical_language>

Target:
private static LockAndTimestampServices createRawServicesFromTimeLock( AtlasDbConfig config, TimestampStoreInvalidator invalidator, String userAgent) { Preconditions.checkState(config.timelock().isPresent(), "Cannot create raw services from timelock without a timelock block!"); TimeLockClientConfig clientConfig = config.timelock().get(); String resolvedClient = OptionalResolver.resolve(clientConfig.client(), config.namespace()); TimeLockClientConfig timeLockClientConfig = TimeLockClientConfigs.copyWithClient(config.timelock().get(), resolvedClient); TimeLockMigrator.create(timeLockClientConfig, invalidator, userAgent).migrate(); return createNamespacedRawRemoteServices(timeLockClientConfig, userAgent); }
Source:
<code>public void handleViolation(final Violation violation) { ViolationEntity entity = buildViolationEntity(violation); this.violationRepository.save(entity); this.counterService.increment(VIOLATION_PERSISTED_JPA); <START> this.counterService.decrement(VIOLATION_EVENTBUS_QUEUED); <END> }</code><technical_language>I move line of this method</technical_language>

Target:
public void handleViolation(final Violation violation) { this.counterService.decrement(VIOLATIONS_EVENTBUS_QUEUED); ViolationEntity entity = buildViolationEntity(violation); this.violationRepository.save(entity); this.counterService.increment(VIOLATIONS_PERSISTED_JPA); }
Source:
<code>public void start() { if (started.compareAndSet(false, true)) { register(); scheduler = Utils.newScheduler(1, false); scheduler.scheduleAtFixedRate(new NettyMetricCollector(), 0, config.nettyMetricsRefreshIntervalSeconds, TimeUnit.SECONDS); <START> logger.trace("Schedule netty metric collector"); <END> } }</code><technical_language>change this INFO level</technical_language>

Target:
public void start() { if (started.compareAndSet(false, true)) { register(); scheduler = Utils.newScheduler(1, false); scheduler.scheduleAtFixedRate(new NettyMetricCollector(), 0, config.nettyMetricsRefreshIntervalSeconds, TimeUnit.SECONDS); logger.info("Schedule netty metric collector"); } }
Source:
<code>public Long parse(String formattedTime) { try { Period period = hourFormatter.parsePeriod(formattedTime); <START> return LocalDateTime.now().minusHours(period.getHours()).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); <END> } catch (IllegalArgumentException e) { logger.info("Could not parse period. {}", e.getMessage()); } try { return dateFormat.parse(formattedTime).toInstant().toEpochMilli(); } catch (ParseException e) { logger.info("Could not parse date. {}", e.getMessage()); } throw new IllegalArgumentException( "Could not parse given time. Available formats: period in hours (ex. \"-7h\") or date time with pattern " + dateTimeFormatPattern ); }</code><technical_language>i double check if this utc</technical_language>

Target:
public Long parse(String formattedTime) { try { Period period = hourFormatter.parsePeriod(formattedTime); return LocalDateTime.now().minusHours(period.getHours()).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); } catch (IllegalArgumentException e) { logger.info("Could not parse period. {}", e.getMessage()); } try { return LocalDateTime.parse(formattedTime, DateTimeFormatter.ISO_LOCAL_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); } catch (DateTimeParseException e) { logger.info("Could not parse date. {}", e.getMessage()); } throw new IllegalArgumentException( "Could not parse given time. Available formats: period in hours (ex. \"-7h\") or ISO local date time" ); }