auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static <T> Task<T> withSideEffect(final String desc, final Callable<Task<T>> func) { ArgumentUtil.requireNotNull(func, "function"); final Task<T> sideEffectWrapper = async(desc, ctx -> { Task<?> sideEffect = func.call(); ctx.runSideEffect(sideEffect); return Promises.value(null); }); sideEffectWrapper.getShallowTraceBuilder().setTaskType(TaskType.WITH_SIDE_EFFECT.getName()); return sideEffectWrapper; }

Target:
static <T> Task<Void> withSideEffect(final String desc, final Callable<Task<T>> func) { ArgumentUtil.requireNotNull(func, "function"); final Task<Void> sideEffectWrapper = async(desc, ctx -> { Task<?> sideEffect = func.call(); ctx.runSideEffect(sideEffect); return Promises.value(null); }); sideEffectWrapper.getShallowTraceBuilder().setTaskType(TaskType.WITH_SIDE_EFFECT.getName()); return sideEffectWrapper; }
Source:
private void uncheckElement(Object element) { fViewer.setChecked(element, false); for (Object child : fContentProvider.getChildren(element)) { uncheckElement(child); } }

Target:
private void uncheckElement(Object element) { fTree.setChecked(element, false); for (Object child : fContentProvider.getChildren(element)) { uncheckElement(child); } }
Source:
public void applyTitle(final String title, final W element, final MutationContext mutationContext) { if (title.trim().length() > 0) { viewHandler.applyTitle(title, mutationContext); applyFont(element, mutationContext); } }

Target:
public void applyTitle(final String title, final W element, final MutationContext mutationContext) { viewHandler.applyTitle(title, mutationContext); applyFont(element, mutationContext); }
Source:
public void addKeysSync(Set<String> changes) { changes.stream().forEach(change -> { String[] changeSplited = change.split(":"); String envname = changeSplited[1]; String objname = changeSplited[2]; String objid = changeSplited[3]; redisTemplate.opsForSet().add("sync:" + envname + ":" + objname + ":" + objid, String.valueOf(System.currentTimeMillis())); }); }

Target:
public void addKeysSync(Set<String> changes) { changes.stream().forEach(change -> { String[] changeSplited = change.split(":"); String envname = changeSplited[1]; String objname = changeSplited[2]; String objid = changeSplited[3]; redisTemplate.opsForSet().add(SYNC_PREFIX + envname + ":" + objname + ":" + objid, String.valueOf(System.currentTimeMillis())); }); }
Source:
public void onAddAccountsToGroup(Account.Id me, Collection<AccountGroupMember> added) { List<AccountGroupMemberAudit> auditInserts = Lists.newLinkedList(); for (AccountGroupMember m : added) { AccountGroupMemberAudit audit = new AccountGroupMemberAudit(m, me, TimeUtil.nowTs()); auditInserts.add(audit); } ReviewDb db = null; try { db = schema.open(); db.accountGroupMembersAudit().insert(auditInserts); } catch (OrmException e) { logOrmExceptionForAccounts( "Cannot log add accounts to group event performed by user", me, added, e); } finally { if (db != null) { db.close(); } } }

Target:
public void onAddAccountsToGroup(Account.Id me, Collection<AccountGroupMember> added) { List<AccountGroupMemberAudit> auditInserts = Lists.newLinkedList(); for (AccountGroupMember m : added) { AccountGroupMemberAudit audit = new AccountGroupMemberAudit(m, me, TimeUtil.nowTs()); auditInserts.add(audit); } try { ReviewDb db = schema.open(); try { db.accountGroupMembersAudit().insert(auditInserts); } finally { db.close(); } } catch (OrmException e) { logOrmExceptionForAccounts( "Cannot log add accounts to group event performed by user", me, added, e); } }
Source:
public Boolean call() throws Exception { long sleepBackoff = 200L; do { final PoolEntry poolEntry = createPoolEntry(); if (poolEntry == PoolEntry.MAXED_POOL_MARKER) { return Boolean.FALSE; } else if (poolEntry != null) { connectionBag.add(poolEntry); return Boolean.TRUE; } quietlySleep(sleepBackoff); sleepBackoff = Math.min(connectionTimeout / 2, (long) (sleepBackoff * 1.3)); } while (true); }

Target:
public Boolean call() throws Exception { long sleepBackoff = 200L; do { final PoolEntry poolEntry = createPoolEntry(); if (poolEntry == MAXED_POOL_MARKER) { return Boolean.FALSE; } else if (poolEntry != null) { connectionBag.add(poolEntry); return Boolean.TRUE; } quietlySleep(sleepBackoff); sleepBackoff = Math.min(connectionTimeout / 2, (long) (sleepBackoff * 1.3)); } while (true); }
Source:
protected void doStart(Collection<? extends Location> locations) { try { Task<?> clusterTask = DependentConfiguration.attributeWhenReady(router, AbstractGroup.FIRST); Entities.submit(this, clusterTask); clusterTask.get(); } catch (Exception e) { Exceptions.propagateIfFatal(e); } MongoDBAuthenticationUtils.setAuthenticationConfig(router, this); router.sensors().set(MongoDBAuthenticationMixins.ROOT_PASSWORD, router.config().get(MongoDBAuthenticationMixins.ROOT_PASSWORD)); router.sensors().set(MongoDBAuthenticationMixins.ROOT_USERNAME, router.config().get(MongoDBAuthenticationMixins.ROOT_USERNAME)); router.sensors().set(MongoDBAuthenticationMixins.AUTHENTICATION_DATABASE, router.config().get(MongoDBAuthenticationMixins.AUTHENTICATION_DATABASE)); Entities.manage(router); addEnricher(Enrichers.builder().propagating(MongoDBRouter.PORT).from(router).build()); super.doStart(locations); sensors().set(Startable.SERVICE_UP, true); }

Target:
protected void doStart(Collection<? extends Location> locations) { MongoDBRouter router = sensors().get(ROUTER); Task<?> clusterTask = DependentConfiguration.attributeWhenReady(router, AbstractGroup.FIRST); Entities.submit(this, clusterTask); clusterTask.getUnchecked(); MongoDBAuthenticationUtils.setAuthenticationConfig(router, this); router.sensors().set(MongoDBAuthenticationMixins.ROOT_PASSWORD, router.config().get(MongoDBAuthenticationMixins.ROOT_PASSWORD)); router.sensors().set(MongoDBAuthenticationMixins.ROOT_USERNAME, router.config().get(MongoDBAuthenticationMixins.ROOT_USERNAME)); router.sensors().set(MongoDBAuthenticationMixins.AUTHENTICATION_DATABASE, router.config().get(MongoDBAuthenticationMixins.AUTHENTICATION_DATABASE)); addEnricher(Enrichers.builder().propagating(MongoDBRouter.PORT).from(router).build()); super.doStart(locations); sensors().set(Startable.SERVICE_UP, true); }
Source:
private void pingSession( @Nonnull final MemcachedBackupSession session, @Nonnull final BackupSessionService backupSessionService ) { boolean touchResult; try { touchResult = _memcached.add( _storageKeyFormat.format(session.getIdInternal()), 5, BYTE_1 ); } catch ( final IOException e ) { _log.warn( "An exception occurred when trying to ping session " + session.getIdInternal(), e ); return; } if ( touchResult ) { _stats.nonStickySessionsPingFailed(); _log.warn( "The session " + session.getIdInternal() + " should be touched in memcached, but it does not exist" + " therein. Will store in memcached again." ); updateSession( session, backupSessionService ); } else _log.debug( "The session was ping'ed successfully." ); }

Target:
private void pingSession( @Nonnull final MemcachedBackupSession session, @Nonnull final BackupSessionService backupSessionService ) throws InterruptedException { final Future<Boolean> touchResult = _memcached.add( _storageKeyFormat.format(session.getIdInternal()), 5, BYTE_1 ); try { if ( touchResult.get() ) { _stats.nonStickySessionsPingFailed(); _log.warn( "The session " + session.getIdInternal() + " should be touched in memcached, but it does not exist" + " therein. Will store in memcached again." ); updateSession( session, backupSessionService ); } else _log.debug( "The session was ping'ed successfully." ); } catch ( final ExecutionException e ) { _log.warn( "An exception occurred when trying to ping session " + session.getIdInternal(), e ); } }
Source:
protected void load(WebContext webContext, BaseEntity<?> entity, List<Mapping> properties) { boolean hasError = false; for (Mapping columnProperty : properties) { Property property = entity.getDescriptor().getProperty(columnProperty); String propertyName = property.getName(); final Value parameterValue = webContext.get(propertyName); if (parameterValue.isNull()) { continue; } try { property.parseValues(entity, Values.of(parameterValue.get(List.class, Collections.singletonList(parameterValue.get())))); ensureTenantMatch(entity, property); } catch (HandledException exception) { UserContext.setFieldError(propertyName, parameterValue); UserContext.setErrorMessage(propertyName, exception.getMessage()); hasError = true; } } if (hasError) { throw Exceptions.createHandled().withNLSKey("BizController.illegalArgument").handle(); } }

Target:
protected void load(WebContext webContext, BaseEntity<?> entity, List<Mapping> properties) { boolean hasError = false; for (Mapping columnProperty : properties) { Property property = entity.getDescriptor().getProperty(columnProperty); if (!tryLoadProperty(webContext, entity, property)) { hasError = true; } } if (hasError) { throw Exceptions.createHandled().withNLSKey("BizController.illegalArgument").handle(); } }
Source:
public void testCheckWrongArgumentForFormat() throws Exception { OracleExportAction.OracleExportActionConfig oracleExportActionConfig = new OracleExportAction.OracleExportActionConfig(sshServer.getHost(), sshServer.getPort(), USER, PASSPHRASE, "system", "cask", "home", "sid", "/tmp/junit.csv", "select * from test;", "format"); OracleExportAction oracleExportAction = new OracleExportAction(oracleExportActionConfig); MockActionContext mockActionContext = new MockActionContext(); try { oracleExportAction.run(mockActionContext); } catch (IllegalArgumentException e) { Assert.assertEquals("Invalid format 'format'. Must be one of [csv, tsv, psv]", e.getMessage()); } }

Target:
public void testCheckWrongArgumentForFormat() throws Exception { OracleExportAction.OracleExportActionConfig oracleExportActionConfig = new OracleExportAction.OracleExportActionConfig(sshServer.getHost(), sshServer.getPort(), USER, "Password", PASSPHRASE, "", "", "system", "cask", "home", "sid", "/tmp/junit.csv", "select * from test;", "", "/tmp", "format"); try { MockPipelineConfigurer configurer = new MockPipelineConfigurer(null); new OracleExportAction(oracleExportActionConfig).configurePipeline(configurer); } catch (IllegalArgumentException e) { Assert.assertEquals(String.format("Invalid format '%s'. Must be one of %s", "format", EnumSet.allOf(OracleExportAction.SeparatorFormat.class)), e.getMessage()); } }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { pipelineConfigurer.createDataset(config.fileSetName, FileSet.class, FileSetProperties.builder() .setInputFormat(TextInputFormat.class) .setOutputFormat(TextOutputFormat.class) .setOutputProperty(TextOutputFormat.SEPERATOR, ":").build()); }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { pipelineConfigurer.createDataset(config.fileSetName, FileSet.class); Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { validateSchema(inputSchema); } }
Source:
public void sentMessageIsReceivedWithHeadersRouting() throws InterruptedException, IOException, TimeoutException { to.expectedMessageCount(1); Channel channel = connection().createChannel(); channel.basicPublish(HEADERS_EXCHANGE, "", propertiesWithHeader("foo", "bar"), MSG.getBytes()); channel.basicPublish(HEADERS_EXCHANGE, "", null, MSG.getBytes()); channel.basicPublish(HEADERS_EXCHANGE, "", propertiesWithHeader("foo", "bra"), MSG.getBytes()); Thread.sleep(500); to.assertIsSatisfied(); }

Target:
public void sentMessageIsReceivedWithHeadersRouting() throws InterruptedException, IOException, TimeoutException { to.expectedMessageCount(1); Channel channel = connection().createChannel(); channel.basicPublish(HEADERS_EXCHANGE, "", propertiesWithHeader("foo", "bar"), MSG.getBytes()); channel.basicPublish(HEADERS_EXCHANGE, "", null, MSG.getBytes()); channel.basicPublish(HEADERS_EXCHANGE, "", propertiesWithHeader("foo", "bra"), MSG.getBytes()); Awaitility.await() .during(1000, TimeUnit.MILLISECONDS) .atMost(2000, TimeUnit.MILLISECONDS) .until(() -> to.getReceivedCounter() >= 1); to.assertIsSatisfied(); }
Source:
public ListenableFuture<JobStatus<Ticket>> createTicketAsync(Ticket ticket) { return submit(req("POST", cnst("/tickets.json?async=true"), JSON, json(Collections.singletonMap("ticket", ticket))), handleJobStatus(Ticket.class)); }

Target:
public ListenableFuture<Ticket> createTicketAsync(Ticket ticket) { return submit(req("POST", cnst("/tickets.json"), JSON, json(Collections.singletonMap("ticket", ticket))), handle(Ticket.class, "ticket")); }
Source:
public List<Folder> findSubFoldersRecursively(Folder folder, User user, boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { if (!permissionAPI.doesUserHavePermission(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read Folder " + folder.getPath()); } List<Folder> subFolders = findSubFolders(folder, user, respectFrontEndPermissions); List<Folder> toIterateOver = new ArrayList<Folder>(subFolders); for (Folder f : toIterateOver) { if (permissionAPI.doesUserHavePermission(f, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { subFolders.addAll(findSubFoldersRecursively(f, user, respectFrontEndPermissions)); } } return subFolders; }

Target:
public List<Folder> findSubFoldersRecursively(Folder folder, User user, boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { if (!doesUserHavePermissions(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read Folder " + folder.getPath()); } List<Folder> subFolders = findSubFolders(folder, user, respectFrontEndPermissions); List<Folder> toIterateOver = new ArrayList<Folder>(subFolders); for (final Folder subFolder : toIterateOver) { if (doesUserHavePermissions(subFolder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { subFolders.addAll(findSubFoldersRecursively(subFolder, user, respectFrontEndPermissions)); } } return subFolders; }
Source:
public void destroyAllPersistenceContext() { if(recursiveDeleteDirectoryContent(rootDirectory)){ LOGGER.info("Destroying all file based persistence context"); } else { LOGGER.warn("Could not delete all file based persistence context"); } }

Target:
public void destroyAllPersistenceContext() { if(recursiveDeleteDirectoryContent(rootDirectory)){ LOGGER.info("Destroyed all file based persistence context"); } else { LOGGER.warn("Could not delete all file based persistence context"); } }
Source:
private static void validateOwnIdAttribute(EntityType entityType, Map<String, Attribute> ownAllAttrMap) { Attribute ownIdAttr = entityType.getOwnIdAttribute(); if (ownIdAttr != null) { Attribute ownAttr = ownAllAttrMap.get(ownIdAttr.getIdentifier()); if (ownAttr == null) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not part of the entity attributes", entityType.getId(), ownIdAttr.getName()))); } if (!AttributeUtils.isIdAttributeTypeAllowed(ownIdAttr)) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] type [%s] is not allowed", entityType.getId(), ownIdAttr.getName(), ownIdAttr.getDataType().toString()))); } if (!ownIdAttr.isUnique()) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not a unique attribute", entityType.getId(), ownIdAttr.getName()))); } if (ownIdAttr.isNillable()) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not a non-nillable attribute", entityType.getId(), ownIdAttr.getName()))); } if (!ownIdAttr.isVisible() && entityType.getLabelAttribute() == null) { throw new MolgenisValidationException(new ConstraintViolation( format("The ID attribute of EntityType [%s] can not be hidden because there is no label attribute specified", entityType.getId()))); } } else { if (!entityType.isAbstract() && entityType.getIdAttribute() == null) { throw new MolgenisValidationException(new ConstraintViolation( format("Entity [%s] is missing required ID attribute", entityType.getId()))); } } }

Target:
static void validateOwnIdAttribute(EntityType entityType, Map<String, Attribute> ownAllAttrMap) { Attribute ownIdAttr = entityType.getOwnIdAttribute(); if (ownIdAttr != null) { Attribute ownAttr = ownAllAttrMap.get(ownIdAttr.getIdentifier()); if (ownAttr == null) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not part of the entity attributes", entityType.getId(), ownIdAttr.getName()))); } if (!AttributeUtils.isIdAttributeTypeAllowed(ownIdAttr)) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] type [%s] is not allowed", entityType.getId(), ownIdAttr.getName(), ownIdAttr.getDataType().toString()))); } if (!ownIdAttr.isUnique()) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not a unique attribute", entityType.getId(), ownIdAttr.getName()))); } if (ownIdAttr.isNillable()) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not a non-nillable attribute", entityType.getId(), ownIdAttr.getName()))); } } else { if (!entityType.isAbstract() && entityType.getIdAttribute() == null) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] is missing required ID attribute", entityType.getId()))); } } }
Source:
public void intercept(IMethodInvocation invocation) throws Throwable { if (invocation.getMethod().getKind() == interceptPoint) { invoke(invocation); } }

Target:
public void intercept(IMethodInvocation invocation) throws Throwable { setUp(invocation); try { invocation.proceed(); } finally { destroy(); } }
Source:
public void initializeDefaultPreferences() { if (!getProfilingType().equals("generic")) { super.performDefaults(); String providerId = ProfileLaunchShortcut .getDefaultLaunchShortcutProviderId(getProfilingType()); configScopeInstance.getNode(getPluginID()) .put(getKey(), providerId); } }

Target:
public void initializeDefaultPreferences() { if (!getProfilingType().equals("generic")) { super.performDefaults(); String providerId = ProfileLaunchShortcut .getDefaultLaunchShortcutProviderId(getProfilingType()); configScopeInstance.getNode(getProfilingType()) .put(PREFS_KEY, providerId); } }
Source:
public String toString() { return null; }

Target:
public String toString() { return "Command for adding JMS Bridge named '" + name + "\' with attributes: {" + "replaceExisting=" + replaceExisting + ", qualityOfService=" + qualityOfService + ", failureRetryInterval=" + failureRetryInterval + ", maxRetries=" + maxRetries + ", maxBatchSize=" + maxBatchSize + ", maxBatchTime=" + maxBatchTime + ", sourceConnectionFactory='" + sourceConnectionFactory + '\'' + ", sourceDestination='" + sourceDestination + '\'' + ", sourceContext=" + sourceContext + ", targetConnectionFactory='" + targetConnectionFactory + '\'' + ", targetDestination='" + targetDestination + '\'' + ", targetContext=" + targetContext + '}'; }
Source:
public StatementExecution toStatementExecution() throws SQLException { System.out.println("DbStoredProcedureCall: toStatementExecution"); StatementExecution cs = new StatementExecution( this.environment.getConnection().prepareCall(toSqlString()), isFunction() ? this.environment.functionReturnValueViaResultSet() : false, isFunction() ? this.environment.discountFunctionReturnValueParameter() : false); bindParametersTo(cs); return cs; }

Target:
public StatementExecution toStatementExecution() throws SQLException { StatementExecution cs = new StatementExecution( this.environment.getConnection().prepareCall(toSqlString()), isFunction() ? this.environment.functionReturnValueViaResultSet() : false, isFunction() ? this.environment.discountFunctionReturnValueParameter() : false); bindParametersTo(cs); return cs; }
Source:
protected SashForm createSash(Composite parent) { final Composite sashComposite = new Composite(parent, SWT.FILL); final GridLayout sashLayout = GridLayoutFactory.fillDefaults().create(); sashLayout.marginWidth = 0; sashComposite.setLayout(sashLayout); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(sashComposite); final SashForm sash = new SashForm(sashComposite, SWT.VERTICAL); sash.setBackground(parent.getBackground()); GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(sash); sash.setSashWidth(5); return sash; }

Target:
protected SashForm createSash(Composite parent) { final SashForm sash = new SashForm(parent, SWT.VERTICAL); sash.setBackground(parent.getBackground()); GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(sash); sash.setSashWidth(5); return sash; }
Source:
protected void updateDetailsAvailability() { super.updateDetailsAvailability(); Cluster cluster = getSelectedItem(); boolean clusterSupportsVirtService = cluster != null && cluster.supportsVirtService(); getClusterVmListModel().setIsAvailable(clusterSupportsVirtService); getClusterServiceModel().setIsAvailable(clusterSupportsVirtService); getClusterGlusterHookListModel().setIsAvailable(clusterSupportsVirtService); getAffinityGroupListModel().setIsAvailable(clusterSupportsVirtService); getCpuProfileListModel().setIsAvailable(clusterSupportsVirtService); getAffinityLabelListModel().setIsAvailable(clusterSupportsVirtService); }

Target:
protected void updateDetailsAvailability() { super.updateDetailsAvailability(); Cluster cluster = getSelectedItem(); boolean clusterSupportsVirtService = cluster != null && cluster.supportsVirtService(); boolean clusterSupportsGlusterService = cluster != null && cluster.supportsGlusterService(); getClusterVmListModel().setIsAvailable(clusterSupportsVirtService); getClusterServiceModel().setIsAvailable(clusterSupportsGlusterService); getClusterGlusterHookListModel().setIsAvailable(clusterSupportsGlusterService); getAffinityGroupListModel().setIsAvailable(clusterSupportsVirtService); getCpuProfileListModel().setIsAvailable(clusterSupportsVirtService); getAffinityLabelListModel().setIsAvailable(clusterSupportsVirtService); }
Source:
private Function<PollingContext<DeletedCertificate>, Mono<PollResponse<DeletedCertificate>>> createDeletePollOperation(String keyName) { return pollingContext -> withContext(context -> service.getDeletedCertificatePoller(vaultUrl, keyName, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(deletedCertificateResponse -> { if (deletedCertificateResponse.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, pollingContext.getLatestResponse().getValue()))); } if (deletedCertificateResponse.getStatusCode() == HttpURLConnection.HTTP_FORBIDDEN) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.fromString("FORBIDDEN", true), pollingContext.getLatestResponse().getValue()))); } return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, deletedCertificateResponse.getValue()))); })) .onErrorReturn(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue())); }

Target:
private Function<PollingContext<DeletedCertificate>, Mono<PollResponse<DeletedCertificate>>> createDeletePollOperation(String keyName) { return pollingContext -> withContext(context -> service.getDeletedCertificatePoller(vaultUrl, keyName, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(deletedCertificateResponse -> { if (deletedCertificateResponse.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, pollingContext.getLatestResponse().getValue()))); } if (deletedCertificateResponse.getStatusCode() == HttpURLConnection.HTTP_FORBIDDEN) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue()))); } return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, deletedCertificateResponse.getValue()))); })) .onErrorReturn(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue())); }
Source:
public static Mono<BinaryData> fromFlux(Flux<ByteBuffer> data) { Objects.requireNonNull(data, "'data' cannot be null."); return FluxUtil.collectBytesInByteBufferStream(data) .flatMap(bytes -> Mono.just(fromBytes(bytes))); }

Target:
public static Mono<BinaryData> fromFlux(Flux<ByteBuffer> data) { if (Objects.isNull(data)) { return monoError(LOGGER, new NullPointerException("'data' cannot be null.")); } return FluxUtil.collectBytesInByteBufferStream(data) .flatMap(bytes -> Mono.just(fromBytes(bytes))); }
Source:
public ProcessInstance getProcessInstance(String instanceId) throws WorkflowException { ProcessInstanceImpl instance = repository.getById(instanceId); return instance; }

Target:
public ProcessInstance getProcessInstance(String instanceId) throws WorkflowException { return repository.getById(instanceId); }
Source:
private boolean loadDataInMemory() { String value = Optional.ofNullable(GeoServerExtensions.getProperty("WMTS_HISTOGRAM_IN_MEMORY")) .orElse("false"); return Boolean.getBoolean(value); }

Target:
private boolean loadDataInMemory() { String value = GeoServerExtensions.getProperty("WMTS_HISTOGRAM_IN_MEMORY"); return Boolean.getBoolean(value); }
Source:
private LoggingRegistry() { this.map = new ConcurrentHashMap<>(); this.childrenMap = new ConcurrentHashMap<>(); this.fileWriterBuffers = new ConcurrentHashMap<>(); this.registerPurgeQueue = new ConcurrentLinkedQueue<>(); this.lastModificationTime = new Date(); this.maxSize = Const.toInt( EnvUtil.getSystemProperty( "KETTLE_MAX_LOGGING_REGISTRY_SIZE" ), DEFAULT_MAX_SIZE ); this.purgeTimeout = Const.toInt( EnvUtil.getSystemProperty( "KETTLE_LOGGING_REGISTRY_PURGE_TIMEOUT" ), DEFAULT_PURGE_TIMER ); this.purgeTimerCount = 0; this.purgedObjectCount = 0; this.foundCounter = 0; installPurgeTimer(); }

Target:
private LoggingRegistry() { this.map = new ConcurrentHashMap<>(); this.childrenMap = new ConcurrentHashMap<>(); this.fileWriterBuffers = new ConcurrentHashMap<>(); this.registerPurgeQueue = new ConcurrentLinkedQueue<>(); this.lastModificationTime = new Date(); this.purgeTimerCount = 0; this.purgedObjectCount = 0; this.foundCounter = 0; updateFromProperties(); installPurgeTimer(); }
Source:
public void shouldBeAbleToUseSessionAfterDefaultTransactionFails() throws Exception { User u1 = new User("frantisek"); session.save(u1); session.clear(); try { session.save(new User("frantisek")); } catch (Exception ex) { logger.info("Caught exception", ex); } User loaded = session.load(User.class, u1.getId()); assertThat(loaded).isNotNull(); }

Target:
public void shouldBeAbleToUseSessionAfterDefaultTransactionFails() throws Exception { User u1 = new User("frantisek"); session.save(u1); session.clear(); try { session.save(new User("frantisek")); fail("Constraint violation should have make the second save fail"); } catch (Exception ex) { logger.info("Caught exception", ex); } User loaded = session.load(User.class, u1.getId()); assertThat(loaded).isNotNull(); }
Source:
protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters"; }

Target:
protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters/xpathfilter"; }
Source:
public CXXGetJavaDataScenario(@NonNull Configuration config, @NonNull Context context) { super(config, context); config.setAutoTrackSessions(false); config.addMetadata("notData", "vals", "passMetaData"); config.setAppVersion("passAppVersion"); config.setContext("passContext"); config.setUser("passUser", "passUser", "passUser"); }

Target:
public CXXGetJavaDataScenario(@NonNull Configuration config, @NonNull Context context) { super(config, context); config.setAutoTrackSessions(false); config.addMetadata("notData", "vals", "passMetaData"); config.setAppVersion("passAppVersion"); config.setContext("passContext"); config.setUser("passUserId", "passUserEmail", "passUserName"); }
Source:
public void testEmptyDictionary() throws Exception { String doc1 = "doc1"; String key1 = "emptyDict"; MutableDocument mDoc = new MutableDocument(doc1); mDoc.setDictionary(key1, new MutableDictionary()); save(mDoc); final Query query = QueryBuilder.select(SelectResult.property(key1)) .from(DataSource.database(db)) .where(Meta.id.equalTo(Expression.string(doc1))); ResultSet results = query.execute(); for (Result result : results.allResults()) { result.toMap(); } }

Target:
public void testEmptyDictionary() throws Exception { String doc1 = "doc1"; String key1 = "emptyDict"; MutableDocument mDoc = new MutableDocument(doc1); mDoc.setDictionary(key1, new MutableDictionary()); save(mDoc); final Query query = QueryBuilder.select(SelectResult.property(key1)) .from(DataSource.database(db)) .where(Meta.id.equalTo(Expression.string(doc1))); ResultSet results = query.execute(); assertNotNull(results); for (Result result : results.allResults()) { assertNotNull(result); assertEquals(1, result.toMap().size()); Dictionary emptyDict = result.getDictionary(key1); assertNotNull(emptyDict); assertTrue(emptyDict.isEmpty()); } }
Source:
private String formattedRule() { if (rule == null) { return ""; } return String.format("[%s]", rule.getName()); }

Target:
private String formattedRule() { return String.format("[%s]", rule.getName()); }
Source:
public void addLine(Object object) { SortedSet<Method> methods = getSortedMethods(object); for (Method method : methods) { if (method.getName().startsWith("get") && method.getParameterTypes().length == 0) { try { if (method.getReturnType().equals(boolean.class)) { builder.append((Boolean) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(int.class)) { builder.append((Integer) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(long.class)) { builder.append((Long) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(double.class)) { builder.append((Double) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(String.class)) { builder.append((String) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(Date.class)) { Date value = (Date) method.invoke(object); builder.append(DATE_FORMAT.print(new DateTime(value))); addSeparator(); } else if (method.getReturnType().equals(Map.class)) { Map value = (Map) method.invoke(object); if (value != null) { String map = MiscFormatter.toJson(value).toString(); map = map.replaceAll("[\\{|\\}|\"]", ""); map = map.replaceAll(",", " "); builder.append(map); addSeparator(); } } } catch (IllegalAccessException | InvocationTargetException error) { Log.warning(error); } } } addLineEnding(); }

Target:
public void addLine(Object object) { SortedSet<Method> methods = getSortedMethods(object); for (Method method : methods) { if (method.getName().startsWith("get") && method.getParameterTypes().length == 0) { try { if (method.getReturnType().equals(boolean.class)) { builder.append((Boolean) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(int.class)) { builder.append((Integer) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(long.class)) { builder.append((Long) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(double.class)) { builder.append((Double) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(String.class)) { builder.append((String) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(Date.class)) { Date value = (Date) method.invoke(object); builder.append(DATE_FORMAT.print(new DateTime(value))); addSeparator(); } else if (method.getReturnType().equals(Map.class)) { Map value = (Map) method.invoke(object); if (value != null) { String map = MiscFormatter.toJson(value).toString(); map = map.replaceAll("[\\{\\}\"]", ""); map = map.replaceAll(",", " "); builder.append(map); addSeparator(); } } } catch (IllegalAccessException | InvocationTargetException error) { Log.warning(error); } } } addLineEnding(); }
Source:
static Stream<Arguments> getTestParameters() { CertificateServiceVersion[] filteredKeyServiceVersion = Arrays.stream(CertificateServiceVersion.values()) .filter(CertificateClientTestBase::shouldServiceVersionBeTested) .toArray(CertificateServiceVersion[]::new); boolean rollingServiceVersion = SERVICE_VERSION_FROM_ENV != null && SERVICE_VERSION_FROM_ENV .equalsIgnoreCase(AZURE_TEST_SERVICE_VERSIONS_VALUE_ROLLING); return getArgumentsFromServiceVersion(Arrays.asList(filteredKeyServiceVersion), rollingServiceVersion); }

Target:
static Stream<Arguments> getTestParameters() { return getArgumentsFromServiceVersion(CertificateServiceVersion.values(), shouldServiceVersionBeTested, SERVICE_VERSION_FROM_ENV); }
Source:
private void executeTask(DatastreamTask task) { Datastream datastream = task.getDatastreams().get(0); int messageSize = _messageSize; long sleepBetweenSendMs = _sleepBetweenSendMs; long index = 0; if (datastream.hasMetadata()) { StringMap dsMetadata = datastream.getMetadata(); if (dsMetadata.containsKey(CFG_MESSAGE_SIZE_KB)) { messageSize = Integer.parseInt(dsMetadata.get(CFG_MESSAGE_SIZE_KB)); } if (dsMetadata.containsKey(CFG_SLEEP_BETWEEN_SEND_MS)) { sleepBetweenSendMs = Long.parseLong(dsMetadata.get(CFG_SLEEP_BETWEEN_SEND_MS)); } } while (true) { DatastreamProducerRecord record = createDatastreamEvent(index, messageSize); task.getEventProducer().send(record, (metadata, exception) -> { if (exception != null) { LOG.error("Send failed for event " + metadata.getCheckpoint(), exception); } }); try { Thread.sleep(sleepBetweenSendMs); } catch (InterruptedException e) { String msg = "Producer thread is interrupted. Stopping the producer for task " + task; LOG.error(msg, e); throw new DatastreamRuntimeException(msg, e); } index++; } }

Target:
private void executeTask(DatastreamTask task) { try { Datastream datastream = task.getDatastreams().get(0); int partitions = datastream.getDestination().getPartitions(); int messageSize = _messageSize; long sleepBetweenSendMs = _sleepBetweenSendMs; String checkpoint = task.getCheckpoints().getOrDefault(0, "0"); long index = Long.parseLong(StringUtils.isBlank(checkpoint) ? "0" : checkpoint); LOG.info("Checkpoint string = " + checkpoint + " index = " + index); if (datastream.hasMetadata()) { StringMap dsMetadata = datastream.getMetadata(); if (dsMetadata.containsKey(CFG_MESSAGE_SIZE_BYTES)) { messageSize = Integer.parseInt(dsMetadata.get(CFG_MESSAGE_SIZE_BYTES)); } if (dsMetadata.containsKey(CFG_SLEEP_BETWEEN_SEND_MS)) { sleepBetweenSendMs = Long.parseLong(dsMetadata.get(CFG_SLEEP_BETWEEN_SEND_MS)); } } while (true) { for (int partition = 0; partition < partitions; partition++) { DatastreamProducerRecord record = createDatastreamEvent(index, messageSize, partition); task.getEventProducer().send(record, (metadata, exception) -> { if (exception != null) { LOG.error("Send failed for event " + metadata.getCheckpoint(), exception); } }); try { Thread.sleep(sleepBetweenSendMs); } catch (InterruptedException e) { String msg = "Producer thread is interrupted. Stopping the producer for task " + task; LOG.error(msg, e); throw new DatastreamRuntimeException(msg, e); } } index++; } } catch (Exception ex) { LOG.error("Event producer threw exception ", ex); } }
Source:
public void reactiveCancel() { if (CoAP.isTcpScheme(request.getScheme())) { proactiveCancel(); } else { cancel(); } }

Target:
public void reactiveCancel() { if (CoAP.isTcpScheme(request.getScheme())) { LOGGER.log(Level.INFO, "Change to cancel the observe {0} proactive over TCP.", request.getTokenString()); proactiveCancel(); } else { cancel(); } }
Source:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); jobProperties.put(VdcObjectType.StoragePool.toString().toLowerCase(), getStoragePoolName()); jobProperties.put(VdcObjectType.VmTemplate.toString().toLowerCase(), getVmTemplateName()); } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); jobProperties.put(VdcObjectType.StoragePool.name().toLowerCase(), getStoragePoolName()); jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), getVmTemplateName()); } return jobProperties; }
Source:
public void testUnmarshallEndSignalEvent() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDSIGNALEVENT); assertDiagram(diagram, 2); assertEquals("EndEventAssignments", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> endSignalEventNode = diagram.getGraph().getNode("_C9151E0C-2E3E-4558-AFC2-34038E3A8552"); EndSignalEvent endSignalEvent = (EndSignalEvent) endSignalEventNode.getContent().getDefinition(); DataIOSet dataIOSet = endSignalEvent.getDataIOSet(); AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo(); assertEquals("EndSignalEventInput1:String||||[din]employee->EndSignalEventInput1", assignmentsinfo.getValue()); }

Target:
public void testUnmarshallEndSignalEvent() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDSIGNALEVENT); assertDiagram(diagram, 2); assertEquals("EndEventAssignments", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> endSignalEventNode = diagram.getGraph().getNode("_C9151E0C-2E3E-4558-AFC2-34038E3A8552"); EndSignalEvent endSignalEvent = (EndSignalEvent) endSignalEventNode.getContent().getDefinition(); DataIOSet dataIOSet = endSignalEvent.getDataIOSet(); AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo(); assertEquals("EndSignalEventInput1:String||||[din]employee->EndSignalEventInput1", assignmentsinfo.getValue()); assertEquals("project", endSignalEvent.getExecutionSet().getSignalScope().getValue()); assertEquals("employee", endSignalEvent.getExecutionSet().getSignalRef().getValue()); }
Source:
public void testMatches() { fFilter.addChild(TRUE_NODE); fFilter.addChild(TRUE_NODE); assertTrue(fFilter.matches(fEvent)); fFilter.replaceChild(0, FALSE_NODE); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(true); assertFalse(fFilter.matches(fEvent)); }

Target:
public void testMatches() { fFilter.setNot(false); assertFalse(fFilter.matches(fEvent)); fFilter.setNot(true); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(false); fFilter.addChild(TRUE_NODE); fFilter.addChild(TRUE_NODE); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(true); assertFalse(fFilter.matches(fEvent)); fFilter.replaceChild(0, FALSE_NODE); assertFalse(fFilter.matches(fEvent)); fFilter.replaceChild(1, FALSE_NODE); fFilter.setNot(true); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(false); assertFalse(fFilter.matches(fEvent)); }
Source:
private Boolean rowTypesAreEquivalent( MutableRel rel0, MutableRel rel1, Litmus litmus) { assert rel0.rowType.getFieldCount() == rel1.rowType.getFieldCount() : Pair.of(rel0, rel1); for (Pair<RelDataTypeField, RelDataTypeField> pair : Pair.zip(rel0.rowType.getFieldList(), rel0.rowType.getFieldList())) { if (!pair.left.getType().equals(pair.right.getType())) { return litmus.fail(Pair.of(rel0, rel1).toString()); } } return litmus.succeed(); }

Target:
private boolean rowTypesAreEquivalent( MutableRel rel0, MutableRel rel1, Litmus litmus) { if (rel0.rowType.getFieldCount() != rel1.rowType.getFieldCount()) { return litmus.fail("Mismatch for column count: [{}]", Pair.of(rel0, rel1)); } for (Pair<RelDataTypeField, RelDataTypeField> pair : Pair.zip(rel0.rowType.getFieldList(), rel0.rowType.getFieldList())) { if (!pair.left.getType().equals(pair.right.getType())) { return litmus.fail("Mismatch for column type: [{}]", Pair.of(rel0, rel1)); } } return litmus.succeed(); }
Source:
public void testSleep() { long now = System.currentTimeMillis(); Util.sleep(100); assertTrue(System.currentTimeMillis() - now >= 100); now = System.currentTimeMillis(); long then = now + 100; Util.sleepAfter(then, 100); assertTrue(System.currentTimeMillis() - now >= 200); now = System.currentTimeMillis(); then = now - 550; Util.sleepAfter(then, 500); assertTrue(System.currentTimeMillis() - now < 500); String LicenseKeytest = Util.generateLicenseKey(); System.out.println(LicenseKeytest); }

Target:
public void testSleep() { long now = System.currentTimeMillis(); Util.sleep(100); assertTrue(System.currentTimeMillis() - now >= 100); now = System.currentTimeMillis(); long then = now + 100; Util.sleepAfter(then, 100); assertTrue(System.currentTimeMillis() - now >= 200); now = System.currentTimeMillis(); then = now - 550; Util.sleepAfter(then, 500); assertTrue(System.currentTimeMillis() - now < 500); String computerIdentifier = Util.getComputerIdentifier(); String idParts[] = computerIdentifier.split("-"); assertEquals(4, idParts.length); }
Source:
private byte[] readSequence(final int knownLength) { byte[] bases = (knownLength == -1) ? basesBuffer : new byte[knownLength] ; int sequenceLength = 0; while (!in.eof()) { final boolean sawEoln = in.skipNewlines(); if (in.eof()) { break; } if (sawEoln && in.peekByte() == '>') { break; } sequenceLength += in.readToEndOfOutputBufferOrEoln(bases, sequenceLength); while (sequenceLength > 0 && Character.isWhitespace(StringUtil.byteToChar(bases[sequenceLength - 1]))) { --sequenceLength; } if (sequenceLength == knownLength) { break; } if (sequenceLength == bases.length) { final byte[] tmp = new byte[bases.length * 2]; System.arraycopy(bases, 0, tmp, 0, sequenceLength); bases = tmp; } } skipToEoln(); if (sequenceLength != bases.length || bases == basesBuffer) { final byte[] tmp = new byte[sequenceLength]; System.arraycopy(bases, 0, tmp, 0, sequenceLength); bases = tmp; } return bases; }

Target:
private byte[] readSequence(final int knownLength) { byte[] bases = (knownLength == -1) ? basesBuffer : new byte[knownLength] ; int sequenceLength = 0; while (!in.eof()) { final boolean sawEoln = in.skipNewlines(); if (in.eof()) { break; } if (sawEoln && in.peekByte() == '>') { break; } sequenceLength += in.readToEndOfOutputBufferOrEoln(bases, sequenceLength); while (sequenceLength > 0 && Character.isWhitespace(StringUtil.byteToChar(bases[sequenceLength - 1]))) { --sequenceLength; } if (sequenceLength == knownLength) { skipToEoln(); break; } if (sequenceLength == bases.length) { final byte[] tmp = new byte[bases.length * 2]; System.arraycopy(bases, 0, tmp, 0, sequenceLength); bases = tmp; } } if (sequenceLength != bases.length || bases == basesBuffer) { final byte[] tmp = new byte[sequenceLength]; System.arraycopy(bases, 0, tmp, 0, sequenceLength); bases = tmp; } return bases; }
Source:
public void beginTree(DetailAST rootAST) { rangeValues.clear(); expressionValues.clear(); processedExpressionRange.resetRange(); currentRangeValue = INITIAL_VALUE; }

Target:
public void beginTree(DetailAST rootAST) { rangeValues.clear(); expressionValues.clear(); isAfterValues.clear(); processingTokenEnd.reset(); currentRangeValue = INITIAL_VALUE; branchVisited = false; }
Source:
public static void main(String[] args) throws Exception { CommandLine cmdLine = new CommandLine(); Config config = cmdLine.loadConfig(cmdLine.parser().parse(args)); LocalApplicationRunner localRunner = new LocalApplicationRunner(config); localRunner.run(new BroadcastExample()); }

Target:
public static void main(String[] args) throws Exception { CommandLine cmdLine = new CommandLine(); Config config = cmdLine.loadConfig(cmdLine.parser().parse(args)); LocalApplicationRunner localRunner = new LocalApplicationRunner(config); localRunner.run(new MergeExample()); }
Source:
public WriteResponse validateApiKey( HttpServletRequest request, HttpServletResponse response, Publisher publisher ) { Maybe<ApplicationConfiguration> possibleConfig; try { possibleConfig = appConfigFetcher.configurationFor(request); } catch (ApiKeyNotFoundException | RevokedApiKeyException | InvalidIpForApiKeyException ex) { return error(request, response, AtlasErrorSummary.forException(ex)); } if (!possibleConfig.isNothing()) { return error( request, response, AtlasErrorSummary.forException(new UnauthorizedException( "API key is unauthorised" )) ); } if (!possibleConfig.requireValue().canWrite(publisher)) { return error( request, response, AtlasErrorSummary.forException(new ForbiddenException( "API key does not have write permission" )) ); } return null; }

Target:
private Optional<AtlasErrorSummary> validateApiKey( HttpServletRequest request, HttpServletResponse response, Publisher publisher ) { if (!possibleConfig.requireValue().canWrite(publisher)) { return Optional.of( AtlasErrorSummary.forException(new ForbiddenException( "API key does not have write permission" )) ); } return Optional.empty(); }
Source:
public void functionsOcrProcess_shouldDetectText() throws IOException { GcsEvent gcsEvent = new GcsEvent(); gcsEvent.bucket = FUNCTIONS_BUCKET; gcsEvent.name = "wakeupcat.jpg"; new OcrProcessImage().accept(gcsEvent, null); List<LogRecord> logs = LOG_HANDLER.getStoredLogRecords(); assertThat(logs.get(1).getMessage()).contains("Extracted text from image: Wake up human!"); assertThat(logs.get(2).getMessage()).contains("Detected language en for file wakeupcat.jpg"); }

Target:
public void functionsOcrProcess_shouldDetectText() throws IOException { GcsEvent gcsEvent = new GcsEvent(); gcsEvent.setBucket(FUNCTIONS_BUCKET); gcsEvent.setName("wakeupcat.jpg"); new OcrProcessImage().accept(gcsEvent, null); List<LogRecord> logs = LOG_HANDLER.getStoredLogRecords(); assertThat(logs.get(1).getMessage()).contains("Extracted text from image: Wake up human!"); assertThat(logs.get(2).getMessage()).contains("Detected language en for file wakeupcat.jpg"); }
Source:
private void detectDeadHost() { long current_time = EstTime.currentTimeMillis(); long current_delta = current_time - m_lastMessageMillis.get(); if (current_delta > m_logRate) { rateLimitedLogger.log( "Have not received a message from host " + hostnameAndIPAndPort() + " for " + (current_delta / 1000.0) + " seconds", current_time); } if (m_isUp && current_delta > m_deadHostTimeout) { if (m_deadReportsCount.getAndIncrement() == 0) { hostLog.error("DEAD HOST DETECTED, hostname: " + hostnameAndIPAndPort()); hostLog.info("\tcurrent time: " + current_time); hostLog.info("\tlast message: " + m_lastMessageMillis.get()); hostLog.info("\tdelta (millis): " + current_delta); hostLog.info("\ttimeout value (millis): " + m_deadHostTimeout); VoltDB.dropStackTrace("Timed out foreign host " + hostnameAndIPAndPort() + " with delta " + current_delta); } m_hostMessenger.reportForeignHostFailed(m_hostId); } }

Target:
private void detectDeadHost() { long current_time = EstTime.currentTimeMillis(); long last_time = m_lastMessageMillis.get(); long current_delta = current_time - last_time; if (m_isUp && current_delta > m_deadHostTimeout) { if (m_deadReportsCount.getAndIncrement() == 0) { hostLog.error("DEAD HOST DETECTED, hostname: " + hostnameAndIPAndPort()); hostLog.info("\tcurrent time: " + current_time); hostLog.info("\tlast message: " + last_time); hostLog.info("\tdelta (millis): " + current_delta); hostLog.info("\ttimeout value (millis): " + m_deadHostTimeout); VoltDB.dropStackTrace("Timed out foreign host " + hostnameAndIPAndPort()); } m_hostMessenger.reportForeignHostFailed(m_hostId); } if (current_delta > m_logRate) { rateLimitedLogger.log( "Have not received a message from host " + hostnameAndIPAndPort() + " for " + (current_delta / 1000.0) + " seconds", current_time); } }