instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public boolean hasOffset() { return this.delegate.hasOffset(); } public long offset() { return this.delegate.offset(); } public boolean hasTimestamp() { return this.delegate.hasTimestamp(); } public long timestamp() { return this.delegate.timestamp(); } public int serializedKeySize() { return this...
public int partition() { return this.delegate.partition(); } public TimestampType timestampType() { return this.timestampType; } @Override public int hashCode() { return this.delegate.hashCode() + this.timestampType.name().hashCode(); } @Override public boolean equals(Object obj) { if (!(obj instance...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\listener\adapter\ConsumerRecordMetadata.java
1
请完成以下Java代码
public void setCertificatePath (java.lang.String CertificatePath) { set_Value (COLUMNNAME_CertificatePath, CertificatePath); } /** Get Zertifikatpfad. @return Zertifikatpfad */ @Override public java.lang.String getCertificatePath () { return (java.lang.String)get_Value(COLUMNNAME_CertificatePath); } ...
} /** Set Support Benutzer. @param Support_User_ID Benutzer für Benachrichtigungen */ @Override public void setSupport_User_ID (int Support_User_ID) { if (Support_User_ID < 1) set_Value (COLUMNNAME_Support_User_ID, null); else set_Value (COLUMNNAME_Support_User_ID, Integer.valueOf(Support_User...
repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.securpharm\src\main\java-gen\de\metas\vertical\pharma\securpharm\model\X_M_Securpharm_Config.java
1
请完成以下Java代码
public Node getNodeById(String id) { try { SAXReader reader = new SAXReader(); Document document = reader.read(file); List<Node> elements = document.selectNodes("//*[@tutId='" + id + "']"); return elements.get(0); } catch (DocumentException e) { ...
e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void generateNewDocument() { try { Document document = DocumentHelper.createDocument(); Element root = document.addElement("...
repos\tutorials-master\xml-modules\xml\src\main\java\com\baeldung\xml\Dom4JParser.java
1
请在Spring Boot框架中完成以下Java代码
public boolean isAllowCoreThreadTimeout() { return this.allowCoreThreadTimeout; } public void setAllowCoreThreadTimeout(boolean allowCoreThreadTimeout) { this.allowCoreThreadTimeout = allowCoreThreadTimeout; } public Duration getKeepAlive() { return this.keepAlive; } public void setKeepAlive(Dur...
* Maximum time the executor should wait for remaining tasks to complete. */ private @Nullable Duration awaitTerminationPeriod; public boolean isAwaitTermination() { return this.awaitTermination; } public void setAwaitTermination(boolean awaitTermination) { this.awaitTermination = awaitTermination; ...
repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\task\TaskExecutionProperties.java
2
请完成以下Java代码
public DocumentDescriptor getDocumentDescriptor(@NonNull final WindowId windowId) { try { return documentDescriptorsByWindowId.getOrLoad(windowId, this::loadDocumentDescriptor); } catch (final Exception e) { throw DocumentLayoutBuildException.wrapIfNeeded(e); } } private DocumentDescriptor loadDoc...
* @return {@code false} if the given {@code windowId} * <br> * is {@code null} <br> * or its {@link WindowId#isInt()} returns {@code false} * or it was declared unsupported via {@link #addUnsupportedWindowId(WindowId)}. */ @Override public boolean isWindowIdSupported(@Nullable final WindowId windowId) { re...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\factory\standard\DefaultDocumentDescriptorFactory.java
1
请完成以下Java代码
public void deleteOAuth2ClientById(TenantId tenantId, OAuth2ClientId oAuth2ClientId) { log.trace("Executing deleteOAuth2ClientById [{}]", oAuth2ClientId); oauth2ClientDao.removeById(tenantId, oAuth2ClientId.getId()); eventPublisher.publishEvent(DeleteEntityEvent.builder() .tenant...
return Optional.ofNullable(findOAuth2ClientById(tenantId, new OAuth2ClientId(entityId.getId()))); } @Override public FluentFuture<Optional<HasId<?>>> findEntityAsync(TenantId tenantId, EntityId entityId) { return FluentFuture.from(oauth2ClientDao.findByIdAsync(tenantId, entityId.getId())) ...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\oauth2\OAuth2ClientServiceImpl.java
1
请完成以下Java代码
private static I_M_CostRevaluation extractRecord(final DocumentTableFields docFields) { return InterfaceWrapperHelper.create(docFields, I_M_CostRevaluation.class); } @Override public String getSummary(final DocumentTableFields docFields) { return extractRecord(docFields).getDocumentNo(); } @Override publi...
final DocStatus docStatus = DocStatus.ofNullableCodeOrUnknown(costRevaluation.getDocStatus()); if (!docStatus.isDraftedOrInProgress()) { throw new AdempiereException("Invalid document status"); } final CostRevaluationId costRevaluationId = CostRevaluationId.ofRepoId(costRevaluation.getM_CostRevaluation_ID()...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costrevaluation\CostRevaluationDocumentHandler.java
1
请在Spring Boot框架中完成以下Java代码
public Result<Order> getOrder( @Parameter(description = "订单ID", required = true) @RequestParam String orderId) { log.info("查询订单 - 订单ID: {}", orderId); Order order = orderStore.get(orderId); if (order == null) { return Result.error("订单不存在: " + orderId); ...
categoryList.sort(String::compareTo); return Result.OK(categoryList); } /** * 重置所有数据(仅用于测试) * * @return 重置结果 * @author chenrui * @date 2025/11/6 14:30 */ @Operation(summary = "重置数据", description = "清空所有订单并重置商品库存(仅用于测试)") @PostMapping("/reset") publ...
repos\JeecgBoot-main\jeecg-boot\jeecg-boot-module\jeecg-module-demo\src\main\java\org\jeecg\modules\demo\shop\controller\ShopController.java
2
请完成以下Java代码
public class IssueEntity { @Nullable private IssueId issueId; @Nullable private UserId assigneeId; @Nullable private ExternalProjectReferenceId externalProjectReferenceId; @Nullable private ProjectId projectId; @NonNull private OrgId orgId; @Nullable private MilestoneId milestoneId; @NonNull private...
private final boolean processed; @Nullable private LocalDate deliveredDate; @Nullable private Instant processedTimestamp; public void setEstimatedEffortIfNotSet(@Nullable final BigDecimal estimatedEffort) { if (this.estimatedEffort == null || this.estimatedEffort.signum() == 0) { this.estimatedEffort = ...
repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\issue\IssueEntity.java
1
请完成以下Java代码
public boolean hasTag(@NonNull final String tag) { return tags.containsKey(tag); } public boolean hasAllTagsSetToTrue(@NonNull final List<String> tagNames) { for (final String tagName : tagNames) { if (!hasTagSetToTrue(tagName)) { return false; } } return true; } public boolean hasTagSetT...
{ if (hasTagSetToString(tagName, tagValue)) { return this; } else { final HashMap<String, String> map = new HashMap<>(this.tags); map.put(tagName, tagValue); return new AttachmentTags(map); } } public AttachmentTags withoutTags(@NonNull final AttachmentTags tagsToRemove) { final HashMap<St...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\attachments\AttachmentTags.java
1
请在Spring Boot框架中完成以下Java代码
public class TableResource { @Autowired protected RestResponseFactory restResponseFactory; @Autowired protected ManagementService managementService; @Autowired(required=false) protected BpmnRestApiInterceptor restApiInterceptor; @ApiOperation(value = "Get a single table", tags = { "D...
TableResponse response = null; for (Entry<String, Long> entry : tableCounts.entrySet()) { if (entry.getKey().equals(tableName)) { response = restResponseFactory.createTableResponse(entry.getKey(), entry.getValue()); break; } } if (response...
repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\management\TableResource.java
2
请完成以下Java代码
public DefaultDmnEngineConfiguration transformer(DmnTransformer transformer) { setTransformer(transformer); return this; } /** * @return the list of FEEL Custom Function Providers */ public List<FeelCustomFunctionProvider> getFeelCustomFunctionProviders() { return feelCustomFunctionProviders; ...
* Controls whether the FEEL legacy behavior is enabled or not * * @param enableFeelLegacyBehavior the FEEL legacy behavior */ public void setEnableFeelLegacyBehavior(boolean enableFeelLegacyBehavior) { this.enableFeelLegacyBehavior = enableFeelLegacyBehavior; } /** * Controls whether the FEEL leg...
repos\camunda-bpm-platform-master\engine-dmn\engine\src\main\java\org\camunda\bpm\dmn\engine\impl\DefaultDmnEngineConfiguration.java
1
请在Spring Boot框架中完成以下Java代码
public IFooService fooHibernateService() { return new FooService(); } @Bean public IBarAuditableService barHibernateAuditableService() { return new BarAuditableService(); } @Bean public IFooAuditableService fooHibernateAuditableService() { return new FooAuditableService...
} @Bean public IFooAuditableDao fooHibernateAuditableDao() { return new FooAuditableDao(); } private final Properties hibernateProperties() { final Properties hibernateProperties = new Properties(); hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibe...
repos\tutorials-master\persistence-modules\spring-data-jpa-query\src\main\java\com\baeldung\hibernate\audit\PersistenceConfig.java
2
请完成以下Java代码
private void prepareTimingAttackProtection() { if (this.userNotFoundEncodedPassword == null) { this.userNotFoundEncodedPassword = this.passwordEncoder.get().encode(USER_NOT_FOUND_PASSWORD); } } private void mitigateAgainstTimingAttack(UsernamePasswordAuthenticationToken authentication) { if (authentication....
public void setUserDetailsPasswordService(UserDetailsPasswordService userDetailsPasswordService) { Assert.notNull(userDetailsPasswordService, "userDetailsPasswordService cannot be null"); this.userDetailsPasswordService = userDetailsPasswordService; } /** * Sets the {@link CompromisedPasswordChecker} to be use...
repos\spring-security-main\core\src\main\java\org\springframework\security\authentication\dao\DaoAuthenticationProvider.java
1
请完成以下Java代码
public String[] tag(String... words) { return perceptronPOSTagger.tag(createInstance(words)); } private POSInstance createInstance(String[] words) { final FeatureTemplate[] featureTemplateArray = model.getFeatureTemplateArray(); final String[][] table = new String[words.length][...
{ int[] offset = offsetIterator.next(); int t = offset[0] + position; int j = offset[1]; if (t < 0) sbFeature.append(FeatureIndex.BOS[-(t + 1)]); else if (t >= words.length...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\crf\CRFPOSTagger.java
1
请完成以下Java代码
public static CurrencyPrecision ofInt(final int precision) { if (precision >= 0 && precision < CACHED_VALUES.length) { return CACHED_VALUES[precision]; } else { return new CurrencyPrecision(precision); } } public static final CurrencyPrecision ZERO; public static final CurrencyPrecision TWO; pub...
this.precision = precision; } @Override @Deprecated public String toString() { return String.valueOf(precision); } @JsonValue public int toInt() { return precision; } public BigDecimal roundIfNeeded(@NonNull final BigDecimal amt) { if (amt.scale() > precision) { return amt.setScale(precision, ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\currency\CurrencyPrecision.java
1
请完成以下Java代码
protected String doIt() throws Exception { final IQuery<I_C_Invoice_Candidate> query = retrieveQuery(true); // // Fail if there is nothing to update final int countToUpdate = query.count(); if (countToUpdate <= 0) { throw new AdempiereException("@NoSelection@"); } final boolean flagToSet = isAppro...
protected abstract boolean isApproveForInvoicing(); protected abstract IQuery<I_C_Invoice_Candidate> retrieveQuery(final boolean includeProcessInfoFilters); @Override protected void postProcess(final boolean success) { if (!success) { return; } // // Notify frontend that the view shall be refreshed...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\invoicecandidate\process\C_Invoice_Candidate_ProcessHelper.java
1
请完成以下Java代码
public class ProcessInstanceResource extends AbstractPluginResource { protected String id; public ProcessInstanceResource(String engineName, String id) { super(engineName); this.id = id; } @GET @Path("/called-process-instances") @Produces(MediaType.APPLICATION_JSON) public List<CalledProcessIns...
@POST @Path("/called-process-instances") @Produces(MediaType.APPLICATION_JSON) public List<CalledProcessInstanceDto> queryCalledProcessInstances(CalledProcessInstanceQueryDto queryParameter) { queryParameter.setParentProcessInstanceId(id); configureExecutionQuery(queryParameter); queryParameter.disabl...
repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\cockpit\impl\plugin\base\sub\resources\ProcessInstanceResource.java
1
请完成以下Java代码
public class OAuth2AuthorizationCodeRequestAuthenticationToken extends AbstractOAuth2AuthorizationCodeRequestAuthenticationToken { @Serial private static final long serialVersionUID = -1946164725241393094L; private final OAuth2AuthorizationCode authorizationCode; private boolean validated; /** * Constructs...
*/ public OAuth2AuthorizationCodeRequestAuthenticationToken(String authorizationUri, String clientId, Authentication principal, OAuth2AuthorizationCode authorizationCode, @Nullable String redirectUri, @Nullable String state, @Nullable Set<String> scopes) { super(authorizationUri, clientId, principal, redirectU...
repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\authentication\OAuth2AuthorizationCodeRequestAuthenticationToken.java
1
请在Spring Boot框架中完成以下Java代码
public RedisSerializer<Object> getDefaultRedisSerializer() { return this.defaultRedisSerializer; } @Autowired public void setRedisConnectionFactory( @SpringSessionRedisConnectionFactory ObjectProvider<ReactiveRedisConnectionFactory> springSessionRedisConnectionFactory, ObjectProvider<ReactiveRedisConnection...
} protected ReactiveRedisTemplate<String, Object> createReactiveRedisTemplate() { RedisSerializer<String> keySerializer = RedisSerializer.string(); RedisSerializer<Object> defaultSerializer = (this.defaultRedisSerializer != null) ? this.defaultRedisSerializer : new JdkSerializationRedisSerializer(); RedisSe...
repos\spring-session-main\spring-session-data-redis\src\main\java\org\springframework\session\data\redis\config\annotation\web\server\AbstractRedisWebSessionConfiguration.java
2
请完成以下Java代码
public ExternalId asExternalId() { Check.assume(Type.EXTERNAL_ID.equals(type), "The type of this instance needs to be {}; this={}", Type.EXTERNAL_ID, this); return ExternalId.of(value); } public JsonExternalId asJsonExternalId() { Check.assume(Type.EXTERNAL_ID.equals(type), "The type of this instance needs ...
public String asDoc() { Check.assume(Type.DOC.equals(type), "The type of this instance needs to be {}; this={}", Type.DOC, this); return value; } public String asValue() { Check.assume(Type.VALUE.equals(type), "The type of this instance needs to be {}; this={}", Type.VALUE, this); return value; } public...
repos\metasfresh-new_dawn_uat\backend\de.metas.util.web\src\main\java\de\metas\rest_api\utils\IdentifierString.java
1
请完成以下Java代码
public NumberAndSumOfTransactions1 getTtlDbtNtries() { return ttlDbtNtries; } /** * Sets the value of the ttlDbtNtries property. * * @param value * allowed object is * {@link NumberAndSumOfTransactions1 } * */ public void setTtlDbtNtries(NumberAndSum...
* <p> * For example, to add a new item, do as follows: * <pre> * getTtlNtriesPerBkTxCd().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link TotalsPerBankTransactionCode2 } * * */ public List<TotalsPe...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\TotalTransactions2.java
1
请完成以下Java代码
public static ChannelExec openExecChannel(Session session) throws JSchException { return (ChannelExec) openChannel(session, "exec"); } /** * disconnect * * @param session */ public static void disconnect(Session session) { if (session != null) { if (session.i...
} if (b == 1 || b == 2) { StringBuilder sb = new StringBuilder(); int c; do { c = in.read(); sb.append((char) c); } while (c != '\n'); if (b == 1) { // error log.debug(sb.toString()); ...
repos\springboot-demo-master\JSch\src\main\java\com\et\jsch\util\JSchUtil.java
1
请完成以下Java代码
public void setName (java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ @Override public java.lang.String getName () { return (java.lang.String)get_Value(COLUMNNAME_Name); } /** Set Board. @param WEBUI_Board_ID Board */ @...
/** Set New record name. @param WEBUI_NameNew New record name */ @Override public void setWEBUI_NameNew (java.lang.String WEBUI_NameNew) { set_Value (COLUMNNAME_WEBUI_NameNew, WEBUI_NameNew); } /** Get New record name. @return New record name */ @Override public java.lang.String getWEBUI_NameNew () ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Menu.java
1
请完成以下Java代码
public void setC_Invoice_ID (final int C_Invoice_ID) { if (C_Invoice_ID < 1) set_Value (COLUMNNAME_C_Invoice_ID, null); else set_Value (COLUMNNAME_C_Invoice_ID, C_Invoice_ID); } @Override public int getC_Invoice_ID() { return get_ValueAsInt(COLUMNNAME_C_Invoice_ID); } @Override public void setE...
@Override public void setNetDays (final int NetDays) { set_Value (COLUMNNAME_NetDays, NetDays); } @Override public int getNetDays() { return get_ValueAsInt(COLUMNNAME_NetDays); } @Override public void setsinglevat (final @Nullable BigDecimal singlevat) { set_Value (COLUMNNAME_singlevat, singlevat); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_cctop_120_v.java
1
请在Spring Boot框架中完成以下Java代码
public void sendSimpleMail(String to, String subject, String content) { SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(from); message.setTo(to); message.setSubject(subject); message.setText(content); try { mailSender.send(message); ...
/** * 发送正文中有静态资源(图片)的邮件 * @param to * @param subject * @param content * @param rscPath * @param rscId */ public void sendInlineResourceMail(String to, String subject, String content, String rscPath, String rscId){ MimeMessage message = mailSender.createMimeMessage(); ...
repos\spring-boot-leaning-master\1.x\第13课:使用 Spring Boot 发送邮件\spring-boot-mail\src\main\java\com\neo\service\impl\MailServiceImpl.java
2
请完成以下Java代码
public ApplicationContext getApplicationContext() { return applicationContext; } @Override public void onApplicationEvent(ApplicationContextEvent event) { try { // we only want to listen for context events of the main application // context, not its children if (event.getSource().equals...
public void start() { deploy(); } public void stop() { undeploy(); } public void afterPropertiesSet() throws Exception { // for backwards compatibility start(); } public void destroy() throws Exception { // for backwards compatibility stop(); } }
repos\camunda-bpm-platform-master\engine-spring\core\src\main\java\org\camunda\bpm\engine\spring\application\SpringProcessApplication.java
1
请完成以下Java代码
public class DecisionUtil { public static DecisionEntity getDecisionTableEntity(String decisionTableId) { return getDecisionTableEntity(decisionTableId, false); } public static DecisionEntity getDecisionTableEntity(String decisionTableId, boolean checkCacheOnly) { if (checkCacheOnly) { ...
} return null; } public static DecisionEntity getDecisionTableFromDatabase(String decisionTableId) { DecisionEntityManager decisionTableEntityManager = CommandContextUtil.getDmnEngineConfiguration().getDecisionEntityManager(); DecisionEntity decisionTable = decisionTableEntityManager.fi...
repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\util\DecisionUtil.java
1
请完成以下Java代码
public MoneySourceAndAcct divide(@NonNull final MoneySourceAndAcct divisor, @NonNull final CurrencyPrecision precision) { return newOfSourceAndAcct(source.divide(divisor.source, precision), acct.divide(divisor.acct, precision)); } public MoneySourceAndAcct multiply(@NonNull final BigDecimal multiplicand) { ret...
public MoneySourceAndAcct negateIf(final boolean condition) { return condition ? negate() : this; } public MoneySourceAndAcct toZero() { return newOfSourceAndAcct(source.toZero(), acct.toZero()); } public MoneySourceAndAcct roundIfNeeded(@NonNull final CurrencyPrecision sourcePrecision, @NonNull final Curre...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\MoneySourceAndAcct.java
1
请完成以下Java代码
public String toString() { return toJson(); } @JsonValue public String toJson() { String json = _json; if (json == null) { json = _json = toJson(huId, storageProductId, topLevelHUId); } return json; } private static String toJson(final HuId huId, final ProductId storageProductId, final HuId topL...
} public HuId getHuId() { return huId; } public HUEditorRowId toTopLevelRowId() { if (isTopLevel()) { return this; } final HuId huId = getTopLevelHUId(); final ProductId storageProductId = null; final HuId topLevelHUId = null; final String json = null; final DocumentId documentId = null; ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\HUEditorRowId.java
1
请在Spring Boot框架中完成以下Java代码
public String getUserNameFromJwtToken(String token) { return Jwts.parser() .verifyWith(getSigningKey()) .build() .parseSignedClaims(token) .getPayload() .getSubject(); } public boolean validateJwtToken(String authToken) { try { ...
logger.error("Invalid JWT signature: {}", e.getMessage()); } catch (MalformedJwtException e) { logger.error("Invalid JWT token: {}", e.getMessage()); } catch (ExpiredJwtException e) { logger.error("JWT token is expired: {}", e.getMessage()); } catch (UnsupportedJwtExcepti...
repos\tutorials-master\spring-security-modules\spring-security-core\src\main\java\com\baeldung\jwtsignkey\jwtconfig\JwtUtils.java
2
请在Spring Boot框架中完成以下Java代码
public static List toList() { ReconciliationMistakeTypeEnum[] ary = ReconciliationMistakeTypeEnum.values(); List list = new ArrayList(); for (int i = 0; i < ary.length; i++) { Map<String, String> map = new HashMap<String, String>(); map.put("desc", ary[i].getDesc()); map.put("name", ary[i].name()); li...
* * @return */ public static String getJsonStr() { ReconciliationMistakeTypeEnum[] enums = ReconciliationMistakeTypeEnum.values(); StringBuffer jsonStr = new StringBuffer("["); for (ReconciliationMistakeTypeEnum senum : enums) { if (!"[".equals(jsonStr.toString())) { jsonStr.append(","); } jsonS...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\enums\ReconciliationMistakeTypeEnum.java
2
请完成以下Java代码
public void setPreAuthenticationChecks(UserDetailsChecker preAuthenticationChecks) { this.preAuthenticationChecks = preAuthenticationChecks; } protected UserDetailsChecker getPostAuthenticationChecks() { return this.postAuthenticationChecks; } public void setPostAuthenticationChecks(UserDetailsChecker postAut...
.debug("Failed to authenticate since user account has expired"); throw new AccountExpiredException(AbstractUserDetailsAuthenticationProvider.this.messages .getMessage("AbstractUserDetailsAuthenticationProvider.expired", "User account has expired")); } } } private class DefaultPostAuthenticationChecks ...
repos\spring-security-main\core\src\main\java\org\springframework\security\authentication\dao\AbstractUserDetailsAuthenticationProvider.java
1
请完成以下Java代码
public class Application { // CSV Reader Examples public static List<String[]> readLineByLineExample() throws Exception { Path path = Helpers.twoColumnCsvPath(); return CsvReaderExamples.readLineByLine(path); } public static List<String[]> readAllLinesExample() throws Exception { ...
} public static List<CsvBean> namedColumnBeanExample() throws Exception { Path path = Helpers.namedColumnCsvPath(); return BeanExamples.beanBuilderExample(path, NamedColumnBean.class); } public static String writeCsvFromBeanExample() throws Exception { Path path = Helpers.fileOutBe...
repos\tutorials-master\libraries-data-io\src\main\java\com\baeldung\libraries\opencsv\Application.java
1
请完成以下Java代码
public String getName() { return nameAttribute.getValue(this); } public void setName(String name) { nameAttribute.setValue(this, name); } public InteractionNode getSource() { return sourceRefAttribute.getReferenceTargetElement(this); } public void setSource(InteractionNode source) { sourc...
targetRefAttribute.setReferenceTargetElement(this, target); } public Message getMessage() { return messageRefAttribute.getReferenceTargetElement(this); } public void setMessage(Message message) { messageRefAttribute.setReferenceTargetElement(this, message); } public BpmnEdge getDiagramElement() {...
repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\MessageFlowImpl.java
1
请完成以下Java代码
private Authentication createAuthentication(Authentication auth, User user) { // // Honor any roles the user already has set; default is just USER role // but could be modified after account creation // Collection<? extends GrantedAuthority> authorities = user .getA...
/** * Creates a new UserDTO with basic info. * @param loginResponse Response from peloton login API * @param authentication Contains user login info (namely username and password) * @return UserDTO */ private UserDTO createUserDTO(LoginResponse loginResponse, Authentication authentication) ...
repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\security\CustomAuthenticationManager.java
1
请完成以下Java代码
private void markProcessed() { final boolean alreadyProcessed = _processed.getAndSet(true); if (alreadyProcessed) { // already processed throw new AdempiereException("Already processed: " + this); } } protected final void assertNotProcessed() { Check.assume(!_processed.get(), "not already processed...
private Optional<PrintFormatId> getPrintFormatId() { // Favor the Report Process if any if (reportProcessId != null) { return Optional.empty(); } // Then check the print format else if (printFormatId != null) { return Optional.of(printFormatId); } // Else, fallback to doc outbound config else...
repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive\de.metas.document.archive.base\src\main\java\de\metas\document\archive\spi\impl\DefaultModelArchiver.java
1
请完成以下Java代码
void addFilesToArchive(net.lingala.zip4j.io.outputstream.ZipOutputStream zipOutputStream) throws IOException { List<String> filesNames = new ArrayList<>(); filesNames.add("first-file.txt"); filesNames.add("second-file.txt"); ZipParameters zipParameters = new ZipParameters(); zip...
List<String> filesNames = new ArrayList<>(); filesNames.add("first-file.txt"); filesNames.add("second-file.txt"); for (String fileName : filesNames) { File file = new File(ZipArchiveController.class.getClassLoader() .getResource(fileName).getFile()); zipOut...
repos\tutorials-master\spring-web-modules\spring-rest-http-3\src\main\java\com\baeldung\zip\ZipArchiveController.java
1
请在Spring Boot框架中完成以下Java代码
public class DataEntryInterceptorUtil { private final DocumentDescriptorFactory documentDescriptorFactory; private final DocumentCollection documentCollection; public DataEntryInterceptorUtil( @NonNull final DocumentDescriptorFactory documentDescriptorFactory, @NonNull final DocumentCollection documentCollec...
{ resetCacheFor(dataEntrySectionRecord.getDataEntry_SubTab()); } } public void resetCacheFor(@NonNull final I_DataEntry_SubTab dataEntrySubGroupRecord) { if (dataEntrySubGroupRecord.getDataEntry_Tab_ID() > 0) { resetCacheFor(dataEntrySubGroupRecord.getDataEntry_Tab()); } } public void resetCacheFor...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\dataentry\interceptor\DataEntryInterceptorUtil.java
2
请完成以下Java代码
public int forLoopBenchmark(MyState state) { int sum = 0; for (int number : state.numbers) { if (number % 2 == 0) { sum = sum + (number * number); } } return sum; } @Benchmark public int parallelStreamBenchMark(MyState state) { ...
sum = sum + (number * number); } } return sum; }); } int totalSum = 0; for (Future<Integer> result : executorService.invokeAll(tasks)) { totalSum += result.get(); } executorService.shutdown(); r...
repos\tutorials-master\core-java-modules\core-java-streams\src\main\java\com\baeldung\stream\streamsvsloops\PerformanceBenchmark.java
1
请完成以下Java代码
public @Nullable T orElse(@Nullable T other) { return (this.value != null) ? this.value : other; } /** * Return the object that was bound, or the result of invoking {@code other} if no * value has been bound. * @param other a {@link Supplier} of the value to be returned if there is no bound * value * @re...
} return ObjectUtils.nullSafeEquals(this.value, ((BindResult<?>) obj).value); } @Override public int hashCode() { return ObjectUtils.nullSafeHashCode(this.value); } @SuppressWarnings("unchecked") static <T> BindResult<T> of(@Nullable T value) { if (value == null) { return (BindResult<T>) UNBOUND; } ...
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\properties\bind\BindResult.java
1
请完成以下Java代码
public void setAdValRuleId(@NonNull final LookupDescriptorProvider.LookupScope lookupScope, @Nullable final AdValRuleId adValRuleId) { if (adValRuleId != null) { adValRuleIdByScope.put(lookupScope, adValRuleId); } else { adValRuleIdByScope.remove(lookupScope); } } public void setAdValRuleIds(@NonN...
public void addFilter(@NonNull final Collection<IValidationRule> validationRules, @Nullable LookupDescriptorProvider.LookupScope scope) { for (final IValidationRule valRule : CompositeValidationRule.unbox(validationRules)) { addFilter(SqlLookupFilter.of(valRule, scope)); } } public void addFilter(@Nullable...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\sql\CompositeSqlLookupFilterBuilder.java
1
请完成以下Java代码
protected void onAfterInit() { UserRolePermissionsEventBus.install(); registerProcessNoFail(UserGroupRecordAccess_Grant.class); registerProcessNoFail(UserGroupRecordAccess_Revoke.class); registerProcessNoFail(RecordPrivateAccess_Add.class); registerProcessNoFail(RecordPrivateAccess_Remove.class); } priv...
@Override protected void onInit(final IModelValidationEngine engine, final I_AD_Client client) { engine.addModelChange(triggeringTableName, this); } @Override public void onModelChange(final Object model, final ModelChangeType changeType) throws Exception { if (!changeType.isAfter()) { return;...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\model\interceptor\SecurityMainInterceptor.java
1
请完成以下Java代码
public CostDetailAdjustment recalculateCostDetailAmountAndUpdateCurrentCost( @NonNull final CostDetail costDetail, @NonNull final CurrentCost currentCost) { if (costDetail.getDocumentRef().isCostRevaluationLine()) { throw new AdempiereException(MSG_RevaluatingAnotherRevaluationIsNotSupported) .setPar...
else { currentCost.addToCurrentQtyAndCumulate(qty, newCostAmount, utils.getQuantityUOMConverter()); } // return CostDetailAdjustment.builder() .costDetailId(costDetail.getId()) .qty(qty) .oldCostPrice(oldCostPrice) .oldCostAmount(oldCostAmount) .newCostPrice(newCostPrice) .newCostAmo...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\methods\CostingMethodHandlerTemplate.java
1
请完成以下Java代码
public void setStackVariables(Map<String, Object> variables) { this.stackVariables = variables; } public Map<String, Object> getStackVariables() { return stackVariables; } public Map<String, Object> getRuleResult(int ruleNumber) { return ruleResults.get(ruleNumber); } ...
} public void setInstanceId(String instanceId) { this.instanceId = instanceId; } public String getScopeType() { return scopeType; } public void setScopeType(String scopeType) { this.scopeType = scopeType; } public String getTenantId() { return tenantId; ...
repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\el\ELExecutionContext.java
1
请完成以下Java代码
public String getName () { return (String)get_Value(COLUMNNAME_Name); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getName()); } /** Set OS Command. @param OS_Command
Operating System Command */ public void setOS_Command (String OS_Command) { set_Value (COLUMNNAME_OS_Command, OS_Command); } /** Get OS Command. @return Operating System Command */ public String getOS_Command () { return (String)get_Value(COLUMNNAME_OS_Command); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Task.java
1
请完成以下Java代码
public BatchWindow getCurrentOrNextBatchWindow(Date date, ProcessEngineConfigurationImpl configuration) { final BatchWindow previousDayBatchWindow = getPreviousDayBatchWindow(date, configuration); if (previousDayBatchWindow != null && previousDayBatchWindow.isWithin(date)) { return previousDayBatchWindow;...
private static Date updateTime(Date now, Date newTime) { Calendar c = Calendar.getInstance(); c.setTime(now); Calendar newTimeCalendar = Calendar.getInstance(); newTimeCalendar.setTime(newTime); c.set(Calendar.ZONE_OFFSET, newTimeCalendar.get(Calendar.ZONE_OFFSET)); c.set(Calendar.DST_OFFSET, ne...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\historycleanup\DefaultBatchWindowManager.java
1
请完成以下Java代码
void registerContributor(String name, C contributor) { synchronized (this.monitor) { Map<String, C> contributors = new LinkedHashMap<>(this.contributors); registerContributor(contributors, name, contributor); this.contributors = Collections.unmodifiableMap(contributors); } } private void registerContrib...
} } @Nullable C getContributor(String name) { return this.contributors.get(name); } Stream<E> stream() { return this.contributors.entrySet() .stream() .map((entry) -> this.entryAdapter.apply(entry.getKey(), entry.getValue())); } private void verifyName(String name, C contributor) { Assert.state(Str...
repos\spring-boot-4.0.1\module\spring-boot-health\src\main\java\org\springframework\boot\health\registry\AbstractRegistry.java
1
请完成以下Java代码
public void setHR_ListLine_ID (int HR_ListLine_ID) { if (HR_ListLine_ID < 1) set_ValueNoCheck (COLUMNNAME_HR_ListLine_ID, null); else set_ValueNoCheck (COLUMNNAME_HR_ListLine_ID, Integer.valueOf(HR_ListLine_ID)); } /** Get Payroll List Line. @return Payroll List Line */ public int getHR_ListLine_ID...
} /** Set Min Value. @param MinValue Min Value */ public void setMinValue (BigDecimal MinValue) { set_Value (COLUMNNAME_MinValue, MinValue); } /** Get Min Value. @return Min Value */ public BigDecimal getMinValue () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_MinValue); if (bd == null) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_HR_ListLine.java
1
请完成以下Java代码
public class SubscriptionChangeException extends AdempiereException { public static final String MSG_NO_CHANGE_ALLOWED = "subscription.noChangeConditions_3P"; public static final String MSG_ILLEGAL_DATE = "subscription.illegalDateForSPs_1P"; /** * */ private static final long serialVersionUID = -440397851337...
private static String buildMsgIllegalDate(final Timestamp date, final I_C_SubscriptionProgress sp1, final I_C_SubscriptionProgress sp2) { return Msg.getMsg(Env.getCtx(), MSG_ILLEGAL_DATE, new Object[] { date }); } private static String buildMsgNoChangeconditions( final int oldSubscriptionId, final int n...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\flatrate\exceptions\SubscriptionChangeException.java
1
请在Spring Boot框架中完成以下Java代码
public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http // 配置请求地址的权限 .authorizeRequests() .antMatchers("/test/demo").permitAll() // 所有用户可访问 .a...
// .logoutUrl("/logout") // 退出 URL 地址 .permitAll(); // 所有用户可访问 } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth. // 使用内存中的 InMemoryUserDetailsManager inMemoryAuthentication() ...
repos\SpringBoot-Labs-master\lab-01-spring-security\lab-01-springsecurity-demo-role\src\main\java\cn\iocoder\springboot\lab01\springsecurity\config\SecurityConfig.java
2
请完成以下Java代码
public char[] generateParameter(Table table, int current) { StringBuilder sb = new StringBuilder(); int i = 0; for (String d : delimiterList) { sb.append(d); int[] offset = offsetList.get(i++); sb.append(table.get(current + offset[0], offset[1])); ...
for (int i = 0; i < size; ++i) { delimiterList.add(byteArray.nextUTF()); } return true; } @Override public String toString() { final StringBuilder sb = new StringBuilder("FeatureTemplate{"); sb.append("template='").append(template).append('\''); ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\crf\FeatureTemplate.java
1
请完成以下Java代码
public FilterSql getSql( @NonNull final DocumentFilter filter, @NonNull final SqlOptions sqlOpts, @NonNull final SqlDocumentFilterConverterContext context) { final String searchText = filter.getParameterValueAsString(FTSDocumentFilterDescriptorsProviderFactory.PARAM_SearchText, null); if (Check.isBlank(se...
whereClause.append(" UNION ") .append("(SELECT ").append(keyColumnName).append(" FROM ").append(ftsTableName) .append(" WHERE fts_string <-> ? < ?", searchText, distance) .append(" ORDER BY fts_string <-> ? ASC", searchText) .append(" LIMIT ?)", fuzzySearchLimit); orderByClause.append(", ") ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\provider\fullTextSearch\PostgresFTSDocumentFilterConverter.java
1
请完成以下Java代码
public Date getUpdateTime() { return updateTime; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column user_info.update_time * * @param updateTime the value for user_info.update_time * * @mbg.generated Sun Apr 28 14:54:...
* @return the value of user_info.enabled * * @mbg.generated Sun Apr 28 14:54:53 CST 2024 */ public Boolean getEnabled() { return enabled; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column user_info.enabled * ...
repos\springboot-demo-master\druid\src\main\java\com\et\druid\entity\UserInfo.java
1
请完成以下Java代码
public void updateOrderWeight(@NonNull final I_M_Product product) { final List<OrderId> orderIdsToBeUpdated = orderBL.getUnprocessedIdsBy(ProductId.ofRepoId(product.getM_Product_ID())); Iterators.partition(orderIdsToBeUpdated.iterator(), 100) .forEachRemaining(this::setWeightFromLines); } private void setW...
final GTIN gtin = GTIN.ofNullableString(record.getGTIN()); productBL.setProductCodeFieldsFromGTIN(record, gtin); } // NOTE: syncing UPC to GTIN is not quite correct, but we have a lot of BPs which are relying on this logic else if (InterfaceWrapperHelper.isValueChanged(record, I_M_Product.COLUMNNAME_UPC)) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\product\model\interceptor\M_Product.java
1
请完成以下Java代码
public String doInRedis(RedisConnection connection) throws DataAccessException { Object nativeConnection = connection.getNativeConnection(); String result = null; if (nativeConnection instanceof JedisCommands) { result = ((JedisCommands) nativeConnecti...
logger.info("获取分布式锁休眠被中断:", e); } } public String getLockKeyLog() { return lockKeyLog; } public void setLockKeyLog(String lockKeyLog) { this.lockKeyLog = lockKeyLog; } public int getExpireTime() { return expireTime; } public void setExpireTime(int expi...
repos\spring-boot-student-master\spring-boot-student-cache-redis\src\main\java\com\xiaolyuh\redis\lock\RedisLock.java
1
请完成以下Java代码
public static UserEMailConfig toUserEMailConfig(@NonNull final I_AD_User userRecord) { return UserEMailConfig.builder() .userId(UserId.ofRepoId(userRecord.getAD_User_ID())) .email(EMailAddress.ofNullableString(userRecord.getEMail())) .username(userRecord.getEMailUser()) .password(userRecord.getEMailU...
roleDAO.deleteUserRolesByUserId(userId); getUserSubstituteRepository().deleteUserSubstituteByUserId(userId); getUserMailRepository().deleteUserMailByUserId(userId); getUserQueryRepository().deleteUserQueryByUserId(userId); } @Override public String getUserFullNameById(@NonNull final UserId userId) {retur...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\user\api\impl\UserBL.java
1
请在Spring Boot框架中完成以下Java代码
private void putHintValue(JSONObject jsonObject, Object value) throws Exception { Object hintValue = extractItemValue(value); jsonObject.put("value", hintValue); } private void putDefaultValue(JSONObject jsonObject, Object value) throws Exception { Object defaultValue = extractItemValue(value); jsonObject.pu...
.thenComparing(ItemMetadata::getSourceType, Comparator.nullsFirst(Comparator.naturalOrder())); private static final Comparator<ItemMetadata> ITEM = Comparator.comparing(ItemMetadataComparator::isDeprecated) .thenComparing(ItemMetadata::getName) .thenComparing(ItemMetadata::getSourceType, Comparator.nullsFirst(...
repos\spring-boot-4.0.1\configuration-metadata\spring-boot-configuration-processor\src\main\java\org\springframework\boot\configurationprocessor\metadata\JsonConverter.java
2
请完成以下Java代码
private static final class SupplierCsrfToken implements CsrfToken { private final Supplier<CsrfToken> csrfTokenSupplier; private SupplierCsrfToken(Supplier<CsrfToken> csrfTokenSupplier) { this.csrfTokenSupplier = csrfTokenSupplier; } @Override public String getHeaderName() { return getDelegate().getH...
public String getToken() { return getDelegate().getToken(); } private CsrfToken getDelegate() { CsrfToken delegate = this.csrfTokenSupplier.get(); if (delegate == null) { throw new IllegalStateException("csrfTokenSupplier returned null delegate"); } return delegate; } } }
repos\spring-security-main\web\src\main\java\org\springframework\security\web\csrf\CsrfTokenRequestAttributeHandler.java
1
请完成以下Java代码
public int getInactivityAlertDays () { Integer ii = (Integer)get_Value(COLUMNNAME_InactivityAlertDays); if (ii == null) return 0; return ii.intValue(); } /** Set Days to keep Log. @param KeepLogDays Number of days to keep the log entries */ public void setKeepLogDays (int KeepLogDays) { set_V...
return "Y".equals(oo); } return false; } /** Set Reminder Days. @param RemindDays Days between sending Reminder Emails for a due or inactive Document */ public void setRemindDays (int RemindDays) { set_Value (COLUMNNAME_RemindDays, Integer.valueOf(RemindDays)); } /** Get Reminder Days. @return D...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WorkflowProcessor.java
1
请完成以下Java代码
public boolean isIncludeEmpty () { Object oo = get_Value(COLUMNNAME_IsIncludeEmpty); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set inkl. "sonstige"-Eintrag. @param IsIncludeOtherGroup Legt fest, ob di...
Object oo = get_Value(COLUMNNAME_IsIncludeOtherGroup); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Name. @param Name Name */ @Override public void setName (java.lang.String Name) { set_Value (COLUMN...
repos\metasfresh-new_dawn_uat\backend\de.metas.dimension\src\main\java-gen\de\metas\dimension\model\X_DIM_Dimension_Spec.java
1
请在Spring Boot框架中完成以下Java代码
public static CamundaAuthorizationConfiguration camundaAuthorizationConfiguration() { return new DefaultAuthorizationConfiguration(); } @Bean @ConditionalOnMissingBean(CamundaDeploymentConfiguration.class) public static CamundaDeploymentConfiguration camundaDeploymentConfiguration() { return new Defaul...
@Bean @ConditionalOnProperty(prefix = "camunda.bpm.filter", name = "create") public CreateFilterConfiguration createFilterConfiguration() { return new CreateFilterConfiguration(); } @Bean public EventPublisherPlugin eventPublisherPlugin(CamundaBpmProperties properties, ApplicationEventPublisher publisher...
repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\CamundaBpmConfiguration.java
2
请完成以下Java代码
public int getTotalPlayers() { return this.totalPlayers; } public void setTotalPlayers(int totalPlayers) { this.totalPlayers = totalPlayers; } public GameMode getMode() { return this.mode; } public void setMode(GameMode mode) { this.mode = mode; } publ...
return this.maxPlayers; } public void setMaxPlayers(int maxPlayers) { this.maxPlayers = maxPlayers; } public List<PlayerDTO> getPlayers() { return this.players; } public void setPlayers(List<PlayerDTO> players) { this.players = players; } }
repos\tutorials-master\libraries-data\src\main\java\com\baeldung\modelmapper\dto\GameDTO.java
1
请完成以下Java代码
public HttpComponentsClientHttpRequestFactoryBuilder withDefaultRequestConfigCustomizer( Consumer<RequestConfig.Builder> defaultRequestConfigCustomizer) { Assert.notNull(defaultRequestConfigCustomizer, "'defaultRequestConfigCustomizer' must not be null"); return new HttpComponentsClientHttpRequestFactoryBuilder(...
HttpClient httpClient = this.httpClientBuilder.build(settings); return new HttpComponentsClientHttpRequestFactory(httpClient); } static class Classes { static final String HTTP_CLIENTS = "org.apache.hc.client5.http.impl.classic.HttpClients"; static boolean present(@Nullable ClassLoader classLoader) { retu...
repos\spring-boot-4.0.1\module\spring-boot-http-client\src\main\java\org\springframework\boot\http\client\HttpComponentsClientHttpRequestFactoryBuilder.java
1
请在Spring Boot框架中完成以下Java代码
public String getWorkerId() { return workerId; } public void setWorkerId(String workerId) { this.workerId = workerId; } public String getErrorMessage() { return errorMessage; } public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage;...
this.errorDetails = errorDetails; } public Integer getRetries() { return retries; } public void setRetries(Integer retries) { this.retries = retries; } public Duration getRetryTimeout() { return retryTimeout; } public void setRetryTimeout(Duration retryTimeout...
repos\flowable-engine-main\modules\flowable-external-job-rest\src\main\java\org\flowable\external\job\rest\service\api\acquire\ExternalWorkerJobFailureRequest.java
2
请完成以下Java代码
public String getFillValue() { return "none"; } @Override public String getStrokeValue() { return "#585858"; } @Override public String getDValue() { return "m 3 3 l 0 0 m 8 8 l 8 0 l 0 -2 l 4 4 l -4 4 l 0 -2 l -8 0 l 0 -4 z"; } public void drawIcon( fin...
return null; } @Override public String getStyleValue() { return "fill:none;stroke-width:1.4;stroke-miterlimit:4;stroke-dasharray:none"; } @Override public Integer getWidth() { return 17; } @Override public Integer getHeight() { return 15; } @Overri...
repos\Activiti-develop\activiti-core\activiti-image-generator\src\main\java\org\activiti\image\impl\icon\LinkCatchIconType.java
1
请完成以下Java代码
public void putContext(final String name, final int value) { getDocument().setDynAttribute(name, value); } @Override public boolean getContextAsBoolean(final String name) { final Object valueObj = getDocument().getDynAttribute(name); return DisplayType.toBoolean(valueObj); } @Override public int getCont...
else { return Integer.parseInt(valueObj.toString()); } } @Override public ICalloutRecord getCalloutRecord() { return getDocument().asCalloutRecord(); } @Override public boolean isLookupValuesContainingId(@NonNull final RepoIdAware id) { return documentField.getLookupValueById(id) != null; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\DocumentFieldAsCalloutField.java
1
请完成以下Java代码
public static List<String> toSentenceList(String content, boolean shortest) { return toSentenceList(content.toCharArray(), shortest); } public static List<String> toSentenceList(char[] chars) { return toSentenceList(chars, true); } public static List<String> toSentenceList(char...
case ' ': case ' ': case '。': case '!': case '!': case '?': case '?': case '\n': case '\r': insertIntoList(sb, sentences); sb = new StringBuilder(); ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\utility\SentencesUtil.java
1
请完成以下Java代码
public class OidcClientRegistrationAuthenticationToken extends AbstractAuthenticationToken { @Serial private static final long serialVersionUID = 5392324479052435784L; private final Authentication principal; private final OidcClientRegistration clientRegistration; private final String clientId; /** * Const...
public Object getPrincipal() { return this.principal; } @Override public Object getCredentials() { return ""; } /** * Returns the client registration. * @return the client registration */ public OidcClientRegistration getClientRegistration() { return this.clientRegistration; } /** * Returns the...
repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\oidc\authentication\OidcClientRegistrationAuthenticationToken.java
1
请完成以下Java代码
public List<String[]> parseCsvFile(String relativePath) { try (Reader inputReader = new InputStreamReader(new FileInputStream(new File(relativePath)), "UTF-8")) { CsvParserSettings settings = new CsvParserSettings(); settings.setMaxCharsPerColumn(100); settings.setMaxColumns(...
logger.error("IOException opening file: " + relativePath + " " + e.getMessage()); return new ArrayList<Product>(); } } public List<String[]> parseCsvFileInBatches(String relativePath) { try (Reader inputReader = new InputStreamReader(new FileInputStream(new File(relativePath)), "UTF...
repos\tutorials-master\libraries-data-2\src\main\java\com\baeldung\univocity\ParsingService.java
1
请完成以下Java代码
public class RemoteServerApacheSshd { private static final Logger LOGGER = LoggerFactory.getLogger(RemoteServerApacheSshd.class); private static final String HOST = "HOST_NAME"; private static final String USER = "USERNAME"; private static final String PRIVATE_KEY = "PRIVATE_KEY"; private static fi...
return session; } public static SftpClient createSftpClient(ClientSession session) throws IOException { SftpClientFactory factory = SftpClientFactory.instance(); return factory.createSftpClient(session); } public static List<SftpClient.DirEntry> listDirectory(SftpClient sftp, String re...
repos\tutorials-master\libraries-security\src\main\java\com\baeldung\listfilesremoteserver\RemoteServerApacheSshd.java
1
请完成以下Java代码
public static class RecordsToAlwaysIncludeSql { @NonNull private final SqlAndParams sqlAndParams; private RecordsToAlwaysIncludeSql(@NonNull final SqlAndParams sqlAndParams) { if (sqlAndParams.isEmpty()) { throw new AdempiereException("empty sqlAndParams is not allowed"); } this.sqlAndParams = ...
} else if (collection.size() == 1) { return collection.iterator().next(); } else { return SqlAndParams.orNullables( collection.stream() .filter(Objects::nonNull) .map(RecordsToAlwaysIncludeSql::toSqlAndParams) .collect(ImmutableSet.toImmutableSet())) .m...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\sql\FilterSql.java
1
请完成以下Java代码
public ArrayList<Document> toList() { return documents; } public ImmutableMap<DocumentId, Document> toImmutableMap() { return Maps.uniqueIndex(documents, Document::getDocumentId); } public void addDocument(@NonNull final Document document) { documents.add(document); } public void addDocuments(@NonNull...
public int size() { return documents.size(); } public boolean isEmpty() { return documents.isEmpty(); } public Document get(final int index) { return documents.get(index); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\OrderedDocumentsList.java
1
请在Spring Boot框架中完成以下Java代码
public class User extends BaseEntity implements Serializable { @Id @Column(name = "user_id") @NotNull(groups = Update.class) @GeneratedValue(strategy = GenerationType.IDENTITY) @ApiModelProperty(value = "ID", hidden = true) private Long id; @ManyToMany(fetch = FetchType.EAGER) @ApiMode...
@ApiModelProperty(value = "头像真实名称",hidden = true) private String avatarName; @ApiModelProperty(value = "头像存储的路径", hidden = true) private String avatarPath; @ApiModelProperty(value = "密码") private String password; @NotNull @ApiModelProperty(value = "是否启用") private Boolean enabled; ...
repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\system\domain\User.java
2
请完成以下Java代码
private Map<String, String> resolveStatusCheckerNamesMapFromProtocolConfigs() { Map<String, String> statusCheckerNamesMap = new LinkedHashMap<>(); for (Map.Entry<String, ProtocolConfig> entry : protocolConfigs.entrySet()) { String beanName = entry.getKey(); ProtocolConfig pro...
ProviderConfig providerConfig = entry.getValue(); Set<String> statusCheckerNames = getStatusCheckerNames(providerConfig); for (String statusCheckerName : statusCheckerNames) { String source = buildSource(beanName, providerConfig); statusCheckerNamesMap.put(sta...
repos\dubbo-spring-boot-project-master\dubbo-spring-boot-compatible\actuator\src\main\java\org\apache\dubbo\spring\boot\actuate\health\DubboHealthIndicator.java
1
请在Spring Boot框架中完成以下Java代码
public class Application { public static void main(String[] args) throws URISyntaxException, IOException { // ProtectionDomain protectionDomain = Launcher.class.getProtectionDomain(); // CodeSource codeSource = protectionDomain.getCodeSource(); // URI location = (codeSource != null) ? codeSour...
// return entry.getName().equals(BOOT_INF_CLASSES); // } // // 如果是文件的情况,只要 BOOT-INF/lib/ 目录下的 `jar` 包 // return entry.getName().startsWith(BOOT_INF_LIB); // } // // }; // // 执行读取 // for (Archive item : archive.getNestedArchi...
repos\SpringBoot-Labs-master\lab-39\lab-39-demo\src\main\java\cn\iocoder\springboot\lab39\skywalkingdemo\Application.java
2
请完成以下Java代码
protected String doIt() { orderCostService.createOrderCost(orderCostCreateRequest()); return MSG_OK; } private OrderCostCreateRequest orderCostCreateRequest() { final OrderCostCreateRequest.OrderLine orderLine; if (p_IsInvoiced) { if (p_InvoiceableProductId == null) { throw new FillMandatoryExc...
throw new FillMandatoryException(PARAM_Percentage); } return PercentageCostCalculationMethodParams.builder() .percentage(Percent.of(p_percentageBD)) .build(); } else { throw new AdempiereException("Method not handled: " + p_CostCalculationMethod); } } private ImmutableSet<OrderAndLineId> ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\costs\C_Order_CreateCost.java
1
请完成以下Java代码
public class DateTimeAndTimestampConverter { public static DateTime convertToDateTimeUsingConstructor(Timestamp timestamp) { return new DateTime(timestamp.getTime()); } public static DateTime convertToDateTimeUsingInstant(Timestamp timestamp) { Instant instant = timestamp.toInstant(); ...
public static Timestamp convertToTimestampUsingConstructor(DateTime dateTime) { return new Timestamp(dateTime.getMillis()); } public static Timestamp convertToTimestampUsingInstant(DateTime dateTime) { Instant instant = Instant.ofEpochMilli(dateTime.getMillis()); return Timestamp.from(i...
repos\tutorials-master\core-java-modules\core-java-datetime-conversion-2\src\main\java\com\baeldung\convertdatetimeandtimestamp\DateTimeAndTimestampConverter.java
1
请完成以下Java代码
public abstract class Event extends BaseData<EventId> { protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); protected final TenantId tenantId; protected final UUID entityId; protected final String serviceId; public Event(TenantId tenantId, UUID entityId, String serviceId, UUID...
EventInfo eventInfo = new EventInfo(); eventInfo.setTenantId(tenantId); eventInfo.setEntityId(EntityIdFactory.getByTypeAndUuid(entityType, entityId)); eventInfo.setType(getType().getOldName()); eventInfo.setId(id); eventInfo.setUid(id.toString()); eventInfo.setCreatedTime...
repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\event\Event.java
1
请完成以下Java代码
public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getOwner() { return owner; } public void setO...
public Date getLastAccess() { return lastAccess; } public void setLastAccess(Date lastAccess) { this.lastAccess = lastAccess; } public List<File> getFiles() { return files; } public void setFiles(List<File> files) { this.files = files; } }
repos\tutorials-master\jackson-modules\jackson-custom-conversions\src\main\java\com\baeldung\defaultserializercustomserializer\Folder.java
1
请完成以下Java代码
private DefaultPaymentBuilder fromInvoice(@NonNull final I_C_Invoice invoice) { adOrgId(OrgId.ofRepoId(invoice.getAD_Org_ID())); invoiceId(InvoiceId.ofRepoId(invoice.getC_Invoice_ID())); bpartnerId(BPartnerId.ofRepoId(invoice.getC_BPartner_ID())); currencyId(CurrencyId.ofRepoId(invoice.getC_Currency_ID())); ...
public final DefaultPaymentBuilder orderExternalId(@Nullable final String orderExternalId) { assertNotBuilt(); if (Check.isNotBlank(orderExternalId)) { payment.setExternalOrderId(orderExternalId); } return this; } public final DefaultPaymentBuilder isAutoAllocateAvailableAmt(final boolean isAutoAllocat...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\payment\api\DefaultPaymentBuilder.java
1
请完成以下Java代码
public void setContinueOnError(boolean continueOnError) { this.continueOnError = continueOnError; } /** * Returns the statement separator used in the schema and data scripts. * @return the statement separator */ public String getSeparator() { return this.separator; } /** * Sets the statement separato...
* performed. * @return the initialization mode * @since 2.5.1 */ public DatabaseInitializationMode getMode() { return this.mode; } /** * Sets the mode the use when determining whether database initialization should be * performed. * @param mode the initialization mode * @since 2.5.1 */ public voi...
repos\spring-boot-4.0.1\module\spring-boot-sql\src\main\java\org\springframework\boot\sql\init\DatabaseInitializationSettings.java
1
请在Spring Boot框架中完成以下Java代码
public void onParameterChanged(final String parameterName) { if (PARAM_SerialNo.equals(parameterName)) { final AlreadyShippedHUsInPreviousSystem result = repairCustomerReturnsService .searchAlreadyShippedHUsInPreviousSystemRepositoryBySerialNo(serialNo) .orElse(null); if (result != null) { p...
.setHUContext(huContext) .setProduct(productId) .setQuantity(Quantity.of(1, productStockingUOM)) .setDate(SystemTime.asZonedDateTime()) .setForceQtyAllocation(true) .setFromReferencedModel(referencedModel) .create()); final I_M_HU vhu = destination.getSingleCreatedHU() .orElse...
repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.webui\src\main\java\de\metas\servicerepair\customerreturns\process\HUsToReturn_CreateShippedHU.java
2
请完成以下Java代码
public void save(DataOutputStream out) throws IOException { out.writeInt(totalFrequency); out.writeInt(nature.length); for (int i = 0; i < nature.length; ++i) { out.writeInt(nature[i].ordinal()); out.writeInt(frequency[i]); ...
return CoreDictionary.trie.exactMatchSearch(a); } /** * 热更新核心词典<br> * 集群环境(或其他IOAdapter)需要自行删除缓存文件 * * @return 是否成功 */ public static boolean reload() { String path = CoreDictionary.path; IOUtil.deleteFile(path + Predefine.BIN_EXT); return load(path); ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dictionary\CoreDictionary.java
1
请在Spring Boot框架中完成以下Java代码
@Nullable String getViewName() { return this.viewName; } /** * Return if the welcome page is from a template. * @return if the welcome page is templated */ boolean isTemplated() { return this.templated; } /** * Resolve the {@link WelcomePage} to use. * @param templateAvailabilityProviders the templ...
* @param indexHtmlResource the index HTML resource to use or {@code null} * @param staticPathPattern the static path pattern being used * @return a resolved {@link WelcomePage} instance or {@link #UNRESOLVED} */ static WelcomePage resolve(TemplateAvailabilityProviders templateAvailabilityProviders, Applicatio...
repos\spring-boot-4.0.1\module\spring-boot-webmvc\src\main\java\org\springframework\boot\webmvc\autoconfigure\WelcomePage.java
2
请在Spring Boot框架中完成以下Java代码
public class POSCashJournalId implements RepoIdAware { int repoId; private POSCashJournalId(final int repoId) { this.repoId = Check.assumeGreaterThanZero(repoId, "C_POS_CashJournal_ID"); } @JsonCreator public static POSCashJournalId ofRepoId(final int repoId) { return new POSCashJournalId(repoId); } @Nu...
{ return id != null ? id.getRepoId() : -1; } @Override @JsonValue public int getRepoId() { return repoId; } public static boolean equals(@Nullable final POSCashJournalId id1, @Nullable final POSCashJournalId id2) { return Objects.equals(id1, id2); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSCashJournalId.java
2
请在Spring Boot框架中完成以下Java代码
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2022-02-18T14:17:41.660Z[GMT]")public class Pair { private String name = ""; private String value = ""; public Pair (String name, String value) { setName(name); setValue(value); } ...
public String getName() { return this.name; } public String getValue() { return this.value; } private boolean isValidString(String arg) { if (arg == null) return false; if (arg.trim().isEmpty()) return false; return true; } }
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-article-api\src\main\java\io\swagger\client\Pair.java
2
请在Spring Boot框架中完成以下Java代码
public ArticleComment getComment(int commentId) { return articleCommentRepository .findById(commentId) .orElseThrow(() -> new NoSuchElementException("invalid comment id.")); } /** * Get all comments by article. * * @param article article * @return Ret...
* @return Returns the written comment */ public ArticleComment write(ArticleComment articleComment) { return articleCommentRepository.save(articleComment); } /** * Delete comment. * * @param requester user who requested * @param articleComment comment */ public voi...
repos\realworld-java21-springboot3-main\module\core\src\main\java\io\zhc1\realworld\service\ArticleCommentService.java
2
请完成以下Java代码
public Object getValue() { return typedValueField.getValue(); } public TypedValue getTypedValue() { return typedValueField.getTypedValue(false); } public TypedValue getTypedValue(boolean deserializeValue) { return typedValueField.getTypedValue(deserializeValue, false); } @Override public vo...
return typedValueField.getTypeName(); } public String getVariableTypeName() { return getTypeName(); } public Date getTime() { return timestamp; } @Override public String toString() { return this.getClass().getSimpleName() + "[variableName=" + variableName + ", variable...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\HistoricDetailVariableInstanceUpdateEntity.java
1
请完成以下Java代码
public POSPayment refundPOSPayment(@NonNull final POSPayment posPaymentToProcess, @NonNull POSOrderId posOrderId, @NonNull final POSTerminalPaymentProcessorConfig paymentProcessorConfig) { posPaymentToProcess.assertAllowRefund(); POSPayment posPayment = posPaymentToProcess; // // Reverse payment // (usuall...
.build() ); posPayment = posPayment.changingStatusFromRemote(refundResponse); return posPayment; } public void scheduleCreateSalesOrderInvoiceAndShipment(@NonNull final POSOrderId posOrderId, @NonNull final UserId cashierId) { final UserId adUserId = Env.getLoggedUserIdIfExists().orElse(cashierId); try (...
repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSOrderProcessingServices.java
1
请在Spring Boot框架中完成以下Java代码
public RepositorySettings getRepositorySettings(TenantId tenantId) throws Exception { var gitRepository = repositories.get(tenantId); return gitRepository != null ? gitRepository.getSettings() : null; } @Override public void clearRepository(TenantId tenantId) throws IOException { Gi...
public static EntityId fromRelativePath(String path) { EntityType entityType = EntityType.valueOf(StringUtils.substringBefore(path, "/").toUpperCase()); String entityId = StringUtils.substringBetween(path, "/", ".json"); return EntityIdFactory.getByTypeAndUuid(entityType, entityId); } p...
repos\thingsboard-master\common\version-control\src\main\java\org\thingsboard\server\service\sync\vc\DefaultGitRepositoryService.java
2
请在Spring Boot框架中完成以下Java代码
public class XForwardedRequestHeadersFilterProperties { /** * XForwardedRequestHeadersFilterProperties prefix. */ public static final String PREFIX = GatewayMvcProperties.PREFIX + ".x-forwarded-request-headers-filter"; /** The order of the XForwardedHeadersFilter. */ private int order = 0; /** If the XForwa...
public boolean isProtoEnabled() { return protoEnabled; } public void setProtoEnabled(boolean protoEnabled) { this.protoEnabled = protoEnabled; } public boolean isPrefixEnabled() { return prefixEnabled; } public void setPrefixEnabled(boolean prefixEnabled) { this.prefixEnabled = prefixEnabled; } publ...
repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\filter\XForwardedRequestHeadersFilterProperties.java
2
请完成以下Java代码
public KeyName[] getLowCardinalityKeyNames() { return ListenerLowCardinalityTags.values(); } @Override public KeyName[] getHighCardinalityKeyNames() { return ListenerHighCardinalityTags.values(); } }; /** * Low cardinality tags. */ public enum ListenerLowCardinalityTags implements KeyName { /...
/** * Default {@link RabbitListenerObservationConvention} for Rabbit listener key values. */ public static class DefaultRabbitListenerObservationConvention implements RabbitListenerObservationConvention { /** * A singleton instance of the convention. */ public static final DefaultRabbitListenerObservati...
repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\support\micrometer\RabbitListenerObservation.java
1
请在Spring Boot框架中完成以下Java代码
public void setValue(Object value, ValueFields valueFields) { EntityManagerSession entityManagerSession = Context.getCommandContext().getSession(EntityManagerSession.class); if (entityManagerSession == null) { throw new FlowableException("Cannot set JPA variable: " + EntityManagerSession.cla...
@Override public Object getValue(ValueFields valueFields) { if (valueFields.getTextValue() != null && valueFields.getTextValue2() != null) { return mappings.getJPAEntity(valueFields.getTextValue(), valueFields.getTextValue2()); } return null; } /** * Force the value...
repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\impl\types\JPAEntityVariableType.java
2
请在Spring Boot框架中完成以下Java代码
public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public RpNotifyRecordLog() { super(); } public RpNotifyRecordLog(Date createTime, String notifyId, String request, String response, String me...
} /** 商户编号 **/ public String getMerchantNo() { return merchantNo; } /** 商户编号 **/ public void setMerchantNo(String merchantNo) { this.merchantNo = merchantNo == null ? null : merchantNo.trim(); } /** 商户订单号 **/ public String getMerchantOrderNo() { return merchant...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\notify\entity\RpNotifyRecordLog.java
2
请完成以下Java代码
public void setAD_UI_Section_ID (int AD_UI_Section_ID) { if (AD_UI_Section_ID < 1) set_ValueNoCheck (COLUMNNAME_AD_UI_Section_ID, null); else set_ValueNoCheck (COLUMNNAME_AD_UI_Section_ID, Integer.valueOf(AD_UI_Section_ID)); } /** Get UI Section. @return UI Section */ @Override public int getAD_UI...
Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst */ @Override public void setSeqNo (int SeqNo) { set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); } /** Get Reihenfolge. @return Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst */ @Override publ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_UI_Column.java
1
请完成以下Java代码
public <T> T getDynAttribute(final @NonNull Object model, final String attributeName) { return DocumentInterfaceWrapper.getDocument(model).getDynAttribute(attributeName); } @Override public Object setDynAttribute(final Object model, final String attributeName, final Object value) { return DocumentInterfaceWra...
{ throw new AdempiereException("Cannot extract " + Document.class + " from " + model); } final String tableName = document.getEntityDescriptor().getTableName(); final boolean checkCache = false; @SuppressWarnings("unchecked") final T po = (T)TableModelLoader.instance.getPO(document.getCtx(), tableName, do...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\DocumentInterfaceWrapperHelper.java
1
请完成以下Java代码
public void appendRow(final List<Object> values) { appendHeaderIfNeeded(); final StringBuilder line = new StringBuilder(); final int cols = header.size(); final int valuesCount = values.size(); for (int i = 0; i < cols; i++) { final Object csvValue; if (i < valuesCount) { csvValue = values....
public void close() { if (writer == null) { return; } try { writer.flush(); } catch (IOException ex) { throw new AdempiereException("Failed flushing CSV data to file", ex); } finally { if (writer != null) { try { writer.close(); } catch (IOException e) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\spreadsheet\csv\CSVWriter.java
1
请完成以下Java代码
public void run() { while (true) { final Duration pollInterval = getPollInterval(); logger.debug("Sleeping {}", pollInterval); try { Thread.sleep(pollInterval.toMillis()); } catch (InterruptedException e) { logger.info("Got interrupt request. Exiting."); return; } try { ...
} private void processNow() { boolean mightHaveMore; do { final int processedCount = faOpenItemsService.processScheduled(); mightHaveMore = processedCount > 0; } while (mightHaveMore); } private Duration getPollInterval() { final int pollIntervalInSeconds = sysConfigBL.getIntValue(SYSCONFIG_Pol...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\open_items\updater\FactAcctOpenItemsToUpdateDBTableWatcher.java
1
请完成以下Java代码
public int firstGreaterThanZeroIntegerSupplier(@NonNull final Supplier<Integer>... suppliers) { if (suppliers == null) { return 0; } for (final Supplier<Integer> supplier : suppliers) { final Integer value = supplier.get(); if (value != null && value > 0) { return value; } } return 0; ...
} } return null; } public boolean isAllNotNulls(final Object... values) { for (final Object value : values) { if (value == null) { return false; } } return true; } public int countNotNulls(@Nullable final Object... values) { if (values == null || values.length == 0) { return 0;...
repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-util\src\main\java\de\metas\common\util\CoalesceUtil.java
1