instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public void setMethod (final @Nullable java.lang.String Method)
{
set_Value (COLUMNNAME_Method, Method);
}
@Override
public java.lang.String getMethod()
{
return get_ValueAsString(COLUMNNAME_Method);
}
/**
* NotifyUserInCharge AD_Reference_ID=541315
* Reference name: NotifyItems
*/
public static f... | }
@Override
public java.lang.String getPathPrefix()
{
return get_ValueAsString(COLUMNNAME_PathPrefix);
}
@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_API_Audit_Config.java | 1 |
请在Spring Boot框架中完成以下Java代码 | void setAuthenticationManager(ReactiveAuthenticationManager authenticationManager) {
this.authenticationManager = authenticationManager;
}
@Autowired(required = false)
void setUserDetailsService(ReactiveUserDetailsService userDetailsService) {
this.reactiveUserDetailsService = userDetailsService;
}
@Autowire... | private ReactiveAuthenticationManager authenticationManager() {
if (this.authenticationManager != null) {
return this.authenticationManager;
}
if (this.reactiveUserDetailsService != null) {
UserDetailsRepositoryReactiveAuthenticationManager manager = new UserDetailsRepositoryReactiveAuthenticationManager(
... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\rsocket\RSocketSecurityConfiguration.java | 2 |
请完成以下Java代码 | private void checkLogicExpression(@NonNull final ContextPath path, @NonNull final ILogicExpression expression)
{
if (expression.isConstant()) {return;}
checkExpression(path, ContextVariablesExpression.ofLogicExpression(expression));
}
private void checkLookupDescriptor(@NonNull final ContextPath path, @Nullable... | private AdempiereException newException(final String message)
{
final AdempiereException exception = new AdempiereException(message);
fillContextInfo(exception);
return exception;
}
private AdempiereException wrapException(final Exception exception)
{
final AdempiereException wrappedException = AdempiereEx... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\health\ContextVariablesCheckCommand.java | 1 |
请完成以下Java代码 | public static boolean isPwdProtected(String path) {
InputStream propStream = null;
try {
propStream = Files.newInputStream(Paths.get(path));
ExtractorFactory.createExtractor(propStream);
} catch (IOException | EncryptedDocumentException e) {
if (e.getMessage()... | Biff8EncryptionKey.setCurrentUserPassword(password);
ExtractorFactory.createExtractor(propStream);
} catch (Exception e) {
return false;
} finally {
Biff8EncryptionKey.setCurrentUserPassword(null);
if(propStream!=null) {//如果文件输入流不是null
try ... | repos\kkFileView-master\server\src\main\java\cn\keking\utils\OfficeUtils.java | 1 |
请完成以下Java代码 | public static Deposit from(Row row) {
return new Deposit(row.getString("DEPOSITCODE"), row.getString("CURRENCY"), row.getString("AMOUNT"));
}
public Deposit() {
}
public Deposit(String depositCode, String currency, String amount) {
this.depositCode = depositCode;
this.currency ... | return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
} | repos\tutorials-master\quarkus-modules\quarkus-hibernate-reactive\src\main\java\com\baeldung\entity\Deposit.java | 1 |
请完成以下Java代码 | public class MapAppender extends AbstractAppender {
private ConcurrentMap<String, LogEvent> eventMap = new ConcurrentHashMap<>();
protected MapAppender(String name, Filter filter) {
super(name, filter, null);
}
@PluginFactory
public static MapAppender createAppender(@PluginAttribute("name... | .isLessSpecificThan(Level.WARN)) {
error("Unable to log less than WARN level.");
return;
}
eventMap.put(Instant.now()
.toString(), event);
}
public ConcurrentMap<String, LogEvent> getEventMap() {
return eventMap;
}
public void setEventMap(Con... | repos\tutorials-master\logging-modules\log4j2\src\main\java\com\baeldung\logging\log4j2\appender\MapAppender.java | 1 |
请完成以下Java代码 | public int getDoc_User_ID()
{
return getCreatedBy();
} // getDoc_User_ID
/**
* Get Document Approval Amount
*
* @return amount difference
*/
@Override
public BigDecimal getApprovalAmt()
{
return getStatementDifference();
} // getApprovalAmt
/**
* Get Currency
*
* @return Currency
*/
@Ov... | public int getC_Currency_ID()
{
return getCashBook().getC_Currency_ID();
} // getC_Currency_ID
/**
* Document Status is Complete or Closed
*
* @return true if CO, CL or RE
*/
public boolean isComplete()
{
String ds = getDocStatus();
return DOCSTATUS_Completed.equals(ds)
|| DOCSTATUS_Closed.equa... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MCash.java | 1 |
请完成以下Java代码 | public String getDefinitionType() {
return definitionTypeAttribute.getValue(this);
}
public void setDefinitionType(String definitionType) {
definitionTypeAttribute.setValue(this, definitionType);
}
public String getStructure() {
return structureAttribute.getValue(this);
}
public void setStruc... | .defaultValue("http://www.omg.org/spec/CMMN/DefinitionType/Unspecified")
.build();
structureAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_STRUCTURE_REF)
.build();
// TODO: The Import does not have an id attribute!
// importRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\CaseFileItemDefinitionImpl.java | 1 |
请完成以下Java代码 | protected void loadPlugins() {
ServiceLoader<T> loader = ServiceLoader.load(pluginType);
Iterator<T> iterator = loader.iterator();
Map<String, T> map = new HashMap<String, T>();
while (iterator.hasNext()) {
T plugin = iterator.next();
map.put(plugin.getId(), plugin);
}
this.plug... | public List<T> getPlugins() {
if (pluginsMap == null) {
loadPlugins();
}
return new ArrayList<T>(pluginsMap.values());
}
@Override
public T getPlugin(String id) {
if (pluginsMap == null) {
loadPlugins();
}
return pluginsMap.get(id);
}
} | repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\webapp\plugin\impl\DefaultAppPluginRegistry.java | 1 |
请完成以下Java代码 | public String getNamet() {
return namet;
}
public void setNamet(String namet) {
this.namet = namet;
}
public String getNamem() {
return namem;
}
public void setNamem(String namem) {
this.namem = namem;
} | public String getNameb() {
return nameb;
}
public void setNameb(String nameb) {
this.nameb = nameb;
}
@Override
public String toString() {
return "CategoryDto{" + "namet=" + namet
+ ", namem=" + namem + ", nameb=" + nameb + '}';
}
} | repos\Hibernate-SpringBoot-master\HibernateSpringBootDtoSqlResultSetMapping\src\main\java\com\app\dto\CategoryDto.java | 1 |
请完成以下Java代码 | 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 Produkt UUID.
@param Product_UUID Produkt UUID */
@Override
public void... | /** Set Menge (old).
@param Qty_Old Menge (old) */
@Override
public void setQty_Old (java.math.BigDecimal Qty_Old)
{
set_Value (COLUMNNAME_Qty_Old, Qty_Old);
}
/** Get Menge (old).
@return Menge (old) */
@Override
public java.math.BigDecimal getQty_Old ()
{
BigDecimal bd = (BigDecimal)get_Value(COL... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java-gen\de\metas\procurement\base\model\X_PMM_RfQResponse_ChangeEvent.java | 1 |
请完成以下Java代码 | private void addCumulatedAmtAndQty(
@NonNull final CostAmount amt,
@NonNull final Quantity qty)
{
assertCostUOM(qty);
addCumulatedAmt(amt);
cumulatedQty = cumulatedQty.add(qty);
}
public void addCumulatedAmt(@NonNull final CostAmount amt)
{
assertCostCurrency(amt);
cumulatedAmt = cumulatedAmt.add(... | }
public void setOwnCostPrice(@NonNull final CostAmount ownCostPrice)
{
setCostPrice(getCostPrice().withOwnCostPrice(ownCostPrice));
}
public void clearOwnCostPrice()
{
setCostPrice(getCostPrice().withZeroOwnCostPrice());
}
public void addToOwnCostPrice(@NonNull final CostAmount ownCostPriceToAdd)
{
se... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\CurrentCost.java | 1 |
请完成以下Java代码 | public void onPrePersist() {
logger.info("@PrePersist");
audit(OPERATION.INSERT);
}
@PreUpdate
public void onPreUpdate() {
logger.info("@PreUpdate");
audit(OPERATION.UPDATE);
}
@PreRemove
public void onPreRemove() {
logger.info("@PreRemove");
aud... | INSERT, UPDATE, DELETE;
private String value;
OPERATION() {
value = toString();
}
public static OPERATION parse(final String value) {
OPERATION operation = null;
for (final OPERATION op : OPERATION.values()) {
if (op.getValue().equals... | repos\tutorials-master\persistence-modules\spring-data-jpa-enterprise\src\main\java\com\baeldung\boot\domain\Bar.java | 1 |
请完成以下Spring Boot application配置 | server:
port: 8888
spring:
application:
name: demo-config-server
profiles:
active: git # 使用的 Spring Cloud Config Server 的存储器方案
# Spring Cloud Config 相关配置项
cloud:
config:
server:
# Spring Cloud Config Server 的 Git 存储器的配置项,对应 MultipleJGitEnvironmentProperties 类
git:
... | username: ${CODING_USERNAME} # 账号
# password: ${CODING_PASSWORD} # 密码
# Kafka 配置项,对应 KafkaProperties 配置类
kafka:
bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 | repos\SpringBoot-Labs-master\labx-19\labx-19-sc-config-server-git-auto-refresh-by-bus\src\main\resources\application.yml | 2 |
请在Spring Boot框架中完成以下Java代码 | public Foo patchFoo(@PathVariable("id") final long id, @RequestBody final Foo foo) {
fooRepository.put(id, foo);
return foo;
}
@RequestMapping(method = RequestMethod.POST, value = "/foos")
@ResponseStatus(HttpStatus.CREATED)
@ResponseBody
public ResponseEntity<Foo> postFoo(@Requ... | @ResponseBody
public Foo createFoo(@RequestBody final Foo foo) {
fooRepository.put(foo.getId(), foo);
return foo;
}
@RequestMapping(method = RequestMethod.DELETE, value = "/foos/{id}")
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public long deleteFoo(@PathVariable final long id... | repos\tutorials-master\spring-web-modules\spring-resttemplate\src\main\java\com\baeldung\resttemplate\configuration\FooController.java | 2 |
请完成以下Java代码 | public class OverrideLocationAdapter
implements IDocumentLocationAdapter, RecordBasedLocationAdapter<OverrideLocationAdapter>
{
private final I_M_ShipmentSchedule delegate;
OverrideLocationAdapter(@NonNull final I_M_ShipmentSchedule delegate)
{
this.delegate = delegate;
}
@Override
public int getC_BPartner_... | @Override
public void setAD_User_ID(final int AD_User_ID)
{
delegate.setAD_User_Override_ID(AD_User_ID);
}
@Override
public String getBPartnerAddress()
{
return delegate.getBPartnerAddress_Override();
}
@Override
public void setBPartnerAddress(String address)
{
delegate.setBPartnerAddress_Override(add... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\location\adapter\OverrideLocationAdapter.java | 1 |
请完成以下Java代码 | public static boolean getDefaultFilterAttributeState()
{
return filter_attribute_state;
}
/**
What is the equality character for an attribute.
*/
public static char getDefaultAttributeEqualitySign()
{
return attribute_equality_sign;
}
/**
What the start modifier should be
*/
public s... | public static String getDefaultCodeset()
{
return codeset;
}
/**
position of tag relative to start and end.
*/
public static int getDefaultPosition()
{
return position;
}
/**
Default value to set case type
*/
public static int getDefaultCaseType()
{
return case_type;
}
public static char getD... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\ECSDefaults.java | 1 |
请在Spring Boot框架中完成以下Java代码 | EncodingConfigurer deflate(boolean deflate) {
this.deflate = deflate;
return this;
}
String encode() {
byte[] bytes = (this.deflate) ? Saml2Utils.samlDeflate(this.decoded)
: this.decoded.getBytes(StandardCharsets.UTF_8);
return Saml2Utils.samlEncode(bytes);
}
}
static final class DecodingCon... | int[] values = new int[256];
Arrays.fill(values, -1);
for (int i = 0; i < alphabet.length; i++) {
values[alphabet[i] & 0xff] = i;
}
return values;
}
boolean isAcceptable(String s) {
int goodChars = 0;
int lastGoodCharVal = -1;
// count number of characters from Base64 alphabet
... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\internal\Saml2Utils.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class SmsHomeRecommendProductServiceImpl implements SmsHomeRecommendProductService {
@Autowired
private SmsHomeRecommendProductMapper recommendProductMapper;
@Override
public int create(List<SmsHomeRecommendProduct> homeRecommendProductList) {
for (SmsHomeRecommendProduct recommendProduct... | SmsHomeRecommendProductExample example = new SmsHomeRecommendProductExample();
example.createCriteria().andIdIn(ids);
SmsHomeRecommendProduct record = new SmsHomeRecommendProduct();
record.setRecommendStatus(recommendStatus);
return recommendProductMapper.updateByExampleSelective(record,... | repos\mall-master\mall-admin\src\main\java\com\macro\mall\service\impl\SmsHomeRecommendProductServiceImpl.java | 2 |
请完成以下Java代码 | public String getBody() {
return body;
}
public String getEncoding() {
return encoding;
}
public String getMethod() {
return method;
}
public Map<String, String> getCookies() {
return cookies;
}
public String getContentType() { | return contentType;
}
public Map<String, List<String>> getHeaders() {
return headers;
}
public String getProtocol() {
return protocol;
}
public String getRemoteInfo() {
return remoteInfo;
}
} | repos\spring-examples-java-17\spring-demo\src\main\java\itx\examples\springboot\demo\dto\RequestInfo.java | 1 |
请完成以下Java代码 | public boolean isCacheBody() {
return cacheBody;
}
public RetryConfig setCacheBody(boolean cacheBody) {
this.cacheBody = cacheBody;
return this;
}
}
public static class RetryException extends NestedRuntimeException {
private final ServerRequest request;
private final ServerResponse response; | RetryException(ServerRequest request, ServerResponse response) {
super(null);
this.request = request;
this.response = response;
}
public ServerRequest getRequest() {
return request;
}
public ServerResponse getResponse() {
return response;
}
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\filter\RetryFilterFunctions.java | 1 |
请完成以下Java代码 | public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createHistoricExternalTaskLogSuccessfulEvt(externalTask);
}
});
}
}
public void fireExternalTaskDeletedEvent(final ExternalTask externalTask) {
if (isHistoryEventProduced(HistoryEventTypes.EXTERN... | }
}
// helper /////////////////////////////////////////////////////////
protected boolean isHistoryEventProduced(HistoryEventType eventType, ExternalTask externalTask) {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getH... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\HistoricExternalTaskLogManager.java | 1 |
请完成以下Java代码 | public final class LoggingFailureAnalysisReporter implements FailureAnalysisReporter {
private static final Log logger = LogFactory.getLog(LoggingFailureAnalysisReporter.class);
@Override
public void report(FailureAnalysis failureAnalysis) {
if (logger.isDebugEnabled()) {
logger.debug("Application failed to s... | StringBuilder builder = new StringBuilder();
builder.append(String.format("%n%n"));
builder.append(String.format("***************************%n"));
builder.append(String.format("APPLICATION FAILED TO START%n"));
builder.append(String.format("***************************%n%n"));
builder.append(String.format("De... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\diagnostics\LoggingFailureAnalysisReporter.java | 1 |
请完成以下Java代码 | public void setC_Invoice_ID (final int C_Invoice_ID)
{
throw new IllegalArgumentException ("C_Invoice_ID is virtual column"); }
@Override
public int getC_Invoice_ID()
{
return get_ValueAsInt(COLUMNNAME_C_Invoice_ID);
}
@Override
public void setIsDeliveryStop (final boolean IsDeliveryStop)
{
set_Value (... | {
return get_ValueAsInt(COLUMNNAME_M_Shipment_Constraint_ID);
}
@Override
public void setSourceDoc_Record_ID (final int SourceDoc_Record_ID)
{
if (SourceDoc_Record_ID < 1)
set_Value (COLUMNNAME_SourceDoc_Record_ID, null);
else
set_Value (COLUMNNAME_SourceDoc_Record_ID, SourceDoc_Record_ID);
}
@Ove... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\inoutcandidate\model\X_M_Shipment_Constraint.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Account {
@Id
private String accountNumber;
@Id
private String accountType;
private String description;
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
... | public String getAccountType() {
return accountType;
}
public void setAccountType(String accountType) {
this.accountType = accountType;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = ... | repos\tutorials-master\persistence-modules\java-jpa\src\main\java\com\baeldung\jpa\primarykeys\Account.java | 2 |
请完成以下Java代码 | public void invalidateCandidatesFor(final Object model)
{
// nothing to do
}
/**
* @return {@link #MANUAL} (i.e. not a real table name).
*/
@Override
public String getSourceTable()
{
return ManualCandidateHandler.MANUAL;
}
/** @return {@code true}. */
@Override
public boolean isUserInChargeUserEdita... | /**
* Does nothing.
*/
@Override
public void setDeliveredData(final I_C_Invoice_Candidate ic)
{
// nothing to do
}
@Override
public void setBPartnerData(final I_C_Invoice_Candidate ic)
{
// nothing to do
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\spi\impl\ManualCandidateHandler.java | 1 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Collection<Role> getRoles() {
return roles;
}
public... | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Privilege other = (Privilege) obj;
if (name == null) {
if (other.name != ... | repos\tutorials-master\spring-security-modules\spring-security-web-boot-1\src\main\java\com\baeldung\roles\rolesauthorities\model\Privilege.java | 1 |
请完成以下Java代码 | public void setAD_BusinessRule_ID (final int AD_BusinessRule_ID)
{
if (AD_BusinessRule_ID < 1)
set_Value (COLUMNNAME_AD_BusinessRule_ID, null);
else
set_Value (COLUMNNAME_AD_BusinessRule_ID, AD_BusinessRule_ID);
}
@Override
public int getAD_BusinessRule_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_Bu... | set_Value (COLUMNNAME_AD_Table_ID, AD_Table_ID);
}
@Override
public int getAD_Table_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_Table_ID);
}
@Override
public void setLookupSQL (final java.lang.String LookupSQL)
{
set_Value (COLUMNNAME_LookupSQL, LookupSQL);
}
@Override
public java.lang.String getLooku... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_BusinessRule_WarningTarget.java | 1 |
请完成以下Java代码 | public I_M_InOutLine createReturnLine(@NonNull final CreateCustomerReturnLineReq request)
{
final I_M_InOut returnHeader = inOutDAO.getById(request.getHeaderId(), I_M_InOut.class);
final I_M_InOutLine returnLine = InterfaceWrapperHelper.newInstance(I_M_InOutLine.class);
returnLine.setAD_Org_ID(returnHeader.get... | returnLine.setIsWarrantyCase(request.isWarrantyCase());
if (request.getHupiItemProductId() != null && request.getQtyTU() != null)
{
returnLine.setQtyEnteredTU(request.getQtyTU().toBigDecimal());
returnLine.setM_HU_PI_Item_Product_ID(request.getHupiItemProductId().getRepoId());
}
if (request.getOriginShi... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inout\returns\customer\CustomerReturnInOutRecordFactory.java | 1 |
请完成以下Java代码 | private ImmutableList<I_C_SubscriptionProgress> processAndCollectRecordWithinPause(
@NonNull final List<I_C_SubscriptionProgress> sps,
@NonNull final Timestamp pauseUntil)
{
final Builder<I_C_SubscriptionProgress> spsWithinPause = ImmutableList.builder();
for (final I_C_SubscriptionProgress sp : sps)
{
... | pauseEnd.setEventDate(pauseUntil);
pauseEnd.setSeqNo(seqNoOfPauseRecord);
save(pauseEnd);
}
private ImmutableList<I_C_SubscriptionProgress> collectSpsAfterEndOfPause(final List<I_C_SubscriptionProgress> sps, final Timestamp pauseUntil)
{
final ImmutableList<I_C_SubscriptionProgress> spsAfterPause = sps.stream... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\subscription\impl\subscriptioncommands\InsertPause.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BeanConfig {
private final static String SOURCE_NAME = "SOURCE_NAME";
@Value("${dynamic.attr.count}")
private int count;
@Value("${dynamic.annotate.unpredictable.value}")
private String[] values;
@Value("${dynamic.annotate.unpredictable.key}")
private String key;
@Value("${dynamic.annotate.de... | /**
* 设置属性
*/
beanDefinitionBuilder.addPropertyValue("id", i);
beanDefinitionBuilder.addPropertyValue("name", "wxc");
beanDefinitionBuilder.addPropertyValue("address", "earth");
beanDefinitionBuilder.addPropertyValue("age", 1000);
beanDefinitionBuilder.addPropertyValue("birthday", new Date());
... | repos\spring-boot-quick-master\quick-dynamic-bean\src\main\java\com\dynamic\bean\config\BeanConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | ProjectMetadataController projectMetadataController(InitializrMetadataProvider metadataProvider,
DependencyMetadataProvider dependencyMetadataProvider) {
return new ProjectMetadataController(metadataProvider, dependencyMetadataProvider);
}
@Bean
@ConditionalOnMissingBean
CommandLineMetadataController co... | @Order(0)
private static final class InitializrJCacheManagerCustomizer implements JCacheManagerCustomizer {
@Override
public void customize(javax.cache.CacheManager cacheManager) {
createMissingCache(cacheManager, "initializr.metadata",
() -> config().setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(D... | repos\initializr-main\initializr-web\src\main\java\io\spring\initializr\web\autoconfigure\InitializrAutoConfiguration.java | 2 |
请完成以下Java代码 | public int getAD_Zebra_Config_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_Zebra_Config_ID);
}
@Override
public void setEncoding (final java.lang.String Encoding)
{
set_Value (COLUMNNAME_Encoding, Encoding);
}
@Override
public java.lang.String getEncoding()
{
return get_ValueAsString(COLUMNNAME_Encodin... | public void setIsDefault (final boolean IsDefault)
{
set_Value (COLUMNNAME_IsDefault, IsDefault);
}
@Override
public boolean isDefault()
{
return get_ValueAsBoolean(COLUMNNAME_IsDefault);
}
@Override
public void setName (final java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
@Override
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Zebra_Config.java | 1 |
请完成以下Java代码 | public String getPasswordInfo ()
{
return (String)get_Value(COLUMNNAME_PasswordInfo);
}
/** Set Port.
@param Port Port */
public void setPort (int Port)
{
set_Value (COLUMNNAME_Port, Integer.valueOf(Port));
}
/** Get Port.
@return Port */
public int getPort ()
{
Integer ii = (Integer)get_Valu... | {
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Search Key.
@param Value
Search key for the record in the format required - must be unique
*/
public void setValue (String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_IMP_Processor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static NoOpPasswordEncoder passwordEncoder() {
return (NoOpPasswordEncoder) NoOpPasswordEncoder.getInstance();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.
// 使用内存中的 InMemoryUserDetailsManager
inMemor... | // // 对所有 URL 都进行认证
// .anyRequest()
// .authenticated();
// }
// @Override
// public void configure(HttpSecurity http) throws Exception {
// http.csrf()
// .disable()
// .authorizeRequests()
// .antMatchers("/oau... | repos\SpringBoot-Labs-master\lab-68-spring-security-oauth\lab-68-demo01-authorization-code-server\src\main\java\cn\iocoder\springboot\lab68\resourceserverdemo\config\SecurityConfig.java | 2 |
请完成以下Java代码 | public void setM_TU_HU(final de.metas.handlingunits.model.I_M_HU M_TU_HU)
{
set_ValueFromPO(COLUMNNAME_M_TU_HU_ID, de.metas.handlingunits.model.I_M_HU.class, M_TU_HU);
}
@Override
public void setM_TU_HU_ID (final int M_TU_HU_ID)
{
if (M_TU_HU_ID < 1)
set_Value (COLUMNNAME_M_TU_HU_ID, null);
else
set... | else
set_Value (COLUMNNAME_Record_ID, Record_ID);
}
@Override
public int getRecord_ID()
{
return get_ValueAsInt(COLUMNNAME_Record_ID);
}
@Override
public de.metas.handlingunits.model.I_M_HU getVHU()
{
return get_ValueAsPO(COLUMNNAME_VHU_ID, de.metas.handlingunits.model.I_M_HU.class);
}
@Override
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Assignment.java | 1 |
请完成以下Java代码 | public void setTenantIdIn(List<String> tenantIds) {
this.tenantIds = tenantIds;
}
@CamundaQueryParam(value = "withoutTenantId", converter = BooleanConverter.class)
public void setWithoutTenantId(Boolean withoutTenantId) {
this.withoutTenantId = withoutTenantId;
}
@CamundaQueryParam(value="suspended"... | if (tenantIds != null && !tenantIds.isEmpty()) {
query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
}
if (TRUE.equals(suspended)) {
query.suspended();
}
if (FALSE.equals(suspended)) {
query.active();
}
if (userId != null) {
query.createdBy(userId);
}
... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\batch\BatchStatisticsQueryDto.java | 1 |
请完成以下Java代码 | public BulletedSection<T> addItem(T item) {
this.items.add(item);
return this;
}
/**
* Specify whether this section is empty.
* @return {@code true} if no item is registered
*/
public boolean isEmpty() {
return this.items.isEmpty();
}
/**
* Return an immutable list of the registered items. | * @return the registered items
*/
public List<T> getItems() {
return Collections.unmodifiableList(this.items);
}
@Override
public void write(PrintWriter writer) throws IOException {
if (!isEmpty()) {
Map<String, Object> model = new HashMap<>();
model.put(this.itemName, this.items);
writer.println(th... | repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\io\text\BulletedSection.java | 1 |
请完成以下Java代码 | public int getM_Product_Category_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_Category_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name... | if (S_ExpenseType_ID < 1)
set_ValueNoCheck (COLUMNNAME_S_ExpenseType_ID, null);
else
set_ValueNoCheck (COLUMNNAME_S_ExpenseType_ID, Integer.valueOf(S_ExpenseType_ID));
}
/** Get Expense Type.
@return Expense report type
*/
public int getS_ExpenseType_ID ()
{
Integer ii = (Integer)get_Value(COLUMN... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_S_ExpenseType.java | 1 |
请完成以下Java代码 | public String getTenantId() {
return tenantId;
}
@Override
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
@Override
public String getEndUserId() {
return endUserId;
}
@Override
public void setEndUserId(String endUserId) {
this.e... | @Override
public Integer getCaseDefinitionVersion() {
return caseDefinitionVersion;
}
@Override
public void setCaseDefinitionVersion(Integer caseDefinitionVersion) {
this.caseDefinitionVersion = caseDefinitionVersion;
}
@Override
public String getCaseDefinitionDeploymentId(... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\persistence\entity\HistoricCaseInstanceEntityImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | class PickAttributes
{
private final static AdMessageKey ERR_NegativeCatchWeight = AdMessageKey.of("de.metas.handlingunits.picking.job.NEGATIVE_CATCH_WEIGHT_ERROR_MSG");
private final static AdMessageKey ERR_LMQ_CatchWeightNotMatching = AdMessageKey.of("de.metas.handlingunits.picking.job.CATCH_WEIGHT_MUST_MATCH_LM_QR... | pickFromHUQRCode.getBestBeforeDate().ifPresent(bestBeforeDate -> builder.isSetBestBeforeDate(true).bestBeforeDate(bestBeforeDate));
pickFromHUQRCode.getProductionDate().ifPresent(productionDate -> builder.isSetProductionDate(true).productionDate(productionDate));
pickFromHUQRCode.getLotNumber().ifPresent(lotNo -> b... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\commands\pick\PickAttributes.java | 2 |
请完成以下Java代码 | public List<DisplayCapabilities1> getDispCpblties() {
if (dispCpblties == null) {
dispCpblties = new ArrayList<DisplayCapabilities1>();
}
return this.dispCpblties;
}
/**
* Gets the value of the prtLineWidth property.
*
* @return
* possible object is
... | }
/**
* Sets the value of the prtLineWidth property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPrtLineWidth(String value) {
this.prtLineWidth = value;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\PointOfInteractionCapabilities1.java | 1 |
请完成以下Java代码 | public java.lang.String getExternalId ()
{
return (java.lang.String)get_Value(COLUMNNAME_ExternalId);
}
/** Set Interner Name.
@param InternalName
Generally used to give records a name that can be safely referenced from code.
*/
@Override
public void setInternalName (java.lang.String InternalName)
{
s... | public void setName (java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Name */
@Override
public java.lang.String getName ()
{
return (java.lang.String)get_Value(COLUMNNAME_Name);
}
/** Set URL.
@param URL
Full URL address - e.g. http://www.adempiere.org
*/
@Ov... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\impex\model\X_AD_InputDataSource.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BoilerPlateRepository
{
public BoilerPlate getByBoilerPlateId(
@NonNull final BoilerPlateId boilerPlateId,
@Nullable final Language language)
{
final I_AD_BoilerPlate boilerPlateRecord = loadOutOfTrx(boilerPlateId, I_AD_BoilerPlate.class);
return toBoilerPlate(boilerPlateRecord, language);
}
... | recordToUse = translate(boilerPlateRecord, I_AD_BoilerPlate.class, language.getAD_Language());
languageEffective = language;
}
else
{
recordToUse = boilerPlateRecord;
languageEffective = Language.getBaseLanguage();
}
return BoilerPlate.builder()
.id(BoilerPlateId.ofRepoId(recordToUse.getAD_Boile... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\letter\BoilerPlateRepository.java | 2 |
请完成以下Java代码 | public String getSourceProcessDefinitionId() {
return sourceProcessDefinitionId;
}
public void setSourceProcessDefinitionId(String sourceProcessDefinitionId) {
this.sourceProcessDefinitionId = sourceProcessDefinitionId;
}
public String getTargetProcessDefinitionId() {
return targetProcessDefinitio... | public boolean isUpdateEventTriggers() {
return updateEventTriggers;
}
public void setUpdateEventTriggers(boolean updateEventTriggers) {
this.updateEventTriggers = updateEventTriggers;
}
public void setVariables(Map<String, VariableValueDto> variables) {
this.variables = variables;
}
public M... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\migration\MigrationPlanGenerationDto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public final class DefaultLoginPageConfigurer<H extends HttpSecurityBuilder<H>>
extends AbstractHttpConfigurer<DefaultLoginPageConfigurer<H>, H> {
private DefaultLoginPageGeneratingFilter loginPageGeneratingFilter = new DefaultLoginPageGeneratingFilter();
private DefaultLogoutPageGeneratingFilter logoutPageGenera... | @SuppressWarnings("unchecked")
public void configure(H http) {
AuthenticationEntryPoint authenticationEntryPoint = null;
ExceptionHandlingConfigurer<?> exceptionConf = http.getConfigurer(ExceptionHandlingConfigurer.class);
if (exceptionConf != null) {
authenticationEntryPoint = exceptionConf.getAuthentication... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\DefaultLoginPageConfigurer.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private void persistLabels(@NonNull final List<I_S_IssueLabel> newLabels,
@NonNull final List<I_S_IssueLabel> existingLabels)
{
if (Check.isEmpty(newLabels))
{
InterfaceWrapperHelper.deleteAll(existingLabels);
return;
}
final List<I_S_IssueLabel> recordsToInsert =
newLabels
... | final List<I_S_IssueLabel> recordsToDelete = existingLabels
.stream()
.filter(record -> newLabels
.stream()
.noneMatch(label -> areEqual(record, label))
)
.collect(Collectors.toList());
InterfaceWrapperHelper.deleteAll(recordsToDelete);
InterfaceWrapperHelper.saveAll(recordsToInsert);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\external\label\IssueLabelRepository.java | 2 |
请完成以下Java代码 | public PublicKeyCredentialRequestOptionsBuilder challenge(Bytes challenge) {
this.challenge = challenge;
return this;
}
/**
* Sets the {@link #getTimeout()} property.
* @param timeout the timeout
* @return the {@link PublicKeyCredentialRequestOptionsBuilder}
*/
public PublicKeyCredentialRequest... | return this;
}
/**
* Allows customizing the {@link PublicKeyCredentialRequestOptionsBuilder}
* @param customizer the {@link Consumer} used to customize the builder
* @return the {@link PublicKeyCredentialRequestOptionsBuilder}
*/
public PublicKeyCredentialRequestOptionsBuilder customize(
Consumer... | repos\spring-security-main\webauthn\src\main\java\org\springframework\security\web\webauthn\api\PublicKeyCredentialRequestOptions.java | 1 |
请在Spring Boot框架中完成以下Java代码 | KotlinSerializationJsonConvertersCustomizer kotlinSerializationJsonConvertersCustomizer(Json json,
ResourceLoader resourceLoader) {
return new KotlinSerializationJsonConvertersCustomizer(json, resourceLoader);
}
static class KotlinSerializationJsonConvertersCustomizer
implements ClientHttpMessageConvertersCu... | : new KotlinSerializationJsonHttpMessageConverter(json, (type) -> true);
}
@Override
public void customize(ClientBuilder builder) {
builder.withKotlinSerializationJsonConverter(this.converter);
}
@Override
public void customize(ServerBuilder builder) {
builder.withKotlinSerializationJsonConverter(th... | repos\spring-boot-4.0.1\module\spring-boot-http-converter\src\main\java\org\springframework\boot\http\converter\autoconfigure\KotlinSerializationHttpMessageConvertersConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class ContactPersonId implements RepoIdAware
{
int repoId;
@JsonCreator
public static ContactPersonId ofRepoId(final int repoId)
{
return new ContactPersonId(repoId);
}
@Nullable
public static ContactPersonId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? ofRepoId(repoId) : null;
} | private ContactPersonId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "MKTG_ContactPerson_ID");
}
@JsonValue
public int getRepoId()
{
return repoId;
}
public static boolean equals(@Nullable final ContactPersonId id1, @Nullable final ContactPersonId id2)
{
return Objects.equals(id... | repos\metasfresh-new_dawn_uat\backend\de.metas.marketing\base\src\main\java\de\metas\marketing\base\model\ContactPersonId.java | 2 |
请完成以下Java代码 | private final void updatePMMBalance(final I_C_OrderLine orderLine, final BigDecimal qtyDeliveredDiff)
{
// If there is no change in qty delivered then do nothing.
if (qtyDeliveredDiff.signum() == 0)
{
logger.debug("Skip updating the PMM_Balance for {} because QtyDeliveredDiff is zero", orderLine);
return;
... | .setDate(date)
.setQtyDelivered(qtyDeliveredDiff)
.build();
//
// Schedule event after commit
logger.debug("Scheduling event: {}", event);
final ITrxListenerManager trxListenerManager = Services.get(ITrxManager.class).getTrxListenerManagerOrAutoCommit(ITrx.TRXNAME_ThreadInherited);
trxListenerManager... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\order\interceptor\C_OrderLine.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void save(final Properties ctx, final String attribute, final Object value, final int adClientId, final int adOrgId, final int adUserId, final int adWindowId)
{
logger.info("");
final String trxName = null;
I_AD_Preference preference = fetch(ctx, attribute, adClientId, adOrgId, adUserId, adWindowId);
... | return null;
}
else if (value instanceof String)
{
return (String)value;
}
else if (value instanceof Boolean)
{
return DisplayType.toBooleanString((Boolean)value);
}
else
{
return value.toString();
}
}
@Override
public void deleteUserPreferenceByUserId(final UserId userId)
{
queryBL.... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\service\impl\ValuePreferenceDAO.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class SecurityConfig {
@Autowired
private UserRepository userRepository;
@Autowired
private UserDetailsService userDetailsService;
@Autowired
private LogoutSuccessHandler myLogoutSuccessHandler;
@Bean
public AuthenticationManager authManager(HttpSecurity http) throws Exception {
... | authorizationManagerRequestMatcherRegistry ->
authorizationManagerRequestMatcherRegistry.requestMatchers("/login*", "/logout*", "/protectedbynothing*", "/home*").permitAll()
.requestMatchers("/protectedbyrole").hasRole("USER")
... | repos\tutorials-master\spring-security-modules\spring-security-web-boot-1\src\main\java\com\baeldung\roles\rolesauthorities\config\SecurityConfig.java | 2 |
请完成以下Java代码 | protected void removePartitions(QueueKey queueKey, Set<TopicPartitionInfo> partitions) {
eventConsumer.removePartitions(partitions);
for (PartitionedQueueConsumerManager<?> consumer : otherConsumers) {
consumer.removePartitions(withTopic(partitions, consumer.getTopic()));
}
}
... | }
public void stop() {
eventConsumer.stop();
eventConsumer.awaitStop();
}
public interface RestoreCallback {
void onAllPartitionsRestored();
default void onPartitionRestored(TopicPartitionInfo partition) {}
}
} | repos\thingsboard-master\common\queue\src\main\java\org\thingsboard\server\queue\common\state\QueueStateService.java | 1 |
请完成以下Java代码 | public void copyTo(@NonNull final IHUPackingAware to)
{
to.setM_Product_ID(from.getM_Product_ID());
copyASI(to);
to.setC_UOM_ID(from.getC_UOM_ID());
to.setQty(from.getQty());
to.setM_HU_PI_Item_Product_ID(from.getM_HU_PI_Item_Product_ID());
to.setQtyTU(from.getQtyTU());
to.setLuId(from.getLuId());
to.... | }
else
{
throw new IllegalStateException("Unknown asiCopyMode: " + asiCopyMode);
}
}
private void copyBPartner(final IHUPackingAware to)
{
// 08276
// do not modify the partner in the orderline if it was already set
if (to.getC_BPartner_ID() <= 0 || overridePartner)
{
to.setC_BPartner_ID(from.ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\adempiere\gui\search\HUPackingAwareCopy.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CommodityNumberId implements RepoIdAware
{
int repoId;
@JsonCreator
public static CommodityNumberId ofRepoId(final int repoId)
{
return new CommodityNumberId(repoId);
}
@Nullable
public static CommodityNumberId ofRepoIdOrNull(@Nullable final Integer repoId)
{
return repoId != null && repoId >... | @JsonValue
public int toJson()
{
return getRepoId();
}
public static int toRepoId(@Nullable final CommodityNumberId commodityNumberId)
{
if (commodityNumberId == null)
{
return -1;
}
return commodityNumberId.getRepoId();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\product\CommodityNumberId.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable Database getDatabase() {
return this.database;
}
public void setDatabase(@Nullable Database database) {
this.database = database;
}
public boolean isGenerateDdl() {
return this.generateDdl;
}
public void setGenerateDdl(boolean generateDdl) {
this.generateDdl = generateDdl;
}
public ... | }
public void setShowSql(boolean showSql) {
this.showSql = showSql;
}
public @Nullable Boolean getOpenInView() {
return this.openInView;
}
public void setOpenInView(@Nullable Boolean openInView) {
this.openInView = openInView;
}
} | repos\spring-boot-4.0.1\module\spring-boot-jpa\src\main\java\org\springframework\boot\jpa\autoconfigure\JpaProperties.java | 2 |
请完成以下Java代码 | public void updateCheckAfterChildrenInserted(TreePath parent) {
if (this.model.isPathChecked(parent)) {
checkPath(parent);
} else {
uncheckPath(parent);
}
}
/*
* (non-Javadoc)
*
* @see it.cnr.imaa.essi.lablib.gui.checkboxtree.TreeCheckingMode#updateCheckAfterChildrenRem... | }
}
}
this.model.updatePathGreyness(parent);
this.model.updateAncestorsGreyness(parent);
}
/*
* (non-Javadoc)
*
* @see it.cnr.imaa.essi.lablib.gui.checkboxtree.TreeCheckingMode#updateCheckAfterStructureChanged(javax.swing.tree.TreePath)
*/
@Override
public v... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\it\cnr\imaa\essi\lablib\gui\checkboxtree\PropagateUpWhiteTreeCheckingMode.java | 1 |
请完成以下Java代码 | public class AbstractStartCaseInstanceAfterContext {
protected CaseInstanceEntity caseInstance;
protected Map<String, Object> variables;
protected Case caseModel;
protected CaseDefinition caseDefinition;
protected CmmnModel cmmnModel;
public AbstractStartCaseInstanceAfterContext() {
... | }
public void setVariables(Map<String, Object> variables) {
this.variables = variables;
}
public Case getCaseModel() {
return caseModel;
}
public void setCaseModel(Case caseModel) {
this.caseModel = caseModel;
}
public CaseDefinition getCaseDefinition() {
... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\interceptor\AbstractStartCaseInstanceAfterContext.java | 1 |
请完成以下Java代码 | public void deleteByTenantId(TenantId tenantId) {
deleteAllRpcByTenantId(tenantId);
}
@Override
public Rpc findById(TenantId tenantId, RpcId rpcId) {
log.trace("Executing findById, tenantId [{}], rpcId [{}]", tenantId, rpcId);
validateId(tenantId, id -> INCORRECT_TENANT_ID + id);
... | return Optional.ofNullable(findById(tenantId, new RpcId(entityId.getId())));
}
@Override
public FluentFuture<Optional<HasId<?>>> findEntityAsync(TenantId tenantId, EntityId entityId) {
return FluentFuture.from(findRpcByIdAsync(tenantId, new RpcId(entityId.getId())))
.transform(Optio... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\rpc\BaseRpcService.java | 1 |
请完成以下Java代码 | public void setRemote_Host (String Remote_Host)
{
set_Value (COLUMNNAME_Remote_Host, Remote_Host);
}
/** Get Remote Host.
@return Remote host Info
*/
public String getRemote_Host ()
{
return (String)get_Value(COLUMNNAME_Remote_Host);
}
/** Set User Agent.
@param UserAgent
Browser Used
*/
pub... | @return Web Counter Count Management
*/
public int getW_CounterCount_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_W_CounterCount_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Web Counter.
@param W_Counter_ID
Individual Count hit
*/
public void setW_Counter_ID (int W_Co... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_Counter.java | 1 |
请完成以下Java代码 | private void addActionClassesToList(final List<Class<? extends IContextMenuAction>> list, final ArrayKey key, final Map<ArrayKey, List<Class<? extends IContextMenuAction>>> actionClasses)
{
List<Class<? extends IContextMenuAction>> classesList = actionClasses.get(key);
if (classesList == null || classesList.isEmpt... | {
return Services.get(IQueryBL.class).createQueryBuilder(I_AD_Field_ContextMenu.class, ctx, ITrx.TRXNAME_None)
.addInArrayOrAllFilter(I_AD_Field_ContextMenu.COLUMN_AD_Client_ID, 0, adClientId)
.addOnlyActiveRecordsFilter()
//
.orderBy()
.addColumn(I_AD_Field_ContextMenu.COLUMN_SeqNo)
.addColum... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\adempiere\ui\impl\ContextMenuProvider.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List<QueryVariable> getVariables() {
return variables;
}
public void setVariables(List<QueryVariable> variables) {
this.variables = variables;
}
public String getActivePlanItemDefinitionId() {
return activePlanItemDefinitionId;
}
public void setActivePlanItemDef... | this.withoutTenantId = withoutTenantId;
}
public Boolean getWithoutTenantId() {
return withoutTenantId;
}
public String getTenantIdLike() {
return tenantIdLike;
}
public void setTenantIdLike(String tenantIdLike) {
this.tenantIdLike = tenantIdLike;
}
public... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\caze\CaseInstanceQueryRequest.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void setSessionRepositoryCustomizer(
ObjectProvider<ReactiveSessionRepositoryCustomizer<ReactiveRedisSessionRepository>> sessionRepositoryCustomizers) {
this.sessionRepositoryCustomizers = sessionRepositoryCustomizers.orderedStream().collect(Collectors.toList());
}
@Override
public void setBeanClassLoad... | RedisSerializer<Object> defaultSerializer = (this.defaultRedisSerializer != null) ? this.defaultRedisSerializer
: new JdkSerializationRedisSerializer(this.classLoader);
RedisSerializationContext<String, Object> serializationContext = RedisSerializationContext
.<String, Object>newSerializationContext(defaultSer... | repos\spring-session-main\spring-session-data-redis\src\main\java\org\springframework\session\data\redis\config\annotation\web\server\RedisWebSessionConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class FooService extends AbstractService<Foo> implements IFooService {
@Autowired
private IFooDao dao;
public FooService() {
super();
}
// API
@Override
protected PagingAndSortingRepository<Foo, Long> getDao() {
return dao;
}
// custom methods
@Overri... | }
// overridden to be secured
@Override
@Transactional(readOnly = true)
public List<Foo> findAll() {
return Lists.newArrayList(getDao().findAll());
}
@Override
public Page<Foo> findPaginated(Pageable pageable) {
return dao.findAll(pageable);
}
} | repos\tutorials-master\persistence-modules\spring-data-jpa-enterprise\src\main\java\com\baeldung\boot\services\impl\FooService.java | 2 |
请完成以下Java代码 | public void setBarcode(final String barcode)
{
this.barcode = barcode != null ? barcode.trim() : null;
}
private Collection<HUAttributeQueryFilterVO> createBarcodeHUAttributeQueryFilterVOs()
{
if (Check.isEmpty(barcode, true))
{
return ImmutableList.of();
}
final HashMap<AttributeId, HUAttributeQuery... | }
private List<I_M_Attribute> getBarcodeAttributes()
{
final IDimensionspecDAO dimensionSpecsRepo = Services.get(IDimensionspecDAO.class);
final DimensionSpec barcodeDimSpec = dimensionSpecsRepo.retrieveForInternalNameOrNull(HUConstants.DIM_Barcode_Attributes);
if (barcodeDimSpec == null)
{
return Immutab... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\HUQueryBuilder_Attributes.java | 1 |
请完成以下Java代码 | public void addToCurrentQtyAndCumulate(
@NonNull final Quantity qtyToAdd,
@NonNull final CostAmount amt,
@NonNull final QuantityUOMConverter uomConverter)
{
final Quantity qtyToAddConv = uomConverter.convertQuantityTo(qtyToAdd, costSegment.getProductId(), uomId);
addToCurrentQtyAndCumulate(qtyToAddConv, a... | this.costPrice = costPrice;
}
public void setOwnCostPrice(@NonNull final CostAmount ownCostPrice)
{
setCostPrice(getCostPrice().withOwnCostPrice(ownCostPrice));
}
public void clearOwnCostPrice()
{
setCostPrice(getCostPrice().withZeroOwnCostPrice());
}
public void addToOwnCostPrice(@NonNull final CostAmou... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\CurrentCost.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Application {
private final DbProperties dbProperties;
private final JavastackProperties javastackProperties;
private final MemberProperties memberProperties;
private final OtherMember otherMember;
@Value("${server.port}")
private int serverPort;
public static void main(St... | springApplication.run(args);
}
@Bean
public CommandLineRunner commandLineRunner() {
return (args) -> {
log.info("db properties: {}", dbProperties);
log.info("javastack properties: {}", javastackProperties);
log.info("member properties: {}", memberProperties);
... | repos\spring-boot-best-practice-master\spring-boot-properties\src\main\java\cn\javastack\springboot\properties\Application.java | 2 |
请完成以下Java代码 | public static EngineInfo getAppEngineInfo(String appEngineName) {
return appEngineInfosByName.get(appEngineName);
}
public static AppEngine getDefaultAppEngine() {
return getAppEngine(NAME_DEFAULT);
}
/**
* Obtain an app engine by name.
*
* @param appEngineName
* ... | appEngines = new HashMap<>();
for (String appEngineName : engines.keySet()) {
AppEngine appEngine = engines.get(appEngineName);
try {
appEngine.close();
} catch (Exception e) {
LOGGER.error("exception while closing {}",... | repos\flowable-engine-main\modules\flowable-app-engine\src\main\java\org\flowable\app\engine\AppEngines.java | 1 |
请完成以下Java代码 | public String getJMXName()
{
return jmxName;
}
@Override
public boolean isStarted()
{
return SwingEventNotifierService.getInstance().isRunning();
}
@Override
public void start()
{
SwingEventNotifierService.getInstance().start(); | }
@Override
public void stop()
{
SwingEventNotifierService.getInstance().stop();
}
@Override
public String[] getSubscribedTopicNames()
{
final Set<String> subscribedTopicNames = SwingEventNotifierService.getInstance().getSubscribedTopicNames();
return subscribedTopicNames.toArray(new String[subscribedTop... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\adempiere\ui\notifications\JMXSwingEventNotifierService.java | 1 |
请完成以下Java代码 | public CommonResult constraintViolationExceptionHandler(HttpServletRequest req, ConstraintViolationException ex) {
logger.debug("[constraintViolationExceptionHandler]", ex);
// 拼接错误
StringBuilder detailMessage = new StringBuilder();
for (ConstraintViolation<?> constraintViolation : ex.ge... | }
// 包装 CommonResult 结果
return CommonResult.error(ServiceExceptionEnum.INVALID_REQUEST_PARAM_ERROR.getCode(),
ServiceExceptionEnum.INVALID_REQUEST_PARAM_ERROR.getMessage() + ":" + detailMessage.toString());
}
/**
* 处理其它 Exception 异常
*/
@ResponseBody
@ExceptionH... | repos\SpringBoot-Labs-master\lab-22\lab-22-validation-01\src\main\java\cn\iocoder\springboot\lab22\validation\core\web\GlobalExceptionHandler.java | 1 |
请完成以下Java代码 | public void setIsExcludeBPGroup (final boolean IsExcludeBPGroup)
{
set_Value (COLUMNNAME_IsExcludeBPGroup, IsExcludeBPGroup);
}
@Override
public boolean isExcludeBPGroup()
{
return get_ValueAsBoolean(COLUMNNAME_IsExcludeBPGroup);
}
@Override
public void setIsExcludeProductCategory (final boolean IsExclud... | set_Value (COLUMNNAME_PercentOfBasePoints, PercentOfBasePoints);
}
@Override
public BigDecimal getPercentOfBasePoints()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_PercentOfBasePoints);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setSeqNo (final int SeqNo)
{
set_Value... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\commission\model\X_C_CommissionSettingsLine.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ServiceImpl extends CommonServiceImpl<JobServiceConfiguration> {
public ServiceImpl() {
}
public ServiceImpl(JobServiceConfiguration configuration) {
super(configuration);
}
public FlowableEventDispatcher getEventDispatcher() {
return configuration.getEventDispat... | return configuration.getSuspendedJobEntityManager();
}
public ExternalWorkerJobEntityManager getExternalWorkerJobEntityManager() {
return configuration.getExternalWorkerJobEntityManager();
}
public TimerJobEntityManager getTimerJobEntityManager() {
return configuration.getTimerJobE... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\ServiceImpl.java | 2 |
请完成以下Java代码 | public void setM_HU_PI_Item_Product(final I_C_InvoiceLine invoiceLine)
{
final IProductBL productBL = Services.get(IProductBL.class);
final boolean isFreightCost = productBL
.getProductType(ProductId.ofRepoId(invoiceLine.getM_Product_ID()))
.isFreightCost();
if (isFreightCost)
{
// don't set a pac... | return;
}
final I_C_OrderLine orderLine = orderDAO.getOrderLineById(OrderLineId.ofRepoId(invoiceLine.getC_OrderLine_ID()), I_C_OrderLine.class);
if (orderLine.getC_UOM_BPartner_ID() <= 0 || orderLine.getQtyEnteredInBPartnerUOM().signum() == 0)
{
invoiceLine.setC_UOM_BPartner_ID(0);
invoiceLine.setQtyEnt... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\model\validator\C_InvoiceLine.java | 1 |
请完成以下Java代码 | public Optional<Account> getAccount(final TaxAcctType acctType)
{
if (TaxAcctType.TaxDue == acctType)
{
return Optional.of(T_Due_Acct);
}
else if (TaxAcctType.TaxLiability == acctType)
{
return Optional.of(T_Liability_Acct);
}
else if (TaxAcctType.TaxCredit == acctType)
{
return Optional.of(T_... | }
else if (TaxAcctType.T_PayDiscount_Rev_Acct == acctType)
{
return T_PayDiscount_Rev_Acct;
}
else
{
throw new AdempiereException("Unknown tax account type: " + acctType);
}
}
public Optional<Account> getPayDiscountAccount(final boolean isExpense)
{
final TaxAcctType acctType = isExpense ? TaxAc... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\accounts\TaxAccounts.java | 1 |
请完成以下Java代码 | public BootstrapPolicy onRequestFailure(BootstrapSession bsSession,
BootstrapDownlinkRequest<? extends LwM2mResponse> request, Throwable cause) {
this.sendLogs(bsSession.getEndpoint(),
String.format("%s: %s %s failed because of %s", LOG_LWM2M_ERROR, re... | this.sendLogs(bsSession.getEndpoint(), String.format("%s: Bootstrap session failed because of %s", LOG_LWM2M_ERROR,
cause.toString()));
this.tasksProvider.remove(bsSession.getEndpoint());
}
private void sendLogs(String endpointName, String logMsg) {
log.info("Endpoint: [{}] [{}]... | repos\thingsboard-master\common\transport\lwm2m\src\main\java\org\thingsboard\server\transport\lwm2m\bootstrap\secure\LwM2mDefaultBootstrapSessionManager.java | 1 |
请完成以下Java代码 | public int getRevisionNext() {
return revision + 1;
}
@Override
public int getRevision() {
return revision;
}
@Override
public void setRevision(int revision) {
this.revision = revision;
}
@Override
public boolean isInserted() {
return isInserted;
... | }
@Override
public void setUpdated(boolean isUpdated) {
this.isUpdated = isUpdated;
}
@Override
public boolean isDeleted() {
return isDeleted;
}
@Override
public void setDeleted(boolean isDeleted) {
this.isDeleted = isDeleted;
}
@Override
public Ob... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\persistence\entity\AbstractEntity.java | 1 |
请完成以下Java代码 | private void saveLog(ProceedingJoinPoint joinPoint, long time) {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
SysLog sysLog = new SysLog();
Log logAnnotation = method.getAnnotation(Log.class);
if (logAnnotation != null) {
// 注解上的描述
sysLog... | }
sysLog.setParams(params);
}
// 获取request
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
// 设置IP地址
sysLog.setIp(IPUtils.getIpAddr(request));
// 模拟一个用户名
sysLog.setUsername("mrbird");
sysLog.setTime((int) time);
Date date = new Date();
sysLog.setCreateTime(date);
// 保存系统日... | repos\SpringAll-master\07.Spring-Boot-AOP-Log\src\main\java\com\springboot\aspect\LogAspect.java | 1 |
请完成以下Java代码 | public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getDesc() {
return desc;
}
public void setDesc(... | public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Todo other = (Todo) obj;
if (id != other.id) {
retu... | repos\SpringBootForBeginners-master\02.Spring-Boot-Web-Application\src\main\java\com\in28minutes\springboot\web\model\Todo.java | 1 |
请完成以下Java代码 | public void insert(int value) {
insert(this, value);
}
private void insert(TreeNode currentNode, final int value) {
if (currentNode.left == null && value < currentNode.value) {
currentNode.left = new TreeNode(value);
return;
}
if (currentNode.right == nu... | }
public TreeNode iterativeParent(int target) {
return iterativeParent(this, new TreeNode(target));
}
private TreeNode iterativeParent(TreeNode current, TreeNode target) {
Deque<TreeNode> parentCandidates = new LinkedList<>();
String notFoundMessage = format("No parent node found ... | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-8\src\main\java\com\baeldung\algorithms\parentnodebinarytree\TreeNode.java | 1 |
请完成以下Java代码 | private boolean isLogConfigurationMessage(@Nullable Throwable ex) {
if (ex == null) {
return false;
}
if (ex instanceof InvocationTargetException) {
return isLogConfigurationMessage(ex.getCause());
}
String message = ex.getMessage();
if (message != null) {
for (String candidate : LOG_CONFIGURATION_... | static SpringBootExceptionHandler forCurrentThread() {
return handler.get();
}
/**
* Thread local used to attach and track handlers.
*/
private static final class LoggedExceptionHandlerThreadLocal extends ThreadLocal<SpringBootExceptionHandler> {
@Override
protected SpringBootExceptionHandler initialValu... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\SpringBootExceptionHandler.java | 1 |
请完成以下Java代码 | public JSONObject buildQuery(List<String> source, JSONObject query, int from, int size) {
JSONObject json = new JSONObject();
if (source != null) {
json.put("_source", source);
}
json.put("query", query);
json.put("from", from);
json.put("size", size);
... | public JSONObject buildQueryString(String query) {
JSONObject queryString = new JSONObject();
queryString.put("query", query);
JSONObject json = new JSONObject();
json.put("query_string", queryString);
return json;
}
/**
* @param field 查询字段
* @param min ... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\es\JeecgElasticsearchTemplate.java | 1 |
请完成以下Java代码 | public <T> T call(@Nullable String contextName, Callable<T> callable) {
try {
bind(contextName);
return callable.call();
}
catch (Exception ex) {
throw new IllegalStateException(ex);
}
finally {
unbind(contextName);
}
}
/**
* Execute a {@link Runnable} binding to the default {@link Connecti... | }
finally {
unbind(contextName);
}
}
/**
* Bind the context.
* @param contextName the name of the context for the connection factory.
*/
private void bind(@Nullable String contextName) {
if (StringUtils.hasText(contextName)) {
SimpleResourceHolder.bind(this.connectionFactory, contextName);
}
}
... | repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\connection\ConnectionFactoryContextWrapper.java | 1 |
请完成以下Java代码 | private RelatedProcessDescriptor createProcessDescriptor(final int sortNo, @NonNull final Class<?> processClass)
{
final AdProcessId processId = adProcessDAO.retrieveProcessIdByClass(processClass);
return RelatedProcessDescriptor.builder()
.processId(processId)
.anyTable().anyWindow()
.displayPlace(Re... | @Nullable
private DocumentFilter getEffectiveFilter(final @NonNull CreateViewRequest request)
{
return request.getFiltersUnwrapped(getFilterDescriptor())
.getFilterById(OIViewFilterHelper.FILTER_ID)
.orElse(null);
}
private DocumentFilterDescriptor getFilterDescriptor()
{
DocumentFilterDescriptor filt... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.webui\src\main\java\de\metas\acct\gljournal_sap\select_open_items\OIViewFactory.java | 1 |
请完成以下Java代码 | public Map<String, VariableValue> wrapVariables(ExternalTask externalTask, Map<String, TypedValueField> variables) {
String executionId = externalTask.getExecutionId();
Map<String, VariableValue> result = new HashMap<>();
if (variables != null) {
variables.forEach((variableName, variableValue) -> {
... | String typeName = valueType.getName();
String typeNameCapitalized = Character.toUpperCase(typeName.charAt(0)) + typeName.substring(1);
typedValueField.setType(typeNameCapitalized);
return typedValueField;
}
@SuppressWarnings("unchecked")
protected <T extends TypedValue> ValueMapper<T> findSerializer... | repos\camunda-bpm-platform-master\clients\java\client\src\main\java\org\camunda\bpm\client\variable\impl\TypedValues.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected TbResource findExistingEntity(EntitiesImportCtx ctx, TbResource resource, IdProvider idProvider) {
TbResource existingResource = super.findExistingEntity(ctx, resource, idProvider);
if (existingResource == null && ctx.isFindExistingByName()) {
existingResource = resourceService.fin... | return resource;
}
}
@Override
protected void onEntitySaved(User user, TbResource savedResource, TbResource oldResource) throws ThingsboardException {
super.onEntitySaved(user, savedResource, oldResource);
clusterService.onResourceChange(savedResource, null);
}
@Override
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\sync\ie\importing\impl\ResourceImportService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public AuthenticationManager getObject() throws Exception {
try {
return (AuthenticationManager) this.bf.getBean(BeanIds.AUTHENTICATION_MANAGER);
}
catch (NoSuchBeanDefinitionException ex) {
if (!BeanIds.AUTHENTICATION_MANAGER.equals(ex.getBeanName())) {
throw ex;
}
UserDetailsService uds = this.b... | @Override
public boolean isSingleton() {
return true;
}
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.bf = beanFactory;
}
public void setObservationRegistry(ObservationRegistry observationRegistry) {
this.observationRegistry = observationRegistry;
}
} | repos\spring-security-main\config\src\main\java\org\springframework\security\config\authentication\AuthenticationManagerFactoryBean.java | 2 |
请完成以下Java代码 | public String getDueDate() {
return dueDate;
}
public void setDueDate(String dueDate) {
this.dueDate = dueDate;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getT... | }
@Override
public HumanTask clone() {
HumanTask clone = new HumanTask();
clone.setValues(this);
return clone;
}
public void setValues(HumanTask otherElement) {
super.setValues(otherElement);
setAssignee(otherElement.getAssignee());
setOwner(otherElement... | repos\flowable-engine-main\modules\flowable-cmmn-model\src\main\java\org\flowable\cmmn\model\HumanTask.java | 1 |
请完成以下Java代码 | protected String escapeQuotedString(String in)
{
return in;
}
/**
* Convert simple SQL Statement. Based on ConvertMap
*
* @param sqlStatement
* @return converted Statement
*/
private final String applyConvertMap(String sqlStatement) {
// Error Checks
if (sqlStatement.toUpperCase().indexOf("EXCEPTIO... | log.warn("Failed converting {}", sqlStatement, e);
}
return sqlStatement;
}
/**
* Get convert map for use in sql convertion
* @return map
*/
protected ConvertMap getConvertMap()
{
return null;
}
/**
* Convert single Statements.
* - remove comments
* - process FUNCTION/TRIGGER/PROCEDURE... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\dbPort\Convert.java | 1 |
请完成以下Java代码 | public void setCookieCustomizer(Consumer<ResponseCookie.ResponseCookieBuilder> cookieCustomizer) {
Assert.notNull(cookieCustomizer, "cookieCustomizer cannot be null");
this.cookieCustomizer = cookieCustomizer;
}
private static ResponseCookie.ResponseCookieBuilder createRedirectUriCookieBuilder(ServerHttpRequest ... | private static String decodeCookie(String encodedCookieValue) {
return new String(Base64.getDecoder().decode(encodedCookieValue.getBytes()));
}
private static ServerWebExchangeMatcher createDefaultRequestMatcher() {
ServerWebExchangeMatcher get = ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, "/**");
S... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\savedrequest\CookieServerRequestCache.java | 1 |
请完成以下Java代码 | public List<String> shortcutFieldOrder() {
return Arrays.asList(DATETIME1_KEY, DATETIME2_KEY);
}
@Override
public Predicate<ServerWebExchange> apply(Config config) {
Objects.requireNonNull(config.getDatetime1(), DATETIME1_KEY + " must not be null");
Assert.isTrue(config.getDatetime1().isBefore(config.getDatet... | public static class Config {
@NotNull
private @Nullable ZonedDateTime datetime1;
@NotNull
private @Nullable ZonedDateTime datetime2;
public @Nullable ZonedDateTime getDatetime1() {
return datetime1;
}
public Config setDatetime1(ZonedDateTime datetime1) {
this.datetime1 = datetime1;
return thi... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\handler\predicate\BetweenRoutePredicateFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserAuthTokenFilterConfiguration
{
private static final Logger logger = LogManager.getLogger(UserAuthTokenFilterConfiguration.class);
private final CopyOnWriteArrayList<PathMatcher> matchers = new CopyOnWriteArrayList<>();
public void doNotAuthenticatePathsContaining(@NonNull final String containing)
... | final String path = httpRequest.getServletPath();
if (path == null)
{
return Optional.empty();
}
return matchers.stream()
.filter(matcher -> matcher.isMatching(path))
.map(PathMatcher::getResolution)
.findFirst();
}
@Value
@Builder
private static class PathMatcher
{
@NonNull String conta... | repos\metasfresh-new_dawn_uat\backend\de.metas.util.web\src\main\java\de\metas\util\web\security\UserAuthTokenFilterConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class TaskConfig {
@Lazy
@Bean
@Primary
public ThreadPoolTaskExecutor taskExecutor1(TaskExecutionProperties taskExecutionProperties) {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
... | }
@Lazy
@Bean
public ThreadPoolTaskExecutor taskExecutor2(TaskExecutionProperties taskExecutionProperties) {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
TaskExecutionProperties.Pool pool ... | repos\spring-boot-best-practice-master\spring-boot-schedule\src\main\java\cn\javastack\springboot.schedule\TaskConfig.java | 2 |
请完成以下Java代码 | public long reset(final CacheInvalidateMultiRequest multiRequest)
{
doConvert("cache reset on " + multiRequest);
return 1;
}
private final Properties getCtx()
{
return Env.getCtx();
}
@Override
public void vetoableChange(final PropertyChangeEvent evt) throws PropertyVetoException
{
// Try apply UOM co... | {
// Reset
setDescription(null);
setQtyConv(null);
final I_C_UOM uomFrom = getC_UOM();
final I_C_UOM uomTo = getC_UOM_To();
if (uomFrom == null || uomTo == null)
{
return;
}
final I_M_Product product = getM_Product();
final BigDecimal qty = getQty();
try
{
final BigDecimal qtyConv;
i... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\de\metas\uom\form\UOMConversionCheckFormPanel.java | 1 |
请完成以下Java代码 | public abstract class EncodeUtil {
private static Logger logger = LoggerFactory.getLogger(EncodeUtil.class);
/**
* 定义加密方式
*/
private final static String KEY_SHA = "SHA";
private final static String MD5 = "MD5";
/**
* SHA 加密
*
* @param data 需要加密的字符串
* @return 加密之后的字符串
*/
public static String sha(... | if (StringUtils.isEmpty(source)) {
return "";
}
try {
MessageDigest md = MessageDigest.getInstance(MD5);
byte[] bytes = md.digest(source.getBytes("utf-8"));
return byteArrayToHexString(bytes);
} catch (Exception e) {
logger.error("字符串使用Md5加密失败" + source + "' to MD5!", e);
return null;
}
}
... | repos\spring-boot-student-master\spring-boot-student-encode\src\main\java\com\xiaolyuh\utils\EncodeUtil.java | 1 |
请完成以下Java代码 | public String getDocumentUrl(@NonNull final AdWindowId windowId, final int documentId)
{
return getDocumentUrl(String.valueOf(windowId.getRepoId()), String.valueOf(documentId));
}
@Nullable
public String getDocumentUrl(@NonNull final String windowId, @NonNull final String documentId)
{
return getFrontendURL(S... | return getFrontendURL(SYSCONFIG_RESET_PASSWORD_PATH, ImmutableMap.<String, Object>builder()
.put(PARAM_ResetPasswordToken, token)
.build());
}
public boolean isCrossSiteUsageAllowed()
{
return sysConfigBL.getBooleanValue(SYSCONFIG_IsCrossSiteUsageAllowed, false);
}
public String getAppApiUrl()
{
fin... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\ui\web\WebuiURLs.java | 1 |
请完成以下Java代码 | public class DebugContinueProcessOperation extends ContinueProcessOperation {
public static final String HANDLER_TYPE_BREAK_POINT = "breakpoint";
protected ProcessDebugger debugger;
public DebugContinueProcessOperation(ProcessDebugger debugger, CommandContext commandContext,
ExecutionEntity e... | brokenJob.setExecutionId(execution.getId());
brokenJob.setProcessInstanceId(execution.getProcessInstanceId());
brokenJob.setProcessDefinitionId(execution.getProcessDefinitionId());
brokenJob.setExclusive(false);
brokenJob.setJobHandlerType(HANDLER_TYPE_BREAK_POINT);
// Inherit t... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\agenda\DebugContinueProcessOperation.java | 1 |
请完成以下Java代码 | public class ImageFileProcessor {
private final ImageFileEditor imageFileEditor;
private final TimeLogger timeLogger;
@Inject
public ImageFileProcessor(@PngFileEditorQualifier ImageFileEditor imageFileEditor, TimeLogger timeLogger) {
this.imageFileEditor = imageFileEditor;
this... | public String openFile(String fileName) {
return imageFileEditor.openFile(fileName) + " at: " + timeLogger.getTime();
}
public String editFile(String fileName) {
return imageFileEditor.editFile(fileName) + " at: " + timeLogger.getTime();
}
public String writeFile(String fileNa... | repos\tutorials-master\di-modules\cdi\src\main\java\com\baeldung\dependencyinjection\imageprocessors\ImageFileProcessor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PickingJobStepId implements RepoIdAware
{
int repoId;
private PickingJobStepId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "M_Picking_Job_Step_ID");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public String getAsString() {return String.valueOf... | @NonNull
public static PickingJobStepId ofString(@NonNull final String string)
{
try
{
return ofRepoId(Integer.parseInt(string));
}
catch (final Exception ex)
{
throw new AdempiereException("Invalid id string: `" + string + "`", ex);
}
}
public static boolean equals(@Nullable final PickingJobStep... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\model\PickingJobStepId.java | 2 |
请完成以下Spring Boot application配置 | ##########################################################
################## 所有profile共有的配置 #################
##########################################################
################### 自定义项目配置 ###################
xncoding:
socket-port: 9076 #socket端口
ping-interval: 60000 #Ping消息间隔(毫秒)
ping-timeout: 18... |
#####################################################################
######################## 测试环境profile ##########################
#####################################################################
spring:
profiles: test
xncoding:
image-dir: /var/pics/echarts/
load-js: /usr/share/nginx/html/echarts/js... | repos\SpringBootBucket-master\springboot-echarts\src\main\resources\application.yml | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.