instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public int getRevisionNext() {
return revision + 1;
}
public int getRevision() {
return revision;
}
public void setRevision(int revision) {
this.r... | }
public boolean isUpdated() {
return isUpdated;
}
public void setUpdated(boolean isUpdated) {
this.isUpdated = isUpdated;
}
public boolean isDeleted() {
return isDeleted;
}
public void setDeleted(boolean isDeleted) {
this.isDeleted = isDeleted;
}
} | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\AbstractEntity.java | 1 |
请完成以下Java代码 | public QueueBuilder lazy() {
return withArgument("x-queue-mode", "lazy");
}
/**
* Set the master locator mode which determines which node a queue master will be
* located on a cluster of nodes.
* @param locator {@link LeaderLocator}.
* @return the builder.
* @since 2.2
*/
public QueueBuilder leaderLoc... | private final String value;
Overflow(String value) {
this.value = value;
}
/**
* Return the value.
* @return the value.
*/
public String getValue() {
return this.value;
}
}
/**
* Locate the queue leader.
*
* @since 2.3.7
*
*/
public enum LeaderLocator {
/**
* Deploy on th... | repos\spring-amqp-main\spring-amqp\src\main\java\org\springframework\amqp\core\QueueBuilder.java | 1 |
请完成以下Java代码 | public class ResultVo extends HashMap<String, Object> {
public ResultVo() {
put("code", 200);
put("msg", "success");
}
public static ResultVo ok() {
return new ResultVo();
}
public static ResultVo ok(Object data) {
ResultVo resultVo = new ResultVo();
result... | resultVo.put("msg", msg);
return resultVo;
}
public static ResultVo error(int code, String msg) {
ResultVo resultVo = new ResultVo();
resultVo.put("code", code);
resultVo.put("msg", msg);
return resultVo;
}
@Override
public ResultVo put(String key, Object va... | repos\SpringBootCodeGenerator-master\src\main\java\com\softdev\system\generator\entity\vo\ResultVo.java | 1 |
请完成以下Java代码 | public String toString()
{
return MoreObjects.toStringHelper(this)
.add("class", classRef)
.add("methodName", methodName)
.add("parameters", parameterTypeRefs)
.toString();
}
public Method getMethod()
{
// Get if not expired
{
final WeakReference<Method> weakRef = methodRef.get();
final... | final Method methodNew = clazz.getDeclaredMethod(methodName, parameterTypes);
methodRef.set(new WeakReference<>(methodNew));
return methodNew;
}
catch (final Exception ex)
{
throw new IllegalStateException("Cannot load expired field: " + classRef + "/" + methodName + " (" + parameterTypeRefs + ")", ex);... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\reflect\MethodReference.java | 1 |
请完成以下Java代码 | public String getProcessDefinitionId() {
return processDefinitionId;
}
public String getProcessDefinitionName() {
return processDefinitionName;
}
public String getProcessDefinitionNameLike() {
return processDefinitionNameLike;
}
public String getActivityId() {
return activityId;
}
pu... | }
public Date getNow() {
return ClockUtil.getCurrentTime();
}
protected void ensureVariablesInitialized() {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
VariableSerializers variableSerializers = processEngineConfiguration.getVariableSerializers... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\ExternalTaskQueryImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static DDOrderQueryBuilder ddOrdersAssignedToUser(@NonNull final UserId responsibleId, @NonNull DistributionJobSorting sorting)
{
return newDDOrdersQuery()
.orderBys(sorting.toDDOrderQueryOrderBys())
.responsibleId(ValueRestriction.equalsTo(responsibleId));
}
public static DDOrderQuery toActiveNot... | return InSetPredicate.only(onlyWarehouseToId);
}
else
{
return InSetPredicate.none();
}
}
else if (!facetWarehouseToIds.isEmpty())
{
return InSetPredicate.only(facetWarehouseToIds);
}
else
{
return InSetPredicate.any();
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\job\service\DistributionJobQueries.java | 2 |
请完成以下Java代码 | public void setPA_Achievement_ID (int PA_Achievement_ID)
{
if (PA_Achievement_ID < 1)
set_ValueNoCheck (COLUMNNAME_PA_Achievement_ID, null);
else
set_ValueNoCheck (COLUMNNAME_PA_Achievement_ID, Integer.valueOf(PA_Achievement_ID));
}
/** Get Achievement.
@return Performance Achievement
*/
public in... | set_ValueNoCheck (COLUMNNAME_PA_Measure_ID, Integer.valueOf(PA_Measure_ID));
}
/** Get Measure.
@return Concrete Performance Measurement
*/
public int getPA_Measure_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_PA_Measure_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Sequen... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_Achievement.java | 1 |
请完成以下Java代码 | public void findAndRegisterMbeans() throws Exception {
register(new ProcessDefinitionsMBean(jmxConfigurator.getProcessEngineConfig()), new ObjectName(jmxConfigurator.getDomain(), "type", "Deployments"));
register(new JobExecutorMBean(jmxConfigurator.getProcessEngineConfig()), new ObjectName(jmxConfigura... | url = new JMXServiceURL("service:jmx:rmi://" + host + ":" + connectorPort + "/jndi/rmi://" + host + ":" + registryPort + path);
} else {
url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + host + ":" + registryPort + path);
}
cs = JMXConnectorServerFactory.newJMXConnectorServ... | repos\flowable-engine-main\modules\flowable-jmx\src\main\java\org\flowable\management\jmx\DefaultManagementAgent.java | 1 |
请完成以下Java代码 | public void onOpen(EventSource eventSource, Response response) {
log.info("OpenAI服务器连接成功!,traceId[{}]", traceId);
}
@SneakyThrows
@Override
public void onEvent(EventSource eventSource, String id, String type, String data) {
log.info("on event data: {}", data);
if (data.equals("... | }
@Override
public void onClosed(EventSource eventSource) {
log.info("OpenAI服务器关闭连接!,traceId[{}]", traceId);
log.info("complete answer: {}", StrUtil.join("", answer));
sseEmitter.complete();
}
@SneakyThrows
@Override
public void onFailure(EventSource eventSource, Thro... | repos\spring-boot-quick-master\quick-sse\src\main\java\com\quick\event\ChatGPTEventListener.java | 1 |
请完成以下Java代码 | public void setOr(boolean or) {
this.or = or;
}
public boolean isOrAlphabetic() {
return orAlphabetic;
}
public void setOrAlphabetic(boolean orAlphabetic) {
this.orAlphabetic = orAlphabetic;
}
public boolean isNot() {
return not;
}
public void setNot(b... | @Override
public String toString() {
return "SpelRelational{" +
"equal=" + equal +
", equalAlphabetic=" + equalAlphabetic +
", notEqual=" + notEqual +
", notEqualAlphabetic=" + notEqualAlphabetic +
", lessThan=" + lessThan +
... | repos\tutorials-master\spring-spel\src\main\java\com\baeldung\spring\spel\examples\SpelRelational.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DatabaseDto findById(String id) {
Database database = databaseRepository.findById(id).orElseGet(Database::new);
ValidationUtil.isNull(database.getId(),"Database","id",id);
return databaseMapper.toDto(database);
}
@Override
@Transactional(rollbackFor = Exception.class)
pub... | }
}
@Override
public boolean testConnection(Database resources) {
try {
return SqlUtils.testConnection(resources.getJdbcUrl(), resources.getUserName(), resources.getPwd());
} catch (Exception e) {
log.error(e.getMessage());
return false;
}
}
... | repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\maint\service\impl\DatabaseServiceImpl.java | 2 |
请完成以下Java代码 | public int getC_PurchaseCandidate_ID()
{
return get_ValueAsInt(COLUMNNAME_C_PurchaseCandidate_ID);
}
@Override
public void setIsAdvised (boolean IsAdvised)
{
set_Value (COLUMNNAME_IsAdvised, Boolean.valueOf(IsAdvised));
}
@Override
public boolean isAdvised()
{
return get_ValueAsBoolean(COLUMNNAME_IsA... | }
@Override
public void setM_ReceiptSchedule_ID (int M_ReceiptSchedule_ID)
{
if (M_ReceiptSchedule_ID < 1)
set_Value (COLUMNNAME_M_ReceiptSchedule_ID, null);
else
set_Value (COLUMNNAME_M_ReceiptSchedule_ID, Integer.valueOf(M_ReceiptSchedule_ID));
}
@Override
public int getM_ReceiptSchedule_ID()
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java-gen\de\metas\material\dispo\model\X_MD_Candidate_Purchase_Detail.java | 1 |
请完成以下Java代码 | public static Optional<PaymentTermBreakId> optionalOfRepoId(
@Nullable final Integer paymentTermId,
@Nullable final Integer paymentTermBreakId)
{
return Optional.ofNullable(ofRepoIdOrNull(paymentTermId, paymentTermBreakId));
}
@Nullable
public static PaymentTermBreakId ofRepoIdOrNull(
@Nullable final Pa... | {
this.paymentTermId = paymentTermId;
this.repoId = Check.assumeGreaterThanZero(repoId, "C_PaymentTerm_Break_ID");
}
public static int toRepoId(@Nullable final PaymentTermBreakId paymentTermBreakId)
{
return paymentTermBreakId != null ? paymentTermBreakId.getRepoId() : -1;
}
public static boolean equals(fi... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\payment\paymentterm\PaymentTermBreakId.java | 1 |
请完成以下Java代码 | public class X_AD_Org extends org.compiere.model.PO implements I_AD_Org, org.compiere.model.I_Persistent
{
private static final long serialVersionUID = 1255990917L;
/** Standard Constructor */
public X_AD_Org (final Properties ctx, final int AD_Org_ID, @Nullable final String trxName)
{
super (ctx,... | return get_ValueAsString(COLUMNNAME_Description);
}
@Override
public void setIsEUOneStopShop (final boolean IsEUOneStopShop)
{
set_Value (COLUMNNAME_IsEUOneStopShop, IsEUOneStopShop);
}
@Override
public boolean isEUOneStopShop()
{
return get_ValueAsBoolean(COLUMNNAME_IsEUOneStopShop);
}
@Override
pub... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Org.java | 1 |
请完成以下Java代码 | public void onApplicationEvent(@Nullable ApplicationEvent event) {
if (event instanceof ApplicationEnvironmentPreparedEvent) {
ApplicationEnvironmentPreparedEvent environmentPreparedEvent = (ApplicationEnvironmentPreparedEvent) event;
onApplicationEnvironmentPreparedEvent(environmentPreparedEvent);
}
}
... | Assert.hasText(propertyName, () -> String.format("PropertyName [%s] is required", propertyName));
if (StringUtils.hasText(propertyValue)) {
System.setProperty(propertyName, propertyValue);
}
}
@Override
public boolean supportsEventType(@NonNull ResolvableType eventType) {
Class<?> rawType = eventType.get... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\context\logging\GeodeLoggingApplicationListener.java | 1 |
请完成以下Java代码 | public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public User password(String password) {
this.password = password;
return this;
}
/**
* Get password
* @return password
**/
@ApiModelProperty(value = "")
public String getPass... | Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
Objects.equals(this.email, user.email) &&
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
... | repos\tutorials-master\spring-swagger-codegen-modules\spring-swagger-codegen-api-client\src\main\java\com\baeldung\petstore\client\model\User.java | 1 |
请完成以下Java代码 | public class DefaultWebSecurityExpressionHandler extends AbstractSecurityExpressionHandler<FilterInvocation>
implements SecurityExpressionHandler<FilterInvocation> {
private static final String DEFAULT_ROLE_PREFIX = "ROLE_";
private String defaultRolePrefix = DEFAULT_ROLE_PREFIX;
@Override
protected SecurityEx... | * <p>
* Sets the default prefix to be added to
* {@link org.springframework.security.access.expression.SecurityExpressionRoot#hasAnyRole(String...)}
* or
* {@link org.springframework.security.access.expression.SecurityExpressionRoot#hasRole(String)}.
* For example, if hasRole("ADMIN") or hasRole("ROLE_ADMIN")... | repos\spring-security-main\access\src\main\java\org\springframework\security\web\access\expression\DefaultWebSecurityExpressionHandler.java | 1 |
请完成以下Java代码 | public class ActivitiElContext extends ELContext {
protected ELResolver elResolver;
private ActivitiFunctionMapper functions;
private ActivitiVariablesMapper variables;
public ActivitiElContext() {
this(null);
}
public ActivitiElContext(ELResolver elResolver) {
this.elResolver... | }
public VariableMapper getVariableMapper() {
if (variables == null) {
variables = new ActivitiVariablesMapper();
}
return variables;
}
public void setFunction(String prefix, String localName, Method method) {
if (functions == null) {
functions = new... | repos\Activiti-develop\activiti-core-common\activiti-expression-language\src\main\java\org\activiti\core\el\ActivitiElContext.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Role {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
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 Role() {
}
public Role(String name) {
this.name = name;
}
@Override
public String toString() {
return "Role{" +
"id=" + id +
", name='" + name + '\'' +
'}'... | repos\Spring-Boot-Advanced-Projects-main\Springboot-Registration-Page\src\main\java\aspera\registration\model\Role.java | 2 |
请完成以下Java代码 | public static String cnapsCode(String code) {
if (oConvertUtils.isEmpty(code)) {
return "";
}
return formatRight(code, 2);
}
/**
* 将右边的格式化成*
* @param str 字符串
* @param reservedLength 保留长度
* @return 格式化后的字符串
*/
public static String formatRight(Str... | }
/**
* 将中间的格式化成*
* @param str 字符串
* @param beginLen 开始保留长度
* @param endLen 结尾保留长度
* @return 格式化后的字符串
*/
public static String formatBetween(String str, int beginLen, int endLen){
int len = str.length();
String begin = str.substring(0, beginLen);
String end ... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\desensitization\util\SensitiveInfoUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class RemoteDevToolsProperties {
public static final String DEFAULT_CONTEXT_PATH = "/.~~spring-boot!~";
public static final String DEFAULT_SECRET_HEADER_NAME = "X-AUTH-TOKEN";
/**
* Context path used to handle the remote connection.
*/
private String contextPath = DEFAULT_CONTEXT_PATH;
/**
* A sha... | this.enabled = enabled;
}
}
public static class Proxy {
/**
* The host of the proxy to use to connect to the remote application.
*/
private @Nullable String host;
/**
* The port of the proxy to use to connect to the remote application.
*/
private @Nullable Integer port;
public @Nullable S... | repos\spring-boot-4.0.1\module\spring-boot-devtools\src\main\java\org\springframework\boot\devtools\autoconfigure\RemoteDevToolsProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public ReportContext build()
{
return new ReportContext(this);
}
public Builder setCtx(final Properties ctx)
{
this.ctx = ctx;
return this;
}
public Builder setAD_Process_ID(final AdProcessId AD_Process_ID)
{
this.AD_Process_ID = AD_Process_ID;
return this;
}
public Builder setPInsta... | }
public Builder setApplySecuritySettings(final boolean applySecuritySettings)
{
this.applySecuritySettings = applySecuritySettings;
return this;
}
private ImmutableList<ProcessInfoParameter> getProcessInfoParameters()
{
return Services.get(IADPInstanceDAO.class).retrieveProcessInfoParameters(pinst... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\metasfresh-report-service\src\main\java\de\metas\report\server\ReportContext.java | 2 |
请完成以下Java代码 | class CoreSecurityRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
registerExceptionEventsHints(hints);
registerExpressionEvaluationHints(hints);
registerMethodSecurityHints(hints);
hints.resources().registerResourceB... | (builder) -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS));
}
private List<TypeReference> getDefaultAuthenticationExceptionEventPublisherTypes() {
return Stream
.of(AuthenticationFailureBadCredentialsEvent.class, AuthenticationFailureCredentialsExpiredEvent.class,
AuthenticationFailureD... | repos\spring-security-main\core\src\main\java\org\springframework\security\aot\hint\CoreSecurityRuntimeHints.java | 1 |
请完成以下Java代码 | public void setTaskId(String taskId) {
startTask(taskId);
}
/**
* @see #associateExecutionById(String)
*/
public void setExecution(Execution execution) {
associateExecutionById(execution.getId());
}
/**
* @see #associateExecutionById(String)
*/
protected void setExecutionId(String exec... | return associationManager.getExecution();
}
/**
* @see #getExecution()
*/
public String getExecutionId() {
Execution e = getExecution();
return e != null ? e.getId() : null;
}
/**
* Returns the {@link ProcessInstance} currently associated or 'null'
*
* @throws ProcessEngineCdiExceptio... | repos\camunda-bpm-platform-master\engine-cdi\core\src\main\java\org\camunda\bpm\engine\cdi\BusinessProcess.java | 1 |
请完成以下Java代码 | public void setPP_Order_Qty_ID (final int PP_Order_Qty_ID)
{
if (PP_Order_Qty_ID < 1)
set_ValueNoCheck (COLUMNNAME_PP_Order_Qty_ID, null);
else
set_ValueNoCheck (COLUMNNAME_PP_Order_Qty_ID, PP_Order_Qty_ID);
}
@Override
public int getPP_Order_Qty_ID()
{
return get_ValueAsInt(COLUMNNAME_PP_Order_Qty... | public boolean isProcessed()
{
return get_ValueAsBoolean(COLUMNNAME_Processed);
}
@Override
public void setQty (final BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
@Override
public BigDecimal getQty()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty);
return bd != null ? bd : Big... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_PP_Order_Qty.java | 1 |
请完成以下Java代码 | public class Dept implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Schema(description = "主键")
@TableId(value = "id", type = IdType.ASSIGN_ID)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 租户ID
*/
@Schema(description = "租户ID")
... | /**
* 部门全称
*/
@Schema(description = "部门全称")
private String fullName;
/**
* 排序
*/
@Schema(description = "排序")
private Integer sort;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 是否已删除
*/
@TableLogic
@Schema(description = "是否已删除")
private Integer isDeleted;
} | repos\SpringBlade-master\blade-service-api\blade-system-api\src\main\java\org\springblade\system\entity\Dept.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SpringSecurity extends WebSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth
.inMemoryAuthentication()
.withUser("admin").password(passwordEncoder().encode("admin123")).roles("ADMIN")
... | http
.authorizeRequests()
.antMatchers("/index").permitAll()
.antMatchers("/profile/**").authenticated()
.antMatchers("/admin/**").hasRole("ADMIN") // Admin
.antMatchers("/management/**").hasAnyRole("ADMIN", "MANAGER")
.antM... | repos\SpringBoot-Projects-FullStack-master\Part-6 Spring Boot Security\3. SpringSecureRestControl\src\main\java\spring\security\security\SpringSecurity.java | 2 |
请完成以下Spring Boot application配置 | server.port=80
#Mongo \u914D\u7F6E
spring.data.mongodb.host=192.168.35.128
spring.data.mongodb.port=27017
#spring.data.mongodb.uri=mongodb://192.168.35.128/test
spring.data.mongodb.database=test
#\u65E5\u5FD7\u914D\u7F6E
logging.level.com.xiaolyuh=debug
logging.level.org.springframework.we | b=debug
logging.level.org.springframework.transaction=debug
logging.level.org.springframework.data.mongodb=debug
debug=false | repos\spring-boot-student-master\spring-boot-student-data-mongo\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public Affinity operation(ConnectionSettings.Affinity.Operation operation) {
this.affinity.operation(operation);
return this;
}
public Affinity reuse(boolean reuse) {
this.affinity.reuse(reuse);
return this;
}
public Affinity strategy(ConnectionSettings.AffinityStrategy strategy) {
this.affinit... | }
public static final class Recovery {
private final ConnectionBuilder.RecoveryConfiguration recoveryConfiguration;
private Recovery(ConnectionBuilder.RecoveryConfiguration recoveryConfiguration) {
this.recoveryConfiguration = recoveryConfiguration;
}
public Recovery activated(boolean activated) {
th... | repos\spring-amqp-main\spring-rabbitmq-client\src\main\java\org\springframework\amqp\rabbitmq\client\SingleAmqpConnectionFactory.java | 1 |
请完成以下Java代码 | public void insert(EventLogEntryEntity eventLogEntryEntity) {
getDbSqlSession().insert(eventLogEntryEntity);
}
@SuppressWarnings("unchecked")
public List<EventLogEntry> findAllEventLogEntries() {
return getDbSqlSession().selectList("selectAllEventLogEntries");
}
@SuppressWarnings("... | return getDbSqlSession().selectList("selectEventLogEntries", params);
}
@SuppressWarnings("unchecked")
public List<EventLogEntry> findEventLogEntriesByProcessInstanceId(String processInstanceId) {
Map<String, Object> params = new HashMap<>(2);
params.put("processInstanceId", processInstance... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\EventLogEntryEntityManager.java | 1 |
请完成以下Java代码 | public int height() {
return root == null ? -1 : root.height;
}
private Node insert(Node root, int key) {
if (root == null) {
return new Node(key);
} else if (root.key > key) {
root.left = insert(root.left, key);
} else if (root.key < key) {
r... | z.left = rotateLeft(z.left);
z = rotateRight(z);
}
}
return z;
}
private Node rotateRight(Node y) {
Node x = y.left;
Node z = x.right;
x.right = y;
y.left = z;
updateHeight(y);
updateHeight(x);
return x;
}
... | repos\tutorials-master\data-structures-2\src\main\java\com\baeldung\avltree\AVLTree.java | 1 |
请完成以下Java代码 | public List<String> queryUsernameByIds(List<String> userIds) {
return List.of();
}
@Override
public List<String> queryUsernameByDepartPositIds(List<String> positionIds) {
return null;
}
@Override
public List<String> queryUserIdsByPositionIds(List<String> positionIds) {
... | return null;
}
@Override
public Object runAiragFlow(AiragFlowDTO airagFlowDTO) {
return null;
}
@Override
public void uniPushMsgToUser(PushMessageDTO pushMessageDTO) {
}
@Override
public String getDepartPathNameByOrgCode(String orgCode, String depId) {
return "";
... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-api\jeecg-system-cloud-api\src\main\java\org\jeecg\common\system\api\fallback\SysBaseAPIFallback.java | 1 |
请完成以下Java代码 | public class GetDeploymentResourceCmd implements Command<InputStream>, Serializable {
private static final long serialVersionUID = 1L;
protected String deploymentId;
protected String resourceName;
public GetDeploymentResourceCmd(String deploymentId, String resourceName) {
this.deploymentId = d... | throw new FlowableIllegalArgumentException("resourceName is null");
}
DmnResourceEntity resource = CommandContextUtil.getResourceEntityManager().findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);
if (resource == null) {
if (CommandContextUtil.getDeploymentEntityM... | repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\cmd\GetDeploymentResourceCmd.java | 1 |
请完成以下Java代码 | public void setM_Product_ID (int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
else
set_Value (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID));
}
/** Get Product.
@return Product, Service, Item
*/
public int getM_Product_ID ()
{
Integer ii = (Integer)... | /** Set Total Quantity.
@param TotalQty
Total Quantity
*/
public void setTotalQty (BigDecimal TotalQty)
{
set_Value (COLUMNNAME_TotalQty, TotalQty);
}
/** Get Total Quantity.
@return Total Quantity
*/
public BigDecimal getTotalQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TotalQty);... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_DistributionRunLine.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CustomUserDetailsService implements UserDetailsService {
Logger log = LoggerFactory.getLogger(CustomUserDetailsService.class);
@Autowired
private UserRepository userRepository;
public CustomUserDetailsService() {
super();
}
@Override
public UserDetails loadUserByUser... | } catch (Exception ex) {
log.error("Exception in CustomUserDetailsService: " + ex);
}
return null;
}
private Collection<GrantedAuthority> getAuthorities(User user) {
Collection<GrantedAuthority> authorities = new HashSet<>();
for (Role role : user.getRoles()) {
... | repos\tutorials-master\spring-security-modules\spring-security-web-sockets\src\main\java\com\baeldung\springsecuredsockets\security\CustomUserDetailsService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void updateTask(TaskEntity taskEntity, boolean fireUpdateEvent) {
getTaskEntityManager().update(taskEntity, fireUpdateEvent);
}
@Override
public void updateAllTaskRelatedEntityCountFlags(boolean configProperty) {
getTaskEntityManager().updateAllTaskRelatedEntityCountFlags(configP... | getTaskEntityManager().delete(task, fireEvents);
}
@Override
public void deleteTasksByExecutionId(String executionId) {
getTaskEntityManager().deleteTasksByExecutionId(executionId);
}
public TaskEntityManager getTaskEntityManager() {
return configuration.getTaskEntityManager();... | repos\flowable-engine-main\modules\flowable-task-service\src\main\java\org\flowable\task\service\impl\TaskServiceImpl.java | 2 |
请完成以下Java代码 | public HistoryCleanupJobHandlerConfiguration getConfiguration() {
return configuration;
}
public HistoryCleanupHandler setConfiguration(HistoryCleanupJobHandlerConfiguration configuration) {
this.configuration = configuration;
return this;
}
public HistoryCleanupHandler setJobId(String jobId) {
... | return this;
}
protected class HistoryCleanupHandlerCmd implements Command<Void> {
@Override
public Void execute(CommandContext commandContext) {
Map<String, Long> report = reportMetrics();
boolean isRescheduleNow = shouldRescheduleNow();
new HistoryCleanupSchedulerCmd(isRescheduleNow, ... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\historycleanup\HistoryCleanupHandler.java | 1 |
请完成以下Java代码 | public class SocialController {
private final SocialProperties socialProperties;
/**
* 授权完毕跳转
*/
@Operation(summary = "授权完毕跳转")
@RequestMapping("/oauth/render/{source}")
public void renderAuth(@PathVariable("source") String source, HttpServletResponse response) throws IOException {
AuthRequest authRequest ... | public Object revokeAuth(@PathVariable("source") String source, @PathVariable("token") String token) {
AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
return authRequest.revoke(AuthToken.builder().accessToken(token).build());
}
/**
* 续期accessToken
*/
@Operation(summary = "续期令牌... | repos\SpringBlade-master\blade-auth\src\main\java\org\springblade\auth\controller\SocialController.java | 1 |
请完成以下Java代码 | public void onResourceTypeChanged(final I_S_ResourceType resourceTypeRecord)
{
final Set<ResourceId> resourceIds = queryBL
.createQueryBuilder(I_S_Resource.class) // in trx!
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_S_Resource.COLUMNNAME_S_ResourceType_ID, resourceTypeRecord.getS_ResourceType_ID()... | if (resourceTypeIds.isEmpty())
{
return ImmutableSet.of();
}
final IQueryBL queryBL = Services.get(IQueryBL.class);
return queryBL.createQueryBuilder(I_S_Resource.class)
.addOnlyActiveRecordsFilter()
.addInArrayFilter(I_S_Resource.COLUMNNAME_S_ResourceType_ID, resourceTypeIds)
.create()
.ids... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\planning\src\main\java\de\metas\material\planning\impl\ResourceDAO.java | 1 |
请完成以下Java代码 | public int calculateDurationDays(final PPRoutingId routingId, @Nullable final ResourceId plantId, final BigDecimal qty)
{
if (plantId == null)
{
return 0;
}
Duration durationTotal = Duration.ZERO;
final PPRouting routing = Services.get(IPPRoutingRepository.class).getById(routingId);
final int intQty = ... | durationTotal = durationTotal.plus(durationBeforeOverlap);
}
//
final IResourceProductService resourceProductService = Services.get(IResourceProductService.class);
final ResourceType resourceType = resourceProductService.getResourceTypeByResourceId(plantId);
final BigDecimal availableDayTimeInHours = BigDeci... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\planning\src\main\java\de\metas\material\planning\impl\DefaultRoutingServiceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final Cctop140V other = (Cctop140V)obj;
if (cInvoiceID == null)
{
if (other.cInvoiceID != null)
{
return false;
... | if (other.discountDays != null)
{
return false;
}
}
else if (!discountDays.equals(other.discountDays))
{
return false;
}
if (rate == null)
{
if (other.rate != null)
{
return false;
}
}
else if (!rate.equals(other.rate))
{
return false;
}
return true;
}
@Override
pu... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\invoicexport\compudata\Cctop140V.java | 2 |
请完成以下Java代码 | public Authentication getAuthenticationForProcessEngine(String engineName) {
return authentications.get(engineName);
}
/**
* Adds an authentication to the list of current authentications. If there already
* exists an authentication of the same process engine, it is replaced silently.
*
* @param aut... | /**
* sets the {@link Authentications} for the current thread in a thread local.
*
* @param auth the {@link Authentications} to set.
*/
public static void setCurrent(Authentications auth) {
currentAuthentications.set(auth);
}
/**
* clears the {@link Authentications} for the current thread.
... | repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\webapp\impl\security\auth\Authentications.java | 1 |
请完成以下Java代码 | public List<JsonDocument> findTopGradesByCourse(String course, int limit) {
ViewQuery query = queryBuilder.findTopGradesByCourse(course, limit);
ViewResult result = bucket.query(query);
return extractDocuments(result);
}
public Map<String, Long> countStudentsByCourse() {
Vie... | for(ViewRow row : result.allRows()) {
String course = (String) row.key();
long sum = Long.valueOf(row.value().toString());
gradePointsByStudent.put(course, sum);
}
return gradePointsByStudent;
}
public Map<String, Float> calculateGpaByStudent() {... | repos\tutorials-master\persistence-modules\couchbase\src\main\java\com\baeldung\couchbase\mapreduce\StudentGradeService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class User extends AbstractPersistable<Long> {
private static final long serialVersionUID = -2952735933715107252L;
@Column(unique = true) private String username;
private String firstname;
private String lastname;
public User() {
this(null);
}
/**
* Creates a new user instance.
*/
private User... | /**
* @param firstname the firstname to set
*/
public void setFirstname(String firstname) {
this.firstname = firstname;
}
/**
* @return the lastname
*/
public String getLastname() {
return lastname;
}
/**
* @param lastname the lastname to set
*/
public void setLastname(String lastname) {
this... | repos\spring-data-examples-main\jpa\example\src\main\java\example\springdata\jpa\caching\User.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((comment == null) ? 0 : comment.hashCode());
result = prime * result + ((posted == null) ? 0 : posted.hashCode());
result = prime * result + ((taskId == null) ? 0 : taskId.hashCode());
return result;
}
/*
* (non-Ja... | */
@Override
public String toString() {
return "CommentDTO [taskId=" + taskId + ", comment=" + comment + ", posted=" + posted + "]";
}
}
/**
* Custom date serializer that converts the date to long before sending it out
*
* @author anilallewar
*
*/
class CustomDateToLongSerializer extends JsonSerializer<Dat... | repos\spring-boot-microservices-master\comments-webservice\src\main\java\com\rohitghatol\microservices\comments\dtos\CommentDTO.java | 2 |
请完成以下Java代码 | public final Date getLatestDateAcct()
{
Date latestDateAcct = null;
for (final IAllocableDocRow row : getRowsInnerList())
{
if (!row.isSelected())
{
continue;
}
final Date dateAcct = row.getDateAcct();
latestDateAcct = TimeUtil.max(latestDateAcct, dateAcct);
}
return latestDateAcct;
} | public final List<ModelType> getRowsSelected()
{
return FluentIterable.from(getRowsInnerList())
.filter(IAllocableDocRow.PREDICATE_Selected)
.toList();
}
public final List<ModelType> getRowsSelectedNoTaboo()
{
return FluentIterable.from(getRowsInnerList())
.filter(IAllocableDocRow.PREDICATE_Select... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.swingui\src\main\java\de\metas\banking\payment\paymentallocation\model\AbstractAllocableDocTableModel.java | 1 |
请完成以下Java代码 | public static final class SimpleElement {
/**
* Element title.
*/
private String title;
/**
* Element description.
*/
private String description;
/**
* Element default value.
*/
private String value;
/**
* Create a new instance with the given value.
* @param value the value
... | }
public void setValue(String value) {
this.value = value;
}
public void apply(TextCapability capability) {
if (StringUtils.hasText(this.title)) {
capability.setTitle(this.title);
}
if (StringUtils.hasText(this.description)) {
capability.setDescription(this.description);
}
if (StringUt... | repos\initializr-main\initializr-metadata\src\main\java\io\spring\initializr\metadata\InitializrProperties.java | 1 |
请完成以下Java代码 | public String getRuleName() {
return ruleName;
}
public void setRuleName(String ruleName) {
this.ruleName = ruleName;
}
public String getRuleColumn() {
return ruleColumn;
}
public void setRuleColumn(String ruleColumn) {
this.ruleColumn = ruleColumn;
}
... | return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getUpdateTime() {
retu... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\system\vo\SysPermissionDataRuleModel.java | 1 |
请完成以下Java代码 | public class DeleteProcessInstanceCmd implements Command<Void>, Serializable {
private static final long serialVersionUID = 1L;
protected String processInstanceId;
protected String deleteReason;
public DeleteProcessInstanceCmd(String processInstanceId, String deleteReason) {
this.processInstan... | throw new ActivitiObjectNotFoundException(
"No process instance found for id '" + processInstanceId + "'",
ProcessInstance.class
);
}
executeInternal(commandContext, processInstanceEntity);
return null;
}
protected void executeInternal(Comman... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cmd\DeleteProcessInstanceCmd.java | 1 |
请完成以下Java代码 | public void updateNameIfNotSet(final I_C_PaySelection paySelection)
{
final StringBuilder name = new StringBuilder();
if (paySelection.getPayDate() != null)
{
final DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
final String formattedDate = dateFormat.format(paySelection.getPayDate());
name... | final String bankAccountName = bankAccountService.createBankAccountName(bankAccountId);
name.append(bankAccountName);
}
if (name.length() > 0 && !paySelection.getName().startsWith(name.toString()))
{
paySelection.setName(name.toString());
}
}
// TODO: Fix this in the followup https://github.com/metasf... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\payment\modelvalidator\C_PaySelection.java | 1 |
请完成以下Java代码 | public void setExternalSystem_Config_ProCareManagement_LocalFile_ID (final int ExternalSystem_Config_ProCareManagement_LocalFile_ID)
{
if (ExternalSystem_Config_ProCareManagement_LocalFile_ID < 1)
set_ValueNoCheck (COLUMNNAME_ExternalSystem_Config_ProCareManagement_LocalFile_ID, null);
else
set_ValueNoChec... | }
@Override
public void setProductFileNamePattern (final @Nullable String ProductFileNamePattern)
{
set_Value (COLUMNNAME_ProductFileNamePattern, ProductFileNamePattern);
}
@Override
public String getProductFileNamePattern()
{
return get_ValueAsString(COLUMNNAME_ProductFileNamePattern);
}
@Override
pu... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Config_ProCareManagement_LocalFile.java | 1 |
请完成以下Java代码 | public void setPickFrom_HU(final de.metas.handlingunits.model.I_M_HU PickFrom_HU)
{
set_ValueFromPO(COLUMNNAME_PickFrom_HU_ID, de.metas.handlingunits.model.I_M_HU.class, PickFrom_HU);
}
@Override
public void setPickFrom_HU_ID (final int PickFrom_HU_ID)
{
if (PickFrom_HU_ID < 1)
set_Value (COLUMNNAME_PickF... | {
return get_ValueAsInt(COLUMNNAME_PickFrom_HU_ID);
}
@Override
public void setQtyPicked (final BigDecimal QtyPicked)
{
set_Value (COLUMNNAME_QtyPicked, QtyPicked);
}
@Override
public BigDecimal getQtyPicked()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyPicked);
return bd != null ? bd... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_Picking_Job_Step_PickedHU.java | 1 |
请完成以下Java代码 | public void afterReverseCorrect(final I_M_Inventory inventory)
{
if (inventoryService.isMaterialDisposal(inventory))
{
restoreHUsFromSnapshots(inventory);
reverseEmptiesMovements(inventory);
}
}
private void restoreHUsFromSnapshots(final I_M_Inventory inventory)
{
final String snapshotId = inventory.... | .addModelIds(topLevelHUIds)
.setReferencedModel(inventory)
.restoreFromSnapshot();
}
private void reverseEmptiesMovements(final I_M_Inventory inventory)
{
final InventoryId inventoryId = InventoryId.ofRepoId(inventory.getM_Inventory_ID());
movementDAO.retrieveMovementsForInventoryQuery(inventoryId)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inventory\interceptor\M_Inventory.java | 1 |
请完成以下Java代码 | public class RestrictedFinancialIdentificationSEPA {
@XmlElement(name = "Id", required = true)
@XmlSchemaType(name = "string")
protected RestrictedSMNDACode id;
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link RestrictedSMNDACode }
... | return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link RestrictedSMNDACode }
*
*/
public void setId(RestrictedSMNDACode value) {
this.id = value;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_008_003_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_008_003_02\RestrictedFinancialIdentificationSEPA.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private OAuthAccessToken fetchNewAccessToken(@NonNull final OAuthAccessTokenRequest request)
{
try
{
final HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAccept(ImmutableList.of(MediaType.APPLICATION_JSON));
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
final Map<String, String>... | if (Check.isNotBlank(request.getIdentity().getUsername()))
{
formData.put("email", request.getIdentity().getUsername());
}
if (Check.isNotBlank(request.getPassword()))
{
formData.put("password", request.getPassword());
}
return formData;
}
@Value
@Builder
private static class CacheKey
{
@NonNu... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-scriptedadapter\src\main\java\de\metas\camel\externalsystems\scriptedadapter\oauth\OAuthTokenManager.java | 2 |
请完成以下Java代码 | private void showRecordInfo()
{
if (m_dse == null)
{
return;
}
final int adTableId = m_dse.getAdTableId();
final ComposedRecordId recordId = m_dse.getRecordId();
if (adTableId <= 0 || recordId == null)
{
return;
}
if (!Env.getUserRolePermissions().isShowPreference()) | {
return;
}
//
final RecordInfo info = new RecordInfo(SwingUtils.getFrame(this), adTableId, recordId);
AEnv.showCenterScreen(info);
}
public void removeBorders()
{
statusLine.setBorder(BorderFactory.createEmptyBorder());
statusDB.setBorder(BorderFactory.createEmptyBorder());
infoLine.setBorder(Bor... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\StatusBar.java | 1 |
请完成以下Java代码 | public boolean isInfiniteQtyTUsPerLU()
{
return false;
}
@Override
public BigDecimal getQtyTUsPerLU()
{
final I_M_HU_Item parentHUItem = aggregatedTU.getM_HU_Item_Parent();
if (parentHUItem == null)
{
// note: shall not happen because we assume the aggregatedTU is really an aggregated TU.
new HUExce... | final BigDecimal qtyCUTotal = huProductStorage.getQty().toBigDecimal();
final BigDecimal qtyCUsPerTU = qtyCUTotal.divide(qtyTUsPerLU, 0, RoundingMode.HALF_UP);
return qtyCUsPerTU;
}
@Override
public I_C_UOM getQtyCUsPerTU_UOM()
{
final IHUProductStorage huProductStorage = getHUProductStorage();
if (huProd... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\util\AggregatedTUPackingInfo.java | 1 |
请完成以下Java代码 | protected JobDefinitionManager getJobDefinitionManager() {
return getCommandContext().getJobDefinitionManager();
}
protected EventSubscriptionManager getEventSubscriptionManager() {
return getCommandContext().getEventSubscriptionManager();
}
protected ProcessDefinitionManager getProcessDefinitionManag... | }
public void setExpressionManager(ExpressionManager expressionManager) {
this.expressionManager = expressionManager;
}
public BpmnParser getBpmnParser() {
return bpmnParser;
}
public void setBpmnParser(BpmnParser bpmnParser) {
this.bpmnParser = bpmnParser;
}
} | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\deployer\BpmnDeployer.java | 1 |
请完成以下Java代码 | protected List<String> getValueAsList(String name, JsonNode objectNode) {
List<String> resultList = new ArrayList<String>();
JsonNode valuesNode = objectNode.get(name);
if (valuesNode != null) {
for (JsonNode valueNode : valuesNode) {
if (valueNode.get("value") != nul... | }
protected boolean getPropertyValueAsBoolean(String name, JsonNode objectNode) {
return JsonConverterUtil.getPropertyValueAsBoolean(name, objectNode);
}
protected List<String> getPropertyValueAsList(String name, JsonNode objectNode) {
return JsonConverterUtil.getPropertyValueAsList(name, ... | repos\Activiti-develop\activiti-core\activiti-json-converter\src\main\java\org\activiti\editor\language\json\converter\BaseBpmnJsonConverter.java | 1 |
请完成以下Java代码 | public void deleteC_Invoice_Candidates(final I_M_InOutLine inOutLine)
{
Services.get(IInvoiceCandDAO.class).deleteAllReferencingInvoiceCandidates(inOutLine);
}
/**
* If the given <code>inoutline</code> does not reference an order, then the method does nothing. <br>
* Otherwise, it iterates that orderLine's <c... | // * create link between invoice candidate and our inout line
for (final I_C_Invoice_Candidate icRecord : invoiceCandDAO.retrieveInvoiceCandidatesForOrderLineId(orderLineId))
{
try (final MDCCloseable icRecordMDC = TableRecordMDC.putTableRecordReference(icRecord))
{
final I_C_InvoiceCandidate_InOutLine ic... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\modelvalidator\M_InOutLine.java | 1 |
请完成以下Java代码 | public static <T> T convert(TbNodeConfiguration configuration, Class<T> clazz) throws TbNodeException {
try {
return JacksonUtil.treeToValue(configuration.getData(), clazz);
} catch (IllegalArgumentException e) {
throw new TbNodeException(e, true);
}
}
public sta... | if (jsonNode != null && jsonNode.isValueNode()) {
result = result.replace(formatDataVarTemplate(group), jsonNode.asText());
}
}
}
return result;
} catch (Exception e) {
throw new RuntimeException("Failed to process p... | repos\thingsboard-master\rule-engine\rule-engine-api\src\main\java\org\thingsboard\rule\engine\api\util\TbNodeUtils.java | 1 |
请完成以下Java代码 | public InitializrMetadata update(InitializrMetadata current) {
String url = current.getConfiguration().getEnv().getSpringBootMetadataUrl();
List<DefaultMetadataElement> bootVersions = fetchSpringBootVersions(url);
if (bootVersions != null && !bootVersions.isEmpty()) {
if (bootVersions.stream().noneMatch(Defaul... | * @return the spring boot versions metadata or {@code null} if it could not be
* retrieved
*/
protected List<DefaultMetadataElement> fetchSpringBootVersions(String url) {
if (StringUtils.hasText(url)) {
try {
logger.info("Fetching Spring Boot metadata from " + url);
return new SpringBootMetadataReader... | repos\initializr-main\initializr-web\src\main\java\io\spring\initializr\web\support\SpringIoInitializrMetadataUpdateStrategy.java | 1 |
请完成以下Java代码 | public JsonObject writeConfiguration(SetJobRetriesBatchConfiguration configuration) {
JsonObject json = JsonUtil.createObject();
JsonUtil.addListField(json, JOB_IDS, configuration.getIds());
JsonUtil.addListField(json, JOB_ID_MAPPINGS, DeploymentMappingJsonConverter.INSTANCE, configuration.getIdMappings())... | }
SetJobRetriesBatchConfiguration configuration = new SetJobRetriesBatchConfiguration(
readJobIds(json), readIdMappings(json), JsonUtil.getInt(json, RETRIES), dueDate, isDueDateSet);
return configuration;
}
protected List<String> readJobIds(JsonObject jsonObject) {
return JsonUtil.asStringLis... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\batch\job\SetJobRetriesBatchConfigurationJsonConverter.java | 1 |
请完成以下Java代码 | public final IAllocationRequest removeQty(final IAllocationRequest request)
{
if (!isEligible(request))
{
return AllocationUtils.createZeroQtyRequest(request);
}
final Bucket capacity = getCapacity();
final Quantity qtyToRemove = request.getQuantity();
final Boolean allowNegativeCapacityOverride = getA... | return qtyConverted;
}
@Override
public boolean isEmpty()
{
return getQty().isZero();
}
public boolean isFull()
{
final BigDecimal qtyFree = getQtyFree();
return qtyFree.signum() == 0;
}
@Override
public final void markStaled()
{
beforeMarkingStalled();
_capacity = null;
}
/**
* This method... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\storage\impl\AbstractProductStorage.java | 1 |
请完成以下Java代码 | public String getSql()
{
return sql;
}
@Override
public List<Object> getSqlParams(final Properties ctx)
{
final Properties ctxToUse = ctx == null ? this.ctx : ctx;
final ClientId clientId = Env.getClientIdIfSet(ctxToUse).orElse(null);
if (clientId == null)
{
//noinspection ThrowableNotThrown
new A... | if (adClientId == contextClientId)
{
return true;
}
// System client
if (includeSystemClient && adClientId == IClientDAO.SYSTEM_CLIENT_ID)
{
return true;
}
return false;
}
private int getAD_Client_ID(final T model)
{
final Object adClientId = InterfaceWrapperHelper.getValueOrNull(model, COLU... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\ContextClientQueryFilter.java | 1 |
请完成以下Java代码 | public void setM_Warehouse_ID (int M_Warehouse_ID)
{
if (M_Warehouse_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_Warehouse_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_Warehouse_ID, Integer.valueOf(M_Warehouse_ID));
}
@Override
public int getM_Warehouse_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Wareho... | return get_ValueAsBoolean(COLUMNNAME_Status_Print_Job_Instructions);
}
@Override
public void setTrayNumber (int TrayNumber)
{
set_ValueNoCheck (COLUMNNAME_TrayNumber, Integer.valueOf(TrayNumber));
}
@Override
public int getTrayNumber()
{
return get_ValueAsInt(COLUMNNAME_TrayNumber);
}
@Override
publi... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java-gen\de\metas\printing\model\X_C_Order_MFGWarehouse_Report_PrintInfo_v.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class RedisConfiguration {
@Bean
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
// 创建 RedisTemplate 对象
RedisTemplate<String, Object> template = new RedisTemplate<>();
// 设置开启事务支持
template.setEnableTransactionSupport(true);
/... | public RedisMessageListenerContainer listenerContainer(RedisConnectionFactory factory) {
// 创建 RedisMessageListenerContainer 对象
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
// 设置 RedisConnection 工厂。😈 它就是实现多种 Java Redis 客户端接入的秘密工厂。感兴趣的胖友,可以自己去撸下。
contai... | repos\SpringBoot-Labs-master\lab-11-spring-data-redis\lab-07-spring-data-redis-with-jedis\src\main\java\cn\iocoder\springboot\labs\lab10\springdatarediswithjedis\config\RedisConfiguration.java | 2 |
请完成以下Java代码 | public ProcessPreconditionsResolution checkPreconditionsApplicable(final @NonNull IProcessPreconditionsContext context)
{
if (context.isNoSelection())
{
return ProcessPreconditionsResolution.rejectBecauseNoSelection();
}
if (context.isMoreThanOneSelected())
{
return ProcessPreconditionsResolution.rejec... | private void updateFlatrateTermProductAndPrice(@NonNull final I_C_Flatrate_Term term)
{
final LocalDate date = TimeUtil.asLocalDate(term.getStartDate(), orgDAO.getTimeZone(OrgId.ofRepoId(term.getAD_Org_ID())));
final FlatrateTermPriceRequest request = FlatrateTermPriceRequest.builder()
.flatrateTerm(term)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\flatrate\process\C_Flatrate_Term_Change_Product.java | 1 |
请完成以下Java代码 | public boolean isReceipt()
{
return getType().canReceive();
}
public boolean isIssue()
{
return getType().canIssue();
}
public boolean isHUStatusActive()
{
return huStatus != null && X_M_HU.HUSTATUS_Active.equals(huStatus.getKey());
}
@Override
public boolean hasAttributes()
{
return attributesSup... | final IViewRowAttributes attributes = attributesSupplier.get();
if (attributes == null)
{
throw new EntityNotFoundException("This PPOrderLineRow does not support attributes; this=" + this);
}
return attributes;
}
@Override
public HuUnitType getHUUnitTypeOrNull() {return huUnitType;}
@Override
public B... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pporder\PPOrderLineRow.java | 1 |
请完成以下Java代码 | public void executeCopyPasteAction(final CopyPasteActionType actionType)
{
if (actionType == CopyPasteActionType.Cut)
{
doCut();
}
else if (actionType == CopyPasteActionType.Copy)
{
doCopy();
}
else if (actionType == CopyPasteActionType.Paste)
{
doPaste();
}
else if (actionType == CopyPast... | {
return;
}
textComponent.copy();
}
private void doCut()
{
final JTextComponent textComponent = getTextComponent();
if (textComponent == null)
{
return;
}
textComponent.cut();
}
private void doPaste()
{
final JTextComponent textComponent = getTextComponent();
if (textComponent == null)... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ui\editor\JComboBoxCopyPasteSupportEditor.java | 1 |
请完成以下Java代码 | public static Result ok(Object data) {
return new Result(200 , data);
}
public static Result ok() {
return new Result(200 , null);
}
public static Result build(Integer status, String msg) {
return new Result(status, msg, null);
}
public static Result build(Integer status, String msg , Object data) {
... | this.status = status;
this.msg = msg;
}
public Result(Integer status,Object data) {
this.status = status;
this.data = data;
}
public Result(Integer status, String msg, Object data) {
this.status = status;
this.msg = msg;
this.data = data;
}
} | repos\SpringBootLearning-master (1)\springboot-jsr303\src\main\java\com\itwolfed\utils\Result.java | 1 |
请完成以下Java代码 | public void setQty (final BigDecimal Qty)
{
set_ValueNoCheck (COLUMNNAME_Qty, Qty);
}
@Override
public BigDecimal getQty()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public de.metas.handlingunits.model.I_M_HU getVHU()
{
return... | }
@Override
public int getVHU_Source_ID()
{
return get_ValueAsInt(COLUMNNAME_VHU_Source_ID);
}
/**
* VHUStatus AD_Reference_ID=540478
* Reference name: HUStatus
*/
public static final int VHUSTATUS_AD_Reference_ID=540478;
/** Planning = P */
public static final String VHUSTATUS_Planning = "P";
/** ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Trace.java | 1 |
请完成以下Java代码 | public void setInvoiceableLine(final IQualityInvoiceLine invoiceableLine)
{
this.invoiceableLine = invoiceableLine;
setThisAsParentIfPossible(invoiceableLine);
}
@Override
public IQualityInvoiceLine getInvoiceableLine()
{
Check.assumeNotNull(invoiceableLine, "invoiceableLine not null");
return invoiceable... | {
return qualityInvoiceLineGroupType;
}
@Override
public void addDetailBefore(final IQualityInvoiceLine line)
{
Check.assumeNotNull(line, "line not null");
detailsBefore.add(line);
setThisAsParentIfPossible(line);
}
@Override
public List<IQualityInvoiceLine> getDetailsBefore()
{
return detailsBefore... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\qualityBasedInvoicing\invoicing\impl\QualityInvoiceLineGroup.java | 1 |
请完成以下Java代码 | public AttributeBuilder<Boolean> booleanAttribute(String attributeName) {
BooleanAttributeBuilder builder = new BooleanAttributeBuilder(attributeName, modelType);
modelBuildOperations.add(builder);
return builder;
}
public StringAttributeBuilder stringAttribute(String attributeName) {
StringAttribu... | public SequenceBuilder sequence() {
SequenceBuilderImpl builder = new SequenceBuilderImpl(modelType);
modelBuildOperations.add(builder);
return builder;
}
public void buildTypeHierarchy(Model model) {
// build type hierarchy
if(extendedType != null) {
ModelElementTypeImpl extendedModelEl... | repos\camunda-bpm-platform-master\model-api\xml-model\src\main\java\org\camunda\bpm\model\xml\impl\type\ModelElementTypeBuilderImpl.java | 1 |
请完成以下Java代码 | public double getItemPrice() {
return itemPrice;
}
public void setItemPrice(double itemPrice) {
this.itemPrice = itemPrice;
}
public ItemType getItemType() {
return itemType;
}
public void setItemType(ItemType itemType) {
this.itemType = itemType;
}
pu... | public void setSeller(Seller seller) {
this.seller = seller;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Item item = (Item) o;
return id == item.id &&
Double.comp... | repos\tutorials-master\persistence-modules\hibernate-mapping-2\src\main\java\com\baeldung\hibernate\persistmaps\mapkeyjoincolumn\Item.java | 1 |
请完成以下Java代码 | /* package */class OrderLinePackingMaterialDocumentLineSource implements IPackingMaterialDocumentLineSource
{
//
// Services
private final transient IHUPackingMaterialDAO packingMaterialDAO = Services.get(IHUPackingMaterialDAO.class);
private final transient IHandlingUnitsDAO handlingUnitsDAO = Services.get(IHandli... | return qtyOrdered.divide(qtyItemCapacity, 0, RoundingMode.UP);
}
@Override
public @Nullable ProductId getLUProductId()
{
final HuPackingInstructionsId luPIId = HuPackingInstructionsId.ofRepoIdOrNull(orderLine.getM_LU_HU_PI_ID());
if (luPIId == null)
{
return null;
}
return packingMaterialDAO.getLUPIIt... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\order\api\impl\OrderLinePackingMaterialDocumentLineSource.java | 1 |
请完成以下Java代码 | private String getArchivePathSnippet(final I_AD_Archive archive)
{
final StringBuilder path = new StringBuilder();
path.append(archive.getAD_Client_ID()).append(File.separator);
path.append(archive.getAD_Org_ID()).append(File.separator);
final int adProcessId = archive.getAD_Process_ID();
if (adProcessId > ... | final int recordId = archive.getRecord_ID();
if (recordId > 0)
{
path.append(recordId).append(File.separator);
}
return path.toString();
}
@Override
public String toString()
{
return "FilesystemArchiveStorage [RootPath=" + archivePathRoot + "]";
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\archive\spi\impl\FilesystemArchiveStorage.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DataExportAudit save(@NonNull final CreateDataExportAuditRequest createDataExportAuditRequest)
{
final I_Data_Export_Audit record = InterfaceWrapperHelper.loadOrNew(createDataExportAuditRequest.getDataExportAuditId(), I_Data_Export_Audit.class);
record.setAD_Table_ID(createDataExportAuditRequest.getTableRe... | .addOnlyActiveRecordsFilter()
.addEqualsFilter(I_Data_Export_Audit.COLUMNNAME_AD_Table_ID, tableRecordReference.getAD_Table_ID())
.addEqualsFilter(I_Data_Export_Audit.COLUMNNAME_Record_ID, tableRecordReference.getRecord_ID())
.create()
.firstOnlyOptional(I_Data_Export_Audit.class)
.map(DataExportAud... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\audit\data\repository\DataExportAuditRepository.java | 2 |
请完成以下Java代码 | private CompositeAggregationKeyValueHandler getCompositeKeyValueHandler(@NonNull final String registrationKey)
{
CompositeAggregationKeyValueHandler compositeKeyValueHandler = _valueHandlers.get(registrationKey);
if (compositeKeyValueHandler == null)
{
compositeKeyValueHandler = new CompositeAggregationKeyVal... | public <T> List<Object> getValuesForModel(final String registrationKey, final T model)
{
final CompositeAggregationKeyValueHandler compositeKeyValueHandler = getCompositeKeyValueHandler(registrationKey);
return compositeKeyValueHandler.getValues(model);
}
@Override
public void clearHandlers(final String regist... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\agg\key\impl\AggregationKeyRegistry.java | 1 |
请完成以下Java代码 | public String toString()
{
final StringBuilder sb = new StringBuilder();
sb.append("QualityInvoiceLineGroup[");
sb.append("\n\tType: ").append(qualityInvoiceLineGroupType);
sb.append("\n\tinvoiceableLine: ").append(invoiceableLine);
if (!detailsBefore.isEmpty())
{
sb.append("\n\tDetails(before)");
... | {
((QualityInvoiceLine)invoiceableLineOverride).setGroup(this);
}
}
@Override
public IQualityInvoiceLine getInvoiceableLineOverride()
{
return invoiceableLineOverride;
}
@Override
public QualityInvoiceLineGroupType getQualityInvoiceLineGroupType()
{
return qualityInvoiceLineGroupType;
}
@Override
... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\qualityBasedInvoicing\invoicing\impl\QualityInvoiceLineGroup.java | 1 |
请完成以下Java代码 | public static int toRepoId(final HuPackingInstructionsVersionId HuPackingInstructionsVersionId)
{
return HuPackingInstructionsVersionId != null ? HuPackingInstructionsVersionId.getRepoId() : -1;
}
public static final HuPackingInstructionsVersionId TEMPLATE = new HuPackingInstructionsVersionId(100);
public static... | return isRealPackingInstructionsRepoId(repoId);
}
public static boolean isRealPackingInstructionsRepoId(final int repoId)
{
return repoId > 0
&& !isTemplateRepoId(repoId)
&& !isVirtualRepoId(repoId);
}
public HuPackingInstructionsId getKnownPackingInstructionsIdOrNull()
{
if (isVirtual())
{
ret... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\HuPackingInstructionsVersionId.java | 1 |
请完成以下Java代码 | public Mono<CsrfToken> loadToken(ServerWebExchange exchange) {
return Mono.fromCallable(() -> {
HttpCookie csrfCookie = exchange.getRequest().getCookies().getFirst(this.cookieName);
if ((csrfCookie == null) || !StringUtils.hasText(csrfCookie.getValue())) {
return null;
}
return createCsrfToken(csrfCoo... | * @param cookiePath The cookie path
*/
public void setCookiePath(String cookiePath) {
this.cookiePath = cookiePath;
}
private CsrfToken createCsrfToken() {
return createCsrfToken(createNewToken());
}
private CsrfToken createCsrfToken(String tokenValue) {
return new DefaultCsrfToken(this.headerName, this.... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\csrf\CookieServerCsrfTokenRepository.java | 1 |
请完成以下Java代码 | protected final void onRemoteEvent(
final Event event,
final String senderId,
final String topicName,
final Type topicType)
{
final Topic topic = Topic.of(topicName, topicType);
if (topic.getType() != topicType)
{
logger.debug("onEvent - different local topicType for topicName:[{}], remote type:[... | }
catch (final Exception ex)
{
logger.warn("onEvent - Failed forwarding event to topic {}: {}", localEventBusTopic.getName(), event, ex);
}
}
private void onRemoteEvent0(
@NonNull final IEventBus localEventBus,
@NonNull final Event event,
@NonNull final String topicName)
{
localEventBus.processE... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\event\remote\rabbitmq\RabbitMQReceiveFromEndpointTemplate.java | 1 |
请完成以下Java代码 | protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_R_GroupUpdates[")
.append(get_ID()).append("]");
return sb.toString();
}
public ... | return "Y".equals(oo);
}
return false;
}
public I_R_Group getR_Group() throws RuntimeException
{
return (I_R_Group)MTable.get(getCtx(), I_R_Group.Table_Name)
.getPO(getR_Group_ID(), get_TrxName()); }
/** Set Group.
@param R_Group_ID
Request Group
*/
public void setR_Group_ID (int R_Group_ID)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_R_GroupUpdates.java | 1 |
请完成以下Java代码 | private void setCountryAttributeAsActive(final I_C_Country country, final boolean isActive)
{
final AttributeListValue existingAttributeValue = getAttributeValue(country);
if (existingAttributeValue != null)
{
final IAttributeDAO attributesRepo = Services.get(IAttributeDAO.class);
attributesRepo.changeAttr... | {
final AttributeListValue existingAttributeValue = getAttributeValue(country);
if (existingAttributeValue != null)
{
final IAttributeDAO attributesRepo = Services.get(IAttributeDAO.class);
attributesRepo.changeAttributeValue(AttributeListValueChangeRequest.builder()
.id(existingAttributeValue.getId())... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\location\interceptor\C_Country.java | 1 |
请完成以下Java代码 | class OperationMethodParameter implements OperationParameter {
private static final boolean jsr305Present = ClassUtils.isPresent("jakarta.annotation.Nonnull", null);
private final String name;
private final Parameter parameter;
/**
* Create a new {@link OperationMethodParameter} instance.
* @param name the ... | public <T extends Annotation> T getAnnotation(Class<T> annotation) {
return this.parameter.getAnnotation(annotation);
}
@Override
public String toString() {
return this.name + " of type " + this.parameter.getType().getName();
}
private static final class Jsr305 {
boolean isMandatory(Parameter parameter) {... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\invoke\reflect\OperationMethodParameter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static PrivateKeyEntry tryGetPrivateKeyEntry(KeyStore keyStore, String alias, char[] pwd) {
PrivateKeyEntry entry = null;
try {
if (keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) {
try {
entry = (KeyStore.PrivateKeyEntry) keyStore... | if (((X509Certificate) cert).getBasicConstraints()>=0) {
set.add((X509Certificate) cert);
}
} else {
set.add((X509Certificate) cert);
}
}
} else if ... | repos\thingsboard-master\common\transport\transport-api\src\main\java\org\thingsboard\server\common\transport\config\ssl\AbstractSslCredentials.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public IncludeAttribute getIncludePath() {
return this.includePath;
}
public void setIncludePath(IncludeAttribute includePath) {
this.includePath = includePath;
}
public Whitelabel getWhitelabel() {
return this.whitelabel;
}
/**
* Include error attributes options.
*/
public enum IncludeAttribute {
... | /**
* Add error attribute when the appropriate request parameter is not "false".
*/
ON_PARAM
}
public static class Whitelabel {
/**
* Whether to enable the default error page displayed in browsers in case of a
* server error.
*/
private boolean enabled = true;
public boolean isEnabled() {
... | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\web\ErrorProperties.java | 2 |
请完成以下Java代码 | public boolean isOrdered() {
return true;
}
},
READY(2) {
@Override
public boolean isReady() {
return true;
}
},
DELIVERED(0) {
@Override
public boolean isDelivered() {
return true;
}
};
private int time... | public boolean isReady() {
return false;
}
public boolean isDelivered() {
return false;
}
public int getTimeToDelivery() {
return timeToDelivery;
}
PizzaStatusEnum(int timeToDelivery) {
this.timeToDelivery = timeToDelivery;
}
} | repos\tutorials-master\core-java-modules\core-java-string-conversions\src\main\java\com\baeldung\stringtoenum\PizzaStatusEnum.java | 1 |
请完成以下Java代码 | public class GlobalActionReadProcess extends JavaProcess
{
private final GlobalActionsDispatcher globalActionsDispatcher = Adempiere.getBean(GlobalActionsDispatcher.class);
private static final String PARAM_Barcode = "Barcode";
@Param(parameterName = PARAM_Barcode, mandatory = true)
String barcode;
@Override
pr... | }
if (result instanceof OpenViewGlobalActionHandlerResult)
{
final OpenViewGlobalActionHandlerResult openViewResult = (OpenViewGlobalActionHandlerResult)result;
final ViewId viewId = openViewResult.getViewId();
final ViewProfileId viewProfileId = openViewResult.getViewProfileId();
getResult().setWebuiV... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\globalaction\process\GlobalActionReadProcess.java | 1 |
请完成以下Java代码 | private static int iterations(int cost)
{
if ((cost < 0) || (cost > 30))
throw new IllegalArgumentException("cost: " + cost);
return 1 << cost;
}
/**
* Hash a password for storage.
*
* @return a secure authentication token to be stored for later authentication
*/
public String hash(ch... | * Hash a password in an immutable {@code String}.
*
* <p>Passwords should be stored in a {@code char[]} so that it can be filled
* with zeros after use instead of lingering on the heap and elsewhere.
*
* @deprecated Use {@link #hash(char[])} instead
*/
@Deprecated
public String hash(String passwor... | repos\tutorials-master\core-java-modules\core-java-security-2\src\main\java\com\baeldung\passwordhashing\PBKDF2Hasher.java | 1 |
请完成以下Java代码 | public void setM_AttributeSetInstance_ID (final int M_AttributeSetInstance_ID)
{
if (M_AttributeSetInstance_ID < 0)
set_Value (COLUMNNAME_M_AttributeSetInstance_ID, null);
else
set_Value (COLUMNNAME_M_AttributeSetInstance_ID, M_AttributeSetInstance_ID);
}
@Override
public int getM_AttributeSetInstance_... | {
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty_Reported);
return bd != null ? bd : BigDecimal.ZERO;
}
@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.contracts\src\main\java-gen\de\metas\contracts\model\X_C_Flatrate_DataEntry_Detail.java | 1 |
请完成以下Java代码 | public class ServicesType {
@XmlElements({
@XmlElement(name = "service_ex", namespace = "http://www.forum-datenaustausch.ch/invoice", type = ServiceExType.class),
@XmlElement(name = "service", namespace = "http://www.forum-datenaustausch.ch/invoice", type = ServiceType.class)
})
protected L... | *
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ServiceExType }
* {@link ServiceType }
*
*
*/
public List<Object> getServiceExOrService() {
if (serviceExOrService == null) {
serviceExOrService = new ArrayList<Object>();
}
... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_450_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_450\request\ServicesType.java | 1 |
请完成以下Java代码 | public class OrderOpen extends JavaProcess
{
/** The Order */
private int p_C_Order_ID = 0;
/**
* Prepare - e.g., get Parameters.
*/
protected void prepare()
{
ProcessInfoParameter[] para = getParametersAsArray();
for (int i = 0; i < para.length; i++)
{
String name = para[i].getParameterName();
... | /**
* Perform process.
* @return Message
* @throws Exception if not successful
*/
protected String doIt() throws AdempiereSystemError
{
log.info("doIt - Open C_Order_ID=" + p_C_Order_ID);
if (p_C_Order_ID == 0)
return "";
//
MOrder order = new MOrder (getCtx(), p_C_Order_ID, get_TrxName());
St... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\process\OrderOpen.java | 1 |
请完成以下Java代码 | void callEnded(Status status) {
clientCallStopWatch.stop();
this.status = status;
boolean shouldRecordFinishedCall = false;
synchronized (lock) {
if (callEnded) {
return;
}
callEnded = true;
... | tracer.recordFinishedAttempt();
} else if (inboundMetricTracer != null) {
// activeStreams has been decremented to 0 by attemptEnded(),
// so inboundMetricTracer.statusCode is guaranteed to be assigned already.
inboundMetricTracer.recordFinishedAttempt();
... | repos\grpc-spring-master\grpc-client-spring-boot-starter\src\main\java\net\devh\boot\grpc\client\metrics\MetricsClientStreamTracers.java | 1 |
请完成以下Java代码 | public ThrowMessageDelegate createThrowMessageJavaDelegate(String className) {
Class<? extends ThrowMessageDelegate> clazz = ReflectUtil.loadClass(className).asSubclass(
ThrowMessageDelegate.class
);
return new ThrowMessageJavaDelegate(clazz, emptyList());
}
public ThrowMes... | protected Optional<String> checkDelegateExpression(Map<String, List<ExtensionAttribute>> attributes) {
return getAttributeValue(attributes, "delegateExpression");
}
protected Optional<String> getAttributeValue(Map<String, List<ExtensionAttribute>> attributes, String name) {
return Optional.ofNu... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\parser\factory\DefaultActivityBehaviorFactory.java | 1 |
请完成以下Java代码 | public I_C_Invoice_Candidate retrieveInvoiceCandidate(final I_C_Flatrate_Term term)
{
final AdTableId tableId = tableDAO.retrieveAdTableId(I_C_Flatrate_Term.Table_Name);
final I_C_Invoice_Candidate ic = queryBL.createQueryBuilder(I_C_Invoice_Candidate.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter... | .addEqualsFilter(I_C_Flatrate_Term.COLUMNNAME_Bill_BPartner_ID, bPartnerId)
.addNotEqualsFilter(I_C_Flatrate_Term.COLUMNNAME_ContractStatus, FlatrateTermStatus.Quit.getCode())
.addNotEqualsFilter(I_C_Flatrate_Term.COLUMNNAME_ContractStatus, FlatrateTermStatus.Voided.getCode())
.addCompareFilter(I_C_Flatrate... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\impl\FlatrateDAO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setShowSummary(@Nullable ShowSummary showSummary) {
this.showSummary = showSummary;
}
public @Nullable ShowSummaryOutput getShowSummaryOutput() {
return this.showSummaryOutput;
}
public void setShowSummaryOutput(@Nullable ShowSummaryOutput showSummaryOutput) {
this.showSummaryOutput = showSummar... | }
/**
* Enumeration of destinations to which the summary should be output. Values are the
* same as those on {@link UpdateSummaryOutputEnum}. To maximize backwards
* compatibility, the Liquibase enum is not used directly.
*/
public enum ShowSummaryOutput {
/**
* Log the summary.
*/
LOG,
/**
... | repos\spring-boot-4.0.1\module\spring-boot-liquibase\src\main\java\org\springframework\boot\liquibase\autoconfigure\LiquibaseProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | protected void sendCancelEvent(JobEntity jobToDelete) {
FlowableEventDispatcher eventDispatcher = jobServiceConfiguration.getEventDispatcher();
if (eventDispatcher != null && eventDispatcher.isEnabled()) {
eventDispatcher.dispatchEvent(FlowableJobEventBuilder.createEntityEvent(FlowableEngine... | JobEntity job = jobServiceConfiguration.getJobEntityManager().findById(jobId);
if (job == null) {
throw new FlowableObjectNotFoundException("No job found with id '" + jobId + "'", Job.class);
}
// We need to check if the job was locked, ie acquired by the job acquisition thread
... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\cmd\DeleteJobCmd.java | 2 |
请在Spring Boot框架中完成以下Java代码 | protected boolean executeLogin(ServletRequest request, ServletResponse response) throws Exception {
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
String token = httpServletRequest.getHeader(CommonConstant.X_ACCESS_TOKEN);
// 代码逻辑说明: JT-355 OA聊天添加token验证,获取token参数
... | TenantContext.setTenant(tenantId);
return super.preHandle(request, response);
}
/**
* JwtFilter中ThreadLocal需要及时清除 #3634
*
* @param request
* @param response
* @param exception
* @throws Exception
*/
@Override
public void afterCompletion(ServletRequest request... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\config\shiro\filters\JwtFilter.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.