instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | protected String doIt() throws Exception
{
final PInstanceId productsSelectionId = createProductsSelection();
final Instant startDate = getStartDate();
getCostElements().forEach(costElement -> recomputeCosts(costElement, productsSelectionId, startDate));
return MSG_OK;
}
private PInstanceId createProducts... | DB.executeFunctionCallEx(getTrxName()
, "select \"de_metas_acct\".product_costs_recreate_from_date( p_C_AcctSchema_ID :=" + getAccountingSchemaId().getRepoId()
+ ", p_M_CostElement_ID:=" + costElement.getId().getRepoId()
+ ", p_m_product_selection_id:=" + productsSelectionId.getRepoId()
+ " , p_Re... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\inventory\process\M_Inventory_RecomputeCosts.java | 1 |
请完成以下Java代码 | public class PMMQtyReportEventsProcessor
{
public static final PMMQtyReportEventsProcessor newInstance()
{
return new PMMQtyReportEventsProcessor();
}
private final transient ITrxItemProcessorExecutorService trxItemProcessorExecutorService = Services.get(ITrxItemProcessorExecutorService.class);
private PMMQtyR... | */
public void processAll()
{
final Properties ctx = Env.getCtx();
final EventSource<I_PMM_QtyReport_Event> events = new EventSource<>(ctx, I_PMM_QtyReport_Event.class);
final PMMQtyReportEventTrxItemProcessor itemProcessor = new PMMQtyReportEventTrxItemProcessor();
trxItemProcessorExecutorService.<I_PMM_Qty... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\event\impl\PMMQtyReportEventsProcessor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DeleteHistoryJobCmd implements Command<Object>, Serializable {
private static final Logger LOGGER = LoggerFactory.getLogger(DeleteHistoryJobCmd.class);
private static final long serialVersionUID = 1L;
protected JobServiceConfiguration jobServiceConfiguration;
protected String history... | throw new FlowableIllegalArgumentException("jobId is null");
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Deleting job {}", historyJobId);
}
HistoryJobEntity job = jobServiceConfiguration.getHistoryJobEntityManager().findById(historyJobId);
if (job == null) {
... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\cmd\DeleteHistoryJobCmd.java | 2 |
请完成以下Java代码 | public Board findNextMove(Board board, int playerNo) {
long start = System.currentTimeMillis();
long end = start + 60 * getMillisForCurrentLevel();
opponent = 3 - playerNo;
Tree tree = new Tree();
Node rootNode = tree.getRoot();
rootNode.getState().setBoard(board);
... | if (tempNode.getState().getPlayerNo() == playerNo)
tempNode.getState().addScore(WIN_SCORE);
tempNode = tempNode.getParent();
}
}
private int simulateRandomPlayout(Node node) {
Node tempNode = new Node(node);
State tempState = tempNode.getState();
int ... | repos\tutorials-master\algorithms-modules\algorithms-searching\src\main\java\com\baeldung\algorithms\mcts\montecarlo\MonteCarloTreeSearch.java | 1 |
请完成以下Java代码 | public class GlobalExceptionHandler {
private Logger logger = LoggerFactory.getLogger(getClass());
/**
* 处理 ServiceException 异常
*/
@ResponseBody
@ExceptionHandler(value = ServiceException.class)
public CommonResult serviceExceptionHandler(ServiceException ex) {
logger.debug("[ser... | }
/**
* 处理其它 Exception 异常
*/
@ResponseBody
@ExceptionHandler(value = Exception.class)
public CommonResult exceptionHandler(Exception e) {
// 记录异常日志
logger.error("[exceptionHandler]", e);
// 返回 ERROR CommonResult
return CommonResult.error(ServiceExceptionEnum.SY... | repos\SpringBoot-Labs-master\lab-27\lab-27-webflux-02\src\main\java\cn\iocoder\springboot\lab27\springwebflux\core\web\GlobalExceptionHandler.java | 1 |
请完成以下Java代码 | private Set<EDIDesadvPackId> generateLabels()
{
return trxManager.callInThreadInheritedTrx(this::generateLabelsInTrx);
}
private Set<EDIDesadvPackId> generateLabelsInTrx()
{
if(!p_IsDefault && p_Counter <= 0)
{
throw new FillMandatoryException(PARAM_Counter);
}
final List<I_EDI_DesadvLine> desadvLine... | private static BPartnerId extractBPartnerId(@NonNull final List<I_EDI_DesadvLine> desadvLines)
{
final I_EDI_Desadv ediDesadvRecord = desadvLines.get(0).getEDI_Desadv();
final int bpartnerRepoId = CoalesceUtil.firstGreaterThanZero(
ediDesadvRecord.getDropShip_BPartner_ID(),
ediDesadvRecord.getC_BPartner_I... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java\de\metas\edi\process\EDI_Desadv_GenerateSSCCLabels.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private URL getAPIUrl(@NonNull final ReportContext reportContext)
{
final String apiBaseURL = getAPIBaseUrl();
final String apiPath = getAPIPath(reportContext);
try
{
return new URL(apiBaseURL + apiPath);
}
catch (final MalformedURLException e)
{
final ITranslatableString errorMsg = msgBL.getTrans... | // Parse the SQL Statement
final IStringExpression sqlExpression = expressionFactory.compile(sql, IStringExpression.class);
final Evaluatee evalCtx = createEvalCtx(reportContext);
final String sqlFinal = sqlExpression.evaluate(evalCtx, OnVariableNotFound.Fail);
return DB.getSQLValueStringEx(ITrx.TRXNAME_Thread... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\metasfresh-report-service\src\main\java\de\metas\report\jasper\data_source\RemoteRestAPIDataSource.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public static void main(final String[] args)
{
try (final IAutoCloseable c = ModelValidationEngine.postponeInit())
{
Ini.setRunMode(RunMode.BACKEND);
Adempiere.instance.startup(RunMode.BACKEND);
final String headless = System.getProperty(SYSTEM_PROPERTY_HEADLESS, Boolean.toString(true));
new SpringAp... | }
@Profile(Profiles.PROFILE_NotTest)
@Bean(Adempiere.BEAN_NAME)
public Adempiere adempiere()
{
// as of right now, we are not interested in loading *any* model validator whatsoever within this service
// therefore we don't e.g. have to deal with the async-processor. It just won't be started.
ModelValidationE... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\metasfresh-report-service-standalone\src\main\java\de\metas\report\ReportServiceMain.java | 2 |
请完成以下Java代码 | public void setCreditPassInfo(final I_C_Order order)
{
final BPartnerId bPartnerId = BPartnerId.ofRepoId(order.getC_BPartner_ID());
final CreditPassConfig config = creditPassConfigRepository.getConfigByBPartnerId(bPartnerId);
final Optional<TransactionResult> transactionResult = transactionResultService.findLast... | else
{
order.setCreditpassFlag(false);
final ITranslatableString message = msgBL.getTranslatableMsgText(CreditPassConstants.CREDITPASS_REQUEST_NOT_NEEDED_MESSAGE_KEY);
order.setCreditpassStatus(message.translate(Env.getAD_Language()));
}
}
@DocValidate(timings = { ModelValidator.TIMING_BEFORE_COMPLETE }... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.creditscore\creditpass\src\main\java\de\metas\vertical\creditscore\creditpass\interceptor\C_Order.java | 1 |
请完成以下Java代码 | public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PersonWithEqualsAndComparable that = (PersonWithEqualsAndComparable) o;
return firstName.equals(that.firstName) &&
lastName.equals(that.lastName) &&
... | return this.birthDate.compareTo(o.birthDate);
} else if (this.birthDate != null) {
return 1;
} else if (o.birthDate != null) {
return -1;
} else {
return 0;
}
} else {
re... | repos\tutorials-master\core-java-modules\core-java-lang\src\main\java\com\baeldung\comparing\PersonWithEqualsAndComparable.java | 1 |
请完成以下Java代码 | public void executeJob() {
try {
ManagementService managementService = engine.getManagementService();
managementService.executeJob(this.jobId);
} catch (AuthorizationException e) {
throw e;
} catch (ProcessEngineException e) {
throw new InvalidRequestException(Status.NOT_FOUND, e.get... | public void updateSuspensionState(JobSuspensionStateDto dto) {
dto.setJobId(jobId);
dto.updateSuspensionState(engine);
}
@Override
public void setJobPriority(PriorityDto dto) {
if (dto.getPriority() == null) {
throw new RestException(Status.BAD_REQUEST, "Priority for job '" + jobId + "' cannot ... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\runtime\impl\JobResourceImpl.java | 1 |
请完成以下Java代码 | public static Builder method(String name) {
return new Builder(name);
}
String getName() {
return this.name;
}
String getReturnType() {
return this.returnType;
}
List<Parameter> getParameters() {
return this.parameters;
}
int getModifiers() {
return this.modifiers;
}
CodeBlock getCode() {
ret... | }
/**
* Sets the return type.
* @param returnType the return type
* @return this for method chaining
*/
public Builder returning(String returnType) {
this.returnType = returnType;
return this;
}
/**
* Sets the parameters.
* @param parameters the parameters
* @return this for method ... | repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\language\groovy\GroovyMethodDeclaration.java | 1 |
请完成以下Java代码 | public int getM_Product_Order_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Product_Order_ID);
}
@Override
public void setPointsBase_Forecasted (final BigDecimal PointsBase_Forecasted)
{
set_Value (COLUMNNAME_PointsBase_Forecasted, PointsBase_Forecasted);
}
@Override
public BigDecimal getPointsBase_Forecaste... | @Override
public void setPOReference (final @Nullable java.lang.String POReference)
{
set_Value (COLUMNNAME_POReference, POReference);
}
@Override
public java.lang.String getPOReference()
{
return get_ValueAsString(COLUMNNAME_POReference);
}
@Override
public void setQty (final BigDecimal Qty)
{
set_V... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\commission\model\X_C_Commission_Instance.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Integer getSessionInvalidateTime() {
return sessionInvalidateTime;
}
public void setSessionInvalidateTime(Integer sessionInvalidateTime) {
this.sessionInvalidateTime = sessionInvalidateTime;
}
public Integer getSessionValidationInterval() {
return sessionValidationInterv... | return heartbeatTimeout;
}
public void setHeartbeatTimeout(Integer heartbeatTimeout) {
this.heartbeatTimeout = heartbeatTimeout;
}
public String getPicsPath() {
return picsPath;
}
public void setPicsPath(String picsPath) {
this.picsPath = picsPath;
}
public St... | repos\SpringBootBucket-master\springboot-shiro\src\main\java\com\xncoding\pos\config\properties\MyProperties.java | 2 |
请完成以下Java代码 | public int intValueExact()
{
return toBigDecimal().intValueExact();
}
public boolean isWeightable()
{
return UOMType.ofNullableCodeOrOther(uom.getUOMType()).isWeight();
}
public Percent percentageOf(@NonNull final Quantity whole)
{
assertSameUOM(this, whole);
return Percent.of(toBigDecimal(), whole.toB... | final ImmutableList.Builder<Quantity> result = ImmutableList.builder();
final Quantity qtyPerPart = divide(count);
Quantity qtyRemainingToSpread = this;
for (int i = 1; i <= count; i++)
{
final boolean isLast = i == count;
if (isLast)
{
result.add(qtyRemainingToSpread);
}
else
{... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\quantity\Quantity.java | 1 |
请完成以下Java代码 | public class ExportProcessor2Wrapper implements IExportProcessor2
{
private final IExportProcessor exportProcessor;
public ExportProcessor2Wrapper(IExportProcessor exportProcessor)
{
this.exportProcessor = exportProcessor;
}
@Override
public void createInitialParameters(MEXPProcessor processor)
{
exportPro... | throw new ExportProcessorException(null, e);
}
}
@Override
public void process(MEXPProcessor expProcessor, Document document, PO po) throws ExportProcessorException
{
final Properties ctx = po.getCtx();
final Trx trx = Trx.get(po.get_TrxName(), false);
try
{
exportProcessor.process(ctx, expProcessor, ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\process\rpl\ExportProcessor2Wrapper.java | 1 |
请完成以下Java代码 | public AnnotationContainer annotations() {
return this.annotations;
}
/**
* Builder for creating a {@link KotlinFunctionDeclaration}.
*/
public static final class Builder {
private final String name;
private List<Parameter> parameters = new ArrayList<>();
private List<KotlinModifier> modifiers = new ... | * @param returnType the return type
* @return this for method chaining
*/
public Builder returning(String returnType) {
this.returnType = returnType;
return this;
}
/**
* Sets the parameters.
* @param parameters the parameters
* @return this for method chaining
*/
public Builder paramet... | repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\language\kotlin\KotlinFunctionDeclaration.java | 1 |
请完成以下Java代码 | public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override
public String toString() {
return "CamundaBpmRunLdapProperty [enabled=" + enabled +
", initialContextFactory=" + initialContextFactory +
", securityAuthent... | ", userIdAttribute=" + userIdAttribute +
", userFirstnameAttribute=" + userFirstnameAttribute +
", userLastnameAttribute=" + userLastnameAttribute +
", userEmailAttribute=" + userEmailAttribute +
", userPasswordAttribute=" + userPasswordAttribute +
", groupIdAttribute=" + groupId... | repos\camunda-bpm-platform-master\distro\run\core\src\main\java\org\camunda\bpm\run\property\CamundaBpmRunLdapProperties.java | 1 |
请完成以下Java代码 | static UomId extractUomIdOrNull(final @NonNull I_M_HU_LUTU_Configuration lutuConfiguration)
{
return UomId.ofRepoIdOrNull(lutuConfiguration.getC_UOM_ID());
}
static BPartnerId extractBPartnerIdOrNull(final I_M_HU_LUTU_Configuration lutuConfiguration)
{
return BPartnerId.ofRepoIdOrNull(lutuConfiguration.getC_BP... | class CreateLUTUConfigRequest
{
@NonNull
I_M_HU_LUTU_Configuration baseLUTUConfiguration;
@NonNull
BigDecimal qtyTU;
@NonNull
BigDecimal qtyCUsPerTU;
@NonNull
Integer tuHUPIItemProductID;
@Nullable
BigDecimal qtyLU;
@Nullable
Integer luHUPIID;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\ILUTUConfigurationFactory.java | 1 |
请完成以下Java代码 | public boolean isNotPicked() {return pickedTo == null;}
public void assertPicked()
{
if (!isPicked())
{
throw new AdempiereException("PickFrom was not picked: " + this);
}
}
public PickingJobStepPickFrom assertNotPicked()
{
if (isPicked())
{
throw new AdempiereException("PickFrom already picked: ... | }
return this;
}
public PickingJobStepPickFrom withPickedEvent(@NonNull final PickingJobStepPickedTo pickedTo)
{
return withPickedTo(pickedTo);
}
public PickingJobStepPickFrom withUnPickedEvent(@NonNull PickingJobStepUnpickInfo unpickEvent)
{
return withPickedTo(pickedTo != null ? pickedTo.removing(unpic... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\model\PickingJobStepPickFrom.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void configure() throws Exception
{
CamelRouteUtil.setupProperties(getContext());
final String maximumRedeliveries = CamelRouteUtil.resolveProperty(getContext(), GRSSignumConstants.EXPORT_BPARTNER_RETRY_COUNT, "0");
final String redeliveryDelay = CamelRouteUtil.resolveProperty(getContext(), GRSSignumCons... | final Object dispatchMessageRequestCandidate = exchange.getIn().getBody();
if (!(dispatchMessageRequestCandidate instanceof DispatchRequest))
{
throw new RuntimeCamelException("The route " + GRS_DISPATCHER_ROUTE_ID
+ " requires the body to be instanceof DispatchMessageRequest."
+ " How... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-grssignum\src\main\java\de\metas\camel\externalsystems\grssignum\to_grs\client\GRSSignumDispatcherRouteBuilder.java | 2 |
请完成以下Java代码 | public ExplainedOptional<HULabelConfig> getFirstMatching(final HULabelConfigQuery query)
{
return huLabelConfigService.getFirstMatching(query);
}
public void print(@NonNull final HULabelPrintRequest request)
{
HULabelPrintCommand.builder()
.handlingUnitsBL(handlingUnitsBL)
.huLabelConfigService(huLabel... | {
return printProcessesCache.getOrLoadNonNull(0, this::retrieveHULabelPrintFormatProcesses);
}
private HULabelPrintProcessesList retrieveHULabelPrintFormatProcesses()
{
return processDAO.retrieveProcessRecordsByValRule(HU_LABEL_PRINTING_OPTIONS_VAL_RULE_ID)
.stream()
.map(HULabelService::toHULabelPrintP... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\report\labels\HULabelService.java | 1 |
请完成以下Java代码 | public void hit(int begin, int end, V value)
{
if (wordNet[end] == null || wordNet[end].word.length() < end - begin)
{
wordNet[end] = new ResultTerm<V>(new String(charArray, begin, end - begin), value, begin);
}
}
});
... | preCharType = CharType.get(charArray[i - 1]);
--i;
}
termList.addFirst(new ResultTerm<V>(sbTerm.reverse().toString(), null, offset));
}
else
{
termList.addFirst(wordNet[i]);
i -= wordNet[i].word.lengt... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\seg\Other\CommonAhoCorasickSegmentUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class C_PurchaseCandidate
{
private final PurchaseCandidateReminderScheduler scheduler;
private final CurrencyRepository currencyRepository;
public C_PurchaseCandidate(@NonNull final PurchaseCandidateReminderScheduler scheduler,
@NonNull final CurrencyRepository currencyRepository)
{
this.scheduler = s... | @ModelChange(timings = { ModelValidator.TYPE_BEFORE_CHANGE }, ifColumnsChanged = { I_C_PurchaseCandidate.COLUMNNAME_PriceEntered, I_C_PurchaseCandidate.COLUMNNAME_Discount, I_C_PurchaseCandidate.COLUMNNAME_IsManualPrice, I_C_PurchaseCandidate.COLUMNNAME_IsManualDiscount })
public void setPriceEffective(final I_C_Purch... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\purchasecandidate\interceptor\C_PurchaseCandidate.java | 2 |
请完成以下Java代码 | public boolean isSendNotification ()
{
Object oo = get_Value(COLUMNNAME_IsSendNotification);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Reihenfolge.
@param SeqNo
Zur Bestimmung der Reihenfolge der ... | set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Reihenfolge.
@return Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst
*/
@Override
public int getSeqNo ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo);
if (ii == null)
return 0;
return ii.intValue();
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Table_AttachmentListener.java | 1 |
请完成以下Spring Boot application配置 | flowable.idm.ldap.enabled=true
flowable.idm.ldap.base-dn=o=flowable
flowable.idm.ldap.server=ldap://localhost
flowable.idm.ldap.port=33389
flowable.idm.ldap.user=uid=admin, ou=users, o=flowable
flowable.idm.ldap.password=pass
spring.ldap.embedded.base-dn=${flowable.idm.ldap.base-dn}
spring.ldap.embedded.port=${flowabl... | lass=groupOfUniqueNames)
# Attribute config
flowable.idm.ldap.attribute.userId=uid
flowable.idm.ldap.attribute.firstName=cn
flowable.idm.ldap.attribute.lastName=sn
flowable.idm.ldap.attribute.emailAttribute=mail
flowable.idm.ldap.attribute.groupId=uid
flowable.idm.ldap.attribute.groupName=cn
# Group cache settings
#... | repos\flowable-engine-main\modules\flowable-spring-boot\flowable-spring-boot-samples\flowable-spring-boot-sample-ldap\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public void setC_BPartner_ID (int C_BPartner_ID)
{
if (C_BPartner_ID < 1)
set_Value (COLUMNNAME_C_BPartner_ID, null);
else
set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID));
}
/** Get Geschäftspartner.
@return Bezeichnet einen Geschäftspartner
*/
@Override
public int getC_BPart... | set_ValueFromPO(COLUMNNAME_C_DocLine_Sort_ID, org.compiere.model.I_C_DocLine_Sort.class, C_DocLine_Sort);
}
/** Set Document Line Sorting Preferences.
@param C_DocLine_Sort_ID Document Line Sorting Preferences */
@Override
public void setC_DocLine_Sort_ID (int C_DocLine_Sort_ID)
{
if (C_DocLine_Sort_ID < 1)... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_BP_DocLine_Sort.java | 1 |
请完成以下Java代码 | public class JwtAuthorizationFilter extends BasicAuthenticationFilter {
private UserRepository userRepository;
public JwtAuthorizationFilter(AuthenticationManager authenticationManager, UserRepository userRepository) {
super(authenticationManager);
this.userRepository = userRepository;
}
... | if(token !=null){
//parse the token validate it
String userName = JWT.require(Algorithm.HMAC512(JwtProperties.SECRET.getBytes()))
.build()
.verify(token)
.getSubject();
// Search in the DB if we find the user by token subjec... | repos\SpringBoot-Projects-FullStack-master\Part-6 Spring Boot Security\11.SpringSecurityJwt\src\main\java\spring\security\security\JwtAuthorizationFilter.java | 1 |
请完成以下Java代码 | public class VarExample {
public String name() {
var name = "name";
name = "newName";
System.out.println("Name: " + name);
return name;
}
public Integer age() {
var age = Integer.valueOf(30);
age = 35;
System.out.println("Age: " + age);
return... | return agenda;
}
public Map<Integer, String> mapOf() {
var books = new HashMap<Integer, String>();
books.put(1, "Book 1");
books.put(2, "Book 2");
books = new HashMap<Integer, String>();
books.put(3, "Book 3");
books.put(4, "Book 4");
System.out.println(... | repos\tutorials-master\lombok-modules\lombok-2\src\main\java\com\baeldung\lombok\valvar\VarExample.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public EmailConfig find() {
Optional<EmailConfig> emailConfig = emailRepository.findById(1L);
return emailConfig.orElseGet(EmailConfig::new);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void send(EmailVo emailVo, EmailConfig emailConfig){
if(emailConfig.getI... | account.setFrom(emailConfig.getUser()+"<"+emailConfig.getFromUser()+">");
// ssl方式发送
account.setSslEnable(true);
// 使用STARTTLS安全连接
account.setStarttlsEnable(true);
// 解决jdk8之后默认禁用部分tls协议,导致邮件发送失败的问题
account.setSslProtocols("TLSv1 TLSv1.1 TLSv1.2");
String content ... | repos\eladmin-master\eladmin-tools\src\main\java\me\zhengjie\service\impl\EmailServiceImpl.java | 2 |
请完成以下Java代码 | public void setCM_Ad_Cat_ID (int CM_Ad_Cat_ID)
{
if (CM_Ad_Cat_ID < 1)
set_Value (COLUMNNAME_CM_Ad_Cat_ID, null);
else
set_Value (COLUMNNAME_CM_Ad_Cat_ID, Integer.valueOf(CM_Ad_Cat_ID));
}
/** Get Advertisement Category.
@return Advertisement Category like Banner Homepage
*/
public int getCM_Ad_C... | /** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name)... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Template_Ad_Cat.java | 1 |
请完成以下Java代码 | public String processUnauthorizedException(NativeWebRequest request, Model model, UnauthorizedException e) {
model.addAttribute("exception", e.getMessage());
logger.error("权限异常。{}", e.getMessage());
return ERROR_403;
}
/**
* 运行时异常
*
* @param exception
* @return
... | /**
* Exception异常
*
* @param exception
* @return
*/
@ExceptionHandler({Exception.class})
@ResponseStatus(HttpStatus.OK)
public String processException(Exception exception, Model model) {
model.addAttribute("exception", exception.getMessage());
logger.error("程序异常", ex... | repos\springBoot-master\springboot-shiro2\src\main\java\cn\abel\rest\exception\DefaultExceptionHandler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static class InvoiceProcessingContext
{
@NonNull
BPartnerId serviceCompanyId;
@NonNull
ZonedDateTime paymentDate;
}
private static InvoiceProcessingContext extractInvoiceProcessingContext(
@NonNull final InvoiceRow row,
@NonNull final List<PaymentDocument> paymentDocuments,
@NonNull final I... | return toPaymentDocument(row, moneyService);
}
@VisibleForTesting
static PaymentDocument toPaymentDocument(
@NonNull final PaymentRow row,
@NonNull final MoneyService moneyService)
{
final PaymentAmtMultiplier amtMultiplier = row.getPaymentAmtMultiplier();
final Money openAmt = amtMultiplier.convertToRea... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\payment_allocation\process\PaymentsViewAllocateCommand.java | 2 |
请完成以下Java代码 | public I_M_Transaction retrieveReversalTransaction(final Object referencedModelReversal, final I_M_Transaction originalTrx)
{
Check.assumeNotNull(referencedModelReversal, "referencedModelReversal not null");
Check.assumeNotNull(originalTrx, "originalTrx not null");
final IQueryFilter<I_M_Transaction> referenced... | .create()
.setOnlyActiveRecords(true)
.firstOnly(I_M_Transaction.class);
if (reversalTrx == null)
{
throw new AdempiereException("@NotFound@ @Reversal_ID@ @M_Transaction_ID@ ("
+ "@ReversalLine_ID@: " + referencedModelFilter
+ ", @M_Transaction_ID@: " + originalTrx
+ ")");
}
return r... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\materialtransaction\impl\MTransactionDAO.java | 1 |
请完成以下Java代码 | public boolean isHistoryEnabledForVariableInstance(String processDefinitionId, VariableInstanceEntity variableInstanceEntity) {
return isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, processDefinitionId);
}
@Override
public boolean isHistoryEnabledForVariables(String processDefinitionId) {
ret... | protected String getProcessDefinitionId(EntityLinkEntity entityLink) {
String processDefinitionId = null;
if (ScopeTypes.BPMN.equals(entityLink.getScopeType()) && entityLink.getScopeId() != null) {
ExecutionEntity execution = processEngineConfiguration.getExecutionEntityManager().findById(en... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\history\DefaultHistoryConfigurationSettings.java | 1 |
请完成以下Java代码 | public boolean isAll() {
return all;
}
public void setAll(boolean all) {
this.all = all;
}
public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public boolean isWithoutTenantId() {
return withoutTenantId;
}
p... | }
public void setProcessInstanceId(String processInstanceId) {
this.processInstanceId = processInstanceId;
}
public boolean isResultEnabled() {
return resultEnabled;
}
public void setResultEnabled(boolean resultEnabled) {
this.resultEnabled = resultEnabled;
}
public boolean isVariablesInRe... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\message\CorrelationMessageDto.java | 1 |
请完成以下Java代码 | public String getActivityId() {
return activityId;
}
public void setActivityId(String activityId) {
this.activityId = activityId;
}
public String getDeploymentId() {
return deploymentId;
}
public void setDeploymentId(String deploymentId) {
this.deploymentId = deploymentId;
}
public i... | return state == JobState.FAILED.getStateCode();
}
public boolean isSuccessLog() {
return state == JobState.SUCCESSFUL.getStateCode();
}
public boolean isDeletionLog() {
return state == JobState.DELETED.getStateCode();
}
public String getRootProcessInstanceId() {
return rootProcessInstanceId;
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\HistoricJobLogEvent.java | 1 |
请完成以下Java代码 | public class EchoServer extends Thread {
protected DatagramSocket socket = null;
protected boolean running;
protected byte[] buf = new byte[256];
public EchoServer() throws IOException {
socket = new DatagramSocket(4445);
}
public void run() {
running = true;
while (r... | socket.receive(packet);
InetAddress address = packet.getAddress();
int port = packet.getPort();
packet = new DatagramPacket(buf, buf.length, address, port);
String received = new String(packet.getData(), 0, packet.getLength());
if (received... | repos\tutorials-master\core-java-modules\core-java-networking-5\src\main\java\com\baeldung\networking\udp\EchoServer.java | 1 |
请完成以下Java代码 | public Date getStartTime() {
return startTime;
}
@Override
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
@Override
public Date getEndTime() {
return endTime;
}
@Override
public void setEndTime(Date endTime) {
this.endTime ... | public String getTenantId() {
return tenantId;
}
@Override
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
@Override
public String getExecutionJson() {
return executionJson;
}
@Override
public void setExecutionJson(String executionJso... | repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\persistence\entity\HistoricDecisionExecutionEntityImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getHistoryCleaningCycle() {
return historyCleaningCycle;
}
public void setHistoryCleaningCycle(String historyCleaningCycle) {
this.historyCleaningCycle = historyCleaningCycle;
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "flowable.history-cleaning-after"... | public int getHistoryCleaningBatchSize() {
return historyCleaningBatchSize;
}
public void setHistoryCleaningBatchSize(int historyCleaningBatchSize) {
this.historyCleaningBatchSize = historyCleaningBatchSize;
}
public String getVariableJsonMapper() {
return variableJsonMapper;
... | repos\flowable-engine-main\modules\flowable-spring-boot\flowable-spring-boot-starters\flowable-spring-boot-autoconfigure\src\main\java\org\flowable\spring\boot\FlowableProperties.java | 2 |
请完成以下Java代码 | public class BankStatementImportFileLoggable implements ILoggable
{
private static final Logger logger = LogManager.getLogger(ApiAuditLoggable.class);
private final BankStatementImportFileLogRepository bankStatementImportFileLogRepository;
private final BankStatementImportFileId bankStatementImportFileId;
private ... | if (logEntries == null || logEntries.isEmpty())
{
return;
}
try
{
bankStatementImportFileLogRepository.insertLogs(logEntries);
}
catch (final Exception ex)
{
// make sure flush never fails
logger.warn("Failed saving {} log entries but IGNORED: {}", logEntries.size(), logEntries, ex);
}
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\importfile\log\BankStatementImportFileLoggable.java | 1 |
请完成以下Java代码 | public VersionRestService getVersionRestService(String engineName) {
String rootResourcePath = getRelativeEngineUri(engineName).toASCIIString();
VersionRestService subResource = new VersionRestService(engineName, getObjectMapper());
subResource.setRelativeRootResourceUri(rootResourcePath);
return subRes... | return subResource;
}
public TelemetryRestService getTelemetryRestService(String engineName) {
String rootResourcePath = getRelativeEngineUri(engineName).toASCIIString();
TelemetryRestServiceImpl subResource = new TelemetryRestServiceImpl(engineName, getObjectMapper());
subResource.setRelativeRootResou... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\AbstractProcessEngineRestServiceImpl.java | 1 |
请完成以下Java代码 | protected void prepare()
{
p_PostingType = getParameterAsIParams().getParameterAsString(PARAM_PostingType);
Check.assumeNotEmpty(p_PostingType, "p_PostingType not empty");
}
@Override
protected String doIt() throws Exception
{
final String tableName = getTableName();
if (I_GL_JournalBatch.Table_Name.equal... | {
glJournalBatch.setPostingType(p_PostingType);
InterfaceWrapperHelper.save(glJournalBatch);
final List<I_GL_Journal> glJournals = glJournalDAO.retrieveJournalsForBatch(glJournalBatch);
for (final I_GL_Journal glJournal : glJournals)
{
changePostingType(glJournal);
}
}
private void changePostingType(... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\process\GL_Journal_ChangePostingType.java | 1 |
请完成以下Java代码 | public class ConsumerStoppedEvent extends KafkaEvent {
private static final long serialVersionUID = 1L;
/**
* Reasons for stopping a consumer.
* @since 2.5.9
*
*/
public enum Reason {
/**
* The consumer was stopped because the container was stopped.
*/
NORMAL,
/**
* The consumer was stoppe... | * @param source the container instance that generated the event.
* @param container the container or the parent container if the container is a child.
* @param reason the reason.
* @since 2.5.8
*/
public ConsumerStoppedEvent(Object source, Object container, Reason reason) {
super(source, container);
this.r... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\event\ConsumerStoppedEvent.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 getUsername() {
return username;
}
public voi... | return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public Date getLastLogin() {
return lastLogin;
}
public void setLastLogin(Date lastLogin) {
this.lastLogin = lastLogin;
}
} | repos\tutorials-master\spring-security-modules\spring-security-web-boot-3\src\main\java\com\baeldung\relationships\models\AppUser.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Jdk8Module jdk8TimeModule() {
return new Jdk8Module();
}
/*
* Support for Hibernate types in Jackson.
*/
@Bean
public Hibernate5Module hibernate5Module() {
return new Hibernate5Module();
}
/*
* Jackson Afterburner module to speed up serialization/deserial... | /*
* Module for serialization/deserialization of RFC7807 Problem.
*/
@Bean
ProblemModule problemModule() {
return new ProblemModule();
}
/*
* Module for serialization/deserialization of ConstraintViolationProblem.
*/
@Bean
ConstraintViolationProblemModule constraintV... | repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\config\JacksonConfiguration.java | 2 |
请完成以下Java代码 | public class GenericRestResponse {
private final Logger logger;
private final Client client;
public GenericRestResponse(Client client, Logger logger) {
this.client = client;
this.logger = logger;
}
public GenericRestResponse() {
this(ClientBuilder.newClient(), LoggerFactory... | try {
if (response.getStatus() == Response.Status.OK.getStatusCode()) {
String responseBody = response.readEntity(String.class);
logger.info("Response Body: " + responseBody);
} else {
logger.error("Failed to get a successful response");
... | repos\tutorials-master\web-modules\jersey-2\src\main\java\com\baeldung\jersey\response\GenericRestResponse.java | 1 |
请完成以下Java代码 | protected java.util.Set<ArrayKey> initialValue()
{
return new HashSet<>();
};
};
private final List<IReceiptScheduleProducer> producers = new ArrayList<IReceiptScheduleProducer>();
private final GenerateReceiptScheduleForModelAggregateFilter modelAggregateFilter;
public CompositeReceiptScheduleProducerEx... | {
final List<I_M_ReceiptSchedule> currentSchedules = producer.createOrUpdateReceiptSchedules(model, currentPreviousSchedulesRO);
// Collect created/updated receipt schedules
if (currentSchedules != null)
{
currentPreviousSchedules.addAll(currentSchedules);
schedules.addAll(currentSchedules);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\api\impl\CompositeReceiptScheduleProducerExecutor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void delete(DeviceProfile deviceProfile, User user) {
ActionType actionType = ActionType.DELETED;
DeviceProfileId deviceProfileId = deviceProfile.getId();
TenantId tenantId = deviceProfile.getTenantId();
try {
deviceProfileService.deleteDeviceProfile(tenantId, devicePr... | if (previousDefaultDeviceProfile != null) {
previousDefaultDeviceProfile = deviceProfileService.findDeviceProfileById(tenantId, previousDefaultDeviceProfile.getId());
logEntityActionService.logEntityAction(tenantId, previousDefaultDeviceProfile.getId(), previousDefaultDeviceProfi... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\entitiy\device\profile\DefaultTbDeviceProfileService.java | 2 |
请完成以下Java代码 | public class CategoryValueImpl extends BaseElementImpl implements CategoryValue {
protected static Attribute<String> valueAttribute;
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CategoryValue.class, BPMN_ELEMENT_CATEGORY_VALUE)
... | typeBuilder.build();
}
public CategoryValueImpl(ModelTypeInstanceContext instanceContext) {
super(instanceContext);
}
public String getValue() {
return valueAttribute.getValue(this);
}
public void setValue(String name) {
valueAttribute.setValue(this, name);
}
} | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\CategoryValueImpl.java | 1 |
请完成以下Java代码 | protected void handleProcessConstraints(BpmnModel bpmnModel, Process process, List<ValidationError> errors) {
if (process.getId() != null && process.getId().length() > Constraints.PROCESS_DEFINITION_ID_MAX_LENGTH) {
addError(errors, Problems.PROCESS_DEFINITION_ID_TOO_LONG, process,
... | int nrOfExecutableDefinitions = 0;
for (Process process : bpmnModel.getProcesses()) {
if (process.isExecutable()) {
nrOfExecutableDefinitions++;
}
}
if (nrOfExecutableDefinitions == 0) {
addError(errors, Problems.ALL_PROCESS_DEFINITIONS_NOT_EX... | repos\flowable-engine-main\modules\flowable-process-validation\src\main\java\org\flowable\validation\validator\impl\BpmnModelValidator.java | 1 |
请完成以下Java代码 | public int getM_Product_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_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 Na... | @param PA_Goal_ID
Performance Goal
*/
public void setPA_Goal_ID (int PA_Goal_ID)
{
if (PA_Goal_ID < 1)
set_Value (COLUMNNAME_PA_Goal_ID, null);
else
set_Value (COLUMNNAME_PA_Goal_ID, Integer.valueOf(PA_Goal_ID));
}
/** Get Goal.
@return Performance Goal
*/
public int getPA_Goal_ID ()
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_GoalRestriction.java | 1 |
请完成以下Java代码 | public static Builder builderFrom(StartMessageDeploymentDefinitionImpl startMessageEventSubscriptionImpl) {
return new Builder(startMessageEventSubscriptionImpl);
}
/**
* Builder to build {@link StartMessageDeploymentDefinitionImpl}.
*/
public static final class Builder {
private... | /**
* Builder method for processDefinition parameter.
* @param processDefinition field to set
* @return builder
*/
public Builder withProcessDefinition(ProcessDefinition processDefinition) {
this.processDefinition = processDefinition;
return this;
... | repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-process-model-impl\src\main\java\org\activiti\api\runtime\model\impl\StartMessageDeploymentDefinitionImpl.java | 1 |
请完成以下Java代码 | public final class ObjectUtils
{
/**
* Calls {@link #toString(Object, boolean)} with <code>multiLine == true</code>.
*/
public static String toString(final Object obj)
{
return toString(obj, true);
}
/**
* To be used in {@link Object#toString()} implementations.
*
* Might arbitrarily throw exceptions... | return "!!! toString() for "
+ obj.getClass().getName() + "@" + Integer.toHexString(obj.hashCode())
+ ", (IdentityHashCode=" + System.identityHashCode(obj) + ") using ExtendedReflectionToStringBuilder threw " + e
+ ") !!!";
}
/**
* Tests whether two objects are equals.
*
* <p>
* It takes care of ... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\lang\ObjectUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Mono<UserData> update(UserData employee) {
data.put(employee.getId(), employee);
return Mono.just(employee);
}
@Override
public Mono<UserData> delete(String id) {
UserData userData = data.remove(id);
if (userData != null) {
return Mono.just(userData);
... | public void createUsersBulk(Integer n) {
LOG.info("createUsersBulk n={} ...", n);
for (int i=0; i<n; i++) {
String id = "user-id-" + i;
data.put(id, new UserData(id, "email" + i + "@corp.com", "name-" + i));
}
LOG.info("created {} users", n);
}
@Override
... | repos\spring-examples-java-17\spring-webflux\src\main\java\itx\examples\webflux\services\UserServiceImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Map<String, Object> getTransientVariablesLocal() {
return null;
}
@Override
public Object getTransientVariable(String variableName) {
return null;
}
@Override
public Map<String, Object> getTransientVariables() {
return null;
}
@Override
public void r... | }
@Override
public void removeTransientVariable(String variableName) {
throw new UnsupportedOperationException("No execution active, no variables can be removed");
}
@Override
public void removeTransientVariables() {
throw new UnsupportedOperationException("No execution active, no ... | repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\impl\el\NoExecutionVariableScope.java | 2 |
请完成以下Java代码 | public boolean isCachable() {
return true;
}
public Object getValue(ValueFields valueFields) {
if (valueFields.getLongValue() != null) {
return valueFields.getLongValue() == 1;
}
return null;
}
public void setValue(Object value, ValueFields valueFields) {
... | if (booleanValue) {
valueFields.setLongValue(1L);
} else {
valueFields.setLongValue(0L);
}
}
}
public boolean isAbleToStore(Object value) {
if (value == null) {
return true;
}
return Boolean.class.isAssignableFr... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\variable\BooleanType.java | 1 |
请完成以下Java代码 | public BigDecimal getMemberPrice() {
return memberPrice;
}
public void setMemberPrice(BigDecimal memberPrice) {
this.memberPrice = memberPrice;
}
public String getMemberLevelName() {
return memberLevelName;
}
public void setMemberLevelName(String memberLevelName) {
... | public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", productId=").append(productId);
sb.append(", memberLevel... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\PmsMemberPrice.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ShipperConfigId implements RepoIdAware
{
int repoId;
@JsonCreator
public static ShipperConfigId ofRepoId(final int repoId)
{
return new ShipperConfigId(repoId);
}
public static ShipperConfigId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? new ShipperConfigId(repoId) : null;
}
publi... | {
return productId != null ? productId.getRepoId() : -1;
}
private ShipperConfigId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "Carrier_Config_Id");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.commons\src\main\java\de\metas\shipper\gateway\commons\model\ShipperConfigId.java | 2 |
请完成以下Java代码 | public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
return this.content;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public ... | return mimeType;
}
/**
* Sets the value of the mimeType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMimeType(String value) {
this.mimeType = value;
}
/**
* Gets the value of the encoding property... | 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\ObjectType.java | 1 |
请完成以下Java代码 | public void setPaymentWriteOffAmt (java.math.BigDecimal PaymentWriteOffAmt)
{
set_Value (COLUMNNAME_PaymentWriteOffAmt, PaymentWriteOffAmt);
}
/** Get Abschreibung Betrag.
@return Abschreibung Betrag
*/
@Override
public java.math.BigDecimal getPaymentWriteOffAmt ()
{
BigDecimal bd = (BigDecimal)get_Val... | public int getReversalLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_ReversalLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Abschreiben.
@param WriteOffAmt
Amount to write-off
*/
@Override
public void setWriteOffAmt (java.math.BigDecimal WriteOffAmt)
{
set_Value... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_AllocationLine.java | 1 |
请完成以下Spring Boot application配置 | spring:
# RabbitMQ 配置项,对应 RabbitProperties 配置类
rabbitmq:
host: 127.0.0.1 # RabbitMQ 服务的地址
port: 5672 # RabbitMQ 服务的端口
username: guest # RabbitMQ 服务的账号
password: guest # RabbitMQ | 服务的密码
listener:
simple:
acknowledge-mode: manual # 配置 Consumer 手动提交 | repos\SpringBoot-Labs-master\lab-04-rabbitmq\lab-04-rabbitmq-demo-ack\src\main\resources\application.yaml | 2 |
请完成以下Java代码 | public String toString()
{
return String.valueOf(value);
}
@JsonValue
public int toInt()
{
return value;
}
public boolean isZero() { return value == 0; }
public boolean isGreaterThanZero() { return value > 0; }
public boolean isGreaterThanOne() { return value > 1; }
public PrintCopies minimumOne()
{... | }
public PrintCopies plus(@NonNull final PrintCopies other)
{
if (other.isZero())
{
return this;
}
else if (isZero())
{
return other;
}
else
{
return ofInt(this.value + other.value);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\report\PrintCopies.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class RefundInvoiceCandidate
{
/** May be {@code null} is the candidate is not persisted */
@Nullable
InvoiceCandidateId id;
@NonNull
BPartnerId bpartnerId;
@NonNull
BPartnerLocationId bpartnerLocationId;
@NonNull
LocalDate invoiceableFrom;
@NonNull
RefundContract refundContract;
/**
* If {@li... | return Quantity
.of(
nextRefundConfig.get().getMinQty(),
uomRecord)
.subtract(getAssignedQuantity())
.subtract(ONE)
.max(Quantity.zero(uomRecord));
}
public RefundInvoiceCandidate subtractAssignment(@NonNull final AssignmentToRefundCandidate assignmentToRefundCandidate)
{
Check.assume(... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\refund\RefundInvoiceCandidate.java | 2 |
请完成以下Java代码 | public boolean isEmpty() {return list.isEmpty();}
public int size() {return list.size();}
public Stream<Packageable> stream() {return list.stream();}
@Override
public @NonNull Iterator<Packageable> iterator() {return list.iterator();}
public ImmutableSet<ShipmentScheduleId> getShipmentScheduleIds()
{
return... | }
else
{
//throw new AdempiereException("More than one value were extracted (" + values + ") from " + list);
return Optional.empty();
}
}
public Stream<PackageableList> groupBy(Function<Packageable, ?> classifier)
{
return list.stream()
.collect(Collectors.groupingBy(classifier, LinkedHashMap::new... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\picking\api\PackageableList.java | 1 |
请完成以下Java代码 | protected void prepare()
{
for (ProcessInfoParameter para : getParametersAsArray())
{
if (para.getParameterName().equals("AD_Migration_ID"))
{
migrationId = para.getParameterAsInt();
}
else if (para.getParameterName().equals("FileName"))
{
fileName = (String)para.getParameter();
}
}
... | migrationId = getRecord_ID();
}
log.debug("AD_Migration_ID = " + migrationId + ", filename = " + fileName);
}
@Override
protected String doIt() throws Exception
{
final I_AD_Migration migration = InterfaceWrapperHelper.create(getCtx(), migrationId, I_AD_Migration.class, get_TrxName());
final XMLWriter wr... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\process\MigrationToXML.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Mono<MongoDatabase> getMongoDatabase() throws DataAccessException {
String gridFsDatabase = getGridFsDatabase();
if (StringUtils.hasText(gridFsDatabase)) {
return this.delegate.getMongoDatabase(gridFsDatabase);
}
return this.delegate.getMongoDatabase();
}
private @Nullable String getGridFsDa... | @Override
public CodecRegistry getCodecRegistry() {
return this.delegate.getCodecRegistry();
}
@Override
public Mono<ClientSession> getSession(ClientSessionOptions options) {
return this.delegate.getSession(options);
}
@Override
public ReactiveMongoDatabaseFactory withSession(ClientSession session... | repos\spring-boot-4.0.1\module\spring-boot-data-mongodb\src\main\java\org\springframework\boot\data\mongodb\autoconfigure\DataMongoReactiveAutoConfiguration.java | 2 |
请完成以下Java代码 | public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
@Schema(description = "Last name of the user", example = "Doe")
public String getLastName() {
return lastName;
}
public void setLastName(St... | builder.append(authority);
builder.append(", firstName=");
builder.append(firstName);
builder.append(", lastName=");
builder.append(lastName);
builder.append(", additionalInfo=");
builder.append(getAdditionalInfo());
builder.append(", createdTime=");
build... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\User.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public BigDecimal getStatus() {
return status;
}
public void setStatus(BigDecimal status) {
this.status = status;
}
public PatientNote noteText(String noteText) {
this.noteText = noteText;
return this;
}
/**
* Text der Patientennotiz
* @return noteText
**/
@Schema(example = "MR... | }
if (o == null || getClass() != o.getClass()) {
return false;
}
PatientNote patientNote = (PatientNote) o;
return Objects.equals(this.status, patientNote.status) &&
Objects.equals(this.noteText, patientNote.noteText) &&
Objects.equals(this.patientId, patientNote.patientId) &&
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-patient-api\src\main\java\io\swagger\client\model\PatientNote.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public PageBean listPage(PageParam pageParam, PmsPermission pmsPermission) {
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("permissionName", pmsPermission.getPermissionName()); // 权限名称(模糊查询)
paramMap.put("permission", pmsPermission.getPermission()); // 权限(精确查询)
return pmsPermissionD... | /**
* 根据角色查找角色对应的功能权限ID集
*
* @param roleId
* @return
*/
public String getPermissionIdsByRoleId(Long roleId) {
List<PmsRolePermission> rmList = pmsRolePermissionDao.listByRoleId(roleId);
StringBuffer actionIds = new StringBuffer();
if (rmList != null && !rmList.isEmpty()) {
for (PmsRolePermission rm... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\permission\service\impl\PmsPermissionServiceImpl.java | 2 |
请完成以下Java代码 | public static void forward(HttpServletRequest request, HttpServletResponse response, String page) throws ServletException, IOException {
request.getRequestDispatcher("/WEB-INF/user.check" + page)
.forward(request, response);
}
@Override
public void doFilter(ServletRequest req, ServletRe... | request.setAttribute("origin", request.getRequestURI());
if (!request.getRequestURI()
.contains("login") && request.getSession(false) == null) {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
forward(request, response, "/login.jsp");
// we return here s... | repos\tutorials-master\web-modules\jakarta-servlets-2\src\main\java\com\baeldung\user\check\UserCheckFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ObjectMapper objectMapper() {
return new ObjectMapper();
}
@Bean
public ViewResolver viewResolver() {
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
bean.setViewClass(JstlView.class);
bean.setPrefix("/WEB-INF/view/");
bean.setSuf... | public View sample() {
return new JstlView("/WEB-INF/view/sample.jsp");
}
@Bean
public View sample2() {
return new JstlView("/WEB-INF/view2/sample2.jsp");
}
@Bean
public View sample3(){
return new JstlView("/WEB-INF/view3/sample3.jsp");
}
} | repos\tutorials-master\spring-web-modules\spring-mvc-basics-4\src\main\java\com\baeldung\config\WebConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public int getOrder() {
return Ordered.LOWEST_PRECEDENCE;
}
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
Resource resource = new ClassPathResource("META-INF/spring.integration.properties");
if (resource.exists()) {
registerIntegrationPro... | IntegrationProperties.CHANNELS_MAX_BROADCAST_SUBSCRIBERS);
mappings.put(PREFIX + "error.require-subscribers", IntegrationProperties.ERROR_CHANNEL_REQUIRE_SUBSCRIBERS);
mappings.put(PREFIX + "error.ignore-failures", IntegrationProperties.ERROR_CHANNEL_IGNORE_FAILURES);
mappings.put(PREFIX + "endpoint.default-ti... | repos\spring-boot-4.0.1\module\spring-boot-integration\src\main\java\org\springframework\boot\integration\autoconfigure\IntegrationPropertiesEnvironmentPostProcessor.java | 2 |
请在Spring Boot框架中完成以下Java代码 | class ReceiptsScheduleHandlerUtil
{
public CandidatesQuery queryByPurchaseCandidateId(@NonNull final ReceiptScheduleCreatedEvent createdEvent)
{
final int purchaseCandidateRepoId = createdEvent.getPurchaseCandidateRepoId();
if (purchaseCandidateRepoId > 0)
{
return prepareQuery(createdEvent)
.purchaseDe... | public CandidatesQuery queryByReceiptScheduleId(@NonNull final AbstractReceiptScheduleEvent event)
{
return prepareQuery(event)
.purchaseDetailsQuery(PurchaseDetailsQuery.builder()
.receiptScheduleRepoId(event.getReceiptScheduleId())
.build())
.build();
}
private CandidatesQueryBuilder prepare... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-service\src\main\java\de\metas\material\dispo\service\event\handler\receiptschedule\ReceiptsScheduleHandlerUtil.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private H100 mapToH100(final HEADERXbest header)
{
final H100 h100 = new H100();
for (final HADRE1 hadre1 : header.getHADRE1())
{
final AddressQual addressQual = AddressQual.valueOf(hadre1.getADDRESSQUAL());
switch (addressQual)
{
case SUPL:
{
h100.setSupplierID(hadre1.getPARTYIDGLN());
... | h100.setMessageDate(hdate1.getDATEFROM());
break;
}
case DELV:
{
if (hdate1.getDATEFROM() == null)
{
h100.setDeliveryDate(hdate1.getDATETO());
}
else
{
h100.setDeliveryDate(hdate1.getDATEFROM());
}
break;
}
}
}
h100.setDocumentNo(header.getDOCUM... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\ordersimport\stepcom\StepComXMLOrdersBean.java | 2 |
请完成以下Java代码 | public class Order {
private final List<OrderLine> orderLines;
private Money totalCost;
public Order(List<OrderLine> orderLines) {
checkNotNull(orderLines);
if (orderLines.isEmpty()) {
throw new IllegalArgumentException("Order must have at least one order line item");
}
... | public void removeLineItem(int line) {
OrderLine removedLine = orderLines.remove(line);
totalCost = totalCost.minus(removedLine.cost());
}
public Money totalCost() {
return totalCost;
}
private Money calculateTotalCost() {
return orderLines.stream()
.map(Ord... | repos\tutorials-master\patterns-modules\ddd\src\main\java\com\baeldung\ddd\order\Order.java | 1 |
请完成以下Java代码 | class PageLoader implements Runnable
{
private JEditorPane html;
private URL url;
private Cursor cursor;
PageLoader( JEditorPane html, URL url, Cursor cursor )
{
this.html = html;
this.url = url;
this.cursor = cursor;
}
@Override
public vo... | catch( IOException ioe )
{
html.setDocument( doc );
}
finally
{
// schedule the cursor to revert after
// the paint has happended.
url = null;
SwingUtilities.invokeLater( this );
}
}
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\adempiere\apps\graph\HtmlDashboard.java | 1 |
请完成以下Java代码 | public class SignalEventListenerExport extends AbstractPlanItemDefinitionExport<SignalEventListener> {
@Override
protected Class<? extends SignalEventListener> getExportablePlanItemDefinitionClass() {
return SignalEventListener.class;
}
@Override
protected String getPlanItemDefinitionXmlEl... | xtw.writeAttribute(FLOWABLE_EXTENSIONS_NAMESPACE, CmmnXmlConstants.ATTRIBUTE_EVENT_LISTENER_TYPE, "signal");
if (StringUtils.isNotEmpty(signalEventListener.getSignalRef())) {
xtw.writeAttribute(FLOWABLE_EXTENSIONS_NAMESPACE, CmmnXmlConstants.ATTRIBUTE_EVENT_LISTENER_SIGNAL_REF, signalEventL... | repos\flowable-engine-main\modules\flowable-cmmn-converter\src\main\java\org\flowable\cmmn\converter\export\SignalEventListenerExport.java | 1 |
请完成以下Java代码 | public void addViewControllers(final ViewControllerRegistry registry) {
registry.addViewController("/anonymous.html");
registry.addViewController("/login.html");
registry.addViewController("/homepage.html");
registry.addViewController("/admin/adminpage.html");
registry.addViewCo... | registry.addResourceHandler("/*.ico").addResourceLocations("/WEB-INF/view/react/build/");
registry.addResourceHandler("/index.html").addResourceLocations("/WEB-INF/view/react/build/index.html");
}
@Bean
public ViewResolver viewResolver() {
final InternalResourceViewResolver bean = new Inter... | repos\tutorials-master\spring-security-modules\spring-security-web-react\src\main\java\com\baeldung\spring\MvcConfig.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Chapter77Application {
public static void main(String[] args) {
SpringApplication.run(Chapter77Application.class, args);
}
@EnableAsync
@Configuration
class TaskPoolConfig {
@Bean
public Executor taskExecutor1() {
ThreadPoolTaskExecutor executor = ... | @Bean
public Executor taskExecutor2() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(2);
executor.setMaxPoolSize(2);
executor.setQueueCapacity(10);
executor.setKeepAliveSeconds(60);
executor.setTh... | repos\SpringBoot-Learning-master\2.x\chapter7-7\src\main\java\com\didispace\chapter77\Chapter77Application.java | 2 |
请完成以下Java代码 | public MobileApp findAppFromQrCodeSettings(TenantId tenantId, PlatformType platformType) {
log.trace("Executing findAppQrCodeConfig for tenant [{}] ", tenantId);
QrCodeSettings qrCodeSettings = findQrCodeSettings(tenantId);
return qrCodeSettings.getMobileAppBundleId() != null ? mobileAppService.... | .build();
qrCodeSettings.setQrCodeConfig(qrCodeConfig);
qrCodeSettings.setMobileAppBundleId(qrCodeSettings.getMobileAppBundleId());
}
if (qrCodeSettings.isUseDefaultApp() || qrCodeSettings.getMobileAppBundleId() == null) {
qrCodeSettings.setGooglePlayLink(googlePlayL... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\mobile\QrCodeSettingServiceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ExcelController {
@GetMapping("/download-excel")
public ResponseEntity<byte[]> downloadExcel() {
try {
HSSFWorkbook workbook = ExcelCreator.createSampleWorkbook();
try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
workbook.write(baos)... | if (file.isEmpty()) {
return ResponseEntity.badRequest()
.body("File is empty. Please upload a file.");
}
try {
try (HSSFWorkbook workbook = new HSSFWorkbook(file.getInputStream())) {
Sheet sheet = workbook.getSheetAt(0);
return Res... | repos\tutorials-master\apache-poi-3\src\main\java\com\baeldung\hssfworkbook\ExcelController.java | 2 |
请完成以下Java代码 | public SignalEventListenerInstanceQuery stateAvailable() {
innerQuery.planItemInstanceStateAvailable();
return this;
}
@Override
public SignalEventListenerInstanceQuery stateSuspended() {
innerQuery.planItemInstanceState(PlanItemInstanceState.SUSPENDED);
return this;
}
... | return this;
}
@Override
public long count() {
return innerQuery.count();
}
@Override
public SignalEventListenerInstance singleResult() {
PlanItemInstance instance = innerQuery.singleResult();
return SignalEventListenerInstanceImpl.fromPlanItemInstance(instance);
}
... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\runtime\SignalEventListenerInstanceQueryImpl.java | 1 |
请完成以下Java代码 | public JSONObject buildQueryString(String query) {
JSONObject queryString = new JSONObject();
queryString.put("query", query);
JSONObject json = new JSONObject();
json.put("query_string", queryString);
return json;
}
/**
* @param field 查询字段
* @param min ... | inner.put("gt", min);
}
}
if (max != null) {
if (containMax) {
inner.put("lte", max);
} else {
inner.put("lt", max);
}
}
JSONObject range = new JSONObject();
range.put(field, inner);
JSONObjec... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\es\JeecgElasticsearchTemplate.java | 1 |
请完成以下Java代码 | public String getID()
{
return m_value;
} // getID
@Override
public boolean equals(final Object obj)
{
if (obj == this)
{
return true;
}
if (obj instanceof ValueNamePair)
{ | final ValueNamePair other = (ValueNamePair)obj;
return Objects.equals(this.m_value, other.m_value)
&& Objects.equals(this.getName(), other.getName())
&& Objects.equals(this.m_validationInformation, other.m_validationInformation);
}
return false;
} // equals
@Override
public int hashCode()
{
r... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\ValueNamePair.java | 1 |
请完成以下Java代码 | void setVocabIndexMap(VocabWord src, int pos)
{
// vocabIndexMap.put(src.word, pos);
trainWords += src.cn;
}
/**
* Create binary Huffman tree using the word counts.
* Frequent words will have short uniqe binary codes
*/
void createBinaryTree()
{
int[] point = n... | min2i = pos1;
pos1--;
}
else
{
min2i = pos2;
pos2++;
}
}
else
{
min2i = pos2;
pos2++;
}
count[vocabSize ... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\mining\word2vec\Corpus.java | 1 |
请完成以下Java代码 | static MethodParameterRuntimeHintsRegistrar fromMethodParameter(
HandlerMethodArgumentResolverComposite resolvers, MethodParameter parameter) {
HandlerMethodArgumentResolver resolver = resolvers.getArgumentResolver(parameter);
if (resolver instanceof ArgumentMethodArgumentResolver
|| resolver instanceof... | DataLoaderHints(MethodParameter methodParameter) {
this.methodParameter = methodParameter;
}
@Override
public void apply(RuntimeHints hints) {
bindingRegistrar.registerReflectionHints(
hints.reflection(), this.methodParameter.nested().getNestedGenericParameterType());
}
}
private static class Pr... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\data\method\annotation\support\SchemaMappingBeanFactoryInitializationAotProcessor.java | 1 |
请完成以下Java代码 | protected String doIt()
{
final ImmutableList<PrintableQRCode> qrCodes = streamSelectedDevices()
.map(PrintDeviceQRCodes::toDeviceQRCode)
.map(DeviceQRCode::toPrintableQRCode)
.collect(ImmutableList.toImmutableList());
final QRCodePDFResource pdf = globalQRCodeService.createPDF(qrCodes);
getResult()... | .getDeviceAccessorById(onlyDeviceId)
.orElseThrow(() -> new AdempiereException("No device found for id: " + onlyDeviceId));
return Stream.of(deviceAccessor);
}
else
{
return deviceAccessorsHubFactory.getDefaultDeviceAccessorsHub()
.streamAllDeviceAccessors();
}
}
private static DeviceQRCode t... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\devices\webui\process\PrintDeviceQRCodes.java | 1 |
请完成以下Java代码 | public int getM_HU_PI_Attribute_ID()
{
return get_ValueAsInt(COLUMNNAME_M_HU_PI_Attribute_ID);
}
@Override
public de.metas.handlingunits.model.I_M_HU_PI_Version getM_HU_PI_Version()
{
return get_ValueAsPO(COLUMNNAME_M_HU_PI_Version_ID, de.metas.handlingunits.model.I_M_HU_PI_Version.class);
}
@Override
pu... | }
@Override
public void setSeqNo (final int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, SeqNo);
}
@Override
public int getSeqNo()
{
return get_ValueAsInt(COLUMNNAME_SeqNo);
}
@Override
public void setSplitterStrategy_JavaClass_ID (final int SplitterStrategy_JavaClass_ID)
{
if (SplitterStrategy_JavaClass_... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_PI_Attribute.java | 1 |
请完成以下Java代码 | protected final Properties getCtx()
{
return Env.getCtx();
}
/**
*
* @param valueObj
* @return {@link BigDecimal} value or {@link BigDecimal#ZERO} if the value is null or cannot be converted
*/
protected final BigDecimal toBigDecimalOrZero(final Object valueObj)
{
if (valueObj == null)
{
return ... | final Object value = row.get(columnIndex);
return value;
}
protected final <T> T getRowValueOrNull(final IRModelMetadata metadata, final List<Object> row, final String columnName, final Class<T> valueClass)
{
final Object valueObj = getRowValueOrNull(metadata, row, columnName);
if (valueObj == null)
{
re... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\compiere\report\core\AbstractRModelAggregatedValue.java | 1 |
请完成以下Java代码 | public class PaymentBatchFactory implements IPaymentBatchFactory
{
private final CopyOnWriteArrayList<IPaymentBatchProvider> providers = new CopyOnWriteArrayList<>();
public PaymentBatchFactory()
{
super();
addPaymentBatchProvider(new PaySelectionPaymentBatchProvider());
}
@Override
public IPaymentBatch re... | final IPaymentBatch paymentBatch = provider.retrievePaymentBatch(payment);
if (paymentBatch != null)
{
return paymentBatch;
}
}
return null;
}
@Override
public void addPaymentBatchProvider(final IPaymentBatchProvider provider)
{
Check.assumeNotNull(provider, "provider not null");
providers.ad... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\bankstatement\match\api\impl\PaymentBatchFactory.java | 1 |
请完成以下Java代码 | public class MD5Util {
private static final String SALT = "tamboo";
public static String encode(String password) {
password = password + SALT;
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
throw new Runti... | StringBuffer hexValue = new StringBuffer();
for (int i = 0; i < md5Bytes.length; i++) {
int val = ((int) md5Bytes[i]) & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toSt... | repos\springBoot-master\springboot-SpringSecurity0\src\main\java\com\us\example\util\MD5Util.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static MethodSecurityMetadataSourceAdvisor methodSecurityInterceptor(AbstractMethodSecurityMetadataSource source,
ReactiveMethodSecurityConfiguration configuration) {
MethodSecurityMetadataSourceAdvisor advisor = new MethodSecurityMetadataSourceAdvisor(
"securityMethodInterceptor", source, "methodMetadataSourc... | @Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Fallback
static DefaultMethodSecurityExpressionHandler methodSecurityExpressionHandler(
ReactiveMethodSecurityConfiguration configuration) {
DefaultMethodSecurityExpressionHandler handler = new DefaultMethodSecurityExpressionHandler();
if (configuration.granted... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\method\configuration\ReactiveMethodSecurityConfiguration.java | 2 |
请完成以下Java代码 | public class CircularLinkedList {
final Logger logger = LoggerFactory.getLogger(CircularLinkedList.class);
private Node head = null;
private Node tail = null;
public void addNode(int value) {
Node newNode = new Node(value);
if (head == null) {
head = newNode;
} e... | }
currentNode = nextNode;
} while (currentNode != head);
}
public void traverseList() {
Node currentNode = head;
if (head != null) {
do {
logger.info(currentNode.value + " ");
currentNode = currentNode.nextNode;
} whi... | repos\tutorials-master\data-structures-2\src\main\java\com\baeldung\circularlinkedlist\CircularLinkedList.java | 1 |
请完成以下Java代码 | 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... | }
private DefaultPaymentBuilder fromOrder(@NonNull final I_C_Order order)
{
adOrgId(OrgId.ofRepoId(order.getAD_Org_ID()));
orderId(OrderId.ofRepoId(order.getC_Order_ID()));
bpartnerId(BPartnerId.ofRepoId(order.getC_BPartner_ID()));
currencyId(CurrencyId.ofRepoId(order.getC_Currency_ID()));
final SOTrx soT... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\payment\api\DefaultPaymentBuilder.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void validateSigningCredentials(Registration properties, boolean signRequest) {
if (signRequest) {
Assert.state(!properties.getSigning().getCredentials().isEmpty(),
"Signing credentials must not be empty when authentication requests require signing.");
}
}
private Saml2X509Credential asSigningCre... | throw new IllegalArgumentException(ex);
}
}
private X509Certificate readCertificate(@Nullable Resource location) {
Assert.state(location != null, "No certificate location specified");
Assert.state(location.exists(), () -> "Certificate location '" + location + "' does not exist");
try (InputStream inputStrea... | repos\spring-boot-4.0.1\module\spring-boot-security-saml2\src\main\java\org\springframework\boot\security\saml2\autoconfigure\Saml2RelyingPartyRegistrationConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public static Object getSQLValueObjectEx(String trxName, String sql, Object... params)
{
Object retValue = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = DB.prepareStatement(sql, trxName);
DB.setParameters(pstmt, params);
rs = pstmt.executeQuery();
if (rs.next())
{
... | logger.info("No Value " + sql);
}
}
catch (SQLException e)
{
throw new DBException(e, sql);
}
finally
{
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
return retValue;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\service\impl\TableColumnPathBL.java | 2 |
请完成以下Java代码 | void processValueChanges(final List<JSONDocumentChangedEvent> events, final ReasonSupplier reason)
{
assertNotCompleted();
data.processValueChanges(events, reason);
}
public Collection<IDocumentFieldView> getFieldViews()
{
return data.getFieldViews();
}
public JSONASIDocument toJSONASIDocument(
final J... | private static I_M_AttributeSetInstance createM_AttributeSetInstance(final ASIDocument asiDoc)
{
//
// Create M_AttributeSetInstance
final AttributeSetId attributeSetId = asiDoc.getAttributeSetId();
final I_M_AttributeSetInstance asiRecord = InterfaceWrapperHelper.newInstance(I_M_AttributeSetInstance.class);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pattribute\ASIDocument.java | 1 |
请完成以下Java代码 | public void setServletConfig(@Nullable ServletConfig servletConfig) {
this.servletConfig = servletConfig;
}
@Override
public @Nullable ServletConfig getServletConfig() {
return this.servletConfig;
}
/**
* Returns the {@link WebServer} that was created by the context or {@code null} if
* the server has no... | private final Map<String, Scope> scopes = new HashMap<>();
public ExistingWebApplicationScopes(ConfigurableListableBeanFactory beanFactory) {
this.beanFactory = beanFactory;
for (String scopeName : SCOPES) {
Scope scope = beanFactory.getRegisteredScope(scopeName);
if (scope != null) {
this.scopes.... | repos\spring-boot-4.0.1\module\spring-boot-web-server\src\main\java\org\springframework\boot\web\server\servlet\context\ServletWebServerApplicationContext.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setTaskAssignee(String taskAssignee) {
this.taskAssignee = taskAssignee;
}
public String getTaskCompletedBy() {
return taskCompletedBy;
}
public void setTaskCompletedBy(String taskCompletedBy) {
this.taskCompletedBy = taskCompletedBy;
}
public String getPro... | public String getTenantIdLike() {
return tenantIdLike;
}
public void setTenantIdLike(String tenantIdLike) {
this.tenantIdLike = tenantIdLike;
}
public Boolean getWithoutTenantId() {
return withoutTenantId;
}
public void setWithoutTenantId(Boolean withoutTenantId) {
... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\process\ActivityInstanceQueryRequest.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.