instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public void onEvent(@NonNull final IEventBus eventBus, @NonNull final Event event)
{
final MaterialEvent lightWeightEvent = materialEventConverter.toMaterialEvent(event);
try (final MDCCloseable ignored = MDC.putCloseable("MaterialEventClass", lightWeightEvent.getClass().getName()))
{
logger.debug("Recei... | @Override
public String toString()
{
return MetasfreshEventBusService.class.getName() + ".internalListener";
}
};
public MetasfreshEventListener(
@NonNull final MaterialEventHandlerRegistry materialEventHandlerRegistry,
@NonNull final MetasfreshEventBusService metasfreshEventBusService,
@NonNull fi... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\eventbus\MetasfreshEventListener.java | 1 |
请完成以下Java代码 | public void initDefaultCommandConfig() {
if (defaultCommandConfig == null) {
defaultCommandConfig = new CommandConfig().setContextReusePossible(true);
}
}
@Override
public CommandInterceptor createTransactionInterceptor() {
if (transactionManager == null) {
t... | // Wrap datasource in Transaction-aware proxy
DataSource proxiedDataSource = new TransactionAwareDataSourceProxy(dataSource);
return (IdmEngineConfiguration) super.setDataSource(proxiedDataSource);
}
}
public PlatformTransactionManager getTransactionManager() {
return tr... | repos\flowable-engine-main\modules\flowable-idm-spring\src\main\java\org\flowable\idm\spring\SpringIdmEngineConfiguration.java | 1 |
请完成以下Java代码 | public String getUsageHelp() {
return "[options] <password to encode>";
}
@Override
public Collection<HelpExample> getExamples() {
List<HelpExample> examples = new ArrayList<>();
examples.add(new HelpExample("To encode a password with the default (bcrypt) encoder",
"spring encodepassword mypassword"));
... | }
String algorithm = options.valueOf(this.algorithm);
String password = (String) options.nonOptionArguments().get(0);
Supplier<PasswordEncoder> encoder = ENCODERS.get(algorithm);
if (encoder == null) {
Log.error("Unknown algorithm, valid options are: "
+ StringUtils.collectionToCommaDelimitedStrin... | repos\spring-boot-4.0.1\cli\spring-boot-cli\src\main\java\org\springframework\boot\cli\command\encodepassword\EncodePasswordCommand.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ReceiverService {
/**
* 消费者实体对象
*/
private DefaultMQPushConsumer consumer;
/**
* 消费者组
*/
public static final String CONSUMER_GROUP = "test_consumer";
/**
* 通过构造函数 实例化对象
*/
public ReceiverService() throws MQClientException {
consumer = new Defau... | // 会把不同的消息分别放置到不同的队列中
try {
for (Message msg : msgs) {
//消费者获取消息 这里只输出 不做后面逻辑处理
String body = new String(msg.getBody(), "utf-8");
System.out.println(String.format("Consumer-获取消息-主题topic为={ %s }, 消费消息为={ %s }", msg.getTopic(), body)... | repos\springBoot-master\springboot-rocketmq\src\main\java\cn\abel\queue\service\ReceiverService.java | 2 |
请完成以下Java代码 | public boolean isCompleted() {
return state == COMPLETED.getStateCode();
}
public boolean isTerminated() {
return state == TERMINATED.getStateCode();
}
public boolean isFailed() {
return state == FAILED.getStateCode();
}
public boolean isSuspended() {
return state == SUSPENDED.getStateCod... | @Override
public String toString() {
return this.getClass().getSimpleName()
+ "[businessKey=" + businessKey
+ ", startUserId=" + createUserId
+ ", superCaseInstanceId=" + superCaseInstanceId
+ ", superProcessInstanceId=" + superProcessInstanceId
+ ", durationInMillis=" + durationInMi... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\HistoricCaseInstanceEventEntity.java | 1 |
请完成以下Java代码 | public class FireNForgetClient {
private static final Logger LOG = LoggerFactory.getLogger(FireNForgetClient.class);
private final RSocket socket;
private final List<Float> data;
public FireNForgetClient() {
this.socket = RSocketFactory.connect()
.transport(TcpClientTransport.create... | buffer.rewind();
return DefaultPayload.create(buffer);
}
/**
* Generate sample data
*
* @return List of random floats
*/
private List<Float> generateData() {
List<Float> dataList = new ArrayList<>(DATA_LENGTH);
float velocity = 0;
for (int i = 0; i < DATA... | repos\tutorials-master\spring-reactive-modules\rsocket\src\main\java\com\baeldung\rsocket\FireNForgetClient.java | 1 |
请完成以下Java代码 | public IReturnsInOutProducer setMovementType(final String movementType)
{
assertConfigurable();
_movementType = movementType;
return this;
}
@Override
public IReturnsInOutProducer setM_Warehouse(final I_M_Warehouse warehouse)
{
assertConfigurable();
_warehouse = warehouse;
return this;
}
private ... | inoutLinesBuilder.create();
}
@Override
protected int getReturnsDocTypeId(final String docBaseType, final boolean isSOTrx, final int adClientId, final int adOrgId)
{
final I_C_DocType docType = getEmptiesDocType(docBaseType, adClientId, adOrgId, isSOTrx);
DocTypeId docTypeId = docType == null ? null : DocTyp... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\empties\impl\EmptiesInOutProducer.java | 1 |
请完成以下Java代码 | public HistoryLevel execute(CommandContext commandContext) {
if (processDefinitionId == null) {
throw new FlowableIllegalArgumentException("processDefinitionId is null");
}
HistoryLevel historyLevel = null;
ProcessDefinition processDefinition = CommandContextUtil.getProcess... | if (StringUtils.isNotEmpty(historyLevelValue)) {
try {
historyLevel = HistoryLevel.getHistoryLevelForKey(historyLevelValue);
} catch (Exception e) {
}
}
}
if (historyLevel == null) {
historyLevel = CommandConte... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\cmd\GetProcessDefinitionHistoryLevelModelCmd.java | 1 |
请完成以下Java代码 | public void setHelp (String Help)
{
set_Value (COLUMNNAME_Help, Help);
}
/** Get Comment/Help.
@return Comment or Hint
*/
public String getHelp ()
{
return (String)get_Value(COLUMNNAME_Help);
}
/** Set Link.
@param Link
Contains URL to a target
*/
public void setLink (String Link)
{
set_V... | /** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_NewsChannel.java | 1 |
请完成以下Java代码 | private static String extractSQLStateOrNull(final Throwable t)
{
final SQLException sqlException = extractSQLExceptionOrNull(t);
if (sqlException == null)
{
return null;
}
return sqlException.getSQLState();
}
/**
* Check if Unique Constraint Exception (aka ORA-00001)
*
* @param e exception
*/
... | //
;
}
/**
* Check if "invalid identifier" exception (aka ORA-00904)
*
* @param e exception
*/
public static boolean isInvalidIdentifierError(final Exception e)
{
return isErrorCode(e, 904);
}
/**
* Check if "invalid username/password" exception (aka ORA-01017)
*
* @param e exception
*/
p... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\exceptions\DBException.java | 1 |
请完成以下Java代码 | public ProcessInstanceBuilder createProcessInstanceBuilder() {
return new ProcessInstanceBuilderImpl(this);
}
@Override
public ChangeActivityStateBuilder createChangeActivityStateBuilder() {
return new ChangeActivityStateBuilderImpl(this);
}
@Override
public Execution addMultiI... | public EventSubscription registerProcessInstanceStartEventSubscription(ProcessInstanceStartEventSubscriptionBuilderImpl builder) {
return commandExecutor.execute(new RegisterProcessInstanceStartEventSubscriptionCmd(builder));
}
public void migrateProcessInstanceStartEventSubscriptionsToProcessDefinitio... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\RuntimeServiceImpl.java | 1 |
请完成以下Java代码 | public class LockExternalTaskCmd extends HandleExternalTaskCmd {
protected long lockDuration;
public LockExternalTaskCmd(String externalTaskId, String workerId, long lockDuration) {
super(externalTaskId, workerId);
this.lockDuration = lockDuration;
}
@Override
protected void execute(ExternalTaskEnt... | // check if another worker is attempting to lock the same task
boolean workerValidation = existingWorkerId != null && !workerId.equals(existingWorkerId);
// and check if an existing lock is already expired
boolean lockValidation = existingLockExpirationTime != null
&& !ClockUtil.getCurrentTime().aft... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\LockExternalTaskCmd.java | 1 |
请完成以下Java代码 | public int getC_Print_Package_ID()
{
return get_ValueAsInt(COLUMNNAME_C_Print_Package_ID);
}
@Override
public void setM_Warehouse_ID (int M_Warehouse_ID)
{
if (M_Warehouse_ID < 1)
set_Value (COLUMNNAME_M_Warehouse_ID, null);
else
set_Value (COLUMNNAME_M_Warehouse_ID, Integer.valueOf(M_Warehouse_ID)... | }
@Override
public void setS_Resource(org.compiere.model.I_S_Resource S_Resource)
{
set_ValueFromPO(COLUMNNAME_S_Resource_ID, org.compiere.model.I_S_Resource.class, S_Resource);
}
@Override
public void setS_Resource_ID (int S_Resource_ID)
{
if (S_Resource_ID < 1)
set_Value (COLUMNNAME_S_Resource_ID, nu... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java-gen\de\metas\printing\model\X_C_Print_Job_Instructions_v.java | 1 |
请完成以下Java代码 | public class SentinelConStants {
public static final String GROUP_ID = "SENTINEL_GROUP";
/**
* 流控规则
*/
public static final String FLOW_DATA_ID_POSTFIX = "-flow-rules";
/**
* 热点参数
*/
public static final String PARAM_FLOW_DATA_ID_POSTFIX = "-param-rules";
/**
* 降级规则
... | public static final String SYSTEM_DATA_ID_POSTFIX = "-system-rules";
/**
* 授权规则
*/
public static final String AUTHORITY_DATA_ID_POSTFIX = "-authority-rules";
/**
* 网关API
*/
public static final String GETEWAY_API_DATA_ID_POSTFIX = "-api-rules";
/**
* 网关流控规则
*/
publi... | repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-sentinel\src\main\java\com\alibaba\csp\sentinel\dashboard\constants\SentinelConStants.java | 1 |
请完成以下Java代码 | public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getHostname() {
return hostname;
}
public void setHostname(String hostname) {
this.hostname = hostname;
}
public Date getTimestamp() {
return time... | machineInfo.setPort(port);
machineInfo.setLastHeartbeat(timestamp.getTime());
machineInfo.setHeartbeatVersion(timestamp.getTime());
return machineInfo;
}
@Override
public String toString() {
return "MachineEntity{" +
"id=" + id +
", gmtCreate=" + gmt... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\datasource\entity\MachineEntity.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SpringBootSpinProcessEnginePlugin extends SpinProcessEnginePlugin {
@Autowired
protected Optional<CamundaJacksonFormatConfiguratorJSR310> dataFormatConfiguratorJsr310;
@Autowired
protected Optional<CamundaJacksonFormatConfiguratorParameterNames> dataFormatConfiguratorParameterNames;
@Autowired... | }
protected void loadSpringBootDataFormats(ClassLoader classloader) {
List<DataFormatConfigurator> configurators = new ArrayList<>();
// add the auto-config Jackson Java 8 module configurators
dataFormatConfiguratorJsr310.ifPresent(configurator -> configurators.add(configurator));
dataFormatConfigur... | repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\spin\SpringBootSpinProcessEnginePlugin.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Boolean getHasChildren() {
return subCount > 0;
}
@ApiModelProperty(value = "是否叶子节点")
public Boolean getLeaf() {
return subCount <= 0;
}
@ApiModelProperty(value = "标题")
public String getLabel() {
return title;
}
@Override
public boolean equals(Object... | if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MenuDto menuDto = (MenuDto) o;
return Objects.equals(id, menuDto.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
} | repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\system\service\dto\MenuDto.java | 2 |
请完成以下Java代码 | public class ProductDocument implements Serializable {
@Id
private String id;
//@Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
private String productName;
//@Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
private String productDesc;
private Date createTime;... | public String getProductDesc() {
return productDesc;
}
public void setProductDesc(String productDesc) {
this.productDesc = productDesc;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTim... | repos\springboot-demo-master\elasticsearch\src\main\java\demo\et59\elaticsearch\document\ProductDocument.java | 1 |
请完成以下Java代码 | public void setField(final GridField mField)
{
// To determine behavior
m_GridField = mField;
m_mField = mField;
// if (m_mField != null)
// FieldRecordInfo.addMenu(this, popupMenu);
//
// (re)Initialize our attribute context because we want to make sure
// it is using exactly the same context as the... | {
return;
}
throw new UnsupportedOperationException();
}
@Override
public void propertyChange(final PropertyChangeEvent evt)
{
final String propertyName = evt.getPropertyName();
if (propertyName.equals(org.compiere.model.GridField.PROPERTY))
{
setValue(evt.getNewValue());
}
else if (property... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VPAttribute.java | 1 |
请完成以下Java代码 | public int getM_CostElement_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_CostElement_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_M_InOut getM_InOut() throws RuntimeException
{
return (I_M_InOut)MTable.get(getCtx(), I_M_InOut.Table_Name)
.getPO(getM_InOut_ID(), get_Trx... | return 0;
return ii.intValue();
}
public I_M_Product getM_Product() throws RuntimeException
{
return (I_M_Product)MTable.get(getCtx(), I_M_Product.Table_Name)
.getPO(getM_Product_ID(), get_TrxName()); }
/** Set Product.
@param M_Product_ID
Product, Service, Item
*/
public void setM_Product_ID (... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_LandedCost.java | 1 |
请在Spring Boot框架中完成以下Java代码 | MessagingAdviceRSocketMessageHandlerCustomizer messagingAdviceRSocketMessageHandlerCustomizer(
ApplicationContext applicationContext) {
return new MessagingAdviceRSocketMessageHandlerCustomizer(applicationContext);
}
}
static final class MessagingAdviceRSocketMessageHandlerCustomizer implements RSocketMess... | private ControllerAdviceBeanWrapper(ControllerAdviceBean adviceBean) {
this.adviceBean = adviceBean;
}
@Override
public @Nullable Class<?> getBeanType() {
return this.adviceBean.getBeanType();
}
@Override
public Object resolveBean() {
return this.adviceBean.resolveBean();
}
@Override
publi... | repos\spring-boot-4.0.1\module\spring-boot-rsocket\src\main\java\org\springframework\boot\rsocket\autoconfigure\RSocketMessagingAutoConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class Product {
@Id
@GeneratedValue
private Long _id;
private String description;
private BigDecimal price;
private String imageUrl;
public Long getId() {
return _id;
}
public void setId(Long id) {
this._id = id;
}
public String getDescription() {
... | public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
} | repos\SpringBootVulExploit-master\repository\springboot-mysql-jdbc-rce\src\main\java\code\landgrey\domain\Product.java | 2 |
请完成以下Java代码 | public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
public String getSourceExpression() {
return sourceExpression;
}
public void setSourceExpression(String sourceExpression) {
this.sourceExpression = sourc... | public void setTransient(boolean isTransient) {
this.isTransient = isTransient;
}
@Override
public IOParameter clone() {
IOParameter clone = new IOParameter();
clone.setValues(this);
return clone;
}
public void setValues(IOParameter otherElement) {
super.set... | repos\flowable-engine-main\modules\flowable-bpmn-model\src\main\java\org\flowable\bpmn\model\IOParameter.java | 1 |
请完成以下Java代码 | public static <T> IQueryFilter<T> getInstance(final Class<T> clazz)
{
return getInstance();
}
@SuppressWarnings("rawtypes")
private static final ActiveRecordQueryFilter instance = new ActiveRecordQueryFilter();
private static final String COLUMNNAME_IsActive = "IsActive";
private final String sql;
private f... | }
@Override
public List<Object> getSqlParams(final Properties ctx)
{
return sqlParams;
}
@Override
public boolean accept(final T model)
{
final Object isActiveObj = InterfaceWrapperHelper.getValueOrNull(model, COLUMNNAME_IsActive);
final boolean isActive = DisplayType.toBoolean(isActiveObj);
return isA... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\ActiveRecordQueryFilter.java | 1 |
请完成以下Java代码 | public void setVisited (boolean visited)
{
m_visited = visited;
if (m_visited)
{
setBackground(Color.green);
}
else
{
setBackground(Color.lightGray);
}
} // setVisited
/**
* Get Selected
* @return selected
*/
public boolean isSelected()
{
return m_selected;
} // isSelected
/**
*... | .append("]");
return sb.toString();
} // toString
/**
* Get Font.
* Italics if not editable
* @return font
*/
public Font getFont ()
{
Font base = new Font(null);
if (!isEditable())
return base;
// Return Bold Italic Font
return new Font(base.getName(), Font.ITALIC | Font.BOLD, base.getSize(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\wf\WFNodeComponent.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void addViewControllers(ViewControllerRegistry registry) {
registry.addRedirectViewController("/info", "/actuator/info");
}
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.defaultContentTypeStrategy(new CommandLineContentNegotiationStrategy());
}
... | return MEDIA_TYPE_ALL_LIST;
}
String userAgent = request.getHeader(HttpHeaders.USER_AGENT);
if (userAgent != null) {
Agent agent = Agent.fromUserAgent(userAgent);
if (agent != null) {
if (AgentId.CURL.equals(agent.getId()) || AgentId.HTTPIE.equals(agent.getId())) {
return Collections.singlet... | repos\initializr-main\initializr-web\src\main\java\io\spring\initializr\web\autoconfigure\InitializrWebConfig.java | 2 |
请完成以下Java代码 | public class UserDO implements Serializable {
/**
* 用户编号
*/
private Integer id;
/**
* 账号
*/
private String username;
/**
* 密码(明文)
*
* ps:生产环境下,千万不要明文噢
*/
private String password;
/**
* 创建时间
*/
private Date createTime;
/**
* 是否删除... | public Date getCreateTime() {
return createTime;
}
public UserDO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Integer getDeleted() {
return deleted;
}
public UserDO setDeleted(Integer deleted) {
this.deleted = del... | repos\SpringBoot-Labs-master\lab-21\lab-21-cache-redis\src\main\java\cn\iocoder\springboot\lab21\cache\dataobject\UserDO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public UserVO get2(@PathVariable("id") Integer id) {
return userService.get(id);
}
/**
* 添加用户
*
* @param addDTO 添加用户信息 DTO
* @return 添加成功的用户编号
*/
@PostMapping("")
public Integer add(UserAddDTO addDTO) {
// 插入用户记录,返回编号
Integer returnId = 1;
// 返回用... | updateDTO.setId(id);
// 更新用户记录
Boolean success = true;
// 返回更新是否成功
return success;
}
/**
* 删除指定用户编号的用户
*
* @param id 用户编号
* @return 是否删除成功
*/
@DeleteMapping("/{id}")
public Boolean delete(@PathVariable("id") Integer id) {
// 删除用户记录
... | repos\SpringBoot-Labs-master\lab-23\lab-springmvc-23-01\src\main\java\cn\iocoder\springboot\lab23\springmvc\controller\UserController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class JsonShipmentOptions
{
@JsonProperty("ServiceLevel")
String serviceLevel;
@JsonProperty("TrackingURL")
@JsonSerialize(converter = BooleanToIntConverter.class)
Boolean trackingURL;
@JsonProperty("RequiredDeliveryDate")
String requiredDeliveryDate; // Expects DATETIME format, e.g., "YYYY-MM-DDTHH:mm... | @JsonProperty("WorkstationID")
UUID workstationID;
@JsonProperty("DropZoneLabelPrinterKey")
String dropZoneLabelPrinterKey;
@JsonProperty("DropZoneDocPrinterKey")
String dropZoneDocPrinterKey;
@JsonProperty("ValidatePostCode")
@JsonSerialize(converter = BooleanToIntConverter.class)
Boolean validatePostCode;
... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.client.nshift\src\main\java\de\metas\shipper\client\nshift\json\JsonShipmentOptions.java | 2 |
请完成以下Java代码 | public IncidentQuery orderByProcessInstanceId() {
orderBy(IncidentQueryProperty.PROCESS_INSTANCE_ID);
return this;
}
public IncidentQuery orderByProcessDefinitionId() {
orderBy(IncidentQueryProperty.PROCESS_DEFINITION_ID);
return this;
}
public IncidentQuery orderByCauseIncidentId() {
orde... | @Override
public IncidentQuery orderByIncidentMessage() {
return orderBy(IncidentQueryProperty.INCIDENT_MESSAGE);
}
//results ////////////////////////////////////////////////////
@Override
public long executeCount(CommandContext commandContext) {
checkQueryOk();
return commandContext
.getI... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\IncidentQueryImpl.java | 1 |
请完成以下Java代码 | public Object getValue(ELContext context, Object base, Object property) {
if (base == null) {
String variable = (String) property; // according to javadoc, can only be a String
if ((EXECUTION_KEY.equals(property) && variableScope instanceof ExecutionEntity)
|| (TASK... | }
return true;
}
@Override
public void setValue(ELContext context, Object base, Object property, Object value) {
if (base == null) {
String variable = (String) property;
if (variableScope.hasVariable(variable)) {
variableScope.setVariable(variable, va... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\el\VariableScopeElResolver.java | 1 |
请完成以下Java代码 | private void cleanupEvents(long eventExpTime, boolean debug) {
for (EventType eventType : EventType.values()) {
if (eventType.isDebug() == debug) {
cleanupPartitions(eventType, eventExpTime);
}
}
}
private void cleanupPartitions(EventType eventType, long ... | try {
UUID.fromString(src);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Failed to convert " + paramName + " to UUID!");
}
}
}
private EventRepository<? extends EventEntity<?>, ?> getEventRepository(EventType eventTyp... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\event\JpaBaseEventDao.java | 1 |
请完成以下Java代码 | public int getDD_OrderLine_Alternative_ID()
{
return get_ValueAsInt(COLUMNNAME_DD_OrderLine_Alternative_ID);
}
@Override
public org.eevolution.model.I_DD_OrderLine getDD_OrderLine()
{
return get_ValueAsPO(COLUMNNAME_DD_OrderLine_ID, org.eevolution.model.I_DD_OrderLine.class);
}
@Override
public void setD... | set_ValueNoCheck (COLUMNNAME_M_Product_ID, M_Product_ID);
}
@Override
public int getM_Product_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Product_ID);
}
@Override
public void setQtyDelivered (final BigDecimal QtyDelivered)
{
set_Value (COLUMNNAME_QtyDelivered, QtyDelivered);
}
@Override
public BigDecim... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_DD_OrderLine_Alternative.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
}
private <T> void registerBeans(String location, String pattern, Class<T> type,
Function<Resource, T> beanSupplier, BeanDefinitionRegistry registry) {
for (Resource resource : getResources(location, patt... | try {
return this.applicationContext.getResources(ensureTrailingSlash(location) + pattern);
}
catch (IOException ex) {
return new Resource[0];
}
}
private String ensureTrailingSlash(String path) {
return path.endsWith("/") ? path : path + "/";
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-webservices\src\main\java\org\springframework\boot\webservices\autoconfigure\WebServicesAutoConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class BookstoreService {
private final TransactionTemplate template;
private final BookRepository bookRepository;
public BookstoreService(BookRepository bookRepository, TransactionTemplate template) {
this.bookRepository = bookRepository;
this.template = template;
}
public ... | .findTop3ByStatus(BookStatus.PENDING, Sort.by(Sort.Direction.ASC, "id"));
template.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
List<Book> books = bookRe... | repos\Hibernate-SpringBoot-master\HibernateSpringBootMySqlSkipLocked\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Java代码 | public static void dumpAllLevelsUpToRoot(final String loggerName)
{
final Logger logger = getLogger(loggerName);
if (logger == null)
{
return;
}
dumpAllLevelsUpToRoot(logger);
}
/**
* @see #dumpAllLevelsUpToRoot(Logger)
*/
public static void dumpAllLevelsUpToRoot(final Class<?> clazz)
{
final L... | forAllLevelsUpToRoot(logger, dumpLevel);
}
public static void forAllLevelsUpToRoot(final Logger logger, final Consumer<Logger> consumer)
{
Logger currentLogger = logger;
String currentLoggerName = currentLogger.getName();
while (currentLogger != null)
{
consumer.accept(currentLogger);
final int idx =... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\logging\LogManager.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserController {
private Logger log = LoggerFactory.getLogger(this.getClass());
@GetMapping("/{id:\\d+}")
public User get(@PathVariable Long id) {
log.info("获取用户id为 " + id + "的信息");
return new User(id, "mrbird", "123456");
}
@GetMapping("users")
public List<User> ... | @PostMapping
public void add(@RequestBody User user) {
log.info("新增用户成功 " + user);
}
@PutMapping
public void update(@RequestBody User user) {
log.info("更新用户成功 " + user);
}
@DeleteMapping("/{id:\\d+}")
public void delete(@PathVariable Long id) {
log.info("删除用户成功 " + ... | repos\SpringAll-master\30.Spring-Cloud-Hystrix-Circuit-Breaker\Eureka-Client\src\main\java\com\example\demo\controller\UserController.java | 2 |
请完成以下Java代码 | public final class JSONASILayout implements Serializable
{
public static JSONASILayout of(final ASILayout layout, final JSONDocumentLayoutOptions options)
{
return new JSONASILayout(layout, options);
}
@JsonProperty("id")
private final String id;
@JsonProperty("caption")
private final String caption;
@JsonP... | .omitNullValues()
.add("id", id)
.add("caption", caption)
.add("description", description)
.add("elements", elements)
.toString();
}
public String getCaption()
{
return caption;
}
public String getDescription()
{
return description;
}
public List<JSONDocumentLayoutElement> getElements... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pattribute\json\JSONASILayout.java | 1 |
请完成以下Java代码 | public void setC_BankStatementMatcher_ID (int C_BankStatementMatcher_ID)
{
if (C_BankStatementMatcher_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_BankStatementMatcher_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_BankStatementMatcher_ID, Integer.valueOf(C_BankStatementMatcher_ID));
}
/** Get Bank Statement ... | {
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Sequence.
@param SeqNo
Method of ordering records; lowest number comes ... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java-gen\org\compiere\model\X_C_BankStatementMatcher.java | 1 |
请完成以下Java代码 | public class DeadLetterJobEntityManager extends AbstractManager {
public DeadLetterJobEntity findJobById(String jobId) {
return (DeadLetterJobEntity) getDbSqlSession().selectOne("selectDeadLetterJob", jobId);
}
@SuppressWarnings("unchecked")
public List<DeadLetterJobEntity> findDeadLetterJobsB... | }
@SuppressWarnings("unchecked")
public List<Job> findDeadLetterJobsByTypeAndProcessDefinitionId(String jobHandlerType, String processDefinitionId) {
Map<String, String> params = new HashMap<>(2);
params.put("handlerType", jobHandlerType);
params.put("processDefinitionId", processDefini... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\DeadLetterJobEntityManager.java | 1 |
请完成以下Java代码 | static String normalizeUploadFilename(final String name, final String contentType)
{
final String fileExtension = MimeType.getExtensionByType(contentType);
final String nameNormalized;
if (Check.isEmpty(name, true)
|| "blob".equals(name) // HARDCODED: this happens when the image is taken from webcam
)
{... | public WebuiImage getWebuiImage(@NonNull final WebuiImageId imageId, final int maxWidth, final int maxHeight)
{
final AdImage adImage = adImageRepository.getById(imageId.toAdImageId());
return WebuiImage.of(adImage, maxWidth, maxHeight);
}
public ResponseEntity<byte[]> getEmptyImage()
{
return ResponseEntity... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\upload\WebuiImageService.java | 1 |
请完成以下Java代码 | public class EndEventXMLConverter extends BaseBpmnXMLConverter {
@Override
public Class<? extends BaseElement> getBpmnElementType() {
return EndEvent.class;
}
@Override
protected String getXMLElementName() {
return ELEMENT_EVENT_END;
}
@Override
protected BaseElement c... | BpmnXMLUtil.addXMLLocation(endEvent, xtr);
parseChildElements(getXMLElementName(), endEvent, model, xtr);
return endEvent;
}
@Override
protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw)
throws Exception {}
@Override
protected... | repos\Activiti-develop\activiti-core\activiti-bpmn-converter\src\main\java\org\activiti\bpmn\converter\EndEventXMLConverter.java | 1 |
请完成以下Java代码 | public void setCustomELResolvers(List<ELResolver> customELResolvers) {
this.customELResolvers = customELResolvers;
}
public ELContext getElContext(VariableScope variableScope) {
ELContext elContext = null;
if (variableScope instanceof VariableScopeImpl) {
VariableScopeImpl v... | elResolver.add(new ListELResolver());
elResolver.add(new MapELResolver());
elResolver.add(new CustomMapperJsonNodeELResolver());
elResolver.add(new DynamicBeanPropertyELResolver(ItemInstance.class, "getFieldValue", "setFieldValue")); // TODO: needs verification
elResolver.add(new ELResol... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\el\ExpressionManager.java | 1 |
请完成以下Java代码 | default Instant getClientSecretExpiresAt() {
return getClaimAsInstant(OAuth2ClientMetadataClaimNames.CLIENT_SECRET_EXPIRES_AT);
}
/**
* Returns the name of the Client to be presented to the End-User
* {@code (client_name)}.
* @return the name of the Client to be presented to the End-User
*/
default String... | * itself to using
*/
default List<String> getResponseTypes() {
return getClaimAsStringList(OAuth2ClientMetadataClaimNames.RESPONSE_TYPES);
}
/**
* Returns the OAuth 2.0 {@code scope} values that the Client will restrict itself to
* using {@code (scope)}.
* @return the OAuth 2.0 {@code scope} values that t... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\OAuth2ClientMetadataClaimAccessor.java | 1 |
请完成以下Java代码 | public void setCustomerTypeOfSubset(CustomerType customerTypeOfSubset) {
this.customerTypeOfSubset = customerTypeOfSubset;
}
public CustomerType getCustomerTypeMatchesPattern() {
return customerTypeMatchesPattern;
}
public void setCustomerTypeMatchesPattern(CustomerType customerTypeMat... | this.customerTypeString = customerTypeString;
return this;
}
public Builder withCustomerTypeOfSubset(CustomerType customerTypeOfSubset) {
this.customerTypeOfSubset = customerTypeOfSubset;
return this;
}
public Builder withCustomerTypeMatchesPattern(C... | repos\tutorials-master\javaxval\src\main\java\com\baeldung\javaxval\enums\demo\Customer.java | 1 |
请完成以下Java代码 | public final class VersionUtils {
/**
* Parse version of Sentinel from raw string.
*
* @param versionFull version string
* @return parsed {@link SentinelVersion} if the version is valid; empty if
* there is something wrong with the format
*/
public static Optional<SentinelVersion>... | index = versionFull.indexOf('.');
if (index < 0) {
if (versionFull.length() > 0) {
ver[segment] = Integer.valueOf(versionFull);
}
break;
}
ver[segment] = Integer.valueOf(versionFull.substr... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\util\VersionUtils.java | 1 |
请完成以下Java代码 | public class AD_Column_AutoApplyValRuleInterceptor implements IModelInterceptor
{
private int m_AD_Client_ID = -1;
private final ValRuleAutoApplierService valRuleAutoApplierService;
public AD_Column_AutoApplyValRuleInterceptor(@NonNull final ValRuleAutoApplierService valRuleAutoApplierService)
{
this.valRuleAut... | return m_AD_Client_ID;
}
@Override
public void onModelChange(
@NonNull final Object recordModel,
@NonNull final ModelChangeType changeType)
{
if (!ModelChangeType.BEFORE_NEW.equals(changeType))
{
return;
}
valRuleAutoApplierService.invokeApplierFor(recordModel);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\column\autoapplyvalrule\interceptor\AD_Column_AutoApplyValRuleInterceptor.java | 1 |
请完成以下Spring Boot application配置 | spring:
application:
name: listener-demo
server:
port: 18080 # 随机端口,方便启动多个消费者
# rocketmq 配置项,对应 RocketMQProperties 配置类
rocketmq:
name-server: 127.0.0.1:9876 # RocketMQ Namesrv
management:
endpoints:
# Actuator HTTP 配置项,对应 WebEndpointProp | erties 配置类
web:
exposure:
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。 | repos\SpringBoot-Labs-master\labx-20\labx-20-sca-bus-rocketmq-demo-listener-actuator\src\main\resources\application.yml | 2 |
请完成以下Java代码 | public int getRetryWaitTimeInMillis() {
return retryWaitTimeInMillis;
}
public void setRetryWaitTimeInMillis(int retryWaitTimeInMillis) {
this.retryWaitTimeInMillis = retryWaitTimeInMillis;
}
public int getResetExpiredJobsInterval() {
return resetExpiredJobsInterval;
}
... | public int getResetExpiredJobsPageSize() {
return resetExpiredJobsPageSize;
}
public void setResetExpiredJobsPageSize(int resetExpiredJobsPageSize) {
this.resetExpiredJobsPageSize = resetExpiredJobsPageSize;
}
public int getNumberOfRetries() {
return numberOfRetries;
}
... | repos\Activiti-develop\activiti-core\activiti-spring-boot-starter\src\main\java\org\activiti\spring\boot\AsyncExecutorProperties.java | 1 |
请完成以下Java代码 | public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public... | return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getCaptcha() {
return captcha;
}
public void setCaptcha(String captcha) {
this.captcha = captcha;
}
} | repos\tutorials-master\javaxval\src\main\java\com\baeldung\javaxval\validationgroup\RegistrationForm.java | 1 |
请完成以下Java代码 | public JdkClientHttpRequestFactoryBuilder withHttpClientCustomizer(
Consumer<HttpClient.Builder> httpClientCustomizer) {
Assert.notNull(httpClientCustomizer, "'httpClientCustomizer' must not be null");
return new JdkClientHttpRequestFactoryBuilder(getCustomizers(),
this.httpClientBuilder.withCustomizer(httpC... | HttpClient httpClient = this.httpClientBuilder.build(settings.withReadTimeout(null));
JdkClientHttpRequestFactory requestFactory = new JdkClientHttpRequestFactory(httpClient);
PropertyMapper map = PropertyMapper.get();
map.from(settings::readTimeout).to(requestFactory::setReadTimeout);
return requestFactory;
}... | repos\spring-boot-4.0.1\module\spring-boot-http-client\src\main\java\org\springframework\boot\http\client\JdkClientHttpRequestFactoryBuilder.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CLR implements CommandLineRunner {
private final AuthorRepository authorRepository;
CLR(AuthorRepository authorRepository) {
this.authorRepository = authorRepository;
}
@Override
public void run(String... args) {
insertAuthors();
listAllAuthors();
findById();
findByPartialName();
queryF... | System.out.printf("findById(): author1 = %s%n", author1);
System.out.printf("findById(): author2 = %s%n", author2);
}
private void listAllAuthors() {
List<Author> authors = this.authorRepository.findAll();
for (Author author : authors) {
System.out.printf("listAllAuthors(): author = %s%n", author);
for (... | repos\spring-data-examples-main\jdbc\graalvm-native\src\main\java\example\springdata\jdbc\graalvmnative\CLR.java | 2 |
请完成以下Java代码 | public ForecastLineId getForecastLineId()
{
return getPurchaseCandidate().getForecastLineId();
}
private Quantity getQtyToPurchase()
{
return getPurchaseCandidate().getQtyToPurchase();
}
public boolean purchaseMatchesRequiredQty()
{
return getPurchasedQty().compareTo(getQtyToPurchase()) == 0;
}
privat... | return purchaseCandidate.getPriceEnteredEff();
}
@Nullable
public UomId getPriceUomId()
{
return purchaseCandidate.getPriceUomId();
}
@Nullable
public Percent getDiscount()
{
return purchaseCandidate.getDiscountEff();
}
@Nullable
public String getExternalPurchaseOrderUrl()
{
return purchaseCandidat... | repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\remotepurchaseitem\PurchaseOrderItem.java | 1 |
请完成以下Java代码 | public void setTimeSlotEnd (java.sql.Timestamp TimeSlotEnd)
{
set_Value (COLUMNNAME_TimeSlotEnd, TimeSlotEnd);
}
/** Get Endzeitpunkt.
@return Time when timeslot ends
*/
@Override
public java.sql.Timestamp getTimeSlotEnd ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_TimeSlotEnd);
}
/** Set St... | */
@Override
public java.sql.Timestamp getTimeSlotStart ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_TimeSlotStart);
}
/** Set Suchschlüssel.
@param Value
Search key for the record in the format required - must be unique
*/
@Override
public void setValue (java.lang.String Value)
{
set_Valu... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_S_ResourceType.java | 1 |
请完成以下Java代码 | public void setUsedForCustomer (final boolean UsedForCustomer)
{
set_Value (COLUMNNAME_UsedForCustomer, UsedForCustomer);
}
@Override
public boolean isUsedForCustomer()
{
return get_ValueAsBoolean(COLUMNNAME_UsedForCustomer);
}
@Override
public void setUsedForVendor (final boolean UsedForVendor)
{
set... | public void setVendorCategory (final @Nullable java.lang.String VendorCategory)
{
set_Value (COLUMNNAME_VendorCategory, VendorCategory);
}
@Override
public java.lang.String getVendorCategory()
{
return get_ValueAsString(COLUMNNAME_VendorCategory);
}
@Override
public void setVendorProductNo (final @Nullab... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_BPartner_Product.java | 1 |
请完成以下Java代码 | public Date getClaimTime() {
return null;
}
@Override
public void setName(String name) {
activiti5Task.setName(name);
}
@Override
public void setLocalizedName(String name) {
activiti5Task.setLocalizedName(name);
}
@Override
public void setDescription(String... | public void setDelegationState(DelegationState delegationState) {
activiti5Task.setDelegationState(delegationState);
}
@Override
public void setDueDate(Date dueDate) {
activiti5Task.setDueDate(dueDate);
}
@Override
public void setCategory(String category) {
activiti5Tas... | repos\flowable-engine-main\modules\flowable5-compatibility\src\main\java\org\flowable\compatibility\wrapper\Flowable5TaskWrapper.java | 1 |
请完成以下Java代码 | protected String doIt() throws Exception
{
final JdbcExcelExporter jdbcExcelExporter = JdbcExcelExporter.builder()
.ctx(getCtx())
.columnHeaders(getColumnHeaders())
.build();
jdbcExcelExporter.setFontCharset(Font.ANSI_CHARSET);
spreadsheetExporterService.processDataFromSQL(getSql(), jdbcExcelExport... | .append(" ORDER BY productValue ");
return sb.toString();
}
private List<String> getColumnHeaders()
{
final List<String> columnHeaders = new ArrayList<>();
columnHeaders.add("ProductName");
columnHeaders.add("CustomerLabelName");
columnHeaders.add("Additional_produktinfos");
columnHeaders.add("ProductV... | repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\de\metas\fresh\product\process\ExportProductSpecifications.java | 1 |
请在Spring Boot框架中完成以下Java代码 | KafkaTemplate<Object, Object> kafkaTemplate(ProducerFactory<Object, Object> pf) {
return new KafkaTemplate<>(pf);
}
// tag::beans[]
@Bean
ReplyingKafkaTemplate<String, String, String> template(
ProducerFactory<String, String> pf,
ConcurrentKafkaListenerContainerFactory<Stri... | log.info(in);
if (in.equals("\"getAThing\"")) {
return ("{\"thingProp\":\"someValue\"}").getBytes();
}
if (in.equals("\"getThings\"")) {
return ("[{\"thingProp\":\"someValue1\"},{\"thingProp\":\"someValue2\"}]").getBytes();
}
return in.toUpperCase().getByt... | repos\spring-kafka-main\spring-kafka-docs\src\main\java\org\springframework\kafka\jdocs\requestreply\Application.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class EntityDescription implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String description;
@Any
@AnyDiscriminator(DiscriminatorType.STRING)
@AnyDiscriminatorValue(discriminator = "S", entity = Employee.class)
@AnyDi... | public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Serializable getEntity() {
return entity;
}
public void setEntity(Serializable entity) {
this.entity = entity;
}... | repos\tutorials-master\persistence-modules\hibernate-mapping-2\src\main\java\com\baeldung\hibernate\pojo\EntityDescription.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String code;
private double price;
public Product() {
}
public Product(String code, double price) {
this.code = code;
this.price = price;
}
public Long getI... | public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
} | repos\tutorials-master\persistence-modules\hibernate-jpa-3\src\main\java\com\baeldung\hibernate\dirtychecking\entity\Product.java | 2 |
请完成以下Java代码 | protected Map<String, String> extractExternalSystemParameters(@NonNull final ExternalSystemParentConfig externalSystemParentConfig)
{
final ExternalSystemPCMConfig pcmConfig = ExternalSystemPCMConfig.cast(externalSystemParentConfig.getChildConfig());
final OrgId orgId = pcmConfig.getOrgId();
final BPartnerLocat... | }
@Override
protected long getSelectedRecordCount(final IProcessPreconditionsContext context)
{
return context.getSelectedIncludedRecords()
.stream()
.filter(recordRef -> I_ExternalSystem_Config_ProCareManagement.Table_Name.equals(recordRef.getTableName()))
.count();
}
@Override
protected String g... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\process\InvokePCMAction.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String showUpdateTodoPage(@RequestParam long id, ModelMap model) {
Todo todo = todoService.getTodoById(id).get();
model.put("todo", todo);
return "todo";
}
@RequestMapping(value = "/update-todo", method = RequestMethod.POST)
public String updateTodo(ModelMap model, @Valid Tod... | return "redirect:/list-todos";
}
@RequestMapping(value = "/add-todo", method = RequestMethod.POST)
public String addTodo(ModelMap model, @Valid Todo todo, BindingResult result) {
if (result.hasErrors()) {
return "todo";
}
todo.setUserName(getLoggedInUserName(model));
... | repos\SpringBoot-Projects-FullStack-master\Part-8 Spring Boot Real Projects\0.ProjectToDoinDB\src\main\java\spring\hibernate\controller\TodoController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public CommonResult<CommonPage<EsProduct>> search(@RequestParam(required = false) String keyword,
@RequestParam(required = false, defaultValue = "0") Integer pageNum,
@RequestParam(required = false, defaultValue ... | @ResponseBody
public CommonResult<CommonPage<EsProduct>> recommend(@PathVariable Long id,
@RequestParam(required = false, defaultValue = "0") Integer pageNum,
@RequestParam(required = false, defaultValu... | repos\mall-master\mall-search\src\main\java\com\macro\mall\search\controller\EsProductController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable String getBrokerUrl() {
return this.brokerUrl;
}
public void setBrokerUrl(@Nullable String brokerUrl) {
this.brokerUrl = brokerUrl;
}
public @Nullable String getUser() {
return this.user;
}
public void setUser(@Nullable String user) {
this.user = user;
}
public @Nullable String getP... | /**
* Configuration for an embedded ActiveMQ broker.
*/
public static class Embedded {
/**
* Whether to enable embedded mode if the ActiveMQ Broker is available.
*/
private boolean enabled = true;
public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
... | repos\spring-boot-4.0.1\module\spring-boot-activemq\src\main\java\org\springframework\boot\activemq\autoconfigure\ActiveMQProperties.java | 2 |
请完成以下Java代码 | private Date generateExpirationDate() {
return new Date(System.currentTimeMillis() + Const.EXPIRATION_TIME * 1000);
}
private Boolean isTokenExpired(String token) {
final Date expiration = getExpirationDateFromToken(token);
return expiration.before(new Date());
}
private Boolea... | public Boolean canTokenBeRefreshed(String token) {
return !isTokenExpired(token);
}
public String refreshToken(String token) {
String refreshedToken;
try {
final Claims claims = getClaimsFromToken(token);
claims.put(CLAIM_KEY_CREATED, new Date());
ref... | repos\Spring-Boot-In-Action-master\springbt_security_jwt\src\main\java\cn\codesheep\springbt_security_jwt\util\JwtTokenUtil.java | 1 |
请完成以下Java代码 | public void setRequestHandler(CsrfTokenRequestHandler requestHandler) {
Assert.notNull(requestHandler, "requestHandler cannot be null");
this.requestHandler = requestHandler;
}
/**
* Constant time comparison to prevent against timing attacks.
* @param expected
* @param actual
* @return
*/
private stat... | byte[] actualBytes = Utf8.encode(actual);
return MessageDigest.isEqual(expectedBytes, actualBytes);
}
private static final class DefaultRequiresCsrfMatcher implements RequestMatcher {
private final HashSet<String> allowedMethods = new HashSet<>(Arrays.asList("GET", "HEAD", "TRACE", "OPTIONS"));
@Override
p... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\csrf\CsrfFilter.java | 1 |
请完成以下Java代码 | public final List<I_M_HU> getAssignedHUs()
{
final String trxName = getTrxName();
if (assignedHUs != null && trxManager.isSameTrxName(trxName, assignedHUsTrxName))
{
assignedHUs = null;
}
if (assignedHUs == null)
{
final Object documentLineModel = getDocumentLineModel();
assignedHUs = huAssignmen... | .collect(Collectors.toSet());
huAssignmentBL.unassignHUs(documentLineModel, huIdsToUnassign, trxName);
deleteAllocations(husToUnassign);
//
// Reset cached values
assignedHUs = null;
markStorageStaled();
}
@Override
public final void destroyAssignedHU(final I_M_HU huToDestroy)
{
Check.assumeNotNull(... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\document\impl\AbstractHUAllocations.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public TaskBuilder taskDefinitionId(String taskDefinitionId) {
this.taskDefinitionId = taskDefinitionId;
return this;
}
@Override
public TaskBuilder taskDefinitionKey(String taskDefinitionKey) {
this.taskDefinitionKey = taskDefinitionKey;
return this;
}
@Override
... | return assigneeId;
}
@Override
public String getTaskDefinitionId() {
return taskDefinitionId;
}
@Override
public String getTaskDefinitionKey() {
return taskDefinitionKey;
}
@Override
public Date getDueDate() {
return dueDate;
}
@Override
public... | repos\flowable-engine-main\modules\flowable-task-service\src\main\java\org\flowable\task\service\impl\BaseTaskBuilderImpl.java | 2 |
请完成以下Java代码 | public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((backCoverArtUrl == null) ? 0 : backCoverArtUrl.hashCode());
result = prime * result + ((frontCoverArtUrl == null) ? 0 : frontCoverArtUrl.hashCode());
result = prime * result + ((upcCode == n... | if (backCoverArtUrl == null) {
if (other.backCoverArtUrl != null)
return false;
} else if (!backCoverArtUrl.equals(other.backCoverArtUrl))
return false;
if (frontCoverArtUrl == null) {
if (other.frontCoverArtUrl != null)
return false;
... | repos\tutorials-master\persistence-modules\hibernate-libraries\src\main\java\com\baeldung\hibernate\types\CoverArt.java | 1 |
请完成以下Java代码 | public static <T> void printRandom(T[] elements, char delimiter) {
Collections.shuffle(Arrays.asList(elements));
printArray(elements, delimiter);
}
private static <T> void swap(T[] elements, int a, int b) {
T tmp = elements[a];
elements[a] = elements[b];
elements[b] = ... | Integer[] elements = {1,2,3,4};
System.out.println("Rec:");
printAllRecursive(elements, ';');
System.out.println("Iter:");
printAllIterative(elements.length, elements, ';');
System.out.println("Orderes:");
printAllOrdered(elements, ';');
System.out.println("Ra... | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-1\src\main\java\com\baeldung\algorithms\permutation\Permutation.java | 1 |
请完成以下Java代码 | public void removeRequest(HttpServletRequest request, HttpServletResponse response) {
Cookie removeSavedRequestCookie = new Cookie(COOKIE_NAME, "");
removeSavedRequestCookie.setSecure(request.isSecure());
removeSavedRequestCookie.setHttpOnly(true);
removeSavedRequestCookie.setPath(getCookiePath(request));
rem... | }
String currentUrl = UrlUtils.buildFullRequestUrl(request);
return savedRequest.getRedirectUrl().equals(currentUrl);
}
/**
* Allows selective use of saved requests for a subset of requests. By default any
* request will be cached by the {@code saveRequest} method.
* <p>
* If set, only matching requests ... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\savedrequest\CookieRequestCache.java | 1 |
请完成以下Java代码 | public String toString()
{
return MoreObjects.toStringHelper(this)
.add("handlers", handlers)
.toString();
}
public void addHandler(final IFlatrateTermEventListener handler)
{
Check.assumeNotNull(handler, "handler not null");
handlers.addIfAbsent(handler);
}
@Override
public void beforeFlatrateTe... | @Override
public void afterSaveOfNextTermForPredecessor(I_C_Flatrate_Term next, I_C_Flatrate_Term predecessor)
{
handlers.forEach(h -> h.afterSaveOfNextTermForPredecessor(next, predecessor));
}
@Override
public void afterFlatrateTermEnded(I_C_Flatrate_Term term)
{
handlers.forEach(h -> h.afterFlatrateTermEn... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\impl\CompositeFlatrateTermEventListener.java | 1 |
请完成以下Java代码 | class ColumnNode extends DancingNode {
int size;
String name;
ColumnNode(String n) {
super();
size = 0;
name = n;
C = this;
}
void cover() {
unlinkLR();
for (DancingNode i = this.D; i != this; i = i.D) {
for (DancingNode j = i.R; j != i; ... | j.unlinkUD();
j.C.size--;
}
}
}
void uncover() {
for (DancingNode i = this.U; i != this; i = i.U) {
for (DancingNode j = i.L; j != i; j = j.L) {
j.C.size++;
j.relinkUD();
}
}
relinkLR();
}
} | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-2\src\main\java\com\baeldung\algorithms\sudoku\ColumnNode.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setProcessDefinitionId(String processDefinitionId) {
this.processDefinitionId = processDefinitionId;
}
@ApiModelProperty(example = "http://localhost:8182/repository/process-definition/3")
public String getProcessDefinitionUrl() {
return processDefinitionUrl;
}
public vo... | }
public void setTaskUrl(String taskUrl) {
this.taskUrl = taskUrl;
}
public List<RestFormProperty> getFormProperties() {
return formProperties;
}
public void setFormProperties(List<RestFormProperty> formProperties) {
this.formProperties = formProperties;
}
public ... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\form\FormDataResponse.java | 2 |
请完成以下Java代码 | public CountResultDto getHistoricDecisionInstancesCount(UriInfo uriInfo) {
HistoricDecisionInstanceQueryDto queryDto = new HistoricDecisionInstanceQueryDto(objectMapper, uriInfo.getQueryParameters());
return queryHistoricDecisionInstancesCount(queryDto);
}
public CountResultDto queryHistoricDecisionInstanc... | builder.calculatedRemovalTime();
}
Date removalTime = dto.getAbsoluteRemovalTime();
if (dto.getAbsoluteRemovalTime() != null) {
builder.absoluteRemovalTime(removalTime);
}
if (dto.isClearedRemovalTime()) {
builder.clearedRemovalTime();
}
builder.byIds(dto.getHistoricDecisio... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\history\HistoricDecisionInstanceRestServiceImpl.java | 1 |
请完成以下Java代码 | protected String doIt() throws Exception
{
final PickingSlotRow rowToProcess = getSingleSelectedRow();
final ImmutableSet<HuId> hUs = filterOutInvalidHUs(rowToProcess);
final ShipmentScheduleId shipmentScheduleId = null;
//noinspection ConstantConditions
pickingCandidateService.processForHUIds(hUs, shipment... | invalidatePickingSlotsView();
invalidatePackablesView();
}
private boolean checkIsEmpty(final PickingSlotRow pickingSlotRowOrHU)
{
Check.assume(pickingSlotRowOrHU.isPickedHURow(), "Was expecting an HuId but found none!");
if (pickingSlotRowOrHU.getHuQtyCU() != null && pickingSlotRowOrHU.getHuQtyCU().signum()... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\pickingslot\process\WEBUI_Picking_M_Picking_Candidate_Process.java | 1 |
请完成以下Java代码 | public ITranslatableString toTranslatableString()
{
if (valueType == IssuingToleranceValueType.PERCENTAGE)
{
final Percent percent = getPercent();
return TranslatableStrings.builder().appendPercent(percent).build();
}
else if (valueType == IssuingToleranceValueType.QUANTITY)
{
final Quantity qty = g... | }
else
{
// shall not happen
throw new AdempiereException("Unknown valueType: " + valueType);
}
}
public IssuingToleranceSpec convertQty(@NonNull final UnaryOperator<Quantity> qtyConverter)
{
if (valueType == IssuingToleranceValueType.QUANTITY)
{
final Quantity qtyConv = qtyConverter.apply(qty);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\product\IssuingToleranceSpec.java | 1 |
请完成以下Java代码 | public void setQtyLUFromQtyTU(final IHUPackingAware record)
{
final BigDecimal qtyTUs = record.getQtyTU();
if (qtyTUs == null)
{
return;
}
final BigDecimal capacity = calculateLUCapacity(record);
if (capacity == null)
{
return;
}
final BigDecimal qtyLUs = qtyTUs.divide(capacity, RoundingMode.... | public void validateLUQty(final BigDecimal luQty)
{
final int maxLUQty = sysConfigBL.getIntValue(SYS_CONFIG_MAXQTYLU, SYS_CONFIG_MAXQTYLU_DEFAULT_VALUE);
if (luQty != null && luQty.compareTo(BigDecimal.valueOf(maxLUQty)) > 0)
{
throw new AdempiereException(MSG_MAX_LUS_EXCEEDED);
}
}
private I_C_UOM extra... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\adempiere\gui\search\impl\HUPackingAwareBL.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public @Nullable String getLocation() {
return this.location;
}
public void setLocation(@Nullable String location) {
this.location = location;
}
public DataSize getMaxFileSize() {
... | }
public boolean isResolveLazily() {
return this.resolveLazily;
}
public void setResolveLazily(boolean resolveLazily) {
this.resolveLazily = resolveLazily;
}
public boolean isStrictServletCompliance() {
return this.strictServletCompliance;
}
public void setStrictServletCompliance(boolean strictServletC... | repos\spring-boot-4.0.1\module\spring-boot-servlet\src\main\java\org\springframework\boot\servlet\autoconfigure\MultipartProperties.java | 2 |
请完成以下Java代码 | public int getA_Asset_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_A_Asset_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set A_Asset_Info_Lic_ID.
@param A_Asset_Info_Lic_ID A_Asset_Info_Lic_ID */
public void setA_Asset_Info_Lic_ID (int A_Asset_Info_Lic_ID)
{
if (A_Asset_Info_Li... | /** Get Policy Renewal Date.
@return Policy Renewal Date */
public Timestamp getA_Renewal_Date ()
{
return (Timestamp)get_Value(COLUMNNAME_A_Renewal_Date);
}
/** Set Account State.
@param A_State
State of the Credit Card or Account holder
*/
public void setA_State (String A_State)
{
set_Value (C... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Info_Lic.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public IPage<DictVO> selectDictPage(IPage<DictVO> page, DictVO dict) {
return page.setRecords(baseMapper.selectDictPage(page, dict));
}
@Override
public List<DictVO> tree() {
return ForestNodeMerger.merge(baseMapper.tree());
}
@Override
@Cacheable(cacheNames = DICT_VALUE, key = "#code+'_'+#dictKey")
public... | public List<Dict> getList(String code) {
return baseMapper.getList(code);
}
@Override
@CacheEvict(cacheNames = {DICT_LIST, DICT_VALUE}, allEntries = true)
public boolean submit(Dict dict) {
LambdaQueryWrapper<Dict> lqw = Wrappers.<Dict>query().lambda().eq(Dict::getCode, dict.getCode()).eq(Dict::getDictKey, dic... | repos\SpringBlade-master\blade-service\blade-system\src\main\java\org\springblade\system\service\impl\DictServiceImpl.java | 2 |
请完成以下Java代码 | private void init()
{
purchaseOrder = orderDAO.getById(selectedPurchaseOrderId);
final Optional<List<I_C_Order>> salesOrders = getSalesOrders();
salesOrderRecordRefs = salesOrders.map(this::getSalesOrdersRecordRef).orElse(ImmutableMap.of());
bPartnerRecordRefs = salesOrders.map(this::getSalesOrderPartnersRe... | @NonNull
private Map<TableRecordReference, I_C_Order> getSalesOrdersRecordRef(@NonNull final List<I_C_Order> salesOrders)
{
return salesOrders
.stream()
.collect(ImmutableMap.toImmutableMap(order -> TableRecordReference.of(I_C_Order.Table_Name, order.getC_Order_ID()),
Function.identity()));
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\attachmenteditor\OrderAttachmentRowsLoader.java | 1 |
请完成以下Java代码 | public final class InvoiceAcct
{
@Getter @NonNull private final InvoiceId invoiceId;
@Getter @NonNull private final OrgId orgId;
@Getter @NonNull private final ImmutableList<InvoiceAcctRule> rulesOrdered;
@Builder
private InvoiceAcct(
final @NonNull InvoiceId invoiceId,
final @NonNull OrgId orgId,
final ... | .collect(ImmutableList.toImmutableList());
}
@NonNull
public Optional<ElementValueId> getElementValueId(
@NonNull final AcctSchemaId acctSchemaId,
@NonNull final AccountConceptualName accountConceptualName,
@Nullable final InvoiceAndLineId invoiceAndLineId)
{
return this.rulesOrdered.stream()
.filte... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\acct\InvoiceAcct.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable ConfigDataResource getLocation() {
return this.location;
}
/**
* Return the replacement property that should be used instead or {@code null} if not
* replacement is available.
* @return the replacement property name
*/
public @Nullable ConfigurationPropertyName getReplacement() {
return... | message.append("' imported from location '");
message.append(location);
}
message.append("' is invalid");
if (profileSpecific) {
message.append(" in a profile specific resource");
}
if (replacement != null) {
message.append(" and should be replaced with '");
message.append(replacement);
message... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\config\InvalidConfigDataPropertyException.java | 2 |
请完成以下Java代码 | public void makeDeliveryStopIfNeeded(@NonNull final I_C_DunningDoc dunningDoc)
{
final org.compiere.model.I_C_DunningLevel dunningLevel = dunningDoc.getC_DunningLevel();
if (!dunningLevel.isDeliveryStop())
{
return;
}
final IShipmentConstraintsBL shipmentConstraintsBL = Services.get(IShipmentConstraintsB... | {
// no dunning grace date => not expired
return false;
}
final Timestamp dunningDate = candidate.getDunningDate();
if (dunningDate.compareTo(dunningGraceDate) >= 0)
{
// DunningDate >= DunningGrace => candidate is perfectly valid. It's date is after dunningGrace date
return false;
}
// Dunnin... | repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java\de\metas\dunning\api\impl\DunningBL.java | 1 |
请完成以下Java代码 | public int getC_PaymentProcessor_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentProcessor_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Document No.
@param DocumentNo
Document sequence number of the document
*/
public void setDocumentNo (String DocumentNo)
{
set_... | /** Get Processed.
@return The document has been processed
*/
public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Process Now.
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_PaymentBatch.java | 1 |
请完成以下Java代码 | private void extendFlatrateTermIfAutoExtension(final I_C_Flatrate_Term term)
{
final I_C_Flatrate_Conditions conditions = term.getC_Flatrate_Conditions();
final I_C_Flatrate_Transition transition = conditions.getC_Flatrate_Transition();
if (transition != null
&& X_C_Flatrate_Transition.EXTENSIONTYPE_Extend... | final CustomerRetentionRepository customerRetentionRepo = SpringContextHolder.instance.getBean(CustomerRetentionRepository.class);
if (!order.isSOTrx())
{
// nothing to do
return;
}
final OrderId orderId = OrderId.ofRepoId(order.getC_Order_ID());
customerRetentionRepo.updateCustomerRetentionOnOrderCo... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\interceptor\C_Order.java | 1 |
请完成以下Java代码 | private void onRecordAndChildrenCopied(final I_C_OrderLine toOrderLine, final I_C_OrderLine fromOrderLine)
{
ClonedOrderLinesInfo.getOrCreate(getTargetOrder())
.addOriginalToClonedOrderLineMapping(
OrderLineId.ofRepoId(fromOrderLine.getC_OrderLine_ID()),
OrderLineId.ofRepoId(toOrderLine.getC_OrderLin... | final int orderCompensationGroupIdNew = orderCompensationGroupIdsMap.computeIfAbsent(orderCompensationGroupId, k -> cloneOrderCompensationGroup(orderCompensationGroupId, toOrderId));
return orderCompensationGroupIdNew;
}
private static int cloneOrderCompensationGroup(final int orderCompensationGroupId, final int t... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\copy\C_OrderLine_CopyRecordSupport.java | 1 |
请完成以下Java代码 | public void setAD_WF_Responsible_ID (int AD_WF_Responsible_ID)
{
if (AD_WF_Responsible_ID < 1)
set_Value (COLUMNNAME_AD_WF_Responsible_ID, null);
else
set_Value (COLUMNNAME_AD_WF_Responsible_ID, Integer.valueOf(AD_WF_Responsible_ID));
}
/** Get Workflow - Verantwortlicher.
@return Verantwortlicher für... | if (ii == null)
return 0;
return ii.intValue();
}
/** Set Datensatz-ID.
@param Record_ID
Direct internal record ID
*/
@Override
public void setRecord_ID (int Record_ID)
{
if (Record_ID < 0)
set_ValueNoCheck (COLUMNNAME_Record_ID, null);
else
set_ValueNoCheck (COLUMNNAME_Record_ID, Intege... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\workflow\model\X_C_Doc_Responsible.java | 1 |
请完成以下Java代码 | private @Nullable Object resolveSecurityContextFromAnnotation(MethodParameter parameter,
CurrentSecurityContext annotation, SecurityContext securityContext) {
Object securityContextResult = securityContext;
String expressionToParse = annotation.expression();
if (StringUtils.hasLength(expressionToParse)) {
S... | /**
* Obtain the specified {@link Annotation} on the specified {@link MethodParameter}.
* @param parameter the {@link MethodParameter} to search for an {@link Annotation}
* @return the {@link Annotation} that was found or null.
*/
private @Nullable CurrentSecurityContext findMethodAnnotation(MethodParameter pa... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\method\annotation\CurrentSecurityContextArgumentResolver.java | 1 |
请完成以下Java代码 | public void setSourceElement(BaseElement sourceElement) {
this.sourceElement = sourceElement;
}
public String getTargetRef() {
return targetRef;
}
public void setTargetRef(String targetRef) {
this.targetRef = targetRef;
}
public BaseElement getTargetElement() {
... | public void setTransitionEvent(String transitionEvent) {
this.transitionEvent = transitionEvent;
}
@Override
public Association clone() {
Association clone = new Association();
clone.setValues(this);
return clone;
}
public void setValues(Association otherElement) {
... | repos\flowable-engine-main\modules\flowable-cmmn-model\src\main\java\org\flowable\cmmn\model\Association.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Duration getStep() {
return this.step;
}
public void setStep(Duration step) {
this.step = step;
}
public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public Duration getConnectTimeout() {
return this.connectTimeout;
}
pu... | }
public void setLwcEnabled(boolean lwcEnabled) {
this.lwcEnabled = lwcEnabled;
}
public Duration getLwcStep() {
return this.lwcStep;
}
public void setLwcStep(Duration lwcStep) {
this.lwcStep = lwcStep;
}
public boolean isLwcIgnorePublishStep() {
return this.lwcIgnorePublishStep;
}
public void set... | repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\atlas\AtlasProperties.java | 2 |
请完成以下Java代码 | public class ExternalTaskActivityBehavior extends AbstractBpmnActivityBehavior implements MigrationObserverBehavior {
protected ParameterValueProvider topicNameValueProvider;
protected ParameterValueProvider priorityValueProvider;
public ExternalTaskActivityBehavior(ParameterValueProvider topicName, ParameterVa... | leave(execution);
}
public ParameterValueProvider getPriorityValueProvider() {
return priorityValueProvider;
}
@Override
public void migrateScope(ActivityExecution scopeExecution) {
}
@Override
public void onParseMigratingInstance(MigratingInstanceParseContext parseContext, MigratingActivityInsta... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\behavior\ExternalTaskActivityBehavior.java | 1 |
请完成以下Java代码 | public BigDecimal getQtyDeliveredInUOM()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyDeliveredInUOM);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setQtyEntered (final @Nullable BigDecimal QtyEntered)
{
set_Value (COLUMNNAME_QtyEntered, QtyEntered);
}
@Override
publ... | return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setQtyOrdered_Override (final @Nullable BigDecimal QtyOrdered_Override)
{
set_Value (COLUMNNAME_QtyOrdered_Override, QtyOrdered_Override);
}
@Override
public BigDecimal getQtyOrdered_Override()
{
final BigDecimal bd = get_ValueAsBigDecimal... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_DesadvLine.java | 1 |
请完成以下Java代码 | public AmountAndCurrencyExchangeDetails3 getCntrValAmt() {
return cntrValAmt;
}
/**
* Sets the value of the cntrValAmt property.
*
* @param value
* allowed object is
* {@link AmountAndCurrencyExchangeDetails3 }
*
*/
public void setCntrValAmt(AmountAn... | * <p>
* For example, to add a new item, do as follows:
* <pre>
* getPrtryAmt().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link AmountAndCurrencyExchangeDetails4 }
*
*
*/
public List<AmountAndCurre... | 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\AmountAndCurrencyExchange3.java | 1 |
请完成以下Java代码 | public class FibonacciSeriesUtils {
public static int nthFibonacciTermRecursiveMethod(int n) {
if (n == 0 || n == 1) {
return n;
}
return nthFibonacciTermRecursiveMethod(n - 1) + nthFibonacciTermRecursiveMethod(n - 2);
}
public static int nthFibonacciTermIterativeMethod... | for (int i = 2; i <= n; i++) {
tempNthTerm = n0 + n1;
n0 = n1;
n1 = tempNthTerm;
}
return n1;
}
public static int nthFibonacciTermUsingBinetsFormula(int n) {
final double squareRootOf5 = Math.sqrt(5);
final double phi = (1 + squareRootOf5)/2;
... | repos\tutorials-master\core-java-modules\core-java-numbers-3\src\main\java\com\baeldung\fibonacci\FibonacciSeriesUtils.java | 1 |
请完成以下Spring Boot application配置 | spring:
application:
name: sc-admin-client
eureka:
instance:
leaseRenewalIntervalInSeconds: 10
health-check-url-path: /actuator/health
client:
registryFetchIntervalSeconds: 5
service-url:
defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/
management:
| endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
server:
port: 8762 | repos\SpringBootLearning-master (1)\springboot-admin\sc-admin-client\src\main\resources\application.yml | 2 |
请完成以下Java代码 | public void setM_Shipper_ID (final int M_Shipper_ID)
{
if (M_Shipper_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_Shipper_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_Shipper_ID, M_Shipper_ID);
}
@Override
public int getM_Shipper_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Shipper_ID);
}
@Override
pu... | return get_ValueAsInt(COLUMNNAME_M_Shipper_Mapping_Config_ID);
}
@Override
public void setSeqNo (final int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, SeqNo);
}
@Override
public int getSeqNo()
{
return get_ValueAsInt(COLUMNNAME_SeqNo);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Shipper_Mapping_Config.java | 1 |
请完成以下Java代码 | public Thread createUserThread(final Runnable runnable, final String threadName)
{
final Thread thread;
if (threadName == null)
{
thread = new Thread(runnable);
}
else
{
thread = new Thread(runnable, threadName);
}
thread.setDaemon(true);
return thread;
}
@Override
public final void execu... | *
* @deprecated please check out the deprecation notice in {@link IClientUIInstance#hideBusyDialog()}.
*/
@Deprecated
@Override
public void hideBusyDialog()
{
// nothing
}
/**
* This method does nothing.
*
* @deprecated please check out the deprecation notice in {@link IClientUIInstance#disableServer... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\adempiere\form\AbstractClientUIInstance.java | 1 |
请完成以下Java代码 | public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public int getSpeed() {
return speed;
}
public void setSpeed(int speed) {
this.speed = speed;
}
public int increaseSpeed(int increment) {
if (... | }
return this.speed;
}
public int decreaseSpeed(int decrement) {
if (decrement > 0 && decrement <= this.speed) {
this.speed -= decrement;
} else {
System.out.println("Decrement can't be negative or greater than current speed.");
}
return this.... | repos\tutorials-master\core-java-modules\core-java-lang-oop-others\src\main\java\com\baeldung\oop\Car.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.