instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public <P> Object set(Map<String, Object> location, String target, P value) {
return location.put(target, value);
}
@Override
public Object recurse(Map<String, Object> location, String target) {
return location.get(target);
}
};
private static final Multi... | if (null != mapper.set(currentLocation, segmentName, file)) {
throw new RuntimeException("expected null value when mapping " + objectPath);
}
} else {
currentLocation = mapper.recurse(currentLocation, segmentName);
if (null == currentLocati... | repos\tutorials-master\spring-boot-modules\spring-boot-graphql-2\src\main\java\com\baeldung\graphql\fileupload\MultipartVariableMapper.java | 1 |
请完成以下Java代码 | public class SysFillRule {
/**
* 主键ID
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键ID")
private java.lang.String id;
/**
* 规则名称
*/
@Excel(name = "规则名称", width = 15)
@Schema(description = "规则名称")
private java.lang.String ruleName;
/**
* 规则Cod... | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "修改时间")
private java.util.Date updateTime;
/**
* 创建人
*/
@Excel(name = "创建人", width = 15)
@Schema(description = "创建人")
private java.lang.String cre... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\entity\SysFillRule.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DDOrderDocStatusChangedHandler implements MaterialEventHandler<DDOrderDocStatusChangedEvent>
{
private final CandidateRepositoryRetrieval candidateRepositoryRetrieval;
private final CandidateChangeService candidateChangeService;
public DDOrderDocStatusChangedHandler(
@NonNull final CandidateReposito... | final Candidate updatedCandidateToPersist = candidateForDDOrderId.toBuilder()
// .status(newCandidateStatus)
.materialDescriptor(candidateForDDOrderId.getMaterialDescriptor().withQuantity(newQuantity))
.businessCaseDetail(distributionDetail.toBuilder().ddOrderDocStatus(newDocStatusFromEvent).build())
... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-service\src\main\java\de\metas\material\dispo\service\event\handler\ddorder\DDOrderDocStatusChangedHandler.java | 2 |
请完成以下Java代码 | public Builder attribute(String name, Object value) {
Assert.hasText(name, "name cannot be empty");
Assert.notNull(value, "value cannot be null");
this.attributes.put(name, value);
return this;
}
/**
* A {@code Consumer} of the attributes {@code Map} allowing the ability to add,
* replace, or rem... | this.id = UUID.randomUUID().toString();
}
authorization.id = this.id;
authorization.registeredClientId = this.registeredClientId;
authorization.principalName = this.principalName;
authorization.authorizationGrantType = this.authorizationGrantType;
authorization.authorizedScopes = Collections.unmodifia... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\OAuth2Authorization.java | 1 |
请完成以下Java代码 | public void setJobCant (int JobCant)
{
set_Value (COLUMNNAME_JobCant, Integer.valueOf(JobCant));
}
/** Get Job Cant.
@return Job Cant */
public int getJobCant ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_JobCant);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name... | {
Integer ii = (Integer)get_Value(COLUMNNAME_Next_Job_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_AD_User getSupervisor() throws RuntimeException
{
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name)
.getPO(getSupervisor_ID(), get_TrxName()); }
/** Set Supervisor.
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_HR_Job.java | 1 |
请完成以下Java代码 | public void execute(Runnable task) {
asyncTaskExecutor.execute(task);
}
@Override
public CompletableFuture<?> submit(Runnable task) {
return asyncTaskExecutor.submitCompletable(task);
}
@Override
public <T> CompletableFuture<T> submit(Callable<T> task) {
return asyncTas... | }
@Override
public int getRemainingCapacity() {
Object executor = asyncTaskExecutor;
if (isAsyncTaskExecutorAopProxied) {
executor = AopProxyUtils.getSingletonTarget(asyncTaskExecutor);
}
if (executor instanceof ThreadPoolTaskExecutor) {
return ((ThreadPo... | repos\flowable-engine-main\modules\flowable-spring-common\src\main\java\org\flowable\common\spring\async\SpringAsyncTaskExecutor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isTemplateAvailable(String view, Environment environment, ClassLoader classLoader,
ResourceLoader resourceLoader) {
if (ClassUtils.isPresent(this.className, classLoader)) {
Binder binder = Binder.get(environment);
TemplateAvailabilityProperties properties = binder.bindOrCreate(this.propertyPre... | protected TemplateAvailabilityProperties(String prefix, String suffix) {
this.prefix = prefix;
this.suffix = suffix;
}
protected abstract List<String> getLoaderPath();
public String getPrefix() {
return this.prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public St... | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\template\PathBasedTemplateAvailabilityProvider.java | 2 |
请完成以下Java代码 | public ResponseEntity<ErrorItem> handle(ResourceNotFoundException e) {
ErrorItem error = new ErrorItem();
error.setMessage(e.getMessage());
return new ResponseEntity<>(error, HttpStatus.NOT_FOUND);
}
public static class ErrorItem {
@JsonInclude(JsonInclude.Include.NON_NULL) pr... | private List<ErrorItem> errors = new ArrayList<>();
public List<ErrorItem> getErrors() {
return errors;
}
public void setErrors(List<ErrorItem> errors) {
this.errors = errors;
}
public void addError(ErrorItem error) {
this.errors.add(error);... | repos\tutorials-master\spring-boot-modules\spring-boot-angular\src\main\java\com\baeldung\ecommerce\exception\ApiExceptionHandler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public final class SystemMetricsAutoConfiguration {
@Bean
@ConditionalOnMissingBean
UptimeMetrics uptimeMetrics() {
return new UptimeMetrics();
}
@Bean
@ConditionalOnMissingBean
ProcessorMetrics processorMetrics(ObjectProvider<JvmCpuMeterConventions> jvmCpuMeterConventions) {
JvmCpuMeterConventions convent... | @Bean
@ConditionalOnMissingBean
FileDescriptorMetrics fileDescriptorMetrics() {
return new FileDescriptorMetrics();
}
@Bean
@ConditionalOnMissingBean
DiskSpaceMetricsBinder diskSpaceMetrics(MetricsProperties properties) {
List<File> paths = properties.getSystem().getDiskspace().getPaths();
return new DiskS... | repos\spring-boot-main\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\system\SystemMetricsAutoConfiguration.java | 2 |
请完成以下Java代码 | public static Collection<EventPayloadInstance> createEventPayloadInstances(VariableScope variableScope, ExpressionManager expressionManager,
BaseElement baseElement, EventModel eventDefinition) {
List<EventPayloadInstance> eventPayloadInstances = new ArrayList<>();
List<ExtensionElement> in... | if (eventPayloadDefinition != null) {
Expression sourceExpression = expressionManager.createExpression(source);
Object value = sourceExpression.getValue(variableScope);
eventPayloadInstances.add(new EventPayloadInstanceImpl(eventPayloadDefinition, value));
... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\util\EventInstanceCmmnUtil.java | 1 |
请完成以下Java代码 | public B authorizationRequestUri(Function<UriBuilder, URI> authorizationRequestUriFunction) {
if (authorizationRequestUriFunction != null) {
this.authorizationRequestUriFunction = authorizationRequestUriFunction;
}
return getThis();
}
public abstract T build();
private String buildAuthorizationRequ... | }
protected Map<String, Object> getParameters() {
Map<String, Object> parameters = new LinkedHashMap<>();
parameters.put(OAuth2ParameterNames.RESPONSE_TYPE, this.responseType.getValue());
parameters.put(OAuth2ParameterNames.CLIENT_ID, this.clientId);
if (!CollectionUtils.isEmpty(this.scopes)) {
param... | repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\endpoint\OAuth2AuthorizationRequest.java | 1 |
请完成以下Java代码 | public class JSONUserSession
{
@JsonProperty("loggedIn")
private final boolean loggedIn;
/**
* login user
*/
@JsonProperty("username")
@JsonInclude(JsonInclude.Include.NON_NULL)
private final String username;
/**
* user's full name/display name
*/
@JsonProperty("fullname")
@JsonInclude(JsonInclude.In... | {
username = userSession.getUserName();
rolename = userSession.getRoleName();
orgname = userSession.getOrgName();
fullname = userSession.getUserFullname();
email = userSession.getUserEmail();
avatarId = userSession.getAvatarId();
defaultFlatrateConditionsId = userSession.getDefaultFlatrateConditi... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\session\json\JSONUserSession.java | 1 |
请完成以下Java代码 | public List<String> getCandidateUsers() {
return candidateUsers;
}
public void setCandidateUsers(List<String> candidateUsers) {
this.candidateUsers = candidateUsers;
}
public List<String> getCandidateGroups() {
return candidateGroups;
}
public void setCandidateGroups(L... | clone.setValues(this);
return clone;
}
public void setValues(HumanTask otherElement) {
super.setValues(otherElement);
setAssignee(otherElement.getAssignee());
setOwner(otherElement.getOwner());
setFormKey(otherElement.getFormKey());
setSameDeployment(otherElement... | repos\flowable-engine-main\modules\flowable-cmmn-model\src\main\java\org\flowable\cmmn\model\HumanTask.java | 1 |
请完成以下Java代码 | public Boolean isArray() {
return jsonNode.isArray();
}
public SpinList<SpinJsonNode> elements() {
if(jsonNode.isArray()) {
Iterator<JsonNode> iterator = jsonNode.elements();
SpinList<SpinJsonNode> list = new SpinListImpl<SpinJsonNode>();
while(iterator.hasNext()) {
SpinJsonNode n... | DataFormatMapper mapper = dataFormat.getMapper();
return mapper.mapInternalToJava(jsonNode, type);
}
/**
* Maps the json represented by this object to a java object of the given type.
* Argument is to be supplied in Jackson's canonical type string format
* (see {@link JavaType#toCanonical()}).<br>
... | repos\camunda-bpm-platform-master\spin\dataformat-json-jackson\src\main\java\org\camunda\spin\impl\json\jackson\JacksonJsonNode.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public TransactionalPackingItemSupport get()
{
return new TransactionalPackingItemSupport(trx);
}
});
}
private final Map<Long, ItemState> items = new LinkedHashMap<>();
private TransactionalPackingItemSupport(final ITrx trx)
{
//
// Register the commit/rollback transaction listeners
trx.getTrxL... | private final Reference<TransactionalPackingItem> transactionalItemRef;
private final PackingItem state;
public ItemState(final TransactionalPackingItem transactionalItem)
{
super();
// NOTE: we keep a weak reference to our transactional item
// because in case nobody is referencing it, there is no poin... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\picking\service\TransactionalPackingItemSupport.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public BigInteger getExternalSeqNo() {
return externalSeqNo;
}
/**
* Sets the value of the externalSeqNo property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setExternalSeqNo(BigInteger value) {
this.externalS... | this.qtyEnteredInBPartnerUOM = value;
}
/**
* Gets the value of the bPartnerQtyItemCapacity property.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getBPartnerQtyItemCapacity() {
return bPartnerQtyItemCapacity;
}
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_metasfreshinhousev1\de\metas\edi\esb\jaxb\metasfreshinhousev1\EDIExpDesadvLineType.java | 2 |
请完成以下Java代码 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
invoke(new FilterInvocation(request, response, chain));
}
public @Nullable FilterInvocationSecurityMetadataSource getSecurityMetadataSource() {
return this.securityMetadataSource;
... | super.finallyInvocation(token);
}
super.afterInvocation(token, null);
}
private boolean isApplied(FilterInvocation filterInvocation) {
return (filterInvocation.getRequest() != null)
&& (filterInvocation.getRequest().getAttribute(FILTER_APPLIED) != null);
}
/**
* Indicates whether once-per-request hand... | repos\spring-security-main\access\src\main\java\org\springframework\security\web\access\intercept\FilterSecurityInterceptor.java | 1 |
请完成以下Java代码 | public SuspensionState getSuspensionState() {
return suspensionState;
}
public void setSuspensionState(SuspensionState suspensionState) {
this.suspensionState = suspensionState;
}
public String getCategoryNotEquals() {
return categoryNotEquals;
}
public String getTenan... | public String getEventSubscriptionType() {
return eventSubscriptionType;
}
public boolean isIncludeAuthorization() {
return authorizationUserId != null || (authorizationGroups != null && !authorizationGroups.isEmpty());
}
public List<List<String>> getSafeAuthorizationGroups() {
... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\ProcessDefinitionQueryImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | final class CacheConfigurations {
private static final Map<CacheType, String> MAPPINGS;
static {
Map<CacheType, String> mappings = new EnumMap<>(CacheType.class);
mappings.put(CacheType.GENERIC, GenericCacheConfiguration.class.getName());
mappings.put(CacheType.HAZELCAST, HazelcastCacheConfiguration.class.get... | private CacheConfigurations() {
}
static String getConfigurationClass(CacheType cacheType) {
String configurationClassName = MAPPINGS.get(cacheType);
Assert.state(configurationClassName != null, () -> "Unknown cache type " + cacheType);
return configurationClassName;
}
static CacheType getType(String config... | repos\spring-boot-4.0.1\module\spring-boot-cache\src\main\java\org\springframework\boot\cache\autoconfigure\CacheConfigurations.java | 2 |
请完成以下Java代码 | public class GetExecutionVariableCmd implements Command<Object>, Serializable {
private static final long serialVersionUID = 1L;
protected String executionId;
protected String variableName;
protected boolean isLocal;
public GetExecutionVariableCmd(String executionId, String variableName, boolean i... | if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, execution.getProcessDefinitionId())) {
Flowable5CompatibilityHandler compatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();
return compatibilityHandler.getExecutionVariable(executionId, variableName, isLocal);
... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\cmd\GetExecutionVariableCmd.java | 1 |
请完成以下Java代码 | public CostDetailCreateRequest withAmount(@NonNull final CostAmount amt)
{
return withAmountAndType(amt, this.amtType);
}
public CostDetailCreateRequest withAmountAndType(@NonNull final CostAmount amt, @NonNull final CostAmountType amtType)
{
if (Objects.equals(this.amt, amt)
&& Objects.equals(this.amtType... | && Objects.equals(this.qty, qty))
{
return this;
}
return toBuilder().productId(productId).qty(qty).build();
}
public CostDetailCreateRequest withQty(@NonNull final Quantity qty)
{
if (Objects.equals(this.qty, qty))
{
return this;
}
return toBuilder().qty(qty).build();
}
public CostDetailCr... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\CostDetailCreateRequest.java | 1 |
请完成以下Java代码 | private Timestamp getNewerDateAcct()
{
Timestamp invoiceDate = null;
Timestamp shipDate = null;
if (getC_InvoiceLine_ID() > 0)
{
final String sql = "SELECT i.DateAcct "
+ "FROM C_InvoiceLine il"
+ " INNER JOIN C_Invoice i ON (i.C_Invoice_ID=il.C_Invoice_ID) "
+ "WHERE C_InvoiceLine_ID=?";
... | return true;
}
@Override
protected boolean afterDelete(final boolean success)
{
if (!success)
{
return success;
}
// Order Delivered/Invoiced
// (Reserved in VMatch and MInOut.completeIt)
final I_C_OrderLine orderLine = getC_OrderLine();
if (orderLine != null)
{
if (getM_InOutLine_ID() > 0)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MMatchPO.java | 1 |
请完成以下Java代码 | public final class ThreadLocalDecimalFormatter
{
public static ThreadLocalDecimalFormatter ofPattern(final String pattern)
{
final DecimalFormatSymbols symbols = null; // auto
return new ThreadLocalDecimalFormatter(pattern, symbols);
}
public static ThreadLocalDecimalFormatter ofPattern(final String pattern, f... | {
supplier = () -> new DecimalFormat(pattern, symbols);
}
formatterHolder = ThreadLocal.withInitial(supplier);
formatterHolder.get(); // get an instance just to make sure the pattern is OK
}
private DecimalFormat getFormatter()
{
return formatterHolder.get();
}
public String format(final Object obj)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\ThreadLocalDecimalFormatter.java | 1 |
请完成以下Java代码 | public Optional<InstantAndOrgId> getSinglePreparationDate() {return getSingleValue(ScheduledPackageable::getPreparationDate);}
public Optional<InstantAndOrgId> getSingleDeliveryDate() {return getSingleValue(ScheduledPackageable::getDeliveryDate);}
public Optional<BPartnerLocationId> getSingleCustomerLocationId() {r... | {
final ShipmentScheduleAndJobScheduleIdSet scheduleIds = getScheduleIds();
return scheduleIds.size() == 1 ? Optional.of(scheduleIds.iterator().next()) : Optional.empty();
}
public Optional<UomId> getSingleCatchWeightUomIdIfUnique()
{
final List<UomId> catchWeightUomIds = list.stream()
.map(ScheduledPacka... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\model\ScheduledPackageableList.java | 1 |
请完成以下Spring Boot application配置 | ## Spring view resolver set up
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
spring.datasource.url = jdbc:mysql://localhost:3306/springboot?useSSL=false
spring.datasource.username=root
spring.datasource.password=posilka2020
... | pring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
#Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto=update | repos\Spring-Boot-Advanced-Projects-main\Springboot-Registration-Page\src\main\resources\application.properties | 2 |
请完成以下Java代码 | private static WFActivityStatus computeStatus(
final @NonNull Quantity qtyToIssue,
final @NonNull Quantity qtyIssued,
final @NonNull ImmutableList<RawMaterialsIssueStep> steps)
{
if (qtyIssued.isZero())
{
return WFActivityStatus.NOT_STARTED;
}
else if (qtyToIssue.compareTo(qtyIssued) <= 0
|| st... | }
@NonNull
public ITranslatableString getProductValueAndProductName()
{
final TranslatableStringBuilder message = TranslatableStrings.builder()
.append(getProductValue())
.append(" ")
.append(getProductName());
return message.build();
}
@NonNull
public Quantity getQtyLeftToIssue()
{
return q... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\job\model\RawMaterialsIssueLine.java | 1 |
请完成以下Java代码 | public CoNLLSentence parse(List<Term> termList)
{
return parse(termList, 64, 1);
}
/**
* 执行句法分析
*
* @param termList 分词结果
* @param beamWidth 柱搜索宽度
* @param numOfThreads 多线程数
* @return 句法树
*/
public CoNLLSentence parse(List<Term> termList, int beamWidth, ... | for (int i = 0; i < words.length; i++)
{
wordArray[i] = new CoNLLWord(i + 1, words[i], tags[i]);
}
for (int i = 0; i < words.length; i++)
{
wordArray[i].DEPREL = parser.idWord(bestParse.state.getDependent(i + 1));
int index = bestParse.state.getHead(i ... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dependency\perceptron\parser\KBeamArcEagerDependencyParser.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public HistoricTaskQueryInterceptor getHistoricTaskQueryInterceptor() {
return historicTaskQueryInterceptor;
}
public TaskServiceConfiguration setHistoricTaskQueryInterceptor(HistoricTaskQueryInterceptor historicTaskQueryInterceptor) {
this.historicTaskQueryInterceptor = historicTaskQueryInterc... | @Override
public TaskServiceConfiguration setTypedEventListeners(Map<String, List<FlowableEventListener>> typedEventListeners) {
this.typedEventListeners = typedEventListeners;
return this;
}
public TaskPostProcessor getTaskPostProcessor() {
return taskPostProcessor;
}
publ... | repos\flowable-engine-main\modules\flowable-task-service\src\main\java\org\flowable\task\service\TaskServiceConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | List<ConfigurationMetadataItem> getItems() {
return this.items;
}
List<ConfigurationMetadataHint> getHints() {
return this.hints;
}
/**
* Resolve the name of an item against this instance.
* @param item the item to resolve
* @see ConfigurationMetadataProperty#setName(String)
*/
private void resolveNa... | if (source != null) {
String groupId = source.getGroupId();
String dottedPrefix = groupId + ".";
String id = item.getId();
if (hasLength(groupId) && id.startsWith(dottedPrefix)) {
String name = id.substring(dottedPrefix.length());
item.setName(name);
}
}
}
private static boolean hasLength(St... | repos\spring-boot-4.0.1\configuration-metadata\spring-boot-configuration-metadata\src\main\java\org\springframework\boot\configurationmetadata\RawConfigurationMetadata.java | 2 |
请完成以下Java代码 | public void setMaxRequestSize(@Nullable DataSize maxRequestSize) {
this.maxRequestSize = maxRequestSize;
}
/**
* Sets the {@link DataSize size} threshold after which files will be written to disk.
* @param fileSizeThreshold the file size threshold
*/
public void setFileSizeThreshold(@Nullable DataSize fileS... | long fileSizeThresholdBytes = convertToBytes(this.fileSizeThreshold, 0);
return new MultipartConfigElement(this.location, maxFileSizeBytes, maxRequestSizeBytes,
(int) fileSizeThresholdBytes);
}
/**
* Return the amount of bytes from the specified {@link DataSize size}. If the size is
* {@code null} or negat... | repos\spring-boot-4.0.1\module\spring-boot-servlet\src\main\java\org\springframework\boot\servlet\MultipartConfigFactory.java | 1 |
请完成以下Java代码 | public void setNm(String value) {
this.nm = value;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link Party6ChoiceCH }
*
*/
public Party6ChoiceCH getId() {
return id;
}
/**
* Sets the value of t... | public ContactDetails2CH getCtctDtls() {
return ctctDtls;
}
/**
* Sets the value of the ctctDtls property.
*
* @param value
* allowed object is
* {@link ContactDetails2CH }
*
*/
public void setCtctDtls(ContactDetails2CH value) {
this.ctctDtls... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\PartyIdentification32CHNameAndId.java | 1 |
请完成以下Java代码 | private void action_treeDelete(ListItem item)
{
log.info("Item=" + item);
if (item != null)
{
MTreeNode info = new MTreeNode(item.id, 0, item.name, item.description, -1,
item.isSummary, item.imageIndicator, false, null);
centerTree.nodeChanged(false, info);
deleteNode(item);
}
} // action_tr... | action_treeAdd(item);
}
} // action_treeAddAll
/**
* Action: Delete All Nodes from Tree
*/
private void action_treeDeleteAll()
{
log.info("");
ListModel model = centerList.getModel();
int size = model.getSize();
int index = -1;
for (index = 0; index < size; index++)
{
ListItem item = (ListIt... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\form\VTreeMaintenance.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Duration getSchemaLockWaitTime() {
return schemaLockWaitTime;
}
public void setSchemaLockWaitTime(Duration schemaLockWaitTime) {
this.schemaLockWaitTime = schemaLockWaitTime;
}
public boolean isEnableHistoryCleaning() {
return enableHistoryCleaning;
}
public void... | }
public void setHistoryCleaningAfter(Duration historyCleaningAfter) {
this.historyCleaningAfter = historyCleaningAfter;
}
public int getHistoryCleaningBatchSize() {
return historyCleaningBatchSize;
}
public void setHistoryCleaningBatchSize(int historyCleaningBatchSize) {
... | 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 |
请在Spring Boot框架中完成以下Java代码 | public Person save(Person person) {
Person p = personRepository.save(person);
try {
// 新开事务 独立回滚
selfProxyPersonService.delete();
} catch (Exception e) {
e.printStackTrace();
}
try {
// 使用当前事务 全部回滚
selfProxyPersonService... | return p;
}
@Transactional
public void save2(Person person) {
personRepository.save(person);
throw new RuntimeException();
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void delete() {
personRepository.delete(1L);
throw new RuntimeException();
... | repos\spring-boot-student-master\spring-boot-student-data-jpa-transaction\src\main\java\com\xiaolyuh\service\PersonServiceImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class DistributionWarehouseService
{
@NonNull private final IWarehouseBL warehouseBL = Services.get(IWarehouseBL.class);
@NonNull private final WorkplaceService workplaceService;
@NonNull private final TrolleyService trolleyService;
@NonNull private final LocatorScannedCodeResolverService locatorScannedCodeR... | {
final I_M_Locator locator = warehouseBL.getLocatorByRepoId(locatorRepoId);
final LocatorId locatorId = LocatorId.ofRepoId(locator.getM_Warehouse_ID(), locator.getM_Locator_ID());
return LocatorInfo.builder()
.locatorId(locatorId)
.qrCode(LocatorQRCode.ofLocator(locator))
.caption(locator.getValue())... | repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\external_services\warehouse\DistributionWarehouseService.java | 2 |
请完成以下Spring Boot application配置 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/jpatest
spring.datasource.username=root
spring.datasource.password=sang
spring.jpa.hibernate.d | dl-auto=update
spring.jpa.show-sql=true
spring.jackson.serialization.indent_output=true | repos\JavaEETest-master\Test22-JPA\src\main\resources\application.properties | 2 |
请在Spring Boot框架中完成以下Java代码 | public JsonDailyReport postDailyReport(@RequestBody @NonNull final JsonDailyReportRequest request)
{
final JsonDailyReportItemRequest requestItem = extractRequestItem(request);
final User user = loginService.getLoggedInUser();
final BPartner bpartner = user.getBpartner();
final Contracts contracts = contractsS... | final List<JsonDailyReportItemRequest> requestItems = request.getItems();
if (requestItems.isEmpty())
{
throw new BadRequestException("No request items mentioned");
}
else if (requestItems.size() != 1)
{
throw new BadRequestException("Only one item is allowed");
}
else
{
return requestItems.get... | repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\rest\dailyReport\DailyReportRestController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getBatchSearchKey() {
return batchSearchKey;
}
@Override
public void setBatchSearchKey(String batchSearchKey) {
this.batchSearchKey = batchSearchKey;
}
@Override
public String getBatchSearchKey2() {
return batchSearchKey2;
}
@Override
public v... | return null;
}
@Override
public void setBatchDocumentJson(String batchDocumentJson, String engineType) {
this.batchDocRefId = setByteArrayRef(this.batchDocRefId, BATCH_DOCUMENT_JSON_LABEL, batchDocumentJson, engineType);
}
@Override
public String getTenantId() {
return tenantId... | repos\flowable-engine-main\modules\flowable-batch-service\src\main\java\org\flowable\batch\service\impl\persistence\entity\BatchEntityImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public long findHistoryJobCountByQueryCriteria(HistoryJobQueryImpl jobQuery) {
return (Long) getDbSqlSession().selectOne("selectHistoryJobCountByQueryCriteria", jobQuery);
}
@Override
public void updateJobTenantIdForDeployment(String deploymentId, String newTenantId) {
HashMap<String, Objec... | bulkUpdateEntities("updateHistoryJobLocks", params, "historyJobs", historyJobs);
}
@Override
public void resetExpiredJob(String jobId) {
Map<String, Object> params = new HashMap<>(2);
params.put("id", jobId);
getDbSqlSession().directUpdate("resetExpiredHistoryJob", params);
}
... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\persistence\entity\data\impl\MybatisHistoryJobDataManager.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class QueryResultPage<T>
{
@NonNull
PageDescriptor currentPageDescriptor;
@Nullable
PageDescriptor nextPageDescriptor;
/** Number of all items that are part of the selection which this page is a part of. */
int totalSize;
/** Point in time when the selection was done */
@NonNull
Instant resultTimesta... | return new QueryResultPage<>(currentPageDescriptor, nextPageDescriptor, totalSize, resultTimestamp, mappedItems);
}
public <R> QueryResultPage<R> mapAllTo(@NonNull final Function<ImmutableList<T>, ImmutableList<R>> mapper)
{
return withItems(mapper.apply(getItems()));
}
public <R> QueryResultPage<R> withItems(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\dao\selection\pagination\QueryResultPage.java | 2 |
请完成以下Java代码 | public final class SyncUUIDs
{
private SyncUUIDs()
{
}
public static String toUUIDString(final I_C_BPartner bpartner)
{
return UUIDs.fromIdAsString(bpartner.getC_BPartner_ID());
}
public static int getC_BPartner_ID(final String uuid)
{
return UUIDs.toId(uuid);
}
public static String toUUIDString(final ... | public static int getC_Flatrate_Term_ID(final String uuid)
{
return UUIDs.toId(uuid);
}
public static String toUUIDString(final I_C_RfQResponseLine rfqResponseLine)
{
return toC_RfQReponseLine_UUID(rfqResponseLine.getC_RfQResponseLine_ID());
}
public static String toC_RfQReponseLine_UUID(final int C_RfQResp... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\impl\SyncUUIDs.java | 1 |
请完成以下Java代码 | public static class Section {
private String activityTitle;
private String activitySubtitle;
private String activityImage;
private List<Fact> facts;
private boolean markdown;
@Data
public static class Fact {
private final String name;
priv... | }
@Data
public static class Action {
@JsonProperty("@type")
private final String type; // HttpPOST
private final String name;
private final String target; // url
}
@Data
public static class Target {
private final Strin... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\notification\channels\TeamsMessageCard.java | 1 |
请完成以下Spring Boot application配置 | quarkus.http.root-path=/api
quarkus.load-shedding.enabled=true
quarkus.load-shedding.max-limit=10
quarkus.load-shedding.initial-limit=5
quarkus.load-shedding.priority.enabled=true
quarkus.load-shedding. | probe-factor=70
quarkus.load-shedding.alpha-factor=1
quarkus.load-shedding.beta-factor=5 | repos\tutorials-master\quarkus-modules\quarkus-extension\quarkus-load-shedding\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public LookupValuesPage retrieveEntities(final LookupDataSourceContext evalCtx)
{
final LookupValueFilterPredicate filter = evalCtx.getFilterPredicate();
final int limit = evalCtx.getLimit(Integer.MAX_VALUE);
final int offset = evalCtx.getOffset(0);
return attributeValuesProvider.getAvailableValues(evalCtx)
... | final AttributeId attributeId = defaultAttributeValuesProvider.getAttributeId();
return SqlForFetchingLookupById.builder()
.keyColumnNameFQ(ColumnNameFQ.ofTableAndColumnName(I_M_AttributeValue.Table_Name, I_M_AttributeValue.COLUMNNAME_Value))
.numericKey(false)
.displayColumn(ConstantStringExpression... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pattribute\ASILookupDescriptor.java | 1 |
请完成以下Java代码 | public Optional<LocatorInfo> getSingleDropToLocator()
{
return lines.stream()
.map(DistributionJobLine::getDropToLocator)
.distinct()
.collect(GuavaCollectors.singleElementOrEmpty());
}
@Nullable
public ProductId getSingleProductIdOrNull()
{
return lines.stream()
.map(DistributionJobLine::getP... | .map(DistributionJobLine::getQtyToMove)
.distinct()
.collect(MixedQuantity.collectAndSum());
return qty.toNoneOrSingleValue().orElse(null);
}
public Optional<DistributionJobLineId> getNextEligiblePickFromLineId(@NonNull final ProductId productId)
{
return lines.stream()
.filter(line -> ProductId.eq... | repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\job\model\DistributionJob.java | 1 |
请完成以下Java代码 | public Class<I_I_BPartner> getImportModelClass()
{
return I_I_BPartner.class;
}
@Override
public String getImportTableName()
{
return I_I_BPartner.Table_Name;
}
@Override
protected String getImportOrderBySql()
{
// gody: 20070113 - Order so the same values are consecutive.
return I_I_BPartner.COLUMNN... | + ", " + I_I_BPartner.COLUMNNAME_GlobalId
+ ", " + I_I_BPartner.COLUMNNAME_I_BPartner_ID;
}
@Override
protected String getTargetTableName()
{
return I_C_BPartner.Table_Name;
}
@Override
public I_I_BPartner retrieveImportRecord(final Properties ctx, final ResultSet rs) throws SQLException
{
return new ... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\bpartner\impexp\BPartnerImportProcess.java | 1 |
请完成以下Java代码 | public class SubmitTaskFormCmd implements Command<VariableMap>, Serializable {
private static final long serialVersionUID = 1L;
protected String taskId;
protected VariableMap properties;
// only fetch variables if they are actually requested;
// this avoids unnecessary loading of variables
protected bool... | // complete or resolve the task
if (DelegationState.PENDING.equals(task.getDelegationState())) {
task.resolve();
task.logUserOperation(UserOperationLogEntry.OPERATION_TYPE_RESOLVE);
task.triggerUpdateEvent();
} else {
task.logUserOperation(UserOperationLogEntry.OPERATION_TYPE_COMPLETE);
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\SubmitTaskFormCmd.java | 1 |
请完成以下Java代码 | private boolean isValidVerificationRequest(final @NonNull IProcessPreconditionsContext context)
{
final InvoiceVerificationRunStatus currentStatus = getInvoiceVerificationRunStatus(context);
return InvoiceVerificationRunStatus.Planned.equals(currentStatus);
}
@Override
protected String doIt() throws Exception
... | .addOnlyActiveRecordsFilter()
.filter(context.getQueryFilter(I_C_Invoice_Verification_Run.class))
.create().firstOnly(I_C_Invoice_Verification_Run.class), "C_Invoice_Verification_Run with ID {} not found", context.getSingleSelectedRecordId());
return Check.isBlank(run.getStatus()) ? InvoiceVerificationRunStat... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\process\C_Invoice_Verification_Run_Execute.java | 1 |
请完成以下Java代码 | private List<Optional<? extends AbstractTsKvEntity>> findAllAndAggregateAsync(EntityId entityId, String key, long startTs, long endTs, long timeBucket, Aggregation aggregation) {
long interval = endTs - startTs;
long remainingPart = interval % timeBucket;
List<TimescaleTsKvEntity> timescaleTsKvE... | }
});
return result;
} else {
return Collections.emptyList();
}
}
private List<TimescaleTsKvEntity> switchAggregation(String key, long startTs, long endTs, long timeBucket, Aggregation aggregation, UUID entityId) {
Integer keyId = keyDictionaryDao.get... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sqlts\timescale\TimescaleTimeseriesDao.java | 1 |
请完成以下Java代码 | public Optional<String> getStrValue() {
return kv.getStrValue();
}
@Override
public Optional<Long> getLongValue() {
return kv.getLongValue();
}
@Override
public Optional<Boolean> getBooleanValue() {
return kv.getBooleanValue();
}
@Override
public Optional<D... | }
@Override
public int getDataPoints() {
int length;
switch (getDataType()) {
case STRING:
length = getStrValue().get().length();
break;
case JSON:
length = getJsonValue().get().length();
break;
... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\kv\BasicTsKvEntry.java | 1 |
请完成以下Java代码 | private static ExistingLockInfo toExistingLockInfo(@NonNull final LockInfo lockInfo, @NonNull final TableRecordReference tableRecordReference)
{
return ExistingLockInfo.builder()
.ownerName(lockInfo.getLockOwner().getOwnerName())
.lockedRecord(tableRecordReference)
.allowMultipleOwners(lockInfo.isAllowMu... | final RecordLocks recordLocks = locks.get(lockKey);
if (recordLocks == null)
{
continue;
}
for (final LockInfo lockInfo : recordLocks.getLocks())
{
result.put(recordRef, toExistingLockInfo(lockInfo, recordRef));
}
}
return result.build();
}
}
@Value(staticConstructor = "o... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\lock\spi\impl\PlainLockDatabase.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Authentication convert(HttpServletRequest request) {
RequestMatcher.MatchResult result = this.requestMatcher.matcher(request);
if (!result.isMatch()) {
return null;
}
String registrationId = result.getVariables().get("registrationId");
ClientRegistration clientRegistration = this.clientRegistrationR... | }
return new OidcLogoutAuthenticationToken(logoutToken, clientRegistration);
}
/**
* The logout endpoint. Defaults to
* {@code /logout/connect/back-channel/{registrationId}}.
* @param requestMatcher the {@link RequestMatcher} to use
*/
void setRequestMatcher(RequestMatcher requestMatcher) {
Assert.notNu... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\oauth2\client\OidcLogoutAuthenticationConverter.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private Mono<String> getTokenKey(Token token) {
String keyId = token.getKeyId();
String cached = this.cachedTokenKeys.get(keyId);
if (cached != null) {
return Mono.just(cached);
}
return this.securityService.fetchTokenKeys()
.doOnSuccess(this::cacheTokenKeys)
.filter((tokenKeys) -> tokenKeys.contains... | X509EncodedKeySpec keySpec = new X509EncodedKeySpec(bytes);
return KeyFactory.getInstance("RSA").generatePublic(keySpec);
}
private Mono<Void> validateExpiry(Token token) {
long currentTime = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());
if (currentTime > token.getExpiry()) {
return Mono.erro... | repos\spring-boot-4.0.1\module\spring-boot-cloudfoundry\src\main\java\org\springframework\boot\cloudfoundry\autoconfigure\actuate\endpoint\reactive\TokenValidator.java | 2 |
请完成以下Java代码 | public BigDecimal getApprovalAmt()
{
return getStatementDifference();
} // getApprovalAmt
/**
* Get Currency
*
* @return Currency
*/
@Override
public int getC_Currency_ID()
{
return getCashBook().getC_Currency_ID();
} // getC_Currency_ID | /**
* Document Status is Complete or Closed
*
* @return true if CO, CL or RE
*/
public boolean isComplete()
{
String ds = getDocStatus();
return DOCSTATUS_Completed.equals(ds)
|| DOCSTATUS_Closed.equals(ds)
|| DOCSTATUS_Reversed.equals(ds);
} // isComplete
} // MCash | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MCash.java | 1 |
请完成以下Java代码 | public boolean verifyAllEqualUsingFrequency(List<String> list) {
return list.isEmpty() || Collections.frequency(list, list.get(0)) == list.size();
}
public boolean verifyAllEqualUsingStream(List<String> list) {
return list.stream()
.distinct()
.count() <= 1;
}
p... | public boolean apply(String s) {
return s.equals(list.get(0));
}
});
}
public boolean verifyAllEqualUsingApacheCommon(List<String> list) {
return IterableUtils.matchesAll(list, new org.apache.commons.collections4.Predicate<String>() {
public boolean evalu... | repos\tutorials-master\core-java-modules\core-java-collections-list-3\src\main\java\com\baeldung\allequalelements\VerifyAllEqualListElements.java | 1 |
请完成以下Java代码 | public class TbMsgToEmailNode implements TbNode {
private static final String IMAGES = "images";
private static final String DYNAMIC = "dynamic";
private TbMsgToEmailNodeConfiguration config;
private boolean dynamicMailBodyType;
@Override
public void init(TbContext ctx, TbNodeConfiguration co... | builder.cc(fromTemplate(config.getCcTemplate(), msg));
builder.bcc(fromTemplate(config.getBccTemplate(), msg));
String htmlStr = dynamicMailBodyType ?
fromTemplate(config.getIsHtmlTemplate(), msg) : config.getMailBodyType();
builder.html(Boolean.parseBoolean(htmlStr));
bu... | repos\thingsboard-master\rule-engine\rule-engine-components\src\main\java\org\thingsboard\rule\engine\mail\TbMsgToEmailNode.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String deals() {
log.info("Client is requesting new deals!");
List<TravelDeal> travelDealList = travelDealRepository.findAll();
if (!travelDealList.isEmpty()) {
int randomDeal = new Random().nextInt(travelDealList.size());
return travelDealList.get(randomDeal)
... | StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Host: ")
.append(InetAddress.getLocalHost()
.getHostName())
.append("<br/>");
stringBuilder.append("IP: ")
.append(InetAddress.getLocalHost()
.getHostAddress())
... | repos\tutorials-master\spring-cloud-modules\spring-cloud-kubernetes\kubernetes-guide\travel-agency-service\src\main\java\com\baeldung\spring\cloud\kubernetes\travelagency\controller\TravelAgencyController.java | 2 |
请完成以下Java代码 | private static void cleanupModifier(StringBuffer result, String modifier) {
Matcher m = FUZZY_MODIFIDER.matcher(modifier);
if (m.matches()) {
modifier = m.group(1);
}
for (int i = 0; i < modifier.length(); i++) {
char c = modifier.charAt(i);
if ((c >= ... | dbf.setNamespaceAware(true);
}
DocumentBuilder db = dbf.newDocumentBuilder();
return db.parse(url.toString());
}
protected static void copyInputStream(InputStream in, OutputStream out) throws Exception {
byte[] buffer = new byte[4096];
int len = in.read(buffer);
... | repos\flowable-engine-main\modules\flowable-osgi\src\main\java\org\flowable\osgi\BpmnTransformer.java | 1 |
请完成以下Java代码 | public long getTotalSpace() throws IOException {
return 0;
}
@Override
public long getUsableSpace() throws IOException {
return 0;
}
@Override
public long getUnallocatedSpace() throws IOException {
return 0;
}
@Override
public boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) ... | @Override
public Object getAttribute(String attribute) throws IOException {
try {
return getJarPathFileStore().getAttribute(attribute);
}
catch (UncheckedIOException ex) {
throw ex.getCause();
}
}
protected FileStore getJarPathFileStore() {
try {
return Files.getFileStore(this.fileSystem.getJarPa... | repos\spring-boot-4.0.1\loader\spring-boot-loader\src\main\java\org\springframework\boot\loader\nio\file\NestedFileStore.java | 1 |
请完成以下Java代码 | protected void waitBeforeRetry(long waitTime) {
try {
Thread.sleep(waitTime);
} catch (InterruptedException e) {
log.debug("I am interrupted while waiting for a retry.");
}
}
public void setNumOfRetries(int numOfRetries) {
this.numOfRetries = numOfRetries... | this.waitTimeInMs = waitTimeInMs;
}
public int getNumOfRetries() {
return numOfRetries;
}
public int getWaitIncreaseFactor() {
return waitIncreaseFactor;
}
public int getWaitTimeInMs() {
return waitTimeInMs;
}
} | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\interceptor\RetryInterceptor.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 getIsbn() {
return isbn;
}
public void ... | }
public void setPages(int pages) {
this.pages = pages;
}
public List<Chapter> getChapters() {
return chapters;
}
public void setChapters(List<Chapter> chapters) {
this.chapters = chapters;
}
} | repos\Hibernate-SpringBoot-master\HibernateSpringBootDatabaseTriggers\src\main\java\com\bookstore\entity\Book.java | 1 |
请完成以下Java代码 | private Collection<String> getTrxNamesForCurrentThread()
{
return getTrxNamesForThreadId(Thread.currentThread().getId());
}
private Collection<String> getTrxNamesForThreadId(final long threadId)
{
synchronized (threadId2TrxName)
{
Collection<String> trxNames = threadId2TrxName.get(threadId);
if (trxNam... | {
final StringBuilder msgSB = new StringBuilder();
msgSB.append(">>> Stacktrace at trx creation, commit or rollback:\n");
msgSB.append(beginStacktrace);
msgSB.append(">>> Current stacktrace of the creating thread:\n");
if (thread.isAlive())
{
msgSB.append(mkStacktrace(thread));
}
else
{
msgSB.ap... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\util\trxConstraints\api\impl\OpenTrxBL.java | 1 |
请完成以下Java代码 | public int getAD_Task_ID()
{
return AD_Task_ID;
}
public void setAD_Task_ID(int aD_Task_ID)
{
AD_Task_ID = aD_Task_ID;
}
public int getWEBUI_Board_ID()
{
return WEBUI_Board_ID;
}
public void setWEBUI_Board_ID(final int WEBUI_Board_ID)
{
this.WEBUI_Board_ID = WEBUI_Board_ID;
}
public void setIsCr... | public void setWEBUI_NameNew(final String webuiNameNew)
{
this.webuiNameNew = webuiNameNew;
}
public String getWEBUI_NameNew()
{
return webuiNameNew;
}
public void setWEBUI_NameNewBreadcrumb(final String webuiNameNewBreadcrumb)
{
this.webuiNameNewBreadcrumb = webuiNameNewBreadcrumb;
}
public String ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MTreeNode.java | 1 |
请完成以下Java代码 | private void copyHUAttribute(final I_M_HU_Attribute oldHUAttribute)
{
final HuId oldHUId = HuId.ofRepoId(oldHUAttribute.getM_HU_ID());
final HuId newHUId = old2new_M_HU_ID.get(oldHUId);
if (newHUId == null)
{
throw new AdempiereException("HU was not already cloned for " + oldHUId);
}
final I_M_HU_Attri... | final I_M_HU_Storage newHUStorage = InterfaceWrapperHelper.newInstance(I_M_HU_Storage.class);
InterfaceWrapperHelper.copyValues(oldHUStorage, newHUStorage);
newHUStorage.setM_HU_ID(newHUId.getRepoId());
InterfaceWrapperHelper.save(newHUStorage);
}
private void copyHUItemStorage(final I_M_HU_Item_Storage oldHUI... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\CopyHUsCommand.java | 1 |
请完成以下Java代码 | public void setSubscriptionInfo (int AD_User_ID)
{
m_AD_User_ID = AD_User_ID;
m_ci = MContactInterest.get(getCtx(), getR_InterestArea_ID(), AD_User_ID,
false, get_TrxName());
} // setSubscription
/**
* Set AD_User_ID
* @param AD_User_ID user
*/
public void setAD_User_ID (int AD_User_ID)
{
m_AD_Us... | return m_ci.getSubscribeDate();
return null;
}
/**
* Get Opt Out Date
* @return opt-out date
*/
public Timestamp getOptOutDate ()
{
if (m_ci != null)
return m_ci.getOptOutDate();
return null;
}
/**
* Is Subscribed
* @return true if sunscribed
*/
public boolean isSubscribed()
{
if (m_A... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MInterestArea.java | 1 |
请完成以下Java代码 | public class ClusterAppFullAssignRequest {
private List<ClusterAppAssignMap> clusterMap;
private Set<String> remainingList;
public List<ClusterAppAssignMap> getClusterMap() {
return clusterMap;
}
public ClusterAppFullAssignRequest setClusterMap(
List<ClusterAppAssignMap> clusterMa... | return remainingList;
}
public ClusterAppFullAssignRequest setRemainingList(Set<String> remainingList) {
this.remainingList = remainingList;
return this;
}
@Override
public String toString() {
return "ClusterAppFullAssignRequest{" +
"clusterMap=" + clusterMap +
... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\domain\cluster\ClusterAppFullAssignRequest.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ShiroConfig {
@Bean
public Realm realm() {
// 创建 SimpleAccountRealm 对象
SimpleAccountRealm realm = new SimpleAccountRealm();
// 添加两个用户。参数分别是 username、password、roles 。
realm.addAccount("admin", "admin", "ADMIN");
realm.addAccount("normal", "normal", "NORMAL");... | // 设置 URL 的权限配置
filterFactoryBean.setFilterChainDefinitionMap(this.filterChainDefinitionMap());
return filterFactoryBean;
}
private Map<String, String> filterChainDefinitionMap() {
Map<String, String> filterMap = new LinkedHashMap<>(); // 注意要使用有序的 LinkedHashMap ,顺序匹配
filterMap.... | repos\SpringBoot-Labs-master\lab-33\lab-33-shiro-demo\src\main\java\cn\iocoder\springboot\lab01\shirodemo\config\ShiroConfig.java | 2 |
请完成以下Java代码 | public String getScopeId() {
return null;
}
@Override
public String getSubScopeId() {
return null;
}
@Override
public String getScopeType() {
return null;
}
@Override
public String getScopeDefinitionId() {
return null;
}
@Override
p... | sb.append(", type=").append(type);
if (userId != null) {
sb.append(", userId=").append(userId);
}
if (groupId != null) {
sb.append(", groupId=").append(groupId);
}
if (taskId != null) {
sb.append(", taskId=").append(taskId);
}
i... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\IdentityLinkEntity.java | 1 |
请完成以下Java代码 | public final void setRabbitOperations(RabbitOperations rabbitOperations) {
this.rabbitOperations = rabbitOperations;
}
/**
* @return The {@link RabbitOperations} for the gateway.
*/
public final @Nullable RabbitOperations getRabbitOperations() {
return this.rabbitOperations;
}
@Override
public final voi... | try {
initGateway();
}
catch (Exception ex) {
throw new BeanInitializationException("Initialization of Rabbit gateway failed: " + ex.getMessage(), ex);
}
}
/**
* Subclasses can override this for custom initialization behavior.
* Gets called after population of this instance's bean properties.
*/
p... | repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\core\RabbitGatewaySupport.java | 1 |
请完成以下Java代码 | public void setInstrForDbtrAgt(String value) {
this.instrForDbtrAgt = value;
}
/**
* Gets the value of the purp property.
*
* @return
* possible object is
* {@link Purpose2CHCode }
*
*/
public Purpose2CHCode getPurp() {
return purp;
}
... | *
* <p>
* Objects of the following type(s) are allowed in the list
* {@link RegulatoryReporting3 }
*
*
*/
public List<RegulatoryReporting3> getRgltryRptg() {
if (rgltryRptg == null) {
rgltryRptg = new ArrayList<RegulatoryReporting3>();
}
return th... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\CreditTransferTransactionInformation10CH.java | 1 |
请完成以下Java代码 | public int getAD_Replication_Run_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Replication_Run_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
s... | Object oo = get_Value(COLUMNNAME_IsReplicated);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Valu... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Replication_Run.java | 1 |
请完成以下Java代码 | public static TargetRecordAction ofRecordAndWindow(@NonNull final TableRecordReference record, @NonNull final AdWindowId adWindowId)
{
return builder().record(record).adWindowId(Optional.of(adWindowId)).build();
}
public static TargetRecordAction of(@NonNull final String tableName, final int recordId)
{
... | @lombok.Value
@lombok.Builder
public static class TargetViewAction implements TargetAction
{
public static TargetViewAction cast(final TargetAction targetAction)
{
return (TargetViewAction)targetAction;
}
@Nullable
AdWindowId adWindowId;
@NonNull
String viewId;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\notification\UserNotificationRequest.java | 1 |
请完成以下Java代码 | private IAllocationResult createAllocationResult(
final IAllocationRequest request,
final IAllocationRequest requestActual,
final boolean outTrx)
{
final IHUTransactionCandidate trx = createHUTransaction(requestActual, outTrx);
return AllocationUtils.createQtyAllocationResult(
request.getQty(), ... | }
private I_M_HU_Item getVHU_Item()
{
// TODO: implement: get VHU Item or create it
return huItem;
}
public Object getReferenceModel()
{
return referenceModel;
}
@Override
public List<IPair<IAllocationRequest, IAllocationResult>> unloadAll(final IHUContext huContext)
{
final IAllocationRequest reque... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\AbstractAllocationSourceDestination.java | 1 |
请完成以下Java代码 | public int getTaskHeight() {
return taskHeight;
}
public void setTaskHeight(int taskHeight) {
this.taskHeight = taskHeight;
}
public int getSubProcessMargin() {
return subProcessMargin;
}
public void setSubProcessMargin(int subProcessMargin) {
this.subProcessMa... | // Due to a bug (see
// http://forum.jgraph.com/questions/5952/mxhierarchicallayout-not-correct-when-using-child-vertex)
// We must extend the default hierarchical layout to tweak it a bit (see url
// link) otherwise the layouting crashes.
//
// Verify again with a later release if fixed (ie the mxH... | repos\Activiti-develop\activiti-core\activiti-bpmn-layout\src\main\java\org\activiti\bpmn\BpmnAutoLayout.java | 1 |
请完成以下Java代码 | public class OverloadingErrors<T extends Serializable> {
public void print() {
System.out.println("Signature is: print()");
}
/*
// Uncommenting this method will lead to a compilation error: java: method print() is already defined in class
// The method signature is independent from return... | }
/*
// Uncommenting this method will lead to a compilation error: java: method print(int) is already defined in class
// The method signature is independent from parameter names
public void print(int anotherParameter) {
System.out.println("Signature is: print(int)");
}
*/
public v... | repos\tutorials-master\core-java-modules\core-java-lang-oop-methods-2\src\main\java\com\baeldung\signature\OverloadingErrors.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public int getX() {
return x;
}
@Override
public void setX(int x) {
this.x = x;
}
@Override
public int getY() {
return y;
... | }
@Override
public void setWidth(int width) {
this.width = width;
}
@Override
public int getHeight() {
return height;
}
@Override
public void setHeight(int height) {
this.height = height;
}
} | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\pvm\process\ParticipantProcess.java | 1 |
请完成以下Java代码 | public List<String> getKey()
{
return key;
}
public int[] getValue()
{
return value;
}
public void setValue(int[] value)
{
this.value = value;
}
public void setKey(List<String> key)
{
this.key = key;
}
public int[] getCheck()
{
... | }
public void setBase(int[] base)
{
this.base = base;
}
public int[] getLength()
{
return length;
}
public void setLength(int[] length)
{
this.length = length;
}
public void setSize(int size)
{
this.size = size;
}
} | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\crf\crfpp\DoubleArrayTrieInteger.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static class SpringBootDataGemFireSecuritySslEnvironmentPostProcessorEnabled { }
@Conditional(SslTriggersCondition.class)
static class AnySslTriggerCondition { }
}
static class SslTriggersCondition extends AnyNestedCondition {
public SslTriggersCondition() {
super(ConfigurationPhase.PARSE_CONFIGURATION);... | @ConditionalOnProperty({ GEMFIRE_SSL_KEYSTORE_PROPERTY, GEMFIRE_SSL_TRUSTSTORE_PROPERTY })
static class ApacheGeodeSslKeyStoreAndTruststorePropertiesSet { }
}
static class TrustedKeyStoreIsPresentCondition implements Condition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\SslAutoConfiguration.java | 2 |
请完成以下Java代码 | abstract class PaymentsToReconcileViewBasedProcess extends ViewBasedProcessTemplate implements IProcessPrecondition
{
@Override
protected abstract ProcessPreconditionsResolution checkPreconditionsApplicable();
@Override
protected final PaymentsToReconcileView getView()
{
return PaymentsToReconcileView.cast(supe... | protected final BankStatementReconciliationView getBanksStatementReconciliationView()
{
final ViewId bankStatementViewId = getBanksStatementReconciliationViewId();
final IViewsRepository viewsRepo = getViewsRepo();
return BankStatementReconciliationView.cast(viewsRepo.getView(bankStatementViewId));
}
protect... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\bankstatement_reconciliation\process\PaymentsToReconcileViewBasedProcess.java | 1 |
请完成以下Java代码 | public Attachment createAttachment(String attachmentType, String taskId, String processInstanceId, String attachmentName, String attachmentDescription, String url) {
return commandExecutor.execute(new CreateAttachmentCmd(attachmentType, taskId, processInstanceId, attachmentName, attachmentDescription, null, url));
... | public List<Task> getSubTasks(String parentTaskId) {
return commandExecutor.execute(new GetSubTasksCmd(parentTaskId));
}
public TaskReport createTaskReport() {
return new TaskReportImpl(commandExecutor);
}
@Override
public void handleBpmnError(String taskId, String errorCode) {
commandExecutor.e... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\TaskServiceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserServiceImpl implements UserService {
@Autowired
private UserDao userDao;
@Override
public List<User> getByMap(Map<String, Object> map) {
return userDao.getByMap(map);
}
@Override
public User getById(Integer id) {
return userDao.getById(id);
}
@Over... | @Override
public User update(User user) {
userDao.update(user);
return user;
}
@Override
public int delete(Integer id) {
return userDao.delete(id);
}
@Override
public User getByUserName(String userName) {
return userDao.getByUserName(userName);
}
} | repos\springBoot-master\springboot-dubbo\abel-user-provider\src\main\java\cn\abel\user\service\impl\UserServiceImpl.java | 2 |
请完成以下Java代码 | public void setFirstBackoff(Duration firstBackoff) {
this.firstBackoff = firstBackoff;
}
public @Nullable Duration getMaxBackoff() {
return maxBackoff;
}
public void setMaxBackoff(Duration maxBackoff) {
this.maxBackoff = maxBackoff;
}
public int getFactor() {
return factor;
}
public void... | private double randomFactor = 0.5;
public void validate() {
Assert.isTrue(randomFactor >= 0 && randomFactor <= 1,
"random factor must be between 0 and 1 (default 0.5)");
}
public JitterConfig() {
}
public JitterConfig(double randomFactor) {
this.randomFactor = randomFactor;
}
public double ... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\RetryGatewayFilterFactory.java | 1 |
请完成以下Spring Boot application配置 | spring.datasource.url=jdbc:mysql://localhost:3306/bookstoredb?createDatabaseIfNotExist=true
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=create
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
spring.jpa.properties.o... | pecifying schema
# for MySQL
# spring.jpa.properties.org.hibernate.envers.default_catalog=... (e.g., bookstoredb)
# for non-MySQL
#spring.jpa.properties.org.hibernate.envers.default_schema=... | repos\Hibernate-SpringBoot-master\HibernateSpringBootEnvers\src\main\resources\application.properties | 2 |
请在Spring Boot框架中完成以下Java代码 | public List<TimerJobEntity> findJobsByTypeAndProcessDefinitionKeyAndTenantId(String jobHandlerType, String processDefinitionKey, String tenantId) {
Map<String, String> params = new HashMap<>(3);
params.put("handlerType", jobHandlerType);
params.put("processDefinitionKey", processDefinitionKey);
... | Map<String, Object> params = new HashMap<>(3);
params.put("lockOwner", lockOwner);
params.put("lockExpirationTime", lockExpirationTime);
bulkUpdateEntities("updateTimerJobLocks", params, "timerJobs", timerJobEntities);
}
@Override
public void bulkDeleteWithoutRevision(List<TimerJob... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\persistence\entity\data\impl\MybatisTimerJobDataManager.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public List<BatchPart> findBatchPartsByBatchId(String batchId) {
HashMap<String, Object> params = new HashMap<>();
params.put("batchId", batchId);
return getDbSqlSession().selectList("selectBatchPartsByBatchId", params);
}
@Override
@SuppressWarnings("unchecked")
pu... | @SuppressWarnings("unchecked")
public List<BatchPart> findBatchPartsByQueryCriteria(BatchPartQueryImpl batchPartQuery) {
return getDbSqlSession().selectList("selectBatchPartsByQueryCriteria", batchPartQuery, getManagedEntityClass());
}
@Override
public long findBatchPartCountByQueryCriteria(Bat... | repos\flowable-engine-main\modules\flowable-batch-service\src\main\java\org\flowable\batch\service\impl\persistence\entity\data\impl\MybatisBatchPartDataManager.java | 2 |
请完成以下Java代码 | private void doCommit() {
try {
transactionManager.commit();
} catch (HeuristicMixedException e) {
throw new TransactionException("Unable to commit transaction", e);
} catch (HeuristicRollbackException e) {
throw new TransactionException("Unable to commit tran... | rollbackEx = e;
throw e;
} finally {
if (rollbackEx != null && originalException != null) {
LOGGER.error("Error when rolling back transaction, original exception was:", originalException);
}
}
}
private static class TransactionException extend... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\interceptor\JtaTransactionInterceptor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Duration getDuration() {
return duration;
}
/**
* Sets the value of the duration property.
*
* @param value
* allowed object is
* {@link Duration }
*
*/
public void setDuration(Duration value) {
this.duration = value;
}
/**
... | /**
* A free-text comment for the payment conditions.
*
* @return
* possible object is
* {@link String }
*
*/
public String getComment() {
return comment;
}
/**
* Sets the value of the comment property.
*
* @param value
* all... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\PaymentConditionsType.java | 2 |
请完成以下Java代码 | public boolean equals(Object o) {
if (this == o) { return true; }
if (o == null || getClass() != o.getClass()) { return false; }
ApiDefinitionEntity entity = (ApiDefinitionEntity) o;
return Objects.equals(id, entity.id) &&
Objects.equals(app, entity.app) &&
... | return Objects.hash(id, app, ip, port, gmtCreate, gmtModified, apiName, predicateItems);
}
@Override
public String toString() {
return "ApiDefinitionEntity{" +
"id=" + id +
", app='" + app + '\'' +
", ip='" + ip + '\'' +
", port=" + po... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\datasource\entity\gateway\ApiDefinitionEntity.java | 1 |
请完成以下Java代码 | public void submitAcquiredJobs(String engineName, AcquiredJobs acquiredJobs) {
acquiredJobsByEngine.put(engineName, acquiredJobs);
}
public void submitAdditionalJobBatch(String engineName, List<String> jobIds) {
CollectionUtil.addToMapOfLists(additionalJobBatchesByEngine, engineName, jobIds);
}
public... | * Jobs that were rejected from execution in the acquisition cycle
* due to lacking execution resources.
* With an execution thread pool, these jobs could not be submitted due to
* saturation of the underlying job queue.
*/
public Map<String, List<List<String>>> getRejectedJobsByEngine() {
return rejec... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\JobAcquisitionContext.java | 1 |
请完成以下Java代码 | public Set<Entry<String, Object>> entrySet() {
Set<String> attrNames = keySet();
Set<Entry<String, Object>> entries = new HashSet<>(attrNames.size());
for (String attrName : attrNames) {
Object value = this.session.getAttribute(attrName);
entries.add(new AbstractMap.SimpleEntry<>(attrName, value));
... | @Override
public int size() {
return SpringSessionMap.this.size();
}
@Override
public boolean isEmpty() {
return SpringSessionMap.this.isEmpty();
}
@Override
public void clear() {
SpringSessionMap.this.clear();
}
@Override
public boolean contains(Object v) {
return Sprin... | repos\spring-session-main\spring-session-core\src\main\java\org\springframework\session\web\server\session\SpringSessionWebSessionStore.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MatchInv
{
@NonNull MatchInvId id;
@NonNull InvoiceAndLineId invoiceAndLineId;
@NonNull InOutAndLineId inoutLineId;
@NonNull ClientAndOrgId clientAndOrgId;
@NonNull SOTrx soTrx;
@NonNull Instant dateTrx;
@NonNull Instant dateAcct;
boolean posted;
@NonNull UserId updatedByUserId;
@NonNull Produ... | this.type = type;
if (type.isCost())
{
this.costPart = Check.assumeNotNull(costPart, "costPart shall be provided for Cost matching type");
}
else
{
this.costPart = null;
}
}
public InvoiceId getInvoiceId() {return invoiceAndLineId.getInvoiceId();}
public InOutId getInOutId() {return inoutLineId.... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\matchinv\MatchInv.java | 2 |
请完成以下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 getGenre() {
return genre;
}
public void setG... | public void setAge(int age) {
this.age = age;
}
public List<Book> getBooks() {
return books;
}
public void setBooks(List<Book> books) {
this.books = books;
}
@Override
public String toString() {
return "Author{" + "id=" + id + ", name=" + name
... | repos\Hibernate-SpringBoot-master\HibernateSpringBootAudit\src\main\java\com\bookstore\entity\Author.java | 1 |
请完成以下Java代码 | public class ClusterApp2 {
public static void main(String[] args) {
// Load configuration
Config config = ConfigFactory.load();
ActorSystem system = ActorSystem.create("ClusterSystem", config);
// Create WorkerRouterActor with 5 workers
ActorRef workerRouter = system.actorO... | // Submit tasks
masterActor.tell(new TaskMessage("Task 1"), ActorRef.noSender());
masterActor.tell(new TaskMessage("Task 2"), ActorRef.noSender());
masterActor.tell(new TaskMessage("Task 3"), ActorRef.noSender());
// Keep system alive for demonstration purposes
try {
... | repos\springboot-demo-master\akka\src\main\java\com\et\akka\cluster\ClusterApp2.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Post {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
public Post() {
}
public Post(String title) {
this.title = title;
}
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;
}
@Override
public String toString() {
return "Post{" + "id=" + id + ", text='" + title + '\'' + '}';
}
} | repos\tutorials-master\persistence-modules\hibernate-exceptions\src\main\java\com\baeldung\hibernate\exception\detachedentity\entity\Post.java | 2 |
请完成以下Java代码 | public ResponseEntity<PageResult<S3Storage>> queryS3Storage(S3StorageQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(s3StorageService.queryAll(criteria, pageable),HttpStatus.OK);
}
@PostMapping
@ApiOperation("上传文件")
public ResponseEntity<Object> uploadS3Storage(@RequestP... | map.put("message", "文件不存在或已被删除");
return new ResponseEntity<>(map, HttpStatus.NOT_FOUND);
}
// 仅适合公开文件访问,私有文件可以使用服务中的 privateDownload 方法
String url = amzS3Config.getDomain() + "/" + storage.getFilePath();
map.put("url", url);
return new ResponseEntity<>(map,HttpStatus... | repos\eladmin-master\eladmin-tools\src\main\java\me\zhengjie\rest\S3StorageController.java | 1 |
请完成以下Java代码 | public class SpringAsyncExecutor extends DefaultAsyncJobExecutor {
protected TaskExecutor taskExecutor;
protected SpringRejectedJobsHandler rejectedJobsHandler;
public SpringAsyncExecutor() {}
public SpringAsyncExecutor(TaskExecutor taskExecutor, SpringRejectedJobsHandler rejectedJobsHandler) {
... | public void setRejectedJobsHandler(SpringRejectedJobsHandler rejectedJobsHandler) {
this.rejectedJobsHandler = rejectedJobsHandler;
}
@Override
public boolean executeAsyncJob(Job job) {
try {
taskExecutor.execute(new ExecuteAsyncRunnable((JobEntity) job, processEngineConfigurati... | repos\Activiti-develop\activiti-core\activiti-spring\src\main\java\org\activiti\spring\SpringAsyncExecutor.java | 1 |
请完成以下Java代码 | public Predicate<ServerWebExchange> apply(Config config) {
return new GatewayPredicate() {
@Override
public boolean test(ServerWebExchange exchange) {
HttpMethod requestMethod = exchange.getRequest().getMethod();
return stream(config.getMethods()).anyMatch(httpMethod -> httpMethod == requestMethod);
... | public static class Config {
private HttpMethod[] methods = new HttpMethod[0];
public HttpMethod[] getMethods() {
return methods;
}
public void setMethods(HttpMethod... methods) {
this.methods = methods;
}
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\handler\predicate\MethodRoutePredicateFactory.java | 1 |
请完成以下Java代码 | private ForecastLineRequest toForecastLineRequest(final @NotNull I_I_Forecast importRecord)
{
final I_C_UOM uom = uomDAO.getById(UomId.ofRepoId(importRecord.getC_UOM_ID()));
return ForecastLineRequest.builder()
.productId(ProductId.ofRepoId(importRecord.getM_Product_ID()))
.quantity(Quantity.of(importReco... | return new X_I_Forecast(ctx, rs, ITrx.TRXNAME_ThreadInherited);
}
@Value
@Builder
private static class ForecastHeaderKey
{
public static final String IMPORT_ORDER_BY = I_I_Forecast.COLUMNNAME_Name
+ ',' + I_I_Forecast.COLUMNNAME_DatePromised
+ ',' + I_I_Forecast.COLUMNNAME_BPValue
+ ',' + I_I_Foreca... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\mforecast\impexp\ForecastImportProcess.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DecisionRequirementsDefinitionDto getDecisionRequirementsDefinition() {
RepositoryService repositoryService = engine.getRepositoryService();
DecisionRequirementsDefinition definition = null;
try {
definition = repositoryService.getDecisionRequirementsDefinition(decisionRequirementsDefinitionI... | } catch (NotFoundException e) {
throw new InvalidRequestException(Status.NOT_FOUND, e, e.getMessage());
} catch (NotValidException e) {
throw new InvalidRequestException(Status.BAD_REQUEST, e, e.getMessage());
} catch (ProcessEngineException e) {
throw new RestException(Status.INTERNAL_SERVE... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\repository\impl\DecisionRequirementsDefinitionResourceImpl.java | 2 |
请完成以下Java代码 | protected void applyConfigOnEnginesAfterClasspathDiscovery() {
var engineNames = getEngineNamesFoundInClasspath();
for (var engineName : engineNames) {
executeConfigurationBeforeEngineCreation(engineName);
}
}
protected List<String> getEngineNamesFoundInClasspath() {
var engineFactories = ge... | *
* @param engineName the given engine name
*/
protected void executeConfigurationBeforeEngineCreation(String engineName) {
var config = engineNameToInitLogicMappings.get(engineName);
if (config != null) {
config.run();
}
}
protected void disableGraalVMInterpreterOnlyModeWarnings() {
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\scripting\engine\CamundaScriptEngineManager.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.