instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Spring Boot application配置 | spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.application.name = spring-boot-bootstrap
spring.datasource.username = ${SPRING_DATAS | OURCE_USER}
spring.datasource.password = ${SPRING_DATASOURCE_PASSWORD} | repos\tutorials-master\spring-boot-modules\spring-boot-bootstrap\src\main\resources\application-mysql.properties | 2 |
请在Spring Boot框架中完成以下Java代码 | public BigInteger getTimeForPayment() {
return timeForPayment;
}
/**
* Sets the value of the timeForPayment property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setTimeForPayment(BigInteger value) {
this.timeF... | /**
* Reference to the consignment.
*
* @return
* possible object is
* {@link String }
*
*/
public String getConsignmentReference() {
return consignmentReference;
}
/**
* Sets the value of the consignmentReference property.
*
* @param... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\extensions\edifact\ORDERSExtensionType.java | 2 |
请完成以下Java代码 | public boolean checkResourceExists(Locale locale) throws Exception {
return resolveResource() != null;
}
@Override
protected Mono<Void> renderInternal(Map<String, Object> model, @Nullable MediaType contentType,
ServerWebExchange exchange) {
Resource resource = resolveResource();
if (resource == null) {
... | }
Resource resource = applicationContext.getResource(url);
if (resource == null || !resource.exists()) {
return null;
}
return resource;
}
private Reader getReader(Resource resource) throws IOException {
if (this.charset != null) {
return new InputStreamReader(resource.getInputStream(), this.charset)... | repos\spring-boot-4.0.1\module\spring-boot-mustache\src\main\java\org\springframework\boot\mustache\reactive\view\MustacheView.java | 1 |
请完成以下Java代码 | private void processInTrx(@NonNull final PickingCandidate pickingCandidate)
{
if (pickingCandidate.isRejectedToPick())
{
// TODO: impl
throw new AdempiereException("Unprocessing not supported");
}
else if (pickingCandidate.getPickFrom().isPickFromHU())
{
processInTrx_unpackHU(pickingCandidate);
}
... | // shall not happen
return;
}
if (X_M_HU.HUSTATUS_Picked.equals(packedToHU.getHUStatus()))
{
handlingUnitsBL.setHUStatus(packedToHU, PlainContextAware.newWithThreadInheritedTrx(), X_M_HU.HUSTATUS_Active);
}
pickingCandidate.changeStatusToDraft();
pickingCandidateRepository.save(pickingCandidate);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\candidate\commands\UnProcessPickingCandidatesCommand.java | 1 |
请完成以下Java代码 | private void setValueForProcessorMap(Map<ProcessReqEnum, Processor> processorMap, Field processorMapField) throws IllegalAccessException {
// 获取ProcessEngine对象
ProcessEngine processEngine = applicationContext.getBean(ProcessEngine.class);
// 将processorMapField设为public
processorMapField.... | }
System.out.println(processorMap);
return processorMap;
}
/**
* 获取需要扫描的包名
*/
private String getPackage() {
PackageScan packageScan = AnnotationUtil.getAnnotationValueByClass(this.getClass(), PackageScan.class);
return packageScan.value();
}
@Override
... | repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Order\src\main\java\com\gaoxi\order\init\InitProcessorMap.java | 1 |
请完成以下Java代码 | public ReadWriteLock getLock() {
return lock;
}
public String getFactoryClassName() {
return className;
}
public void setFactoryClassName(String className) {
this.className = className;
}
public Class<?> getFactoryClass() {
... | private static String getClassNameJreDir() {
File file = new File(PROPERTY_FILE);
if (file.canRead()) {
try (InputStream is = new FileInputStream(file)) {
Properties props = new Properties();
props.load(is);
String value = props.getProperty(PRO... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\javax\el\ExpressionFactory.java | 1 |
请完成以下Java代码 | public boolean containsValue(Object value) {
return this.session.getAttributeNames()
.stream()
.anyMatch((attrName) -> this.session.getAttribute(attrName) != null);
}
@Override
@Nullable
public Object get(Object key) {
if (key instanceof String) {
return this.session.getAttribute((String) key... | @Override
public Object next() {
return this.i.next().getValue();
}
@Override
public void remove() {
this.i.remove();
}
};
}
@Override
public int size() {
return SpringSessionMap.this.size();
}
@Override
public boolean isEmpty() {
return SpringSessi... | repos\spring-session-main\spring-session-core\src\main\java\org\springframework\session\web\server\session\SpringSessionWebSessionStore.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ReadPluFileProcessor implements Processor
{
private final ProcessLogger processLogger;
public ReadPluFileProcessor(@NonNull final ProcessLogger processLogger)
{
this.processLogger = processLogger;
}
@Override
public void process(@NonNull final Exchange exchange)
{
final ExportPPOrderRouteConte... | return fileContentWithoutXMLDeclaration;
}
catch (final Exception e)
{
throw new RuntimeCamelException(e);
}
}
@NonNull
private JsonPluFileAudit updateDocument(
@NonNull final Document pluDocument,
@NonNull final Path filepath,
@NonNull final ExportPPOrderRouteContext context) throws Transformer... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-leichundmehl\src\main\java\de\metas\camel\externalsystems\leichundmehl\to_leichundmehl\pporder\processor\ReadPluFileProcessor.java | 2 |
请完成以下Java代码 | public boolean isCanAdjust()
{
return (getQty().compareTo(getMinQty()) > 0);
} // isCanAdjust
/**
* Get Actual Allocation Qty
* @return the greater of the min/qty
*/
public BigDecimal getActualAllocation()
{
if (getQty().compareTo(getMinQty()) > 0)
return getQty();
else
return getMinQty();
} /... | } // adjustQty
/**
* String Representation
* @return info
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MDistributionRunDetail[")
.append (get_ID ())
.append (";M_DistributionListLine_ID=").append (getM_DistributionListLine_ID())
.append(";Qty=").append(getQty())
.append(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MDistributionRunDetail.java | 1 |
请完成以下Java代码 | public boolean reverseAccrualIt()
{
throw new UnsupportedOperationException();
}
@Override
public boolean reActivateIt()
{
throw new UnsupportedOperationException();
}
private boolean isReversal()
{
final int reversalId = getReversal_ID();
return reversalId > 0 && reversalId > getPP_Cost_Collector_ID(... | @Override
public BigDecimal getApprovalAmt()
{
return BigDecimal.ZERO; // N/A
}
@Override
public File createPDF()
{
throw new UnsupportedOperationException(); // N/A
}
@Override
public String getDocumentInfo()
{
final I_C_DocType dt = MDocType.get(getCtx(), getC_DocType_ID());
return dt.getName() + ... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\model\MPPCostCollector.java | 1 |
请完成以下Java代码 | public ImmutableList<List<String>> getSQL_ResultRowsAsListsOfStrings(final String sqlStatement, final List<Object> parameters, final String trxName)
{
List<List<String>> result = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = prepareStatement(sqlStatement, trxName);
setParame... | }
}
}
catch (final SQLException sqlException)
{
throw new DBException(sqlException, sqlStatement, parameters);
}
finally
{
DB.close(rs, pstmt);
}
return result != null ? ImmutableList.copyOf(result) : ImmutableList.of();
}
} // DB | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\DB.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class InMemoryHttpExchangeRepository implements HttpExchangeRepository {
private int capacity = 100;
private boolean reverse = true;
private final List<HttpExchange> httpExchanges = new LinkedList<>();
/**
* Flag to say that the repository lists exchanges in reverse order.
* @param reverse flag value... | }
}
@Override
public void add(HttpExchange exchange) {
synchronized (this.httpExchanges) {
while (this.httpExchanges.size() >= this.capacity) {
this.httpExchanges.remove(this.reverse ? this.capacity - 1 : 0);
}
if (this.reverse) {
this.httpExchanges.add(0, exchange);
}
else {
this.httpE... | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\web\exchanges\InMemoryHttpExchangeRepository.java | 2 |
请完成以下Java代码 | public void copy(Path source, Path target, CopyOption... options) throws IOException {
throw new ReadOnlyFileSystemException();
}
@Override
public void move(Path source, Path target, CopyOption... options) throws IOException {
throw new ReadOnlyFileSystemException();
}
@Override
public boolean isSameFile(Pa... | Path jarPath = getJarPath(path);
return jarPath.getFileSystem().provider().readAttributes(jarPath, type, options);
}
@Override
public Map<String, Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException {
Path jarPath = getJarPath(path);
return jarPath.getFileSystem().pro... | repos\spring-boot-4.0.1\loader\spring-boot-loader\src\main\java\org\springframework\boot\loader\nio\file\NestedFileSystemProvider.java | 1 |
请完成以下Java代码 | private void addExecutionListener(final ActivityImpl activity) {
if (executionListener != null) {
for (String event : EXECUTION_EVENTS) {
addListenerOnCoreModelElement(activity, executionListener, event);
}
}
}
private void addExecutionListener(final TransitionImpl transition) {
if ... | if (skippable) {
taskDefinition.addTaskListener(event, taskListener);
} else {
taskDefinition.addBuiltInTaskListener(event, taskListener);
}
}
}
}
/**
* Retrieves task definition.
*
* @param activity the taskActivity
* @return taskDefinition for activity
... | repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\event\PublishDelegateParseListener.java | 1 |
请完成以下Java代码 | protected boolean isChildOfMultiInstanceExecution(
DelegateExecution executionEntity,
DelegateExecution multiInstanceExecution
) {
boolean isChild = false;
DelegateExecution parentExecution = executionEntity.getParent();
if (parentExecution != null) {
if (parentEx... | DelegateExecution parentExecution = execution.getParent();
if (parentExecution != null && parentExecution.getCurrentFlowElement() != null) {
FlowElement flowElement = parentExecution.getCurrentFlowElement();
if (flowElement instanceof Activity) {
Activity activity = (Acti... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\behavior\ParallelGatewayActivityBehavior.java | 1 |
请完成以下Java代码 | public void setC_Flatrate_RefundConfig(de.metas.contracts.model.I_C_Flatrate_RefundConfig C_Flatrate_RefundConfig)
{
set_ValueFromPO(COLUMNNAME_C_Flatrate_RefundConfig_ID, de.metas.contracts.model.I_C_Flatrate_RefundConfig.class, C_Flatrate_RefundConfig);
}
/** Set C_Flatrate_RefundConfig.
@param C_Flatrate_Ref... | if (C_Invoice_Candidate_Term_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_Invoice_Candidate_Term_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_Invoice_Candidate_Term_ID, Integer.valueOf(C_Invoice_Candidate_Term_ID));
}
/** Get Vertrag-Rechnungskandidat.
@return Vertrag-Rechnungskandidat */
@Override
publi... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\model\X_C_Invoice_Candidate_Assignment_Aggregate_V.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void onFailure(Throwable t) {
log.warn("[{}][{}] Failed to process websocket command: {}:{}", ctx.getSessionId(), ctx.getCmdId(), ctx.getQuery(), latestCmd, t);
ctx.sendWsMsg(new EntityDataUpdate(ctx.getCmdId(), SubscriptionErrorCode.INTERNAL_ERROR.getCode(), "Failed to pr... | @Override
public void cancelAllSessionSubscriptions(String sessionId) {
Map<Integer, TbAbstractSubCtx> sessionSubs = subscriptionsBySessionId.remove(sessionId);
if (sessionSubs != null) {
sessionSubs.values().forEach(sub -> {
try {
clea... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\subscription\DefaultTbEntityDataSubscriptionService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | protected Specification<User> resolveSpecificationFromInfixExpr(String searchParameters) {
CriteriaParser parser = new CriteriaParser();
GenericSpecificationsBuilder<User> specBuilder = new GenericSpecificationsBuilder<>();
return specBuilder.build(parser.parse(searchParameters), UserSpecificati... | }
@RequestMapping(method = RequestMethod.GET, value = "/api/myusers")
@ResponseBody
public Iterable<MyUser> findAllByWebQuerydsl(@QuerydslPredicate(root = MyUser.class) Predicate predicate) {
return myUserRepository.findAll(predicate);
}
// API - WRITE
@RequestMapping(method = Request... | repos\tutorials-master\spring-web-modules\spring-rest-query-language\src\main\java\com\baeldung\web\controller\UserController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class RoncooPayGoodsDetails {
/** 构造函数 传入所需参数 **/
public RoncooPayGoodsDetails (String goodsId , String goodsName ,Long singlePrice , Integer nums){
this.goodsId = goodsId;
this.goodsName = goodsName;
this.singlePrice = singlePrice;
this.nums = nums;
}
/** 商品ID *... | this.goodsName = goodsName;
}
public Long getSinglePrice() {
return singlePrice;
}
public void setSinglePrice(Long singlePrice) {
this.singlePrice = singlePrice;
}
public Integer getNums() {
return nums;
}
public void setNums(Integer nums) {
this.nums ... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\trade\entity\RoncooPayGoodsDetails.java | 2 |
请完成以下Java代码 | protected void runJobLogic(ExternalWorkerJobEntity externalWorkerJob, CommandContext commandContext) {
externalWorkerJob.setJobHandlerConfiguration("terminate:");
if (variables != null && !variables.isEmpty()) {
CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEng... | variableService.insertVariableInstanceWithValue(variableInstance, varValue, externalWorkerJob.getTenantId());
}
PlanItemInstanceEntity planItemInstanceEntity = cmmnEngineConfiguration.getPlanItemInstanceEntityManager()
.findById(externalWorkerJob.getSubScopeId());
... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\cmd\ExternalWorkerJobTerminateCmd.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static WorkPackagesProgress getWPsProgress(@NonNull final AsyncBatchNotifyRequest request)
{
return WorkPackagesProgress.builder()
.noOfProcessedWPs(request.getNoOfProcessedWPs())
.noOfEnqueuedWPs(request.getNoOfEnqueuedWPs())
.noOfErrorWPs(request.getNoOfErrorWPs())
.build();
}
pr... | Check.assumeGreaterThanZero(noOfEnqueuedWPs, "noOfEnqueuedWPs");
Check.assumeGreaterOrEqualToZero(this.noOfProcessedWPs, this.noOfErrorWPs);
}
public boolean isProcessedSuccessfully()
{
return noOfErrorWPs == 0 && noOfProcessedWPs >= noOfEnqueuedWPs;
}
public boolean isProcessedWithError()
{... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\service\AsyncBatchObserver.java | 2 |
请完成以下Java代码 | public List<String> findAllNamesUsingCriteriaBuilder() {
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<String> query = builder.createQuery(String.class);
Root<Product> product = query.from(Product.class);
query.select(product.get("name"));
List<Strin... | CriteriaQuery<Tuple> query = builder.createQuery(Tuple.class);
Root<Product> product = query.from(Product.class);
query.select(builder.tuple(product.get("id"), product.get("name")));
List<Tuple> resultList = entityManager.createQuery(query).getResultList();
return resultList;
}
... | repos\tutorials-master\persistence-modules\java-jpa-2\src\main\java\com\baeldung\jpa\projections\ProductRepository.java | 1 |
请完成以下Java代码 | public TbQueueProducer<TbProtoQueueMsg<TransportProtos.ToEdgeNotificationMsg>> createEdgeNotificationsMsgProducer() {
return new InMemoryTbQueueProducer<>(storage, topicService.getEdgeNotificationsTopic(serviceInfoProvider.getServiceId()).getFullTopicName());
}
@Override
public TbQueueProducer<TbPr... | .queueAdmin(queueAdmin)
.requestTemplate(requestProducer)
.responseTemplate(responseConsumer)
.maxPendingRequests(edqsConfig.getMaxPendingRequests())
.maxRequestTimeout(edqsConfig.getMaxRequestTimeout())
.pollInterval(edqsConfig.getPollInte... | repos\thingsboard-master\common\queue\src\main\java\org\thingsboard\server\queue\provider\InMemoryMonolithQueueFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static class CachingConnectionFactoryConfiguration {
@Bean
CachingConnectionFactory jmsConnectionFactory(JmsProperties jmsProperties, ActiveMQProperties properties,
ObjectProvider<ActiveMQConnectionFactoryCustomizer> factoryCustomizers,
ActiveMQConnectionDetails connectionDetails) {
JmsProperties.C... | @Bean(destroyMethod = "stop")
@ConditionalOnBooleanProperty("spring.activemq.pool.enabled")
JmsPoolConnectionFactory jmsConnectionFactory(ActiveMQProperties properties,
ObjectProvider<ActiveMQConnectionFactoryCustomizer> factoryCustomizers,
ActiveMQConnectionDetails connectionDetails) {
ActiveMQConnectio... | repos\spring-boot-4.0.1\module\spring-boot-activemq\src\main\java\org\springframework\boot\activemq\autoconfigure\ActiveMQConnectionFactoryConfiguration.java | 2 |
请完成以下Java代码 | public ScriptBindingsFactory getScriptBindingsFactory() {
return scriptBindingsFactory;
}
public void setScriptBindingsFactory(ScriptBindingsFactory scriptBindingsFactory) {
this.scriptBindingsFactory = scriptBindingsFactory;
}
public ScriptTraceEnhancer getDefaultTraceEnhancer() {
... | }
public void setScriptErrorListener(ScriptTraceListener scriptErrorListener) {
this.scriptErrorListener = scriptErrorListener;
}
public ScriptTraceListener getScriptSuccessListener() {
return scriptSuccessListener;
}
public void setScriptSuccessListener(ScriptTraceListener script... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\scripting\ScriptingEngines.java | 1 |
请完成以下Java代码 | protected I_M_HU_PI getM_HU_PI()
{
return huPI;
}
@Override
protected IAllocationResult loadHU(final I_M_HU hu, final IAllocationRequest request)
{
final IAllocationStrategy allocationStrategy = allocationStrategyFactory.createAllocationStrategy(AllocationDirection.INBOUND_ALLOCATION);
return allocationStra... | return this;
}
/**
* Then this producer creates a new HU, than i uses the given {@code parentHUItem} for the new HU's {@link I_M_HU#COLUMN_M_HU_Item_Parent_ID}.
*
* @param parentHUItem
*/
public HUProducerDestination setParent_HU_Item(final I_M_HU_Item parentHUItem)
{
this.parentHUItem = parentHUItem;
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\HUProducerDestination.java | 1 |
请完成以下Java代码 | static Resource toResource(@NonNull final I_S_Resource record)
{
final IModelTranslationMap trl = InterfaceWrapperHelper.getModelTranslationMap(record);
return Resource.builder()
.orgId(OrgId.ofRepoId(record.getAD_Org_ID()))
.resourceId(ResourceId.ofRepoId(record.getS_Resource_ID()))
.isActive(record.... | public Stream<Resource> streamAllActive()
{
return allActive.stream();
}
public List<Resource> getByIds(final Set<ResourceId> ids)
{
return ids.stream()
.map(byId::get)
.filter(Objects::nonNull)
.collect(ImmutableList.toImmutableList());
}
public ImmutableSet<ResourceId> getActivePlan... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\resource\ResourceRepository.java | 1 |
请完成以下Java代码 | public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((left == null) ? 0 : left.hashCode());
result = prime * result + ((right == null) ? 0 : right.hashCode());
return result;
}
@Override
public boolean equals(final Object obj)
{
if (this == obj)
return true;
if... | if (other.right != null)
return false;
}
else if (!right.equals(other.right))
return false;
return true;
}
@Override
public LT getLeft()
{
return left;
}
@Override
public RT getRight()
{
return right;
}
} | repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-util\src\main\java\de\metas\common\util\pair\ImmutablePair.java | 1 |
请完成以下Java代码 | public int getDhl_LenghtUOM_ID()
{
return get_ValueAsInt(COLUMNNAME_Dhl_LenghtUOM_ID);
}
@Override
public void setDHL_Shipper_Config_ID (final int DHL_Shipper_Config_ID)
{
if (DHL_Shipper_Config_ID < 1)
set_ValueNoCheck (COLUMNNAME_DHL_Shipper_Config_ID, null);
else
set_ValueNoCheck (COLUMNNAME_DHL... | @Override
public int getM_Shipper_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Shipper_ID);
}
@Override
public void setSignature (final @Nullable java.lang.String Signature)
{
set_Value (COLUMNNAME_Signature, Signature);
}
@Override
public java.lang.String getSignature()
{
return get_ValueAsString(COLU... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dhl\src\main\java-gen\de\metas\shipper\gateway\dhl\model\X_DHL_Shipper_Config.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static class Config {
private String fields;
private String replacement;
public String getFields() {
return fields;
}
public void setFields(String fields) {
this.fields = fields;
}
public String getReplacem... | private JsonNode scrubRecursively(JsonNode u) {
if ( !u.isContainerNode()) {
return u;
}
if ( u.isObject()) {
ObjectNode node = (ObjectNode)u;
node.fields().forEachRemaining((f) -> {
if ( fields.matcher(... | repos\tutorials-master\spring-cloud-modules\spring-cloud-gateway-2\src\main\java\com\baeldung\springcloudgateway\customfilters\gatewayapp\filters\factories\ScrubResponseGatewayFilterFactory.java | 2 |
请完成以下Java代码 | private void createOrUpdateDisposeCandidate(
@NonNull final IHUProductStorage huProductStorage,
@NonNull final QtyRejectedReasonCode reasonCode,
@Nullable final I_M_Inventory_Candidate existingRecord)
{
final I_M_Inventory_Candidate record;
if (existingRecord == null)
{
record = InterfaceWrapperHelpe... | {
return queryBL.createQueryBuilder(I_M_Inventory_Candidate.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_M_Inventory_Candidate.COLUMNNAME_M_HU_ID, huId)
.addEqualsFilter(I_M_Inventory_Candidate.COLUMNNAME_Processed, false);
}
public boolean isDisposalPending(final @NonNull HuId huId)
{
re... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\inventory\InventoryCandidateService.java | 1 |
请完成以下Java代码 | public ProcessDefinitionBuilder transition(String destinationActivityId, String transitionId) {
startTransition(destinationActivityId, transitionId);
endTransition();
return this;
}
public ProcessDefinitionBuilder behavior(ActivityBehavior activityBehaviour) {
getActivity().setActivityBehavior(acti... | protected ActivityImpl getActivity() {
return (ActivityImpl) scopeStack.peek();
}
public ProcessDefinitionBuilder scope() {
getActivity().setScope(true);
return this;
}
public ProcessDefinitionBuilder executionListener(ExecutionListener executionListener) {
if (transition!=null) {
transi... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\pvm\ProcessDefinitionBuilder.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ReceiptCandidatesRestController
{
private final static transient Logger logger = LogManager.getLogger(ReceiptCandidatesRestController.class);
private final ReceiptCandidateAPIService receiptCandidateAPIService;
public ReceiptCandidatesRestController(@NonNull final ReceiptCandidateAPIService receiptCan... | Loggables.withLogger(logger, Level.DEBUG).addLog("Number of exported receiptCandidates: {}", result.getItems().size());
return ResponseEntity.ok(result);
}
@PostMapping("receiptCandidatesResult")
public ResponseEntity<String> postReceiptCandidatesStatus(@RequestBody @NonNull final JsonRequestCandidateResults stat... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\shipping\ReceiptCandidatesRestController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Filter getFilter() {
return this.filter;
}
public Servlet getServlet() {
return this.servlet;
}
public Type getType() {
return this.type;
}
public void setType(Type type) {
this.type = type;
}
public Map<String, String> getInit() {
return this.init;
}
public void setInit(Map<String, Stri... | /**
* Jersey filter chain order.
*/
private int order;
public int getOrder() {
return this.order;
}
public void setOrder(int order) {
this.order = order;
}
}
public static class Servlet {
/**
* Load on startup priority of the Jersey servlet.
*/
private int loadOnStartup = -1;
p... | repos\spring-boot-4.0.1\module\spring-boot-jersey\src\main\java\org\springframework\boot\jersey\autoconfigure\JerseyProperties.java | 2 |
请完成以下Java代码 | public class JtaTransactionInterceptor extends AbstractTransactionInterceptor {
protected final static CommandLogger LOG = ProcessEngineLogger.CMD_LOGGER;
protected final TransactionManager transactionManager;
public JtaTransactionInterceptor(TransactionManager transactionManager,
... | transactionManager.commit();
} catch (HeuristicMixedException e) {
throw new TransactionException("Unable to commit transaction", e);
} catch (HeuristicRollbackException e) {
throw new TransactionException("Unable to commit transaction", e);
} catch (RollbackException e) {
handleRollbackEx... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\interceptor\JtaTransactionInterceptor.java | 1 |
请完成以下Java代码 | protected void updateEntity(DbEntityOperation operation) {
final DbEntity dbEntity = operation.getEntity();
String updateStatement = dbSqlSessionFactory.getUpdateStatement(dbEntity);
ensureNotNull("no update statement for " + dbEntity.getClass() + " in the ibatis mapping files", "updateStatement", updateS... | // get statement
String deleteStatement = dbSqlSessionFactory.getDeleteStatement(dbEntity.getClass());
ensureNotNull("no delete statement for " + dbEntity.getClass() + " in the ibatis mapping files", "deleteStatement", deleteStatement);
LOG.executeDatabaseOperation("DELETE", dbEntity);
// execute the ... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\db\sql\BatchDbSqlSession.java | 1 |
请完成以下Java代码 | public int getAD_Rule_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Rule_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Validation code.
@param Code
Validation Code
*/
@Override
public void setCode (java.lang.String Code)
{
set_Value (COLUMNNAME_Code, Code);
}
/** ... | public void setType (java.lang.String Type)
{
set_Value (COLUMNNAME_Type, Type);
}
/** Get Type.
@return Type of Validation (SQL, Java Script, Java Language)
*/
@Override
public java.lang.String getType ()
{
return (java.lang.String)get_Value(COLUMNNAME_Type);
}
/** Set Search Key.
@param Value
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\letters\model\X_AD_BoilerPlate_Var.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void removeProductQtyFromHU(
final IHUContext huContext,
final I_M_HU hu,
final PackingItemPart part)
{
final ShipmentScheduleId shipmentScheduleId = part.getShipmentScheduleId();
final I_M_ShipmentSchedule schedule = Services.get(IShipmentSchedulePA.class).getById(shipmentScheduleId);
//
// ... | // Allocation Source
final IAllocationSource source = HUListAllocationSourceDestination.of(hu);
//
// Move Qty from HU to shipment schedule (i.e. un-pick)
final IAllocationResult result = HULoader.of(source, destination)
.load(request);
// Make sure result is completed
// NOTE: this issue could happen... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\picking\service\impl\PackingService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public AuthorizationManagerRequestMatcherRegistry anonymous() {
return access(this.authorizationManagerFactory.anonymous());
}
/**
* Specify that a path variable in URL to be compared.
*
* <p>
* For example, <pre>
* requestMatchers("/user/{username}").hasVariable("username").equalTo(Authenticatio... | /**
* Compares the value of a path variable in the URI with an `Authentication`
* attribute
* <p>
* For example, <pre>
* requestMatchers("/user/{username}").hasVariable("username").equalTo(Authentication::getName));
* </pre>
* @param function a function to get value from {@link Authenticatio... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\AuthorizeHttpRequestsConfigurer.java | 2 |
请完成以下Java代码 | public class AiAppConsts {
/**
* 状态:启用
*/
public static final String STATUS_ENABLE = "enable";
/**
* 状态:禁用
*/
public static final String STATUS_DISABLE = "disable";
/**
* 状态:发布
*/
public static final String STATUS_RELEASE = "release";
/**
* 默认应用id
*... | */
public static final String APP_TYPE_CHAT_SIMPLE = "chatSimple";
/**
* 应用类型:聊天流(高级编排)
*/
public static final String APP_TYPE_CHAT_FLOW = "chatFLow";
/**
* 应用元数据:流程输入参数
* for [issues/8545]新建AI应用的时候只能选择没有自定义参数的AI流程
*/
public static final String APP_METADATA_FLOW_INPUTS = "... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-module\jeecg-boot-module-airag\src\main\java\org\jeecg\modules\airag\app\consts\AiAppConsts.java | 1 |
请完成以下Java代码 | public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Account other = (Account) obj;
if (branchId == null) {
if (other.branchId != null)
... | return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
... | repos\tutorials-master\spring-cloud-modules\spring-cloud-vault\src\main\java\com\baeldung\spring\cloud\vaultsample\domain\Account.java | 1 |
请完成以下Java代码 | public LocalDate getDocumentDate(@NonNull final DocumentTableFields docFields)
{
final I_C_PaySelection paySelection = extractPaySelection(docFields);
return TimeUtil.asLocalDate(paySelection.getPayDate());
}
@Override
public int getDoc_User_ID(DocumentTableFields docFields)
{
return extractPaySelection(doc... | return IDocument.STATUS_Completed;
}
@Override
public void reactivateIt(DocumentTableFields docFields)
{
final I_C_PaySelection paySelection = extractPaySelection(docFields);
Services.get(IPaySelectionBL.class).reactivatePaySelection(paySelection);
}
private static I_C_PaySelection extractPaySelection(fina... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\payment\PaySelectionDocumentHandler.java | 1 |
请完成以下Java代码 | public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
} | public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return "UserDto [id=" + id + ", username=" + username + ", age=" + age + "]";
}
} | repos\tutorials-master\libraries-data-2\src\main\java\com\baeldung\jmapper\UserDto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public BigDecimal getTimePeriod() {
return timePeriod;
}
public void setTimePeriod(BigDecimal timePeriod) {
this.timePeriod = timePeriod;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false... | StringBuilder sb = new StringBuilder();
sb.append("class OrderedArticleLineDuration {\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
sb.append(" timePeriod: ").append(toIndentedString(timePeriod)).append("\n");
sb.append("}");
return sb.toString();
}
/**
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-orders-api\src\main\java\io\swagger\client\model\OrderedArticleLineDuration.java | 2 |
请完成以下Java代码 | public String[] getServerContext()
{
final Properties ctx = Env.getCtx();
String[] context = Env.getEntireContext(ctx);
Arrays.sort(context);
return context;
}
@ManagedOperation
public void setLogLevel(String levelName)
{
LogManager.setLevel(levelName);
}
@ManagedOperation
public String getLogLevel(... | System.runFinalization();
}
@ManagedOperation
public void resetLocalCache()
{
CacheMgt.get().reset();
}
@ManagedOperation
public void rotateMigrationScriptFile()
{
MigrationScriptFileLoggerHolder.closeMigrationScriptFiles();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\jmx\Metasfresh.java | 1 |
请完成以下Java代码 | public TbResultSet get() throws InterruptedException, ExecutionException {
return mainFuture.get();
}
@Override
public TbResultSet get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
return mainFuture.get(timeout, unit);
}
@Override
... | try {
return mainFuture.get();
} catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException(e);
}
}
private TbResultSet getSafe(long timeout, TimeUnit unit) throws TimeoutException {
try {
return mainFuture.get(timeout, unit... | repos\thingsboard-master\common\dao-api\src\main\java\org\thingsboard\server\dao\nosql\TbResultSetFuture.java | 1 |
请完成以下Java代码 | public void updateShipToColumn(final I_C_BPartner_Location location, final ICalloutField field)
{
if (location == null)
{
return;
}
// 07224
// In case the isBillToDefault flag is set on true, the IsBillTo must be true, as well
// The field will also be read only (set readonly logic in database)
fina... | @CalloutMethod(columnNames = { I_C_BPartner_Location.COLUMNNAME_ValidFrom})
public void updatePreviousId(final I_C_BPartner_Location bpLocation)
{
final int bPartnerId = bpLocation.getC_BPartner_ID();
if (bPartnerId <= 0)
{
return;
}
if (bpLocation.getValidFrom() == null)
{
return;
}
final IBP... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\bpartner\callout\C_BPartner_Location.java | 1 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author; | }
public void setAuthor(String author) {
this.author = author;
}
static Specification<Book> hasAuthor(String author) {
return (book, cq, cb) -> cb.equal(book.get("author"), author);
}
static Specification<Book> titleContains(String title) {
return (book, cq, cb) -> cb.like... | repos\tutorials-master\persistence-modules\spring-data-jpa-query\src\main\java\com\baeldung\criteriaquery\Book.java | 1 |
请完成以下Java代码 | public class AgeAttributeCreator
{
private final transient IAttributeSetInstanceAwareFactoryService attributeSetInstanceAwareFactoryService = Services.get(IAttributeSetInstanceAwareFactoryService.class);
private final transient IAttributeSetInstanceBL attributeSetInstanceBL = Services.get(IAttributeSetInstanceBL.clas... | if (ageAttributeId == null)
{
return;
}
final ProductId productId = ProductId.ofRepoId(asiAware.getM_Product_ID());
final I_M_Attribute attribute = attributesBL.getAttributeOrNull(productId, ageAttributeId);
if (attribute == null)
{
return;
}
attributeSetInstanceBL.getCreateASI(asiAware);
fina... | repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\org\adempiere\mm\attributes\api\impl\AgeAttributeCreator.java | 1 |
请完成以下Java代码 | public void setM_InOutConfirm_ID (int M_InOutConfirm_ID)
{
if (M_InOutConfirm_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_InOutConfirm_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_InOutConfirm_ID, Integer.valueOf(M_InOutConfirm_ID));
}
/** Get Bestätigung Versand/Wareneingang.
@return Material Shipment o... | set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Verarbeitet.
@return Checkbox sagt aus, ob der Beleg verarbeitet wurde.
*/
@Override
public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Bo... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_InOutConfirm.java | 1 |
请完成以下Java代码 | public String getPmtInfId() {
return pmtInfId;
}
/**
* Sets the value of the pmtInfId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPmtInfId(String value) {
this.pmtInfId = value;
}
/**
* G... | this.ttlAmt = value;
}
/**
* Gets the value of the cdtDbtInd property.
*
* @return
* possible object is
* {@link CreditDebitCode }
*
*/
public CreditDebitCode getCdtDbtInd() {
return cdtDbtInd;
}
/**
* Sets the value of the cdtDbtInd pr... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\BatchInformation2.java | 1 |
请完成以下Java代码 | public int getRecordId()
{
GridTab gridTab = getGridTab();
return gridTab == null ? -1 : gridTab.getRecord_ID();
}
@Override
public boolean canImport(TransferHandler.TransferSupport support)
{
final GridTab gridTab = getGridTab();
if (gridTab == null)
return false;
// if (!support.isDataFlavorSuppor... | if (data == null)
continue;
final String text = data.toString();
final DateFormat df = DisplayType.getDateFormat(DisplayType.DateTime);
final String name = "Text " + df.format(new Timestamp(System.currentTimeMillis()));
attachmentEntryService.createNewAttachment(tableRecordReference, name, te... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\de\schaeffer\compiere\tools\AttachmentDnDTransferHandler.java | 1 |
请完成以下Java代码 | public class BatchResourceImpl implements BatchResource {
protected ProcessEngine processEngine;
protected String batchId;
public BatchResourceImpl(ProcessEngine processEngine, String batchId) {
this.processEngine = processEngine;
this.batchId = batchId;
}
public BatchDto getBatch() {
Batch bat... | }
protected void activateBatch() {
try {
processEngine.getManagementService().activateBatchById(batchId);
}
catch (BadUserRequestException e) {
throw new InvalidRequestException(Status.BAD_REQUEST, e, "Unable to activate batch with id '" + batchId + "'");
}
}
public void deleteBatch(... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\batch\impl\BatchResourceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class WebSocketHandler extends SimpleChannelInboundHandler<TextWebSocketFrame> {
private static final Logger log = LoggerFactory.getLogger(NettyServer.class);
/**
* 一旦连接,第一个被执行
*/
@Override
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
log.info("有新的客户端链... | NettyConfig.getChannelGroup().remove(ctx.channel());
removeUserId(ctx);
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
log.info("异常:{}", cause.getMessage());
// 删除通道
NettyConfig.getChannelGroup().remove(ctx.channel());
... | repos\springboot-demo-master\netty\src\main\java\com\et\netty\handler\WebSocketHandler.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class VehicleController {
private final InventoryService inventoryService;
public VehicleController(InventoryService inventoryService) {
this.inventoryService = inventoryService;
}
@QueryMapping
public List<Vehicle> searchAll() {
return this.inventoryService.searchAll();
... | return this.inventoryService.searchByLocation(zipcode);
}
@QueryMapping
public Vehicle searchByVin(@Argument String vin) {
return this.inventoryService.searchByVin(vin);
}
@MutationMapping
public Vehicle addVehicle(@Argument("vin") String vin, @Argument("year") Integer year,
@Arg... | repos\tutorials-master\spring-boot-modules\spring-boot-graphql\src\main\java\com\baeldung\graphql\error\handling\controller\VehicleController.java | 2 |
请完成以下Java代码 | protected IMigrationExecutorContext getMigrationExecutorContext()
{
return migrationExecutorContext;
}
/**
* Get current properties context.
*
* @return {@link Properties} ctx
*/
protected Properties getCtx()
{
return migrationExecutorContext.getCtx();
}
/**
* Log error messages as WARNING and n... | if (!Check.isEmpty(msg, true))
{
sb.append(": ").append(msg.trim());
}
if (resolution != null)
{
sb.append(" [").append(resolution).append("]");
}
if(isError)
{
logger.error(sb.toString());
}
else
{
logger.info(sb.toString());
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\migration\executor\impl\AbstractMigrationStepExecutor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JsonDataImportResponse
{
@Value
@Builder
@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
public static class JsonInsertIntoImportTable
{
String fromResource;
String toImportTableName;
... | }
@JsonInclude(JsonInclude.Include.NON_EMPTY)
JsonImportRecordsValidation importRecordsValidation;
@Value
@Builder
@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
public static class JsonActualImport
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\data_import\JsonDataImportResponse.java | 2 |
请完成以下Java代码 | public void unlockAll(final Collection<I_M_HU> hus, final LockOwner lockOwner)
{
if (hus.isEmpty())
{
return;
}
Preconditions.checkNotNull(lockOwner, "lockOwner is null");
Preconditions.checkArgument(!lockOwner.isAnyOwner(), "{} not allowed", lockOwner);
Services.get(ILockManager.class)
.unlock()
... | InterfaceWrapperHelper.refresh(hus);
}
}
@Override
public IQueryFilter<I_M_HU> isLockedFilter()
{
return Services.get(ILockManager.class).getLockedByFilter(I_M_HU.class, LockOwner.ANY);
}
@Override
public IQueryFilter<I_M_HU> isNotLockedFilter()
{
return Services.get(ILockManager.class).getNotLockedFilt... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\HULockBL.java | 1 |
请完成以下Java代码 | public IQueryBuilder<ModelType> createQueryBuilder(final Predicate<IFacetCategory> onlyFacetCategoriesPredicate)
{
final IQueryBuilder<ModelType> queryBuilder = queryBL.createQueryBuilder(modelClass, getCtx(), ITrx.TRXNAME_None);
//
queryBuilder.filter(gridTabBaseQueryFilter);
final IQueryFilter<ModelType> f... | for (final Map.Entry<IFacetCategory, IQueryFilter<ModelType>> facetCategory2filter : facetCategoryFilters.entrySet())
{
final IFacetCategory facetCategory = facetCategory2filter.getKey();
if (onlyFacetCategoriesPredicate != null && !onlyFacetCategoriesPredicate.test(facetCategory))
{
continue;
}
f... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\facet\impl\GridTabFacetFilterable.java | 1 |
请完成以下Java代码 | private static @Nullable Object initFieldValue(List<Object> path, GraphQlResponse response) {
Object value = (response.isValid() ? response.getData() : null);
for (Object segment : path) {
if (value == null) {
return null;
}
if (segment instanceof String) {
Assert.isTrue(value instanceof Map... | @Override
public String getPath() {
return this.path;
}
@Override
public List<Object> getParsedPath() {
return this.parsedPath;
}
@SuppressWarnings("unchecked")
@Override
public @Nullable <T> T getValue() {
return (T) this.value;
}
@Override
public List<ResponseError> getErrors() {
... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\support\AbstractGraphQlResponse.java | 1 |
请完成以下Java代码 | private List<String> createUpdateSqls(String classname)
{
final List<String> updateSqls = new ArrayList<>();
final Class<?> clazz = loadClass(classname);
final Field[] classFields = clazz.getFields();
for (final Field field : classFields)
{
final String fieldName = field.getName();
if (!fieldName.endsW... | private final String getFieldValueAsString(final Field field)
{
try
{
return (String)field.get(null);
}
catch (Exception e)
{
throw new RuntimeException("Cannot get value of " + field);
}
}
private final int getFieldValueAsInt(final Field field)
{
try
{
return (int)field.get(null);
}
c... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\adempiere\tools\AD_Ref_List_ValueName_UpdateFromClass.java | 1 |
请完成以下Java代码 | public boolean isSecure() {
// TODO: move to map
if ("https".equals(this.overrideScheme) || "wss".equals(this.overrideScheme)) {
return true;
}
return delegate.isSecure();
}
@Override
public URI getUri() {
return delegate.getUri();
}
@Override
public @Nullable Map<String, String> getMet... | return delegate.getMetadata();
}
@Override
public String getScheme() {
String scheme = delegate.getScheme();
if (scheme != null) {
return scheme;
}
return this.overrideScheme;
}
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\filter\LoadBalancerFilterFunctions.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BPartnerCompositeLookupKey
{
public static BPartnerCompositeLookupKey ofMetasfreshId(@NonNull final MetasfreshId metasfreshId)
{
return new BPartnerCompositeLookupKey(metasfreshId, null, null, null, null);
}
public static <T extends RepoIdAware> BPartnerCompositeLookupKey ofMetasfreshId(@NonNull fin... | return BPartnerCompositeLookupKey.ofGln(bpartnerIdentifier.asGLN());
case GLN_WITH_LABEL:
return BPartnerCompositeLookupKey.ofGlnWithLabel(bpartnerIdentifier.asGlnWithLabel());
case METASFRESH_ID:
return BPartnerCompositeLookupKey.ofMetasfreshId(bpartnerIdentifier.asMetasfreshId());
default:
throw ... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\utils\BPartnerCompositeLookupKey.java | 2 |
请完成以下Java代码 | public LocalInstrumentSEPA getLclInstrm() {
return lclInstrm;
}
/**
* Sets the value of the lclInstrm property.
*
* @param value
* allowed object is
* {@link LocalInstrumentSEPA }
*
*/
public void setLclInstrm(LocalInstrumentSEPA value) {
thi... | *
*/
public void setSeqTp(SequenceType1Code value) {
this.seqTp = value;
}
/**
* Gets the value of the ctgyPurp property.
*
* @return
* possible object is
* {@link CategoryPurposeSEPA }
*
*/
public CategoryPurposeSEPA getCtgyPurp() {
... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_008_003_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_008_003_02\PaymentTypeInformationSDD.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class AuthProgramInitResultVo implements Serializable {
private static final long serialVersionUID = -5167161500901848253L;
private String mchOrderNo;
/**
* 交易状态 YES 成功,其他失败
*/
private String errCode;
/**
* 支付信息
*/
private String payMessage;
/**
* 银行返回信息
... | return bankReturnMsg;
}
public void setBankReturnMsg(String bankReturnMsg) {
this.bankReturnMsg = bankReturnMsg;
}
public TradeStatusEnum getTradeStatus() {
return tradeStatus;
}
public void setTradeStatus(TradeStatusEnum tradeStatus) {
this.tradeStatus = tradeStatus;
... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\trade\vo\AuthProgramInitResultVo.java | 2 |
请完成以下Java代码 | public class CreateIndexService {
/** 设置集合名称 */
private static final String COLLECTION_NAME = "users";
@Resource
private MongoTemplate mongoTemplate;
/**
* 创建升序索引
*
* @return 索引信息
*/
public Object createAscendingIndex() {
// 设置字段名称
String field = "name";
... | // 创建索引
return mongoTemplate.getCollection(COLLECTION_NAME).createIndex(Indexes.text(field));
}
/**
* 创建哈希索引
*
* @return 索引信息
*/
public Object createHashIndex() {
// 设置字段名称
String field = "name";
// 创建索引
return mongoTemplate.getCollection(COLLECTI... | repos\springboot-demo-master\mongodb\src\main\java\demo\et\mongodb\service\CreateIndexService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class WebDriverConfig {
@Bean
@ConditionalOnProperty(name = "browser", havingValue = "edge")
public WebDriver edgeDriver() {
// this is the bean class for edge driver
if (System.getenv("CLOUD_RUN_FLAG") == null) {
WebDriverManager.edgedriver().setup();
}
... | if (System.getenv("CLOUD_RUN_FLAG") == null) {
WebDriverManager.chromedriver().setup();
return new ChromeDriver();
} else {
WebDriverManager.chromedriver().setup();
ChromeOptions options = new ChromeOptions();
options.addArguments("--no-sandbox");
... | repos\springboot-demo-master\Selenium\src\main\java\com\et\selenium\config\WebDriverConfig.java | 2 |
请完成以下Java代码 | public void setProcessed (final boolean Processed)
{
set_Value (COLUMNNAME_Processed, Processed);
}
@Override
public boolean isProcessed()
{
return get_ValueAsBoolean(COLUMNNAME_Processed);
}
@Override
public void setQty (final @Nullable BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
@Overrid... | * Reference name: GL_JournalLine_Type
*/
public static final int TYPE_AD_Reference_ID=540534;
/** Normal = N */
public static final String TYPE_Normal = "N";
/** Tax = T */
public static final String TYPE_Tax = "T";
@Override
public void setType (final java.lang.String Type)
{
set_Value (COLUMNNAME_Type, Ty... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_GL_JournalLine.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public int hashCode() {
return Objects.hash(articleDescription, articleNumber, batchNumber, technicalServiceCompletionDate, dueDate, name, additionalName, inspectionType, inspectionCompleted, serialNumber, serviceOriginType, serviceDescription, serviceLocation, serviceCompleted, deviceAppraisalLines, active, archiv... | sb.append(" serviceLocation: ").append(toIndentedString(serviceLocation)).append("\n");
sb.append(" serviceCompleted: ").append(toIndentedString(serviceCompleted)).append("\n");
sb.append(" deviceAppraisalLines: ").append(toIndentedString(deviceAppraisalLines)).append("\n");
sb.append(" active: ... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-article-api\src\main\java\io\swagger\client\model\DeviceInformationLine.java | 2 |
请完成以下Java代码 | public final class AuthenticatorAttachment implements Serializable {
@Serial
private static final long serialVersionUID = 8446133215195918090L;
/**
* Indicates <a href=
* "https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#cross-platform-attachment">cross-platform
* attachment</a>.
*
* <p>
* Authentic... | */
public String getValue() {
return this.value;
}
@Override
public String toString() {
return "AuthenticatorAttachment [" + this.value + "]";
}
/**
* Gets an instance of {@link AuthenticatorAttachment} based upon the value passed in.
* @param value the value to obtain the {@link AuthenticatorAttachment... | repos\spring-security-main\webauthn\src\main\java\org\springframework\security\web\webauthn\api\AuthenticatorAttachment.java | 1 |
请完成以下Java代码 | public static List<Integer> findPairsWithForLoop(int[] input, int sum) {
final List<Integer> allExistingPairs = new ArrayList<>();
for (int i = 0; i < input.length; i++) {
for (int j = 0; j < input.length; j++) {
if (j != i && (input[i] + input[j]) == sum) {
... | * @param input - number's array
* @param sum - given sum
* @return - number's array with all existing pairs. This list will contain just one pair's element because
* the other one can be calculated with SUM - element_1 = element_2
*/
public static List<Integer> findPairsWithStreamApi(int[] inp... | repos\tutorials-master\core-java-modules\core-java-numbers-9\src\main\java\com\baeldung\pairsaddupnumber\ExistingPairs.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public int getM_Product_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Product_ID);
}
@Override
public void setQtyConsumed (final BigDecimal QtyConsumed)
{
set_Value (COLUMNNAME_QtyConsumed, QtyConsumed);
}
@Override
public BigDecimal getQtyConsumed()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNA... | }
@Override
public void setQtyReserved (final BigDecimal QtyReserved)
{
set_Value (COLUMNNAME_QtyReserved, QtyReserved);
}
@Override
public BigDecimal getQtyReserved()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyReserved);
return bd != null ? bd : BigDecimal.ZERO;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.base\src\main\java-gen\de\metas\servicerepair\repository\model\X_C_Project_Repair_Consumption_Summary.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public List<EntityLink> findEntityLinksWithSameRootScopeForScopeIdAndScopeType(String scopeId, String scopeType, String linkType) {
return getEntityLinkEntityManager().findEntityLinksWithSameRootScopeForScopeIdAndScopeType(scopeId, scopeType, linkType);
}
@Override
@SuppressWarnings("unchecked"... | @Override
public void deleteEntityLinksByScopeIdAndType(String scopeId, String scopeType) {
getEntityLinkEntityManager().deleteEntityLinksByScopeIdAndScopeType(scopeId, scopeType);
}
@Override
public void deleteEntityLinksByRootScopeIdAndType(String scopeId, String scopeType) {
getEntit... | repos\flowable-engine-main\modules\flowable-entitylink-service\src\main\java\org\flowable\entitylink\service\impl\EntityLinkServiceImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class SslCredentialsWebServerCustomizer implements WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> {
@Bean
@ConfigurationProperties(prefix = "server.ssl.credentials")
public SslCredentialsConfig httpServerSslCredentials() {
return new SslCredentialsConfig("HTTP Server SSL Cre... | httpServerSslCredentialsConfig.getCredentials().getKeyPassword(),
null
);
return new SslBundles() {
@Override
public SslBundle getBundle(String name) {
return SslBundle.of(storeBundle);
}
@Override
public List<S... | repos\thingsboard-master\common\transport\transport-api\src\main\java\org\thingsboard\server\common\transport\config\ssl\SslCredentialsWebServerCustomizer.java | 2 |
请完成以下Java代码 | public void setAuthenticationSuccessHandler(AuthenticationSuccessHandler authenticationSuccessHandler) {
this.authenticationSuccessHandler = authenticationSuccessHandler;
}
/**
* Sets the strategy used to handle a failed authentication.
*/
public void setAuthenticationFailureHandler(AuthenticationFailureHandl... | @Override
public boolean matches(HttpServletRequest request) {
Authentication currentUser = AbstractPreAuthenticatedProcessingFilter.this.securityContextHolderStrategy
.getContext()
.getAuthentication();
if (currentUser == null) {
return true;
}
if (!AbstractPreAuthenticatedProcessingFilter.th... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\preauth\AbstractPreAuthenticatedProcessingFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public PickingJobOptions getPickingJobOptions(@Nullable final BPartnerId customerId, @NonNull PickingJobOptionsCollection pickingJobOptionsCollection)
{
final PickingJobOptions customerPickingJobOptions = customerId != null
? customerConfigs.getPickingJobOptionsId(customerId).map(pickingJobOptionsCollection::get... | final T option = extractOption.apply(pickingJobOptions);
if (option != null)
{
return option;
}
}
}
final T option = extractOption.apply(defaultPickingJobOptions);
if (option != null)
{
return option;
}
return defaultValue;
}
@NonNull
public ImmutableSet<BPartnerId> getPickOnlyC... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\config\mobileui\MobileUIPickingUserProfile.java | 2 |
请完成以下Java代码 | public static ConcurrentHashMap<Integer, String[]> groupByObjectIdVersionedIds(Set<String> targetIds) {
return targetIds.stream()
.collect(Collectors.groupingBy(
id -> new LwM2mPath(fromVersionedIdToObjectId(id)).getObjectId(),
ConcurrentHashMap::n... | if (!m2.containsKey(key)) return false;
String[] arr1 = m1.get(key);
String[] arr2 = m2.get(key);
if (arr1 == null || arr2 == null) {
if (arr1 != arr2) return false;
String[] sorted1 = arr1.clone();
String[] sorted2 = arr2.clone();
... | repos\thingsboard-master\common\transport\lwm2m\src\main\java\org\thingsboard\server\transport\lwm2m\utils\LwM2MTransportUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | JWTAuthenticationProvider jwtAuthenticationProvider(JWTDeserializer jwtDeserializer) {
return new JWTAuthenticationProvider(jwtDeserializer);
}
@Bean
PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
public void addCorsMappings(CorsRegistry reg... | }
@ConstructorBinding
@ConfigurationProperties("security")
class SecurityConfigurationProperties {
private final List<String> allowedOrigins;
SecurityConfigurationProperties(List<String> allowedOrigins) {
this.allowedOrigins = allowedOrigins;
}
public List<String> getAllowedOrigins() {
... | repos\realworld-springboot-java-master\src\main\java\io\github\raeperd\realworld\application\security\SecurityConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String passwordUpdate(HttpServletRequest request, @RequestParam("originalPassword") String originalPassword,
@RequestParam("newPassword") String newPassword) {
if (!StringUtils.hasText(originalPassword) || !StringUtils.hasText(newPassword)) {
return "参数不能为空";
... | Long loginUserId = (long) request.getSession().getAttribute("loginUserId");
if (adminService.updateName(loginUserId, loginUserName, nickName)) {
return "success";
} else {
return "修改失败";
}
}
@GetMapping("/logout")
public String logout(HttpServletRequest reque... | repos\spring-boot-projects-main\SpringBoot咨询发布系统实战项目源码\springboot-project-news-publish-system\src\main\java\com\site\springboot\core\controller\admin\AdminController.java | 2 |
请完成以下Java代码 | public void setC_BPartner_Location_Value_ID(final int C_BPartner_Location_Value_ID)
{
delegate.setC_BPartner_Location_Value_ID(C_BPartner_Location_Value_ID);
}
@Override
public int getAD_User_ID()
{
return delegate.getAD_User_ID();
}
@Override
public void setAD_User_ID(final int AD_User_ID)
{
delegate.... | public void setFrom(@NonNull final I_C_Order from)
{
setFrom(OrderDocumentLocationAdapterFactory.locationAdapter(from).toDocumentLocation());
}
public void setFrom(@NonNull final I_C_Invoice from)
{
setFrom(InvoiceDocumentLocationAdapterFactory.locationAdapter(from).toDocumentLocation());
}
@Override
publi... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\inout\location\adapter\DocumentLocationAdapter.java | 1 |
请完成以下Java代码 | public class AuthorId implements Serializable {
private static final long serialVersionUID = 1L;
@ManyToOne
@JoinColumn(name = "publisher")
private Publisher publisher;
@Column(name = "name")
private String name;
public AuthorId() {
}
public AuthorId(Publisher publisher, String ... | public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final AuthorId other = (AuthorId) o... | repos\Hibernate-SpringBoot-master\HibernateSpringBootCompositeKeyEmbeddableMapRel\src\main\java\com\bookstore\entity\AuthorId.java | 1 |
请完成以下Java代码 | protected final ProcessPreconditionsResolution checkPreconditionsApplicable()
{
if (!isHUEditorView())
{
return ProcessPreconditionsResolution.rejectWithInternalReason("not the HU view");
}
if (!streamSelectedHUIds(HUEditorRowFilter.Select.ONLY_TOPLEVEL).findAny().isPresent())
{
return ProcessPrecondi... | {
final List<I_M_HU> hus = streamSelectedHUs(HUEditorRowFilter.Select.ONLY_TOPLEVEL).collect(ImmutableList.toImmutableList());
if (hus.isEmpty())
{
throw new AdempiereException("@NoSelection@");
}
return hus;
}
@Override
protected final void postProcess(final boolean success)
{
if (somethingWasProce... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\process\WEBUI_M_HU_InternalUse_Template.java | 1 |
请完成以下Java代码 | public @Nullable String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
@Override
public @Nullable Tag getParent() {
return this.parent;
}
@Override
public void setParent(Tag parent) {
this.parent = parent;
}
public @Nullable String getVar() {
return this.var;
}
pub... | public List<ConstructorResolver> getConstructorResolvers() {
return this.delegate.getConstructorResolvers();
}
@Override
public List<MethodResolver> getMethodResolvers() {
return this.delegate.getMethodResolvers();
}
@Override
public List<PropertyAccessor> getPropertyAccessors() {
return this.del... | repos\spring-security-main\taglibs\src\main\java\org\springframework\security\taglibs\authz\JspAuthorizeTag.java | 1 |
请完成以下Java代码 | public class CamundaFormDefinitionCache extends ResourceDefinitionCache<CamundaFormDefinitionEntity> {
public CamundaFormDefinitionCache(CacheFactory factory, int cacheCapacity, CacheDeployer cacheDeployer) {
super(factory, cacheCapacity, cacheDeployer);
}
@Override
protected AbstractResourceDefinitionMan... | ensureNotNull("no deployed camunda form definition found with key '" + definitionKey + "' and tenant-id '" + tenantId + "'", "camundaFormDefinition", definition);
}
@Override
protected void checkInvalidDefinitionByKeyVersionAndTenantId(String definitionKey, Integer definitionVersion, String tenantId, CamundaForm... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\deploy\cache\CamundaFormDefinitionCache.java | 1 |
请完成以下Java代码 | public String getPhone() {
return super.getPhone();
}
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Email", example = "example@company.com")
@Override
public String getEmail() {
return super.getEmail();
}
@Schema(description = "Additional parameters of the... | builder.append(title);
builder.append(", tenantId=");
builder.append(tenantId);
builder.append(", additionalInfo=");
builder.append(getAdditionalInfo());
builder.append(", country=");
builder.append(country);
builder.append(", state=");
builder.append(stat... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\Customer.java | 1 |
请完成以下Java代码 | public static boolean isEditable(Component c)
{
if (c == null)
return false;
if (!c.isEnabled())
return false;
if (c instanceof CEditor)
return ((CEditor)c).isReadWrite();
if (c instanceof JTextComponent)
return ((JTextComponent)c).isEditable();
//
log.warn("Unknown component type - "+c.getClas... | last = c;
if (found)
{
if (isEditable(c) && isEmpty(c))
{
c.requestFocus();
return;
}
}
else if (c == component)
{
found = true;
}
}
//
if (!found)
log.warn("Component not found - "+component);
if (found && last != null)
last.requestFocus();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\form\swing\SwingFieldsUtil.java | 1 |
请完成以下Java代码 | public List<EmailAttachment> getEmailAttachments(
@NonNull final DocumentPath documentPath,
@NonNull final String tagName)
{
final TableRecordReference recordRef = documentDescriptorFactory.getTableRecordReference(documentPath);
final WebuiDocumentPrintRequest printRequest = WebuiDocumentPrintRequest.builde... | .map(Stream::of).orElseGet(Stream::empty);
return Stream.concat(emailAttachments, attachmentEntryService.streamEmailAttachments(recordRef, tagName))
.filter(Objects::nonNull)
.collect(ImmutableList.toImmutableList());
}
private static EmailAttachment toEmailAttachment(final ReportResultData contextDocumen... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\mail\MailRestService.java | 1 |
请完成以下Java代码 | public void setWithoutTenantId(Boolean withoutTenantId) {
this.withoutTenantId = withoutTenantId;
}
@Override
protected void applyFilters(HistoricIdentityLinkLogQuery query) {
if (dateBefore != null) {
query.dateBefore(dateBefore);
}
if (dateAfter != null) {
query.dateAfter(dateAfter)... | if (tenantIds != null && !tenantIds.isEmpty()) {
query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
}
if (TRUE.equals(withoutTenantId)) {
query.withoutTenantId();
}
}
@Override
protected void applySortBy(HistoricIdentityLinkLogQuery query, String sortBy, Map<String, Object... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\HistoricIdentityLinkLogQueryDto.java | 1 |
请完成以下Java代码 | private static void addContentToDocument(PdfDocument pdfDocument) throws MalformedURLException {
// 4.1. add form
PdfFormField personal = PdfFormField.createEmptyField(pdfDocument);
personal.setFieldName("information");
PdfTextFormField name = PdfFormField.createText(pdfDocument, new Rec... | Text title = new Text("This is a demo").setFontSize(16);
Text author = new Text("Baeldung tutorials.");
Paragraph p = new Paragraph().setFontSize(8)
.add(title)
.add(" from ")
.add(author);
document.add(p);
// 4.6. add a table
Table table = ne... | repos\tutorials-master\text-processing-libraries-modules\pdf-2\src\main\java\com\baeldung\pdfedition\PdfEditor.java | 1 |
请完成以下Java代码 | public LoginContext getLoginContext() {
return this.loginContext;
}
@Override
public Builder<?> toBuilder() {
return new Builder<>(this);
}
/**
* A builder of {@link JaasAuthenticationToken} instances
*
* @since 7.0
*/
public static class Builder<B extends Builder<B>> extends UsernamePasswordAuthent... | * Use this {@link LoginContext}
* @param loginContext the {@link LoginContext} to use
* @return the {@link Builder} for further configurations
*/
public B loginContext(LoginContext loginContext) {
this.loginContext = loginContext;
return (B) this;
}
@Override
public JaasAuthenticationToken build... | repos\spring-security-main\core\src\main\java\org\springframework\security\authentication\jaas\JaasAuthenticationToken.java | 1 |
请完成以下Java代码 | public static Object getFieldValue(Object bean, String fieldName) throws IllegalAccessException {
Assert.notNull(bean, "Bean cannot be null");
Assert.hasText(fieldName, "Field name required");
String[] nestedFields = StringUtils.tokenizeToStringArray(fieldName, ".");
Class<?> componentClass = bean.getClass();
... | catch (Exception ex) {
ReflectionUtils.handleReflectionException(ex);
return null; // unreachable - previous line throws exception
}
}
public static void setProtectedFieldValue(String protectedField, Object object, Object newValue) {
Field field = FieldUtils.getField(object.getClass(), protectedField);
t... | repos\spring-security-main\core\src\main\java\org\springframework\security\util\FieldUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Organization {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(nullable = false, unique = true)
private String name;
public Organization() {
}
public Organization(String name) {
this.name = name;
}
public Long getId() {
... | int result = 1;
result = (prime * result) + ((id == null) ? 0 : id.hashCode());
result = (prime * result) + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if... | repos\tutorials-master\spring-security-modules\spring-security-web-boot-1\src\main\java\com\baeldung\roles\custom\persistence\model\Organization.java | 2 |
请完成以下Java代码 | private Map<ProductEntity, Integer> buildProductEntityIntegerMap(List<ProductEntity> productEntityList, Map<String, Integer> prodIdCountMap) {
Map<ProductEntity, Integer> map = Maps.newHashMap();
if (CollectionUtils.isEmpty(productEntityList)) {
return map;
}
for (ProductEn... | }
productEntityList.add(productEntitys.get(0));
}
return productEntityList;
}
/**
* 构建产品查询请求
* @param prodIdCountMap 产品ID-库存 映射
* @return 产品查询请求列表
*/
private List<ProdQueryReq> buildProdQueryReq(Map<String, Integer> prodIdCountMap) {
List<ProdQueryR... | repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Order\src\main\java\com\gaoxi\order\component\datatransfer\ProdCountMapTransferComponent.java | 1 |
请完成以下Java代码 | public int getC_OLCand_ID()
{
return get_ValueAsInt(COLUMNNAME_C_OLCand_ID);
}
@Override
public void setDurationAmount (final @Nullable BigDecimal DurationAmount)
{
set_Value (COLUMNNAME_DurationAmount, DurationAmount);
}
@Override
public BigDecimal getDurationAmount()
{
final BigDecimal bd = get_Val... | @Override
public String getSalesLineId()
{
return get_ValueAsString(COLUMNNAME_SalesLineId);
}
@Override
public void setTimePeriod (final @Nullable BigDecimal TimePeriod)
{
set_Value (COLUMNNAME_TimePeriod, TimePeriod);
}
@Override
public BigDecimal getTimePeriod()
{
final BigDecimal bd = get_ValueAs... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.healthcare.alberta\src\main\java-gen\de\metas\vertical\healthcare\alberta\model\X_Alberta_OrderedArticleLine.java | 1 |
请完成以下Java代码 | public void removeEventListener(ActivitiEventListener listenerToRemove) {
eventSupport.removeEventListener(listenerToRemove);
}
@Override
public void dispatchEvent(ActivitiEvent event) {
if (enabled) {
eventSupport.dispatchEvent(event);
}
if (event.getType() == ... | * @return
*/
protected BpmnModel extractBpmnModelFromEvent(ActivitiEvent event) {
BpmnModel result = null;
if (result == null && event.getProcessDefinitionId() != null) {
ProcessDefinition processDefinition = ProcessDefinitionUtil.getProcessDefinition(
event.getProc... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\delegate\event\impl\ActivitiEventDispatcherImpl.java | 1 |
请完成以下Java代码 | public class ElasticsearchException extends RuntimeException {
@Getter
private int errcode;
@Getter
private String errmsg;
public ElasticsearchException(ResultCode resultCode) {
this(resultCode.getCode(), resultCode.getMsg());
}
public ElasticsearchException(String message) {
... | super(errmsg);
this.errcode = errcode;
this.errmsg = errmsg;
}
public ElasticsearchException(String message, Throwable cause) {
super(message, cause);
}
public ElasticsearchException(Throwable cause) {
super(cause);
}
public ElasticsearchException(String messag... | repos\spring-boot-demo-master\demo-elasticsearch-rest-high-level-client\src\main\java\com\xkcoding\elasticsearch\exception\ElasticsearchException.java | 1 |
请完成以下Java代码 | abstract class JsonNodeUtils {
static final TypeReference<Set<String>> STRING_SET = new TypeReference<>() {
};
static final TypeReference<Map<String, Object>> STRING_OBJECT_MAP = new TypeReference<>() {
};
static String findStringValue(JsonNode jsonNode, String fieldName) {
if (jsonNode == null) {
return n... | if (jsonNode == null) {
return null;
}
JsonNode value = jsonNode.findValue(fieldName);
return (value != null && value.isContainer())
? context.readTreeAsValue(value, context.getTypeFactory().constructType(valueTypeReference)) : null;
}
static JsonNode findObjectNode(JsonNode jsonNode, String fieldName) ... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\jackson\JsonNodeUtils.java | 1 |
请完成以下Java代码 | public int hashCode()
{
return new HashcodeBuilder()
.append(columnName)
.append(direction)
.toHashcode();
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
final QueryOrderByItem other = EqualsBuilder.getOther(this, obj);
if (other == null)
{
retur... | */
public String getColumnName()
{
return columnName;
}
public Direction getDirection()
{
return direction;
}
public Nulls getNulls()
{
return nulls;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\QueryOrderByItem.java | 1 |
请完成以下Java代码 | public static Mono<Author> findAuthorByName(String authorName) {
Optional<Author> author = authors.stream()
.filter(it -> it.getName()
.equals(authorName))
.findFirst();
return Mono.justOrEmpty(author);
}
public static Mono<Book> findLatestBookByAuthorId... | public static class AuthorNotFoundException extends RuntimeException {
public AuthorNotFoundException(String message) {
super(message);
}
public AuthorNotFoundException() {
super();
}
}
static <T> List<T> listOf(T... items) {
List<T> list = new A... | repos\tutorials-master\core-java-modules\core-java-functional\src\main\java\com\baeldung\monads\AuthorsRepository.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List<ItemListType> getItemList() {
if (itemList == null) {
itemList = new ArrayList<ItemListType>();
}
return this.itemList;
}
/**
* A free-text footer description with suceeds the details section.
*
* @return
* possible object is
* {... | return footerDescription;
}
/**
* Sets the value of the footerDescription property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setFooterDescription(String value) {
this.footerDescription = value;
}
} | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\DetailsType.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.