instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public class ExceptionLogger extends BaseLogger { public static final String PROJECT_CODE = "ENGINE-REST"; public static final String REST_API = "org.camunda.bpm.engine.rest.exception"; public static final ExceptionLogger REST_LOGGER = BaseLogger.createLogger(ExceptionLogger.class, PROJECT_CODE, RES...
SQLException sqlException = getSqlException((ProcessEnginePersistenceException) throwable); if (sqlException == null) { return false; } String sqlState = sqlException.getSQLState(); return sqlState != null && sqlState.startsWith(PERSISTENCE_CONNECTION_ERROR_CLASS); } protected SQLException...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\exception\ExceptionLogger.java
1
请完成以下Java代码
public TablePageQueryImpl tableName(String tableName) { this.tableName = tableName; return this; } public TablePageQueryImpl orderAsc(String column) { addOrder(column, AbstractQuery.SORTORDER_ASC); return this; } public TablePageQueryImpl orderDesc(String column) { ...
} else { order = order + ", "; } order = order + column + " " + sortOrder; } public TablePage listPage(int firstResult, int maxResults) { this.firstResult = firstResult; this.maxResults = maxResults; return commandExecutor.execute(this); } public Tab...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\TablePageQueryImpl.java
1
请完成以下Java代码
public Resource newInstance(ModelTypeInstanceContext instanceContext) { return new ResourceImpl(instanceContext); } }); nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME) .required() .build(); SequenceBuilder sequenceBuilder = typeBuilder.sequence(); reso...
public ResourceImpl(ModelTypeInstanceContext context) { super(context); } public String getName() { return nameAttribute.getValue(this); } public void setName(String name) { nameAttribute.setValue(this, name); } public Collection<ResourceParameter> getResourceParameters() { return resourc...
repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\ResourceImpl.java
1
请完成以下Java代码
private static void updateDescription(@NonNull final I_I_BankStatement importRecord) { final String lineDescription = Joiner.on(" / ") .skipNulls() .join(StringUtils.trimBlankToNull(importRecord.getLineDescription()), StringUtils.trimBlankToNull(importRecord.getLineDescriptionExtra_1()), String...
{ //noinspection ConstantConditions return importRecord.getAmtFormat(); } // try to autodetect the current format if (Check.isNotBlank(importRecord.getDebitOrCreditIndicator()) && importRecord.getDebitOrCreditAmt().signum() != 0) { return X_I_BankStatement.AMTFORMAT_AmountPlusIndicator; } else if ...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\impexp\BankStatementImportProcess.java
1
请完成以下Java代码
private void sleep() throws InterruptedException { final Duration pollInterval = getPollInterval(); logger.debug("Sleeping {}", pollInterval); Thread.sleep(pollInterval.toMillis()); } private Duration getPollInterval() { final int pollIntervalInSeconds = sysConfigBL.getIntValue(SYSCONFIG_PollIntervalInSeco...
boolean mightHaveMore; do { final QueryLimit retrieveBatchSize = getRetrieveBatchSize(); final FactAcctLogProcessResult result = factAcctLogService.processAll(retrieveBatchSize); finalResult = finalResult.combineWith(result); mightHaveMore = retrieveBatchSize.isLessThanOrEqualTo(result.getProcessedLogR...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\aggregation\FactAcctLogDBTableWatcher.java
1
请完成以下Java代码
public class Account { private Long id; private String iban; private BigDecimal balance; public Account() {} public Account(Long id, String iban, BigDecimal balance) { this.id = id; this.iban = iban; this.balance = balance; } public Account(Long id, S...
* @return the iban */ public String getIban() { return iban; } /** * @param iban the iban to set */ public void setIban(String iban) { this.iban = iban; } /** * @return the balance */ public BigDecimal getBalance() { return balance; } ...
repos\tutorials-master\persistence-modules\r2dbc\src\main\java\com\baeldung\examples\r2dbc\Account.java
1
请在Spring Boot框架中完成以下Java代码
public class AccountSetting { @Id @GeneratedValue private Long id; @Column(name = "name", nullable = false) private String settingName; @Column(name = "value", nullable = false) private String settingValue; @ManyToOne() @JoinColumn(name ="account_id", nullable = false) privat...
} public String getSettingName() { return settingName; } public void setSettingName(String settingName) { this.settingName = settingName; } public String getSettingValue() { return settingValue; } public void setSettingValue(String settingValue) { this.set...
repos\tutorials-master\persistence-modules\spring-data-jpa-simple\src\main\java\com\baeldung\jpa\schemageneration\model\AccountSetting.java
2
请在Spring Boot框架中完成以下Java代码
public boolean matches(Class<?> clazz) { return this.expression.couldMatchJoinPointsInType(clazz); } @Override public boolean matches(Method method, Class<?> targetClass) { return this.expression.matchesMethodExecution(method).alwaysMatches(); } @Override public boolean isRuntime() { return false; } @O...
public boolean matches(Method method, Class<?> targetClass, Object... args) { return matches(method, targetClass); } @Override public ClassFilter getClassFilter() { return this; } @Override public MethodMatcher getMethodMatcher() { return this; } }
repos\spring-security-main\config\src\main\java\org\springframework\security\config\method\AspectJMethodMatcher.java
2
请在Spring Boot框架中完成以下Java代码
private void prepareApiCredentials(@NonNull final Map<String, String> parameters, @NonNull final OAuth2Api oAuth2Api) throws IOException { final ApiMode apiMode = ApiMode.valueOf(parameters.get(ExternalSystemConstants.PARAM_API_MODE)); final Map<String, String> mapCredentialUtil = new HashMap<>(); mapCredential...
{ final String ebayMappings = request.getParameters().get(ExternalSystemConstants.PARAM_CONFIG_MAPPINGS); if (Check.isBlank(ebayMappings)) { return Optional.empty(); } final ObjectMapper mapper = new ObjectMapper(); try { return Optional.of(mapper.readValue(ebayMappings, JsonExternalSystemEbayConf...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-ebay\de-metas-camel-ebay-camelroutes\src\main\java\de\metas\camel\externalsystems\ebay\processor\order\GetEbayOrdersProcessor.java
2
请完成以下Java代码
public void setLanguage(final String language) { this.language = language; this.languageSet = true; } public void setInvoiceRule(final JsonInvoiceRule invoiceRule) { this.invoiceRule = invoiceRule; this.invoiceRuleSet = true; } public void setUrl(final String url) { this.url = url; this.urlSet = tr...
this.group = group; this.groupSet = true; } public void setGlobalId(final String globalId) { this.globalId = globalId; this.globalIdset = true; } public void setSyncAdvise(final SyncAdvise syncAdvise) { this.syncAdvise = syncAdvise; this.syncAdviseSet = true; } public void setVatId(final String vat...
repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-bpartner\src\main\java\de\metas\common\bpartner\v1\request\JsonRequestBPartner.java
1
请在Spring Boot框架中完成以下Java代码
public class JsonPurchaseCandidate { @JsonProperty("externalSystemCode") String externalSystemCode; @JsonProperty("externalHeaderId") JsonExternalId externalHeaderId; @JsonProperty("externalLineId") JsonExternalId externalLineId; @Schema(description = "The date ordered of the purchase candidate") @JsonPrope...
@JsonProperty("externalLineId") @Nullable final JsonExternalId externalLineId, @JsonProperty("purchaseDatePromised") @Nullable final ZonedDateTime purchaseDatePromised, @JsonProperty("purchaseDateOrdered") @Nullable final ZonedDateTime purchaseDateOrdered, @JsonProperty("externalPurchaseOrderUrl") @Nullable fi...
repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-rest_api\src\main\java\de\metas\common\rest_api\v2\JsonPurchaseCandidate.java
2
请完成以下Java代码
public void setM_PromotionGroup_ID (int M_PromotionGroup_ID) { if (M_PromotionGroup_ID < 1) set_ValueNoCheck (COLUMNNAME_M_PromotionGroup_ID, null); else set_ValueNoCheck (COLUMNNAME_M_PromotionGroup_ID, Integer.valueOf(M_PromotionGroup_ID)); } /** Get Promotion Group. @return Promotion Group */ pu...
*/ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ public String getName () { return (String)get_Value(COLUMNNAME_Name); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public Ke...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_PromotionGroup.java
1
请完成以下Java代码
public List<ShipmentScheduleWithHU> retrieveShipmentSchedulesWithHUsFromHUs(@NonNull final List<I_M_HU> hus) { final IMutableHUContext huContext = huContextFactory.createMutableHUContext(); // // Iterate HUs and collect candidates from them final IHandlingUnitsBL handlingUnitsBL = handlingUnitsBL(); final A...
final ShipmentScheduleWithHU candidate = ShipmentScheduleWithHU.ofShipmentScheduleQtyPickedWithHuContext(shipmentScheduleQtyPicked, huContext); candidatesForHU.add(candidate); } // // Add the candidates for current HU to the list of all collected candidates result.addAll(candidatesForHU); // Log if...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\shipmentschedule\api\impl\HUShipmentScheduleDAO.java
1
请在Spring Boot框架中完成以下Java代码
public class CommissionInstanceDAO { private final IQueryBL queryBL = Services.get(IQueryBL.class); /** * @return true if any of the {@code salesCandDocIds}'s {@link InvoiceCandidateId}s is referenced by a commission instance. */ public boolean isICsReferencedByCommissionInstances(@NonNull final Set<SalesInvoic...
} /** * @return true if any of the {@code salesCandDocIds}'s {@link InvoiceLineId}s is referenced by a commission instance. */ public boolean isILsReferencedByCommissionInstances(@NonNull final Set<SalesInvoiceLineDocumentId> salesInvoiceLineDocumentIds) { final ImmutableSet<InvoiceAndLineId> invoiceLineIds =...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\commission\commissioninstance\services\dao\CommissionInstanceDAO.java
2
请在Spring Boot框架中完成以下Java代码
public void setDateConfirmed(Date dateConfirmed) { this.dateConfirmed = dateConfirmed; } /** * * @return the date when our local endpoint received the remote endpoint's confirmation. */ public Date getDateConfirmReceived() { return dateConfirmReceived; } public void setDateConfirmReceived(Date dateCo...
{ this.dateConfirmReceived = dateConfirmReceived; } public long getEntryId() { return entryId; } public void setEntryId(long entryId) { this.entryId = entryId; } }
repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\model\SyncConfirm.java
2
请完成以下Java代码
public Object getAggregatedValue(final RModelCalculationContext calculationCtx, final List<Object> groupRow) { if (!valid) { return null; } if (!isGroupBy(calculationCtx, COLUMNNAME_M_Product_ID)) { return null; } final IRModelMetadata metadata = calculationCtx.getMetadata(); final int groupPr...
// Update UOM column // FIXME: dirty hack { final KeyNamePair uomKNP = new KeyNamePair(uom.getC_UOM_ID(), uom.getName()); setRowValueOrNull(metadata, groupRow, COLUMNNAME_C_UOM_ID, uomKNP); } return qty; } private final int getM_Product_ID(final IRModelMetadata metadata, final List<Object> row) { f...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\compiere\report\core\ProductQtyRModelAggregatedValue.java
1
请在Spring Boot框架中完成以下Java代码
public Status getStatus() { return this.status; } public @Nullable Show getShowComponents() { return this.showComponents; } public void setShowComponents(@Nullable Show showComponents) { this.showComponents = showComponents; } public abstract @Nullable Show getShowDetails(); public Set<String> getRoles...
private List<String> order = new ArrayList<>(); /** * Mapping of health statuses to HTTP status codes. By default, registered health * statuses map to sensible defaults (for example, UP maps to 200). */ private final Map<String, Integer> httpMapping = new HashMap<>(); public List<String> getOrder() { ...
repos\spring-boot-4.0.1\module\spring-boot-health\src\main\java\org\springframework\boot\health\autoconfigure\actuate\endpoint\HealthProperties.java
2
请完成以下Java代码
public class BaseResp<T> { private int status; private T data; private String message; public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public T getData() { return data; } public void setData(T data) { this.data = data;
} public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } @Override public String toString() { return "BaseResp{" + "status=" + status + ", data=" + data + ", message='" + message + '\'' + '}'; } }
repos\spring-boot-quick-master\quick-feign\src\main\java\com\quick\feign\entity\BaseResp.java
1
请在Spring Boot框架中完成以下Java代码
public String loginPage() { return "login.html"; } @ResponseBody @PostMapping("/login") public String login(HttpServletRequest request) { // 判断是否已经登陆 Subject subject = SecurityUtils.getSubject(); if (subject.getPrincipal() != null) { return "你已经登陆账号:" + subje...
msg = "未知"; logger.error("[login][未知登陆错误:{}]", shiroLoginFailure); } return "登陆失败,原因:" + msg; } @ResponseBody @GetMapping("/login_success") public String loginSuccess() { return "登陆成功"; } @ResponseBody @GetMapping("/unauthorized") public String unaut...
repos\SpringBoot-Labs-master\lab-33\lab-33-shiro-demo\src\main\java\cn\iocoder\springboot\lab01\shirodemo\controller\SecurityController.java
2
请完成以下Java代码
protected boolean writeExtensionChildElements( BaseElement element, boolean didWriteExtensionStartElement, XMLStreamWriter xtw ) throws Exception { ValuedDataObject dataObject = (ValuedDataObject) element; if (StringUtils.isNotEmpty(dataObject.getId()) && dataObject.getValue...
} if (dataObject instanceof StringDataObject && xmlChars.matcher(value).find()) { xtw.writeCData(value); } else { xtw.writeCharacters(value); } } xtw.writeEndElement(); } return didWriteExte...
repos\Activiti-develop\activiti-core\activiti-bpmn-converter\src\main\java\org\activiti\bpmn\converter\ValuedDataObjectXMLConverter.java
1
请完成以下Java代码
public class DiagnosisType { @XmlValue protected String value; @XmlAttribute(name = "type") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String type; @XmlAttribute(name = "code") protected String code; /** * Gets the value of the value property. * * @retu...
return "by_contract"; } else { return type; } } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(String value) { this.type = value; } /** ...
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\DiagnosisType.java
1
请完成以下Java代码
public FactLineBuilder toLocationOfBPartner(@Nullable final BPartnerLocationId bpartnerLocationId) { return toLocation(getServices().getLocationId(bpartnerLocationId)); } public FactLineBuilder toLocationOfLocator(final int locatorRepoId) { return toLocation(getServices().getLocationIdByLocatorRepoId(locatorRe...
{ assertNotBuild(); this.productId = Optional.ofNullable(productId); return this; } public FactLineBuilder userElementString1(@Nullable final String userElementString1) { assertNotBuild(); this.userElementString1 = StringUtils.trimBlankToOptional(userElementString1); return this; } public FactLineBui...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\FactLineBuilder.java
1
请完成以下Java代码
public String getId() { return idAttribute.getValue(this); } public void setId(String id) { idAttribute.setValue(this, id); } public String getName() { return nameAttribute.getValue(this); } public void setName(String name) { nameAttribute.setValue(this, name); } public String getTar...
exporterVersionAttribute.setValue(this, exporterVersion); } public Collection<Import> getImports() { return importCollection.get(this); } public Collection<Extension> getExtensions() { return extensionCollection.get(this); } public Collection<RootElement> getRootElements() { return rootElemen...
repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\DefinitionsImpl.java
1
请完成以下Java代码
public PlanItem newInstance(ModelTypeInstanceContext instanceContext) { return new PlanItemImpl(instanceContext); } }); nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) .build(); planItemDefinitionRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_D...
SequenceBuilder sequenceBuilder = typeBuilder.sequence(); itemControlChild = sequenceBuilder.element(ItemControl.class) .build(); entryCriterionCollection = sequenceBuilder.elementCollection(EntryCriterion.class) .build(); exitCriterionCollection = sequenceBuilder.elementCollection(ExitCr...
repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\PlanItemImpl.java
1
请在Spring Boot框架中完成以下Java代码
public Rfq changeActiveRfq( @NonNull final JsonChangeRfqRequest request, @NonNull final User loggedUser) { final Rfq rfq = getUserActiveRfq( loggedUser, Long.parseLong(request.getRfqId())); for (final JsonChangeRfqQtyRequest qtyChangeRequest : request.getQuantities()) { rfq.setQtyPromised(qtyCh...
{ return rfqRepo.countUnconfirmed(user.getBpartner()); } @Override @Transactional public void confirmUserEntries(@NonNull final User user) { final BPartner bpartner = user.getBpartner(); final List<Rfq> rfqs = rfqRepo.findUnconfirmed(bpartner); for (final Rfq rfq : rfqs) { rfq.confirmByUser(); sav...
repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\service\impl\RfQService.java
2
请在Spring Boot框架中完成以下Java代码
public CommonResult cancelTimeOutOrder() { portalOrderService.cancelTimeOutOrder(); return CommonResult.success(null); } @ApiOperation("取消单个超时订单") @RequestMapping(value = "/cancelOrder", method = RequestMethod.POST) @ResponseBody public CommonResult cancelOrder(Long orderId) { ...
public CommonResult<OmsOrderDetail> detail(@PathVariable Long orderId) { OmsOrderDetail orderDetail = portalOrderService.detail(orderId); return CommonResult.success(orderDetail); } @ApiOperation("用户取消订单") @RequestMapping(value = "/cancelUserOrder", method = RequestMethod.POST) @Respons...
repos\mall-master\mall-portal\src\main\java\com\macro\mall\portal\controller\OmsPortalOrderController.java
2
请完成以下Java代码
public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } ...
public void setActive(boolean isActive) { this.isActive = isActive; } public List<String> getCourses() { return courses; } public void setCourses(List<String> courses) { this.courses = courses; } public String getAdditionalSkills() { return additionalSkills; } public void setAdditionalSkills(String ...
repos\tutorials-master\spring-web-modules\spring-thymeleaf\src\main\java\com\baeldung\thymeleaf\model\Teacher.java
1
请完成以下Java代码
public UserCredentials findByUserId(TenantId tenantId, UUID userId) { return DaoUtil.getData(userCredentialsRepository.findByUserId(userId)); } @Override public UserCredentials findByActivateToken(TenantId tenantId, String activateToken) { return DaoUtil.getData(userCredentialsRepository.fi...
@Override public int incrementFailedLoginAttempts(TenantId tenantId, UserId userId) { return userCredentialsRepository.incrementFailedLoginAttemptsByUserId(userId.getId()); } @Override public void setFailedLoginAttempts(TenantId tenantId, UserId userId, int failedLoginAttempts) { userCr...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\user\JpaUserCredentialsDao.java
1
请完成以下Java代码
public class RoleAccessUpdate extends JavaProcess { private static final Logger logger = LogManager.getLogger(RoleAccessUpdate.class); /** Update Role */ private int p_AD_Role_ID = -1; /** Update Roles of Client */ private int p_AD_Client_ID = -1; /** * Prepare */ @Override protected void prepare() { P...
final ClientId clientId = null; // all updateAllRoles(clientId); } public static void updateAllRoles(final ClientId clientId) { Services.get(IRoleDAO.class).retrieveAllRolesWithAutoMaintenance() .stream() .filter(role -> isRoleMatchingClientId(role, clientId)) .forEach(role -> updateRole(role)); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\process\RoleAccessUpdate.java
1
请完成以下Java代码
public class Author { @Id private Long id; private String name; @Relationship(type = "WRITTEN_BY", direction = Relationship.Direction.INCOMING) private List<Book> books; public Author(Long id, String name) { this.id = id; this.name = name; } public Long getId() { ...
public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Book> getBooks() { return books; } public void setBooks(List<Book> books) { this.books = books; } }
repos\tutorials-master\persistence-modules\spring-data-neo4j\src\main\java\com\baeldung\spring\data\neo4j\domain\Author.java
1
请完成以下Java代码
public boolean isRecordCopyingMode() { final GridTab gridTab = getGridTab(); // If there was no GridTab set for this field, consider as we are not copying the record if (gridTab == null) { return false; } return gridTab.isDataNewCopy(); } @Override public boolean isRecordCopyingModeIncludingDetail...
gridTab.fireDataStatusEEvent(AD_Message, info, isError); } @Override public void fireDataStatusEEvent(final ValueNamePair errorLog) { final GridTab gridTab = getGridTab(); if(gridTab == null) { log.warn("Could not fire EEvent on {} because gridTab is not set. The event was: errorLog={}", this, errorLog); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\GridField.java
1
请完成以下Java代码
public class JSONObjectMapper<T> { public static <T> JSONObjectMapper<T> forClass(@NonNull final Class<T> clazz) { return new JSONObjectMapper<>(clazz); } private final static ObjectMapper jsonObjectMapper= JsonObjectMapperHolder.sharedJsonObjectMapper(); private final Class<T> clazz; private JSONObjectMappe...
return jsonObjectMapper.readValue(objectString, clazz); } catch (IOException ex) { throw new AdempiereException("Failed converting json to class= " + clazz + "; object=" + objectString, ex); } } public T readValue(final InputStream objectStream) { try { return jsonObjectMapper.readValue(objectStre...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\util\JSONObjectMapper.java
1
请完成以下Java代码
public void setProcessing (boolean Processing) { set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); } /** Get Process Now. @return Process Now */ public boolean isProcessing () { Object oo = get_Value(COLUMNNAME_Processing); if (oo != null) { if (oo instanceof Boolean) return ...
} /** Set Sequence. @param SeqNo Method of ordering records; lowest number comes first */ public void setSeqNo (int SeqNo) { set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); } /** Get Sequence. @return Method of ordering records; lowest number comes first */ public int getSeqNo () { Inte...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_ReportLine.java
1
请完成以下Java代码
public BigDecimal getTotalNetAmt(final boolean isApprovedForInvoicing) { if (isApprovedForInvoicing) { return getTotalNetAmtApproved(); } else { return getTotalNetAmt(); } } public int getCountTotalToRecompute() { return countTotalToRecompute; } public Set<String> getCurrencySymbols() { r...
message.append(" - ").append("Ware ").append(getAmountFormatted(cuNetAmtNotApproved)); if (countTotalToRecompute > 0) { message.append(", @IsToRecompute@: "); message.append(countTotalToRecompute); } return message.toString(); } private String getAmountFormatted(final BigDecimal amt) { final Decim...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\invoicecandidate\ui\spi\impl\HUInvoiceCandidatesSelectionSummaryInfo.java
1
请在Spring Boot框架中完成以下Java代码
public class SumUpLogRepository { @NonNull private final Logger logger = LogManager.getLogger(SumUpLogRepository.class); @NonNull private final ObjectMapper jsonMapper = JsonObjectMapperHolder.sharedJsonObjectMapper(); public void createLog(final SumUpLogRequest request) { try { final I_SUMUP_API_Log record...
{ return null; } if (obj instanceof String) { return StringUtils.trimBlankToNull((String)obj); } try { return jsonMapper.writeValueAsString(obj); } catch (JsonProcessingException ex) { logger.error("Failed converting object to json: {}", obj, ex); return obj.toString(); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sumup\src\main\java\de\metas\payment\sumup\repository\SumUpLogRepository.java
2
请完成以下Spring Boot application配置
#basic auth creddentials spring.security.user.name=client spring.security.user.password=client #configs to connect to a secured server spring.boot.admin.client.url=http://localhost:8080 #spring.boot.admin.client.instance.service-base-url=http://localhost:8081 spring.boot.admin.client.username=admin spring.boot.admin.c...
user.password=${spring.security.user.password} #app config spring.application.name=spring-boot-admin-client server.port=8081 management.endpoints.web.exposure.include=* management.endpoint.health.show-details=always
repos\tutorials-master\spring-boot-modules\spring-boot-admin\spring-boot-admin-client\src\main\resources\application.properties
2
请完成以下Java代码
public String getSourceCaseDefinitionId() { return sourceProcessDefinitionId; } public void setSourceCaseDefinitionId(String sourceProcessDefinitionId) { this.sourceProcessDefinitionId = sourceProcessDefinitionId; } public String getTargetCaseDefinitionId() { return targetProce...
} succesfulMigrationParts.add(migrationPart); } else { if (failedMigrationParts == null) { failedMigrationParts = new ArrayList<>(); } failedMigrationParts.add(migrationPart); } } } public List<...
repos\flowable-engine-main\modules\flowable-cmmn-api\src\main\java\org\flowable\cmmn\api\migration\CaseInstanceBatchMigrationResult.java
1
请完成以下Java代码
private boolean isBlankColumn(final String columnName) { return rowsList.stream().allMatch(row -> row.isBlankColumn(columnName)); } public void moveColumnsToStart(final String... columnNamesToMove) { if (columnNamesToMove == null || columnNamesToMove.length == 0) { return; } for (int i = columnNamesT...
private Optional<Cell> getCommonValue(@NonNull final String columnName) { if (rowsList.isEmpty()) { return Optional.empty(); } final Cell firstValue = rowsList.get(0).getCell(columnName); for (int i = 1; i < rowsList.size(); i++) { final Cell value = rowsList.get(i).getCell(columnName); if (!Obj...
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\text\tabular\Table.java
1
请在Spring Boot框架中完成以下Java代码
private String getLogoutSuccessUrl() { return this.logoutSuccessUrl; } /** * Gets the {@link LogoutHandler} instances that will be used. * @return the {@link LogoutHandler} instances. Cannot be null. */ public List<LogoutHandler> getLogoutHandlers() { return this.logoutHandlers; } /** * Creates the {...
return this.logoutRequestMatcher; } @SuppressWarnings("unchecked") private RequestMatcher createLogoutRequestMatcher(H http) { RequestMatcher post = createLogoutRequestMatcher("POST"); if (http.getConfigurer(CsrfConfigurer.class) != null) { return post; } RequestMatcher get = createLogoutRequestMatcher("...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\LogoutConfigurer.java
2
请在Spring Boot框架中完成以下Java代码
public List<HistoricTaskLogEntry> findHistoricTaskLogEntriesByQueryCriteria(HistoricTaskLogEntryQueryImpl taskLogEntryQuery) { return getDbSqlSession().selectList("selectHistoricTaskLogEntriesByQueryCriteria", taskLogEntryQuery); } @Override public void deleteHistoricTaskLogEntry(long logEntryNumbe...
@Override public void deleteHistoricTaskLogEntriesForNonExistingProcessInstances() { getDbSqlSession().delete("bulkDeleteHistoricTaskLogEntriesForNonExistingProcessInstances", null, HistoricTaskLogEntryEntityImpl.class); } @Override public void deleteHistoricTaskLogEntriesForNonExistingCase...
repos\flowable-engine-main\modules\flowable-task-service\src\main\java\org\flowable\task\service\impl\persistence\entity\data\impl\MyBatisHistoricTaskLogEntryDataManager.java
2
请完成以下Java代码
public void setAD_PrintFont_ID (int AD_PrintFont_ID) { if (AD_PrintFont_ID < 1) set_ValueNoCheck (COLUMNNAME_AD_PrintFont_ID, null); else set_ValueNoCheck (COLUMNNAME_AD_PrintFont_ID, Integer.valueOf(AD_PrintFont_ID)); } /** Get Print Font. @return Maintain Print Font */ public int getAD_PrintFont...
return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ public ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_PrintFont.java
1
请完成以下Java代码
public JdbcTemplate getJdbcTemplate() { return jdbcTemplate; } public void setJdbcTemplate(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } public boolean isIgnoreDataAccessException() { return ignoreDataAccessException; } public void setIgnoreDataAccessException(boolean ignor...
protected String getSql() { String tablePrefix = camundaBpmProperties.getDatabase().getTablePrefix(); if (tablePrefix == null) { tablePrefix = ""; } return SQL_TEMPLATE.replace(TABLE_PREFIX_PLACEHOLDER, tablePrefix); } protected String getHistoryLevelFrom(Integer historyLevelFromDb) { Str...
repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\jdbc\HistoryLevelDeterminatorJdbcTemplateImpl.java
1
请完成以下Java代码
private static <T> T parse(Map<String, Object> body, ThrowingFunction<JSONObject, T, ParseException> parser) { try { return parser.apply(new JSONObject(body)); } catch (ParseException ex) { throw new RuntimeException(ex); } } private static ClientRegistration.Builder withProviderConfiguration(Authoriza...
List<com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod> metadataAuthMethods) { if (metadataAuthMethods == null || metadataAuthMethods .contains(com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod.CLIENT_SECRET_BASIC)) { // If null, the default includes client_secret_basic return ClientAuthenticatio...
repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\registration\ClientRegistrations.java
1
请完成以下Java代码
public static boolean hasColumnName(final Object model, final String columnName) { final Document document = getDocument(model); if (document == null) { return false; } final IDocumentFieldView documentField = document.getFieldViewOrNull(columnName); return documentField != null; } @Override public...
@Override public boolean isCalculated(final String columnName) { final IDocumentFieldView field = document.getFieldViewOrNull(columnName); return field != null && field.isCalculated(); } @Override public boolean setValueNoCheck(final String columnName, final Object value) { return setValue(columnName, valu...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\DocumentInterfaceWrapper.java
1
请完成以下Java代码
public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public Integer getOccurCount() { return occurCount; } public void setOccurCount(Integer occurCount) { this.occurCount = occurCount; } public String getOwner() { return owner; } public void set...
} @Override public String toString() { return "Event{" + "id=" + id + ", rawEventId=" + rawEventId + ", host=" + host + ", ip=" + ip + ", source=" + source + ", type=" + type + ", startTime=" + startTime + ", endTime=" + endTime + ", content=" + content + ", dataType=" + dataType + ...
repos\springBoot-master\springboot-shiro\src\main\java\com\us\bean\Event.java
1
请完成以下Java代码
public String getActivityId() { return activityId; } public void setActivityId(String activityId) { this.activityId = activityId; } public String getActivityName() { return activityName; } public void setActivityName(String activityName) { this.activityName = a...
strb.append(" | "); } strb.append("activityName = " + activityName + " | "); extraInfoAlreadyPresent = true; } if (xmlLineNumber > 0 && xmlColumnNumber > 0) { strb.append(" ( line: " + xmlLineNumber + ", column: " + xmlColumnNumber + ")"); } ...
repos\Activiti-develop\activiti-core\activiti-process-validation\src\main\java\org\activiti\validation\ValidationError.java
1
请在Spring Boot框架中完成以下Java代码
public SecurityUser getOrCreateUserByClientPrincipal(HttpServletRequest request, OAuth2AuthenticationToken token, String providerAccessToken, OAuth2Client oAuth2Client) { OAuth2MapperConfig config = oAuth2Client.getMapperConfig(); Map<String, String> githubMapperConfig = oAuth2Configuration.getGithubMap...
Optional<String> emailOpt = githubEmailsResponse.stream() .filter(GithubEmailResponse::isPrimary) .map(GithubEmailResponse::getEmail) .findAny(); if (emailOpt.isPresent()){ return emailOpt.get(); } else { log.error("Could not find p...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\security\auth\oauth2\GithubOAuth2ClientMapper.java
2
请完成以下Java代码
public void setPriceMatchDifference (java.math.BigDecimal PriceMatchDifference) { set_Value (COLUMNNAME_PriceMatchDifference, PriceMatchDifference); } /** Get Price Match Difference. @return Difference between Purchase and Invoice Price per matched line */ @Override public java.math.BigDecimal getPriceMatc...
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); } /** Get Verarbeiten. @return Verarbeiten */ @Override public boolean isProcessing () { Object oo = get_Value(COLUMNNAME_Processing); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_MatchPO.java
1
请完成以下Java代码
public class InventoryUserNotificationsProducer { public static InventoryUserNotificationsProducer newInstance() { return new InventoryUserNotificationsProducer(); } // services private final INotificationBL notificationBL = Services.get(INotificationBL.class); /** * Topic used to send notifications about s...
.contentADMessageParam(inventoryRef) .targetAction(TargetRecordAction.ofRecordAndWindow(inventoryRef, WINDOW_INTERNAL_INVENTORY)) .build(); } private static UserId getNotificationRecipientUserId(final I_M_Inventory inventory) { // // In case of reversal i think we shall notify the current user too fi...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\inventory\event\InventoryUserNotificationsProducer.java
1
请完成以下Java代码
public Object getValue() { return isSelected(); } // getValue /** * Return Display Value * @return value */ @Override public String getDisplay() { String value = isSelected() ? "Y" : "N"; return Msg.translate(Env.getCtx(), value); } // getDisplay /** * Set Background (nop) */ public void...
@Override public GridField getField() { return m_mField; } /** * @return Returns the savedMnemonic. */ public char getSavedMnemonic () { return m_savedMnemonic; } // getSavedMnemonic /** * @param savedMnemonic The savedMnemonic to set. */ public void setSavedMnemonic (char savedMnemonic) { m_...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VCheckBox.java
1
请完成以下Java代码
public void setISO_Code (java.lang.String ISO_Code) { set_Value (COLUMNNAME_ISO_Code, ISO_Code); } /** Get ISO Währungscode. @return Three letter ISO 4217 Code of the Currency */ @Override public java.lang.String getISO_Code () { return (java.lang.String)get_Value(COLUMNNAME_ISO_Code); } /** Set Rou...
return Env.ZERO; return bd; } /** Set Standardgenauigkeit. @param StdPrecision Rule for rounding calculated amounts */ @Override public void setStdPrecision (int StdPrecision) { set_Value (COLUMNNAME_StdPrecision, Integer.valueOf(StdPrecision)); } /** Get Standardgenauigkeit. @return Rule for ro...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Currency.java
1
请完成以下Java代码
public class TreeSelectModel implements Serializable { private static final long serialVersionUID = 9016390975325574747L; private String key; private String title; /** * 是否叶子节点 */ private boolean isLeaf; private String icon; private String parentId; private String value; private String code; ...
return title; } public void setTitle(String title) { this.title = title; } public boolean isLeaf() { return isLeaf; } public void setLeaf(boolean isLeaf) { this.isLeaf = isLeaf; } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public String ge...
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\TreeSelectModel.java
1
请完成以下Java代码
public String getEventName() { return eventSubscriptionDeclaration.getUnresolvedEventName(); } public String getActivityId() { return eventSubscriptionDeclaration.getActivityId(); } protected ExecutionEntity resolveExecution(EventSubscriptionEntity context) { return context.getExecution(); } ...
} /** * Assumes that an activity has at most one declaration of a certain eventType. */ public static EventSubscriptionJobDeclaration findDeclarationForSubscription(EventSubscriptionEntity eventSubscription) { List<EventSubscriptionJobDeclaration> declarations = getDeclarationsForActivity(eventSubscripti...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\EventSubscriptionJobDeclaration.java
1
请完成以下Java代码
public long getId() { return id; } public int getIndex() { return index; } public String getName() { return name; } @Override public int hashCode() { return Objects.hash(index, name); } public void setId(final long id) { this.id = id; ...
this.index = index; } public void setName(final String name) { this.name = name; } @Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.append("Bar [name=") .append(name) .append("]"); return builder.toStrin...
repos\tutorials-master\persistence-modules\spring-hibernate-6\src\main\java\com\baeldung\hibernate\cache\model\Bar.java
1
请完成以下Java代码
public static ResponseEntity ok(Object data) { ResponseEntity ResponseEntity = new ResponseEntity(); ResponseEntity.setData(data); return ResponseEntity; } public static ResponseEntity error(InfoCode infoCode) { ResponseEntity ResponseEntity = new ResponseEntity(); Respo...
public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public Object getData() { re...
repos\springBoot-master\abel-util\src\main\java\cn\abel\response\ResponseEntity.java
1
请完成以下Java代码
public Void execute(CommandContext commandContext) { CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext); if (taskId == null) { throw new FlowableIllegalArgumentException("taskId is null"); } TaskEntity tas...
task.setSuspendedBy(null); if (task.getInProgressStartTime() != null) { task.setState(Task.IN_PROGRESS); } else if (task.getClaimTime() != null) { task.setState(Task.CLAIMED); } else { task.setState(Task.CREATED); } task.setSuspensionState(Susp...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\cmd\ActivateTaskCmd.java
1
请在Spring Boot框架中完成以下Java代码
public class ShipmentScheduleUnLockRequest { public static ShipmentScheduleUnLockRequest of(final ShipmentScheduleLockRequest lockRequest) { return builder() .shipmentScheduleIds(lockRequest.getShipmentScheduleIds()) .lockType(lockRequest.getLockType()) .lockedBy(lockRequest.getLockedBy()) .build();...
{ return this; } return toBuilder().shipmentScheduleIds(shipmentScheduleIds).build(); } // // // // // public static class ShipmentScheduleUnLockRequestBuilder { public ShipmentScheduleUnLockRequestBuilder lockedByAnyUser() { return lockedBy(null); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\lock\ShipmentScheduleUnLockRequest.java
2
请完成以下Java代码
public boolean isTexture() { return MFColorType.TEXTURE.equals(getType()); } public MFColor setGradientUpperColor(final Color color) { if (!isGradient() || color == null) { return this; } return toBuilder().gradientUpperColor(color).build(); } public MFColor setGradientLowerColor(final Color color)...
} public MFColor setLineDistance(final int distance) { if (!isLine()) { return this; } return toBuilder().lineDistance(distance).build(); } public MFColor toFlatColor() { switch (getType()) { case FLAT: return this; case GRADIENT: return ofFlatColor(getGradientUpperColor()); case...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\util\MFColor.java
1
请完成以下Java代码
public org.compiere.util.KeyNamePair getKeyNamePair() { return new org.compiere.util.KeyNamePair(get_ID(), getName()); } /** Set Sql ORDER BY. @param OrderByClause Fully qualified ORDER BY clause */ @Override public void setOrderByClause (java.lang.String OrderByClause) { set_Value (COLU...
return "Y".equals(oo); } return false; } /** Set ShowInMenu. @param ShowInMenu ShowInMenu */ @Override public void setShowInMenu (boolean ShowInMenu) { set_Value (COLUMNNAME_ShowInMenu, Boolean.valueOf(ShowInMenu)); } /** Get ShowInMenu. @return ShowInMenu */ @Override public boolean isShowInMe...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_InfoWindow.java
1
请完成以下Java代码
public Artifact getArtifact(String id) { Artifact foundArtifact = null; for (Artifact artifact : artifactList) { if (id.equals(artifact.getId())) { foundArtifact = artifact; break; } } return foundArtifact; } public Collect...
dataObjects = new ArrayList<ValuedDataObject>(); if (otherElement.getDataObjects() != null && !otherElement.getDataObjects().isEmpty()) { for (ValuedDataObject dataObject : otherElement.getDataObjects()) { ValuedDataObject clone = dataObject.clone(); dataObjects.add(c...
repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\SubProcess.java
1
请完成以下Java代码
public static JsonDhlAddress getShipperAddress(@NonNull final Address address) { final JsonDhlAddress.JsonDhlAddressBuilder addressBuilder = JsonDhlAddress.builder(); mapCommonAddressFields(addressBuilder, address); return addressBuilder.build(); } @NonNull public static JsonDhlAddress getConsigneeAd...
for (final String iso : Locale.getISOCountries()) { final Locale locale = new Locale("", iso); if (locale.getISO3Country().equalsIgnoreCase(code)) { return true; } } return false; } private static void mapCommonAddressFields(@NonNull final JsonDhlAddress.JsonDhlAddressBuilder addressB...
repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dhl\src\main\java\de\metas\shipper\gateway\dhl\DhlAddressMapper.java
1
请在Spring Boot框架中完成以下Java代码
public void checkQueryOk() { super.checkQueryOk(); // latest() makes only sense when used with key() or keyLike() if (latest && ( (id != null) || (name != null) || (nameLike != null) || (version != null) || (deploymentId != null) ) ){ throw new NotValidException("Calling latest() can only be used in ...
} public String getKeyLike() { return keyLike; } public String getResourceName() { return resourceName; } public String getResourceNameLike() { return resourceNameLike; } public Integer getVersion() { return version; } public boolean isLatest() { return latest; } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\entity\repository\CaseDefinitionQueryImpl.java
2
请在Spring Boot框架中完成以下Java代码
public class PropertyConfig { @Value("注入普通字符串") // 注入普通字符串 private String normal; @Value("#{systemProperties['os.name']}") // 注入操作系统属性 private String osName; @Value("#{T(java.lang.Math).random() * 100.0 }") // 注入表达式结果 private double randomNumber; @Value("#{person.name}") // 注入其他Bean属性 private String fromAnot...
// public static PropertySourcesPlaceholderConfigurer propertyConfigure() { // return new PropertySourcesPlaceholderConfigurer(); // } @Override public String toString() { try { return "PropertyConfig [normal=" + normal + ", osName=" + osName + ", randomNumber=" + randomNumber + ", fromAnother=" + fromAn...
repos\spring-boot-student-master\spring-boot-student-config\src\main\java\com\xiaolyuh\config\PropertyConfig.java
2
请完成以下Java代码
public static void defineDynamicPersistentUnit() { PersistenceUnitMetaData pumd = new PersistenceUnitMetaData("dynamic-unit", "RESOURCE_LOCAL", null); pumd.addProperty("javax.jdo.option.ConnectionURL", "xml:file:myfile_dynamicPMF.xml"); pumd.addProperty("datanucleus.schema.autoCreateAll", "true...
try { tx.begin(); pm.makePersistent(obj); tx.commit(); } finally { if (tx.isActive()) { tx.rollback(); } } } public static void queryPersonsInXML() { Query<Person> query = pm.newQuery(Person.class); Lis...
repos\tutorials-master\libraries-data-db-2\src\main\java\com\baeldung\libraries\jdo\xml\MyApp.java
1
请完成以下Java代码
private void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { if (requiresLogout(request, response)) { Authentication auth = this.securityContextHolderStrategy.getContext().getAuthentication(); if (this.logger.isDebugEnabled()) { ...
/** * Sets the {@link SecurityContextHolderStrategy} to use. The default action is to use * the {@link SecurityContextHolderStrategy} stored in {@link SecurityContextHolder}. * * @since 5.8 */ public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) { Assert...
repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\logout\LogoutFilter.java
1
请完成以下Java代码
private boolean checkEligible(final I_C_Aggregation aggregationDef) { if (aggregationDef == null) { return false; // not eligible } final int aggregationId = aggregationDef.getC_Aggregation_ID(); if (aggregationId <= 0) { return false; // not eligible } // Avoid cycles (i.e. self including an ag...
} final String tableName = aggregationDef.getAD_Table().getTableName(); final String tableNameExpected = getTableName(); if (!Objects.equals(tableNameExpected, tableName)) { throw new AdempiereException("Aggregation's table name does not match" + "\n @C_Aggregation_ID@: " + aggregationDef + "\n @T...
repos\metasfresh-new_dawn_uat\backend\de.metas.aggregation\src\main\java\de\metas\aggregation\api\impl\C_Aggregation2AggregationBuilder.java
1
请完成以下Java代码
public abstract class AbstractAppRuntimeDelegate<T extends AppPlugin> implements AppRuntimeDelegate<T> { protected final AppPluginRegistry<T> pluginRegistry; protected final ProcessEngineProvider processEngineProvider; protected List<PluginResourceOverride> resourceOverrides; public AbstractAppRuntimeDelegat...
* * @return */ protected ProcessEngineProvider loadProcessEngineProvider() { ServiceLoader<ProcessEngineProvider> loader = ServiceLoader.load(ProcessEngineProvider.class); try { return loader.iterator().next(); } catch (NoSuchElementException e) { String message = String.format("No impl...
repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\webapp\impl\AbstractAppRuntimeDelegate.java
1
请在Spring Boot框架中完成以下Java代码
public class OrderPayScheduleCreateRequest { @NonNull OrderId orderId; @NonNull ImmutableList<Line> lines; @Builder private OrderPayScheduleCreateRequest( @NonNull final OrderId orderId, @NonNull final ImmutableList<Line> lines) { Check.assumeNotEmpty(lines, "lines shall not empty"); this.orderId = ord...
@Value @Builder public static class Line { @NonNull PaymentTermBreakId paymentTermBreakId; @NonNull ReferenceDateType referenceDateType; @NonNull Percent percent; @NonNull OrderPayScheduleStatus orderPayScheduleStatus; @NonNull LocalDate dueDate; @NonNull Money dueAmount; int offsetDays; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\paymentschedule\service\OrderPayScheduleCreateRequest.java
2
请在Spring Boot框架中完成以下Java代码
public boolean enabled() { return obtain(AtlasProperties::isEnabled, AtlasConfig.super::enabled); } @Override public Duration connectTimeout() { return obtain(AtlasProperties::getConnectTimeout, AtlasConfig.super::connectTimeout); } @Override public Duration readTimeout() { return obtain(AtlasProperties::...
@Override public boolean lwcIgnorePublishStep() { return obtain(AtlasProperties::isLwcIgnorePublishStep, AtlasConfig.super::lwcIgnorePublishStep); } @Override public Duration configRefreshFrequency() { return obtain(AtlasProperties::getConfigRefreshFrequency, AtlasConfig.super::configRefreshFrequency); } @O...
repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\atlas\AtlasPropertiesConfigAdapter.java
2
请完成以下Java代码
public BigDecimal getLatitude() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Latitude); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setLongitude (final @Nullable BigDecimal Longitude) { set_Value (COLUMNNAME_Longitude, Longitude); } @Override public BigDecimal getLongi...
return get_ValueAsString(COLUMNNAME_Postal_Add); } @Override public void setRegionName (final @Nullable java.lang.String RegionName) { set_ValueNoCheck (COLUMNNAME_RegionName, RegionName); } @Override public java.lang.String getRegionName() { return get_ValueAsString(COLUMNNAME_RegionName); } @Overrid...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Location.java
1
请完成以下Java代码
public Tls hostnameVerification() { this.tls.hostnameVerification(); return this; } public Tls hostnameVerification(boolean hostnameVerification) { this.tls.hostnameVerification(hostnameVerification); return this; } public Tls sslContext(SSLContext sslContext) { this.tls.sslContext(sslContext);...
this.oAuth2Settings.tokenEndpointUri(uri); return this; } public OAuth2 clientId(String clientId) { this.oAuth2Settings.clientId(clientId); return this; } public OAuth2 clientSecret(String clientSecret) { this.oAuth2Settings.clientSecret(clientSecret); return this; } public OAuth2 grantTyp...
repos\spring-amqp-main\spring-rabbitmq-client\src\main\java\org\springframework\amqp\rabbitmq\client\SingleAmqpConnectionFactory.java
1
请完成以下Java代码
protected String doIt() throws Exception { if (m_C_ProjectLine_ID == 0) throw new IllegalArgumentException("No Project Line"); MProjectLine projectLine = new MProjectLine (getCtx(), m_C_ProjectLine_ID, get_TrxName()); log.info("doIt - " + projectLine); if (projectLine.getM_Product_ID() == 0) throw new Il...
isSOTrx); pp.setM_PriceList_ID(project.getM_PriceList_ID()); pp.setPriceDate(project.getDateContract()); // projectLine.setPlannedPrice(pp.getPriceStd()); projectLine.setPlannedMarginAmt(pp.getPriceStd().subtract(pp.getPriceLimit())); projectLine.save(); // String retValue = Msg.getElement(getCtx(), "Pr...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\de\metas\project\process\legacy\ProjectLinePricing.java
1
请完成以下Java代码
public class Computer { private Processor processor; private Memory memory; private SoundCard soundCard; public Computer(Processor processor, Memory memory) { this.processor = processor; this.memory = memory; } public void setSoundCard(SoundCard soundCard) { this.s...
return processor; } public Memory getMemory() { return memory; } public Optional<SoundCard> getSoundCard() { return Optional.ofNullable(soundCard); } @Override public String toString() { return "Computer{" + "processor=" + processor + ", memory=" + memory +...
repos\tutorials-master\core-java-modules\core-java-lang-oop-patterns-2\src\main\java\com\baeldung\inheritancecomposition\model\Computer.java
1
请完成以下Java代码
public WebServer getWebServer(HttpHandler httpHandler) { Tomcat tomcat = createTomcat(); TomcatHttpHandlerAdapter servlet = new TomcatHttpHandlerAdapter(httpHandler); prepareContext(tomcat.getHost(), servlet); return getTomcatWebServer(tomcat); } protected void prepareContext(Host host, TomcatHttpHandlerAdap...
private void skipAllTldScanning(TomcatEmbeddedContext context) { StandardJarScanFilter filter = new StandardJarScanFilter(); filter.setTldSkip("*.jar"); context.getJarScanner().setJarScanFilter(filter); } /** * Configure the Tomcat {@link Context}. * @param context the Tomcat context */ protected void c...
repos\spring-boot-4.0.1\module\spring-boot-tomcat\src\main\java\org\springframework\boot\tomcat\reactive\TomcatReactiveWebServerFactory.java
1
请完成以下Java代码
public String retrieveAccessToken(final DhlClientConfig clientConfig) { // Build the form-encoded body for the request final MultiValueMap<String, String> formData = new LinkedMultiValueMap<>(); formData.add("grant_type", "password"); // As described by DHL formData.add("client_id", clientConfig.getApplication...
requestEntity, DhlOAuthTokenResponse.class ); // Extract and return the access token return Objects.requireNonNull(response.getBody()).getAccess_token(); } // Response handling class for parsing the token response @Getter public static class DhlOAuthTokenResponse { private String access_token; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dhl\src\main\java\de\metas\shipper\gateway\dhl\oauth2\CustomOAuth2TokenRetriever.java
1
请完成以下Java代码
public void setTrxItemProcessorCtx(final ITrxItemProcessorContext processorCtx) { this.processorCtx = processorCtx; } @Override public void process(final I_M_InOut item) throws Exception { // Also add invalid ones. The user can sort it out in the desadv window // final IEDIDocumentBL ediDocu...
InterfaceWrapperHelper.save(item); } } finally { InterfaceWrapperHelper.setTrxName(item, trxNameBackup); } } @Override public Void getResult() { return null; } }; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java\de\metas\edi\process\EDI_Desadv_Aggregate_M_InOuts.java
1
请完成以下Java代码
public VariableSerializers getVariableSerializers() { return variableSerializers; } public void setVariableSerializers(VariableSerializers variableSerializers) { this.variableSerializers = variableSerializers; } /** * <p>Provides the default Process Engine name to deploy to, if no Process Engine ...
public String getDefaultDeployToEngineName() { return defaultDeployToEngineName; } /** * <p>Programmatically set the name of the Process Engine to deploy to if no Process Engine * is defined in <code>processes.xml</code>. This allows to circumvent the "default" Process * Engine name and set a custom o...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\application\AbstractProcessApplication.java
1
请完成以下Java代码
public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getCommentId() { return commentId; } public void setCommentId(Long commentId) { this.commentId = commentId; } public String getMemberNickName() { return...
public void setCreateTime(Date createTime) { this.createTime = createTime; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } @Override public String toString() { StringBuilder sb = new StringBuilder(); ...
repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\PmsCommentReplay.java
1
请完成以下Java代码
public class UserResponseDTO { @ApiModelProperty(position = 0) private Integer id; @ApiModelProperty(position = 1) private String username; @ApiModelProperty(position = 2) private String email; @ApiModelProperty(position = 3) List<Role> roles; public Integer getId() { return id; } public void setId(Inte...
public void setUsername(String username) { this.username = username; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public List<Role> getRoles() { return roles; } public void setRoles(List<Role> roles) { this.roles = roles; } }
repos\spring-boot-quick-master\quick-jwt\src\main\java\com\quick\jwt\dto\UserResponseDTO.java
1
请完成以下Java代码
public String getDescription () { return (String)get_Value(COLUMNNAME_Description); } /** Direction AD_Reference_ID=540086 */ public static final int DIRECTION_AD_Reference_ID=540086; /** Import = I */ public static final String DIRECTION_Import = "I"; /** Export = E */ public static final String DIRECTION_...
{ Integer ii = (Integer)get_Value(COLUMNNAME_ImpEx_ConnectorType_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanum...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\impex\model\X_ImpEx_ConnectorType.java
1
请在Spring Boot框架中完成以下Java代码
private static void findAndAddClassesInPackageByFile(String packageName, String packagePath, final boolean recursive, List<Class<?>> classes) { // 获取此包的目录 建立一个File File dir = new File(packagePath); // 如果不存在或者 也不是目录就直接返回 if (!dir.exists() || !dir.isDirectory()) { return; ...
// 如果是目录 则继续扫描 if (file.isDirectory()) { findAndAddClassesInPackageByFile(packageName + "." + file.getName(), file.getAbsolutePath(), recursive, classes); } else { // 如果是java类文件 去掉后面的.class 只留下类名 String className = file.getName().substring(0, file....
repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Common-Service-Facade\src\main\java\com\gaoxi\utils\ClassUtil.java
2
请在Spring Boot框架中完成以下Java代码
public ResponseEntity<?> get(@Valid @PathVariable String username ) { Try<User> githubUserProfile = githubService.findGithubUser(username); if (githubUserProfile.isFailure()) { return ResponseEntity.status(HttpStatus.FAILED_DEPENDENCY).body(githubUserProfile.getCause().getMessage()); ...
if (githubUserProfile.isFailure()) { System.out.println("Fail case"); return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body(githubUserProfile.getCause().getMessage()); } if (githubUserProfile.isEmpty()) { System.out.println("Empty case"); retur...
repos\springboot-demo-master\vavr\src\main\java\com\et\vavr\controller\GithubController.java
2
请完成以下Java代码
public class SystemInfo { private final String appId; private final String name; private final String version; private final long timestamp; private final long uptime; @JsonCreator public SystemInfo(@JsonProperty("appId") String appId, @JsonProperty("name") String nam...
public String getName() { return name; } public String getVersion() { return version; } public long getTimestamp() { return timestamp; } public long getUptime() { return uptime; } }
repos\spring-examples-java-17\spring-demo\src\main\java\itx\examples\springboot\demo\dto\SystemInfo.java
1
请完成以下Java代码
public void setAD_Desktop_ID (int AD_Desktop_ID) { if (AD_Desktop_ID < 1) set_ValueNoCheck (COLUMNNAME_AD_Desktop_ID, null); else set_ValueNoCheck (COLUMNNAME_AD_Desktop_ID, Integer.valueOf(AD_Desktop_ID)); } /** Get Desktop. @return Collection of Workbenches */ public int getAD_Desktop_ID () { ...
public void setHelp (String Help) { set_Value (COLUMNNAME_Help, Help); } /** Get Comment/Help. @return Comment or Hint */ public String getHelp () { return (String)get_Value(COLUMNNAME_Help); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Nam...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Desktop.java
1
请完成以下Java代码
public ExchangeRateType1Code getRateTp() { return rateTp; } /** * Sets the value of the rateTp property. * * @param value * allowed object is * {@link ExchangeRateType1Code } * */ public void setRateTp(ExchangeRateType1Code value) { this.rate...
* possible object is * {@link String } * */ public String getCtrctId() { return ctrctId; } /** * Sets the value of the ctrctId property. * * @param value * allowed object is * {@link String } * */ public void setCtrctI...
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\ExchangeRateInformation1.java
1
请在Spring Boot框架中完成以下Java代码
private static Saml2X509Credential getSaml2Credential(String privateKeyLocation, String certificateLocation, Saml2X509Credential.Saml2X509CredentialType credentialType) { RSAPrivateKey privateKey = readPrivateKey(privateKeyLocation); X509Certificate certificate = readCertificate(certificateLocation); return ne...
private static X509Certificate readCertificate(String certificateLocation) { Resource certificate = resourceLoader.getResource(certificateLocation); try (InputStream inputStream = certificate.getInputStream()) { return (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(inputStream); ...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\saml2\RelyingPartyRegistrationsBeanDefinitionParser.java
2
请完成以下Java代码
public static JSONDocumentFilter of(final DocumentFilter filter, final JSONOptions jsonOpts) { final String filterId = filter.getFilterId(); final List<JSONDocumentFilterParam> jsonParameters = filter.getParameters() .stream() .filter(filterParam -> !filter.isInternalParameter(filterParam.getFieldName())) ...
@JsonProperty("parameters") List<JSONDocumentFilterParam> parameters; @JsonCreator @Builder private JSONDocumentFilter( @JsonProperty("filterId") @NonNull final String filterId, @JsonProperty("caption") @Nullable final String caption, @JsonProperty("parameters") @Nullable @Singular final List<JSONDocument...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\json\JSONDocumentFilter.java
1
请完成以下Java代码
public Builder setC_Invoice_Candidate(final I_C_Invoice_Candidate invoiceCandidate) { this.invoiceCandidate = invoiceCandidate; return this; } public Builder setC_InvoiceCandidate_InOutLine(final I_C_InvoiceCandidate_InOutLine iciol) { this.iciol = iciol; return this; } /** * Adds an additi...
* * @deprecated This method will be removed because we shall go entirely with standard aggregation definition. */ @Deprecated public Builder addLineAggregationKeyElement(@NonNull final Object aggregationKeyElement) { aggregationKeyElements.add(aggregationKeyElement); return this; } public void ad...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\InvoiceLineAggregationRequest.java
1
请完成以下Java代码
public String getDeliveryToAddress() { return delegate.getDeliveryToAddress(); } @Override public void setDeliveryToAddress(final String address) { delegate.setDeliveryToAddress(address); } @Override public void setRenderedAddressAndCapturedLocation(final @NonNull RenderedAddressAndCapturedLocation from) ...
public void setFromShipLocation(@NonNull final I_C_Order from) { setFrom(OrderDocumentLocationAdapterFactory.locationAdapter(from).toDocumentLocation()); } @Override public I_C_Order getWrappedRecord() { return delegate; } @Override public Optional<DocumentLocation> toPlainDocumentLocation(final IDocument...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\location\adapter\OrderDropShipLocationAdapter.java
1
请完成以下Java代码
public class Article { /** * 文章id */ @Id private Long id; /** * 文章标题 */ private String title; /** * 文章内容 */ private String content; /** * 创建时间 */ private Date createTime; /**
* 更新时间 */ private Date updateTime; /** * 点赞数量 */ private Long thumbUp; /** * 访客数量 */ private Long visits; }
repos\spring-boot-demo-master\demo-mongodb\src\main\java\com\xkcoding\mongodb\model\Article.java
1
请完成以下Java代码
public LocatorId getPickFromLocatorId() {return pickFromLocator.getLocatorId();} public LocatorId getDropToLocatorId() {return dropToLocator.getLocatorId();} public I_C_UOM getUOM() {return qtyToMove.getUOM();} public boolean isInTransit() { return !steps.isEmpty() && steps.stream().anyMatch(DistributionJobSte...
if (!added) { changedSteps.add(stepToAdd); changed = true; } return changed ? toBuilder().steps(ImmutableList.copyOf(changedSteps)).build() : this; } public DistributionJobLine withChangedSteps(@NonNull final UnaryOperator<DistributionJobStep> stepMapper) { final ImmutableList<DistributionJob...
repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\job\model\DistributionJobLine.java
1
请完成以下Java代码
public TableCalloutsMap getCallouts(final Properties ctx, final String tableName) { // if(tableName == ANY_TABLE) { return TableCalloutsMap.EMPTY; } final TableCalloutsMap.Builder tableCalloutsBuilder = TableCalloutsMap.builder(); for (final Entry<String, Supplier<ICalloutInstance>> entry : supplyCa...
return callouts.build(); } /** * @return supplier or <code>null</code> but never throws exception */ private Supplier<ICalloutInstance> supplyCalloutInstanceOrNull(final I_AD_ColumnCallout calloutDef) { if (calloutDef == null) { return null; } if (!calloutDef.isActive()) { return null; } t...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\callout\spi\impl\DefaultCalloutProvider.java
1
请完成以下Java代码
public ShipmentCandidateRow withChanges(@NonNull final ShipmentCandidateRowUserChangeRequest userChanges) { final ShipmentCandidateRowBuilder rowBuilder = toBuilder(); if (userChanges.getQtyToDeliverUserEntered() != null) { rowBuilder.qtyToDeliverUserEntered(userChanges.getQtyToDeliverUserEntered()); } i...
{ builder.asiId(asiId); changes = true; } return changes ? Optional.of(builder.build()) : Optional.empty(); } private boolean qtyToDeliverCatchOverrideIsChanged() { final Optional<Boolean> nullValuechanged = isNullValuesChanged(qtyToDeliverCatchOverrideInitial, qtyToDeliverCatchOverride); ret...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\shipment_candidates_editor\ShipmentCandidateRow.java
1
请完成以下Java代码
public int getCM_AccessProfile_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_CM_AccessProfile_ID); if (ii == null) return 0; return ii.intValue(); } public I_CM_Container getCM_Container() throws RuntimeException { return (I_CM_Container)MTable.get(getCtx(), I_CM_Container.Table_Name) .getP...
if (CM_Container_ID < 1) set_ValueNoCheck (COLUMNNAME_CM_Container_ID, null); else set_ValueNoCheck (COLUMNNAME_CM_Container_ID, Integer.valueOf(CM_Container_ID)); } /** Get Web Container. @return Web Container contains content like images, text etc. */ public int getCM_Container_ID () { Integer ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_AccessContainer.java
1
请完成以下Java代码
public LookupValuesList getFieldDropdown(final RowEditingContext ctx, final String fieldName) { throw new UnsupportedOperationException(); } @Override public ViewHeaderProperties getHeaderProperties() { return rowsData.getHeaderProperties(); } @Override public List<RelatedProcessDescriptor> getAdditionalR...
{ return rowsData.getBasePriceListVersionId(); } public PriceListVersionId getBasePriceListVersionIdOrFail() { return rowsData.getBasePriceListVersionId() .orElseThrow(() -> new AdempiereException("@NotFound@ @M_Pricelist_Version_Base_ID@")); } public List<ProductsProposalRow> getAllRows() { return Im...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\products_proposal\view\ProductsProposalView.java
1
请在Spring Boot框架中完成以下Java代码
public RabbitMqConsumer initRabbitMqConsumer() { return new RabbitMqConsumer(); } @Bean(name = "firstRabbitTemplate") public RabbitTemplate firstRabbitTemplate( @Qualifier("firstConnectionFactory") ConnectionFactory connectionFactory) { RabbitTemplate firstRabbitTemplate = new ...
//lpzRabbitTemplate.setChannelTransacted(true); return secondRabbitTemplate; } @Bean(name = "secondContainerFactory") public SimpleRabbitListenerContainerFactory secondFactory( SimpleRabbitListenerContainerFactoryConfigurer configurer, @Qualifier("secondConnectionFactory") C...
repos\spring-boot-quick-master\quick-multi-rabbitmq\src\main\java\com\multi\rabbitmq\config\RabbitMqConfiguration.java
2
请完成以下Java代码
public Optional<String> getDeviceId() {return getByPathAsString("device", "deviceId");} public Optional<String> getTabId() {return getByPathAsString("device", "tabId");} public Optional<String> getUserAgent() {return getByPathAsString("device", "userAgent");} public Optional<String> getByPathAsString(final String...
} return Optional.of(currentValue); } private static Optional<Object> getByKey(final Map<String, Object> map, final String key) { return map.entrySet() .stream() .filter(e -> e.getKey().equalsIgnoreCase(key)) .map(Map.Entry::getValue) .filter(Objects::nonNull) .findFirst(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\serverRoot\de.metas.adempiere.adempiere.serverRoot.base\src\main\java\de\metas\server\ui_trace\rest\JsonUITraceEvent.java
1
请完成以下Java代码
protected boolean hasTokenExpired(OAuth2Token token) { return token.getExpiresAt() == null || ClockUtil.now().after(Date.from(token.getExpiresAt())); } protected void clearContext(HttpServletRequest request) { SecurityContextHolder.clearContext(); try { request.getSession().invalidate(); } ca...
}).build(); // @formatter:on var name = token.getName(); try { var res = clientManager.authorize(authRequest); if (res == null || hasTokenExpired(res.getAccessToken())) { logger.warn("Authorize failed for '{}': could not re-authorize expired access token", name); clearContext(re...
repos\camunda-bpm-platform-master\spring-boot-starter\starter-security\src\main\java\org\camunda\bpm\spring\boot\starter\security\oauth2\impl\AuthorizeTokenFilter.java
1
请完成以下Java代码
public void handle(OrderProcessContext orderProcessContext) { preHandle(orderProcessContext); // 获取产品Entity的Map OrderInsertReq orderInsertReq = (OrderInsertReq) orderProcessContext.getOrderProcessReq().getReqData(); Map<ProductEntity ,Integer> prodEntityCountMap = orderInsertReq.getProd...
* @param prodEntityCountMap 产品-购买数量 集合 */ private void checkStock(Map<ProductEntity, Integer> prodEntityCountMap) { // 校验库存 for (ProductEntity productEntity : prodEntityCountMap.keySet()) { // 获取购买量 Integer count = prodEntityCountMap.get(productEntity); // 校验...
repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Order\src\main\java\com\gaoxi\order\component\checkstock\BaseCheckStockComponent.java
1
请完成以下Java代码
private static PayPalEnvironment createPayPalEnvironment(@NonNull final PayPalConfig config) { if (!config.isSandbox()) { return new PayPalEnvironment( config.getClientId(), config.getClientSecret(), config.getBaseUrl(), config.getWebUrl()); } else { return new PayPalEnvironment.San...
final String errorAsJson = httpException.getMessage(); try { final PayPalErrorResponse error = JsonObjectMapperHolder.sharedJsonObjectMapper().readValue(errorAsJson, PayPalErrorResponse.class); return PayPalClientResponse.ofError(error, httpException); } catch (final Exception jsonException) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.paypal\src\main\java\de\metas\payment\paypal\client\PayPalClientService.java
1