instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public String getRaw() {
return raw;
}
public void setRaw(String raw) {
this.raw = raw;
}
@Override
public String toString() {
return "TokenDto [raw=" + raw + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
... | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
TokenDto other = (TokenDto) obj;
if (raw == null) {
if (other.raw != null... | repos\tutorials-master\spring-boot-modules\spring-boot-springdoc-2\src\main\java\com\baeldung\defaultglobalsecurityscheme\dto\TokenDto.java | 1 |
请完成以下Java代码 | public I_M_Product getM_Product() throws RuntimeException
{
return (I_M_Product)MTable.get(getCtx(), I_M_Product.Table_Name)
.getPO(getM_Product_ID(), get_TrxName()); }
/** Set Product.
@param M_Product_ID
Product, Service, Item
*/
public void setM_Product_ID (int M_Product_ID)
{
if (M_Product_ID... | /** Get Training Class.
@return The actual training class instance
*/
public int getS_Training_Class_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_S_Training_Class_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_S_Training getS_Training() throws RuntimeException
{
return ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_S_Training_Class.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ExampleConnectionProvider implements MultiTenantConnectionProvider<Object>, HibernatePropertiesCustomizer {
@Autowired DataSource dataSource;
@Override
public Connection getAnyConnection() throws SQLException {
return getConnection("PUBLIC");
}
@Override
public void releaseAnyConnection(Connecti... | @Override
public boolean supportsAggressiveRelease() {
return false;
}
@Override
public boolean isUnwrappableAs(Class<?> aClass) {
return false;
}
@Override
public <T> T unwrap(Class<T> aClass) {
throw new UnsupportedOperationException("Can't unwrap this.");
}
@Override
public void customize(Map<Stri... | repos\spring-data-examples-main\jpa\multitenant\schema\src\main\java\example\springdata\jpa\hibernatemultitenant\schema\ExampleConnectionProvider.java | 2 |
请完成以下Java代码 | default ValidationEntry addWarning(String problem, String description) {
return addWarning(problem, null, null, null, description);
}
default ValidationEntry addWarning(String problem, Case caze, CaseElement caseElement, BaseElement baseElement, String description) {
return addEntry(problem, ca... | entry.setProblem(problem);
entry.setDefaultDescription(description);
if (caseElement == null && baseElement instanceof CaseElement) {
caseElement = (CaseElement) baseElement;
}
if (caseElement != null) {
entry.setItemId(caseElement.getId());
entry.se... | repos\flowable-engine-main\modules\flowable-case-validation\src\main\java\org\flowable\cmmn\validation\CaseValidationContext.java | 1 |
请完成以下Java代码 | public ChargeBearerTypeSEPACode getChrgBr() {
return chrgBr;
}
/**
* Sets the value of the chrgBr property.
*
* @param value
* allowed object is
* {@link ChargeBearerTypeSEPACode }
*
*/
public void setChrgBr(ChargeBearerTypeSEPACode value) {
... | *
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the drctDbtTxInf property.
*
* <p>
... | 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\PaymentInstructionInformationSDD.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ChatController {
@Qualifier("openaiRestTemplate")
@Autowired
private RestTemplate restTemplate;
@Value("${openai.model}")
private String model;
@Value("${openai.api.url}")
private String apiUrl;
/**
* Creates a chat request and sends it to the OpenAI API
* Retu... | */
@GetMapping("/chat")
public String chat(@RequestParam String prompt) {
ChatRequest request = new ChatRequest(model, prompt);
ChatResponse response = restTemplate.postForObject(
apiUrl,
request,
ChatResponse.class);
if (response == null... | repos\tutorials-master\spring-boot-modules\spring-boot-libraries-2\src\main\java\com\baeldung\openai\controller\ChatController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Product createProduct(Product product) {
return productRepository.save(product);
}
@Override
public Product updateProduct(Product product) {
Optional<Product> productDb = this.productRepository.findById(product.getId());
if(productDb.isPresent()) {
Product productUpdate = productDb.get();
prod... | }else {
throw new ResourceNotFoundException("Record not found with id : " + productId);
}
}
@Override
public void deleteProduct(long productId) {
Optional<Product> productDb = this.productRepository.findById(productId);
if(productDb.isPresent()) {
this.productRepository.delete(productDb.get());
}el... | repos\Spring-Boot-Advanced-Projects-main\springboot-crud-hibernate-example\src\main\java\net\alanbinu\springboot\service\ProductServiceImpl.java | 2 |
请完成以下Java代码 | public ReceiveTask newInstance(ModelTypeInstanceContext instanceContext) {
return new ReceiveTaskImpl(instanceContext);
}
});
implementationAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_IMPLEMENTATION)
.defaultValue("##WebService")
.build();
instantiateAttribute = ... | implementationAttribute.setValue(this, implementation);
}
public boolean instantiate() {
return instantiateAttribute.getValue(this);
}
public void setInstantiate(boolean instantiate) {
instantiateAttribute.setValue(this, instantiate);
}
public Message getMessage() {
return messageRefAttribute... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\ReceiveTaskImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class X_QRCode_Configuration extends org.compiere.model.PO implements I_QRCode_Configuration, org.compiere.model.I_Persistent
{
private static final long serialVersionUID = -1807661472L;
/** Standard Constructor */
public X_QRCode_Configuration (final Properties ctx, final int QRCode_Configuration_ID... | public boolean isOneQRCodeForMatchingAttributes()
{
return get_ValueAsBoolean(COLUMNNAME_IsOneQRCodeForMatchingAttributes);
}
@Override
public void setName (final String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
@Override
public String getName()
{
return get_ValueAsString(COLUMNNAME_Name);
}
@Ov... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_QRCode_Configuration.java | 2 |
请完成以下Java代码 | public Object getParameterDefaultValue(@NonNull final IProcessDefaultParameter parameter)
{
if (I_ESR_Import.COLUMNNAME_ESR_Import_ID.equals(parameter.getColumnName()))
{
final int esrImportId = parameter.getContextAsInt(I_ESR_Import.COLUMNNAME_ESR_Import_ID);
if (esrImportId > 0)
{
return esrImportId... | private final I_ESR_Import retrieveESR_Import()
{
if (p_ESR_Import_ID <= 0)
{
if (I_ESR_Import.Table_Name.equals(getTableName()))
{
p_ESR_Import_ID = getRecord_ID();
}
if (p_ESR_Import_ID <= 0)
{
throw new FillMandatoryException(I_ESR_Import.COLUMNNAME_ESR_Import_ID);
}
}
final I_ESR... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java\de\metas\payment\esr\process\ESR_Import_LoadFromFile.java | 1 |
请完成以下Java代码 | public void addAll(String[] total)
{
for (String single : total)
{
add(single);
}
}
/**
* 查找是否有该后缀
* @param suffix
* @return
*/
public int get(String suffix)
{
suffix = reverse(suffix);
Integer length = trie.get(suffix);
... | }
private static String reverse(String word)
{
return new StringBuilder(word).reverse().toString();
}
/**
* 键值对
* @return
*/
public Set<Map.Entry<String, Integer>> entrySet()
{
Set<Map.Entry<String, Integer>> treeSet = new LinkedHashSet<Map.Entry<String, Integer>... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\dictionary\SuffixDictionary.java | 1 |
请完成以下Java代码 | public boolean isEmpty() {
return connectors.isEmpty();
}
private static class ConnectorMetricsState {
private final AtomicInteger count;
private final AtomicLong gwLatencySum;
private final AtomicLong transportLatencySum;
private volatile long minGwLatency;
priv... | if (maxGwLatency < gwLatency) {
maxGwLatency = gwLatency;
}
if (minTransportLatency == 0 || minTransportLatency > transportLatency) {
minTransportLatency = transportLatency;
}
if (maxTransportLatency < transportLatency) {
ma... | repos\thingsboard-master\common\transport\mqtt\src\main\java\org\thingsboard\server\transport\mqtt\gateway\metrics\GatewayMetricsState.java | 1 |
请完成以下Java代码 | public void onDesadvDelete(final I_EDI_Desadv desadv)
{
final List<I_EDI_DesadvLine> allLines = desadvDAO.retrieveAllDesadvLines(desadv);
for (final I_EDI_DesadvLine line : allLines)
{
InterfaceWrapperHelper.delete(line);
}
final List<I_M_InOut> allInOuts = desadvDAO.retrieveAllInOuts(desadv);
for (fin... | final String exportStatus = desadv.getEDI_ExportStatus();
final boolean processing = I_EDI_Document.EDI_EXPORTSTATUS_Enqueued.equals(exportStatus) || I_EDI_Document.EDI_EXPORTSTATUS_SendingStarted.equals(exportStatus);
desadv.setProcessing(processing);
final boolean processed = I_EDI_Document.EDI_EXPORTSTATUS_S... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java\de\metas\edi\model\validator\EDI_Desadv.java | 1 |
请完成以下Java代码 | public String getTaskIdVariableName() {
return taskIdVariableName;
}
public void setTaskIdVariableName(String taskIdVariableName) {
this.taskIdVariableName = taskIdVariableName;
}
public String getTaskCompleterVariableName() {
return taskCompleterVariableName;
}
public... | public void setTaskListeners(List<FlowableListener> taskListeners) {
this.taskListeners = taskListeners;
}
@Override
public HumanTask clone() {
HumanTask clone = new HumanTask();
clone.setValues(this);
return clone;
}
public void setValues(HumanTask otherElement) {
... | repos\flowable-engine-main\modules\flowable-cmmn-model\src\main\java\org\flowable\cmmn\model\HumanTask.java | 1 |
请完成以下Java代码 | public class RedisCache<K, V> implements Cache<K, V> {
private String cacheName;
public RedisCache() {
}
public RedisCache(String cacheName) {
this.cacheName = cacheName;
}
private RedisTemplate getRedisTemplate() {
RedisTemplate redisTemplate = (RedisTemplate) ApplicationCon... | @Override
public V remove(K k) throws CacheException {
return (V) getRedisTemplate().opsForHash().delete(this.cacheName,k.toString());
}
@Override
public void clear() throws CacheException {
getRedisTemplate().opsForHash().delete(this.cacheName);
}
@Override
public int siz... | repos\springboot-demo-master\shiro\src\main\java\com\et\shiro\cache\RedisCache.java | 1 |
请完成以下Java代码 | public int hashCode()
{
return m_AD_Language.hashCode();
} // hashcode
@Override
public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj instanceof Language)
{
final Language other = (Language)obj;
return Objects.equals(this.m_AD_Language, other.m_AD_Language);
... | {
return timeStyleDefault;
}
public int getTimeStyle()
{
return getDefaultTimeStyle();
}
private boolean matchesLangInfo(final String langInfo)
{
if (langInfo == null || langInfo.isEmpty())
{
return false;
}
return langInfo.equals(getName())
|| langInfo.equals(getAD_Language())
|| langIn... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\Language.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DatasourceProxyBeanPostProcessor implements BeanPostProcessor {
private static final Logger logger
= Logger.getLogger(DatasourceProxyBeanPostProcessor.class.getName());
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
if (bean instanc... | super();
this.dataSource = ProxyDataSourceBuilder.create(dataSource)
.name("DATA_SOURCE_PROXY")
.logQueryBySlf4j(SLF4JLogLevel.INFO)
.multiline()
.build();
}
@Override
public Object invoke(final MethodIn... | repos\Hibernate-SpringBoot-master\HibernateSpringBootBatchDeleteCascadeDelete\src\main\java\com\bookstore\config\DatasourceProxyBeanPostProcessor.java | 2 |
请完成以下Java代码 | public Vector query(String content)
{
if (content == null || content.length() == 0) return null;
List<Term> termList = segment.seg(content);
if (filter)
{
CoreStopWordDictionary.apply(termList);
}
Vector result = new Vector(dimension());
int n = 0;... | if (B == null) return -1f;
return A.cosineForUnitVector(B);
}
public Segment getSegment()
{
return segment;
}
public void setSegment(Segment segment)
{
this.segment = segment;
}
/**
* 是否激活了停用词过滤器
*
* @return
*/
public boolean isFilterEna... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\mining\word2vec\DocVectorModel.java | 1 |
请完成以下Java代码 | private NumberFormat createCurrencyNumberFormat(final I_C_Invoice_Candidate ic)
{
final IBPartnerDAO bpartnerDAO = Services.get(IBPartnerDAO.class);
final ICurrencyDAO currencyDAO = Services.get(ICurrencyDAO.class);
final IInvoiceCandBL invoiceCandBL = Services.get(IInvoiceCandBL.class);
final BPartnerLocat... | final String aggregationKey2 = buildKey(model2);
return Objects.equals(aggregationKey1, aggregationKey2);
}
@Override
public String getTableName()
{
return I_C_Invoice_Candidate.Table_Name;
}
@Override
public List<String> getDependsOnColumnNames()
{
return columnNames;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\agg\key\impl\ICLineAggregationKeyBuilder_OLD.java | 1 |
请完成以下Java代码 | public InfoSimple create(boolean modal, int windowNo, String tableName, boolean multiSelection, String whereClause, Map<String, Object> attributes)
{
final Frame frame = Env.getWindow(windowNo);
final String keyColumn = tableName + "_ID";
final String value = "";
final I_AD_InfoWindow infoWindow = Services.ge... | cl = getClass().getClassLoader();
@SuppressWarnings("unchecked")
Class<InfoSimple> clazz = (Class<InfoSimple>)cl.loadClass(className);
java.lang.reflect.Constructor<? extends Info> ctor = clazz.getConstructor(Frame.class);
InfoSimple infoSimple = (InfoSimple)ctor.newInstance(frame);
infoSimple.init(moda... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\apps\search\InfoSimpleFactory.java | 1 |
请完成以下Java代码 | public static MEXPFormatLine getFormatLineByValue(Properties ctx, String value, int EXP_Format_ID, String trxName)
throws SQLException
{
MEXPFormatLine result = null;
StringBuffer sql = new StringBuffer("SELECT * ")
.append(" FROM ").append(X_EXP_FormatLine.Table_Name)
.append(" WHERE ").... | try {
if (pstmt != null) pstmt.close ();
pstmt = null;
} catch (Exception e) { pstmt = null; }
}
return result;
}
@Override
protected boolean afterSave (boolean newRecord, boolean success)
{
if(!success)
{
return false;
}
CacheMgt.get().reset(I_EXP_Format.Table_Name);
return true;
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MEXPFormatLine.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_AD_Role getExportRole()
{
return get_ValueAsPO(COLUMNNAME_ExportRole_ID, org.compiere.model.I_AD_Role.class);
}
@Override
public void setExportRole(final org.compiere.model.I_AD_Role ExportRole)
{
set_ValueFromPO(COLUMNNAME_ExportRole_ID, org.compiere.model.I_AD_Role.class, ExportR... | public void setExternalSystem(final de.metas.externalsystem.model.I_ExternalSystem ExternalSystem)
{
set_ValueFromPO(COLUMNNAME_ExternalSystem_ID, de.metas.externalsystem.model.I_ExternalSystem.class, ExternalSystem);
}
@Override
public void setExternalSystem_ID (final int ExternalSystem_ID)
{
if (ExternalSys... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_ExportAudit.java | 1 |
请在Spring Boot框架中完成以下Java代码 | void setExceptionListener(@Nullable ExceptionListener exceptionListener) {
this.exceptionListener = exceptionListener;
}
/**
* Set the {@link JmsProperties} to use.
* @param jmsProperties the {@link JmsProperties}
*/
void setJmsProperties(@Nullable JmsProperties jmsProperties) {
this.jmsProperties = jmsPr... | * @param factory the {@link AbstractJmsListenerContainerFactory} instance to
* configure
* @param connectionFactory the {@link ConnectionFactory} to use
*/
public void configure(T factory, ConnectionFactory connectionFactory) {
Assert.notNull(factory, "'factory' must not be null");
Assert.notNull(connectionF... | repos\spring-boot-main\module\spring-boot-jms\src\main\java\org\springframework\boot\jms\autoconfigure\AbstractJmsListenerContainerFactoryConfigurer.java | 2 |
请完成以下Java代码 | public void process(final I_M_HU_Trx_Attribute huTrxAttribute)
{
//
// Check if it was already processed
if (huTrxAttribute.isProcessed())
{
return;
}
//
// Actually process it
process0(huTrxAttribute);
//
// Flag it as Processed and save it
huTrxAttribute.setProcessed(true);
save(huTrxAtt... | *
* @param huTrxAttribute
*/
private void process0(final I_M_HU_Trx_Attribute huTrxAttribute)
{
final Object referencedModel = getReferencedObject(huTrxAttribute);
final IHUTrxAttributeProcessor trxAttributeProcessor = getHUTrxAttributeProcessor(referencedModel);
final HUTransactionAttributeOperation opera... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\impl\HUTransactionAttributeProcessor.java | 1 |
请完成以下Java代码 | private static Warehouse ofRecord(@NonNull final I_M_Warehouse warehouseRecord)
{
return Warehouse.builder()
.id(WarehouseId.ofRepoId(warehouseRecord.getM_Warehouse_ID()))
.orgId(OrgId.ofRepoId(warehouseRecord.getAD_Org_ID()))
.name(warehouseRecord.getName())
.value(warehouseRecord.getValue())
.p... | public ClientAndOrgId getClientAndOrgIdByLocatorId(@NonNull WarehouseId warehouseId)
{
final I_M_Warehouse warehouse = getById(warehouseId);
return ClientAndOrgId.ofClientAndOrg(warehouse.getAD_Client_ID(), warehouse.getAD_Org_ID());
}
@Override
@NonNull
public ImmutableSet<LocatorId> getLocatorIdsByRepoId(@N... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\warehouse\api\impl\WarehouseDAO.java | 1 |
请完成以下Java代码 | public static FMeasure evaluate(IClassifier classifier, Map<String, String[]> testingDataSet)
{
return evaluate(classifier, new MemoryDataSet(classifier.getModel()).add(testingDataSet));
}
/**
*
* @param c 类目数量
* @param size 样本数量
* @param TP 判定为某个类别且判断正确的数量
* @param TP_FP 判... | precision[i] = TP[i] / TP_FP[i];
recall[i] = TP[i] / TP_FN[i];
result.average_accuracy += TP[i];
}
else
{
precision[i] = 0;
recall[i] = 0;
}
f1[i] = 2 * precision[i] * recall[i] / (precision[i] + ... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\classification\statistics\evaluations\Evaluator.java | 1 |
请完成以下Java代码 | public CurrentPickingTarget withLuPickingTarget(final @Nullable LUPickingTarget luPickingTarget)
{
if (LUPickingTarget.equals(this.luPickingTarget, luPickingTarget))
{
return this;
}
return toBuilder()
.luPickingTarget(luPickingTarget)
.tuPickingTarget(luPickingTarget == null ? null : this.tuPickin... | .luPickingTarget(null)
.tuPickingTarget(null)
.build();
}
@NonNull
public Optional<TUPickingTarget> getTuPickingTarget() {return Optional.ofNullable(tuPickingTarget);}
@NonNull
public CurrentPickingTarget withTuPickingTarget(@Nullable final TUPickingTarget tuPickingTarget)
{
return TUPickingTarget.equ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\model\CurrentPickingTarget.java | 1 |
请完成以下Java代码 | public ImportProcessResult toResult()
{
return new ImportProcessResult(this);
}
public ImportProcessResultCollector importTableName(@NonNull final String importTableName)
{
this.importTableName = importTableName;
return this;
}
public void setCountImportRecordsDeleted(final int countImportRecords... | return unknownValue ? "N/A" : String.valueOf(value);
}
public void set(final int value)
{
if (value < 0)
{
throw new AdempiereException("value shall NOT be negative: " + value);
}
this.value = value;
this.unknownValue = false;
}
public void add(final int valueToAdd)
{
Check.assumeGre... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\processing\ImportProcessResult.java | 1 |
请完成以下Java代码 | public T findOne(final long id) {
return entityManager.find(clazz, id);
}
@SuppressWarnings("unchecked")
public List<T> findAll() {
return entityManager.createQuery("from " + clazz.getName()).getResultList();
}
public void create(final T entity) {
entityManager.persist(enti... | Criteria criteria = session.createCriteria(clazz);
criteria.createAlias("bar", "b");
criteria.add(Restrictions.eq("b.name", barName));
criteria.setProjection(Projections.rowCount());
return (Long) criteria.uniqueResult();
}
public long getFooCountByBarNameAndFooNameUsingHibernat... | repos\tutorials-master\persistence-modules\spring-hibernate-5\src\main\java\com\baeldung\hibernate\cache\dao\AbstractJpaDAO.java | 1 |
请完成以下Java代码 | public BooleanWithReason getEnabled()
{
if (Adempiere.isUnitTestMode())
{
return DISABLED_BECAUSE_JUNIT_MODE;
}
// Check if it was disabled by sysconfig
if (!sysConfigBL.getBooleanValue(SYSCONFIG_elastic_enable, true))
{
return DISABLED_BECAUSE_SYSCONFIG;
}
return BooleanWithReason.TRUE;
}
p... | if (enabled.isFalse())
{
throw new AdempiereException("Expected elasticsearch feature to be enabled but is disabled because `" + enabled.getReasonAsString() + "`");
}
}
@Override
public RestHighLevelClient elasticsearchClient()
{
assertEnabled();
RestHighLevelClient elasticsearchClient = this.elasticse... | repos\metasfresh-new_dawn_uat\backend\de.metas.elasticsearch\src\main\java\de\metas\elasticsearch\impl\ESSystem.java | 1 |
请完成以下Java代码 | public class RecordBasedLocationUtils
{
public static <SELF extends RecordBasedLocationAdapter<SELF>> void updateCapturedLocationAndRenderedAddressIfNeeded(
@NonNull RecordBasedLocationAdapter<SELF> locationAdapter,
@NonNull final IDocumentLocationBL documentLocationBL)
{
final Object record = locationAdapter... | final boolean updateCapturedLocation = isNewRecord
? currentLocation.getLocationId() == null
: !BPartnerLocationId.equals(currentLocation.getBpartnerLocationId(), previousLocation.getBpartnerLocationId());
final boolean updateRenderedAddress = isNewRecord
|| updateCapturedLocation
|| !currentLocation... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\document\location\RecordBasedLocationUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public final class HttpSessionOAuth2AuthorizedClientRepository implements OAuth2AuthorizedClientRepository {
private static final String DEFAULT_AUTHORIZED_CLIENTS_ATTR_NAME = HttpSessionOAuth2AuthorizedClientRepository.class
.getName() + ".AUTHORIZED_CLIENTS";
private final String sessionAttributeName = DEFAULT_... | Map<String, OAuth2AuthorizedClient> authorizedClients = this.getAuthorizedClients(request);
if (!authorizedClients.isEmpty()) {
if (authorizedClients.remove(clientRegistrationId) != null) {
if (!authorizedClients.isEmpty()) {
request.getSession().setAttribute(this.sessionAttributeName, authorizedClients);... | repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\web\HttpSessionOAuth2AuthorizedClientRepository.java | 2 |
请完成以下Java代码 | public class DeleteJobCmd implements Command<Object>, Serializable {
private static final long serialVersionUID = 1L;
protected String jobId;
public DeleteJobCmd(String jobId) {
this.jobId = jobId;
}
public Object execute(CommandContext commandContext) {
ensureNotNull("jobId", jobId);
JobEnti... | // We need to check if the job was locked, ie acquired by the job acquisition thread
// This happens if the the job was already acquired, but not yet executed.
// In that case, we can't allow to delete the job.
if (job.getLockOwner() != null || job.getLockExpirationTime() != null) {
throw new ProcessE... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\DeleteJobCmd.java | 1 |
请完成以下Java代码 | public class PartyIdentificationSEPA4 {
@XmlElement(name = "Nm")
protected String nm;
@XmlElement(name = "Id")
protected PartySEPA2 id;
/**
* Gets the value of the nm property.
*
* @return
* possible object is
* {@link String }
*
*/
public Strin... | */
public PartySEPA2 getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link PartySEPA2 }
*
*/
public void setId(PartySEPA2 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\PartyIdentificationSEPA4.java | 1 |
请完成以下Java代码 | ListenableFuture<Optional<TsKvEntity>> findAndAggregateAsync(EntityId entityId, String key, long startTs, long endTs, long ts, Aggregation aggregation) {
return service.submit(() -> {
TsKvEntity entity = switchAggregation(entityId, key, startTs, endTs, aggregation);
if (entity != null &&... | return tsKvRepository.findStringMax(entityId.getId(), keyId, startTs, endTs);
}
case MIN:
var min = tsKvRepository.findNumericMin(entityId.getId(), keyId, startTs, endTs);
if (min.isNotEmpty()) {
return min;
} else {
... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sqlts\AbstractChunkedAggregationTimeseriesDao.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public PlatformTwoFaSettings savePlatformTwoFaSettings(TenantId tenantId, PlatformTwoFaSettings twoFactorAuthSettings) throws ThingsboardException {
ConstraintValidator.validateFields(twoFactorAuthSettings);
for (TwoFaProviderConfig providerConfig : twoFactorAuthSettings.getProviders()) {
tw... | settings.setJsonValue(JacksonUtil.valueToTree(twoFactorAuthSettings));
adminSettingsService.saveAdminSettings(tenantId, settings);
return twoFactorAuthSettings;
}
@Override
public void deletePlatformTwoFaSettings(TenantId tenantId) {
Optional.ofNullable(adminSettingsService.findAdmi... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\security\auth\mfa\config\DefaultTwoFaConfigManager.java | 2 |
请完成以下Java代码 | public Collection<DocumentFilterDescriptor> getFilterDescriptors()
{
return getFilterDescriptorsProvider().getAll();
}
private List<DocumentFilterDescriptor> createFilterDescriptors()
{
return ImmutableList.of(
createIsCustomerFilterDescriptor(),
createIsVendorFilterDescriptor());
}
private Document... | final boolean showCustomers = filters.getParamValueAsBoolean(FILTERID_IsCustomer, PARAM_IsCustomer, false);
final boolean showVendors = filters.getParamValueAsBoolean(FILTERID_IsVendor, PARAM_IsVendor, false);
final boolean showAll = !showCustomers && !showVendors;
if (showAll)
{
return Predicates.alwaysTrue... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\pricingconditions\view\PricingConditionsViewFilters.java | 1 |
请完成以下Java代码 | public String toString()
{
return getCode();
}
@NonNull
@JsonValue
public String getCode()
{
return code;
}
public static Set<String> toStringSet(@Nullable final Collection<GLN> glns)
{
if (glns == null || glns.isEmpty())
{
return ImmutableSet.of(); | }
return glns.stream().map(GLN::getCode).collect(ImmutableSet.toImmutableSet());
}
@Nullable
public static String toCode(@Nullable final GLN gln)
{
return gln != null ? gln.getCode() : null;
}
public static boolean equals(@Nullable final GLN gln1, @Nullable final GLN gln2)
{
return Objects.equals(gln1, ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\bpartner\GLN.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List<QuoteDTO> findByCriteria(QuoteCriteria criteria) {
log.debug("find by criteria : {}", criteria);
final Specification<Quote> specification = createSpecification(criteria);
return quoteMapper.toDto(quoteRepository.findAll(specification));
}
/**
* Return a {@link Page} of ... | */
private Specification<Quote> createSpecification(QuoteCriteria criteria) {
Specification<Quote> specification = Specification.where(null);
if (criteria != null) {
if (criteria.getId() != null) {
specification = specification.and(buildSpecification(criteria.getId(), Quo... | repos\tutorials-master\jhipster-modules\jhipster-uaa\quotes\src\main\java\com\baeldung\jhipster\quotes\service\QuoteQueryService.java | 2 |
请完成以下Java代码 | public Set<Integer> toIntSet()
{
return toSet(DocumentId::toInt);
}
public <ID extends RepoIdAware> ImmutableSet<ID> toIds(@NonNull final Function<Integer, ID> idMapper)
{
return toSet(idMapper.compose(DocumentId::toInt));
}
public <ID extends RepoIdAware> ImmutableSet<ID> toIdsFromInt(@NonNull final IntFun... | if (this.all)
{
return this;
}
else if (documentIdsSelection.all)
{
return documentIdsSelection;
}
final ImmutableSet<DocumentId> combinedIds = Stream.concat(this.stream(), documentIdsSelection.stream()).collect(ImmutableSet.toImmutableSet());
final DocumentIdsSelection result = DocumentIdsSelectio... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\datatypes\DocumentIdsSelection.java | 1 |
请完成以下Java代码 | public void onBeforeSave_WhenNameOrColumnChanged(final I_AD_Field field)
{
updateFieldFromElement(field);
}
private void updateFieldFromElement(final I_AD_Field field)
{
final AdElementId fieldElementId = getFieldElementIdOrNull(field);
if (fieldElementId == null)
{
// Nothing to do. the element was not... | else if (field.getAD_Column_ID() > 0)
{
// the AD_Name_ID was set to null. Get back to the values from the AD_Column
final I_AD_Column fieldColumn = field.getAD_Column();
return AdElementId.ofRepoId(fieldColumn.getAD_Element_ID());
}
else
{
// Nothing to do. the element was not yet saved.
return ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\field\model\interceptor\AD_Field.java | 1 |
请完成以下Java代码 | public Set<String> getProcessDefinitionIds() {
return processDefinitionIds;
}
public String getProcessDefinitionCategory() {
return processDefinitionCategory;
}
public String getProcessDefinitionName() {
return processDefinitionName;
}
public Integer getProcessDefiniti... | this.nameLike = nameLike;
}
public String getExecutionId() {
return executionId;
}
public String getDeploymentId() {
return deploymentId;
}
public List<String> getDeploymentIds() {
return deploymentIds;
}
public boolean isIncludeProcessVariables() {
re... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\ProcessInstanceQueryImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String editPmsMenu(HttpServletRequest req, PmsMenu menu, Model model, DwzAjax dwz) {
try {
PmsMenu parentMenu = menu.getParent();
if (null == parentMenu) {
parentMenu = new PmsMenu();
parentMenu.setId(0L);
}
menu.setParent(parentMenu);
pmsMenuService.update(menu);
// 记录系统操作日志
retur... | return operateError("此菜单下关联有【" + childMenuList.size() + "】个子菜单,不能支接删除!", model);
}
// 删除掉菜单
pmsMenuService.delete(menuId);
// 删除菜单后,要判断其父菜单是否还有子菜单,如果没有子菜单了就要装其父菜单设为叶子节点
List<PmsMenu> childList = pmsMenuService.listByParentId(parentId);
if (childList == null || childList.isEmpty()) {
// 此时要将父菜单设为... | repos\roncoo-pay-master\roncoo-pay-web-boss\src\main\java\com\roncoo\pay\permission\controller\PmsMenuController.java | 2 |
请完成以下Java代码 | void configureSSL(Properties props) {
if (sslEnabled) {
props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL");
props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, sslTruststoreLocation);
props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, sslTruststorePassword);
... | private Map<String, List<TbProperty>> parseTopicPropertyList(String inlineProperties) {
Map<String, List<String>> grouped = PropertyUtils.getGroupedProps(inlineProperties);
Map<String, List<TbProperty>> result = new HashMap<>();
grouped.forEach((topic, entries) -> {
Map<String, Stri... | repos\thingsboard-master\common\queue\src\main\java\org\thingsboard\server\queue\kafka\TbKafkaSettings.java | 1 |
请完成以下Java代码 | protected final <T> T getParentModel(final Class<T> modelType)
{
return parentPO != null ? InterfaceWrapperHelper.create(parentPO, modelType) : null;
}
private int getParentID()
{
return parentPO != null ? parentPO.get_ID() : -1;
}
/**
* Allows other modules to install customer code to be executed each ti... | {
recordCopiedListeners.add(listener);
}
return this;
}
@Override
public final CopyRecordSupport onChildRecordCopied(@NonNull final OnRecordCopiedListener listener)
{
if (!childRecordCopiedListeners.contains(listener))
{
childRecordCopiedListeners.add(listener);
}
return this;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\copy_with_details\GeneralCopyRecordSupport.java | 1 |
请完成以下Java代码 | public String getId() {
return this.id;
}
@Override
public void executionId(ExecutionId executionId) {
Assert.notNull(executionId, "executionId is required");
this.executionId = executionId;
}
@Override
public @Nullable ExecutionId getExecutionId() {
return this.executionId;
}
@Override
public Local... | ExecutionInput.Builder inputBuilder = ExecutionInput.newExecutionInput()
.query(getDocument())
.operationName(getOperationName())
.variables(getVariables())
.extensions(getExtensions())
.locale(this.locale)
.executionId((this.executionId != null) ? this.executionId : ExecutionId.from(this.id));
... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\support\DefaultExecutionGraphQlRequest.java | 1 |
请完成以下Java代码 | default List<String> getTokenRevocationEndpointAuthenticationMethods() {
return getClaimAsStringList(
OAuth2AuthorizationServerMetadataClaimNames.REVOCATION_ENDPOINT_AUTH_METHODS_SUPPORTED);
}
/**
* Returns the {@code URL} of the OAuth 2.0 Token Introspection Endpoint
* {@code (introspection_endpoint)}.
... | * Returns {@code true} to indicate support for mutual-TLS client certificate-bound
* access tokens {@code (tls_client_certificate_bound_access_tokens)}.
* @return {@code true} to indicate support for mutual-TLS client certificate-bound
* access tokens, {@code false} otherwise
*/
default boolean isTlsClientCert... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\OAuth2AuthorizationServerMetadataClaimAccessor.java | 1 |
请完成以下Java代码 | public void multiplyIncorrectMatrices() throws Exception {
Matrix m1 = new DenseMatrix(new double[][]{
{1, 2, 3},
{4, 5, 6}
});
Matrix m2 = new DenseMatrix(new double[][]{
{3, 2, 1},
{6, 5, 4}
});
Matrix m3 = m1.multiply(m2);
... | }
public Polynomial createPolynomial() {
return new Polynomial(new double[]{3, -5, 1});
}
public void evaluatePolynomial(Polynomial p) {
// Evaluate using a real number
log.info("Evaluating a polynomial using a real number: {}", p.evaluate(5));
// Evaluate using a complex n... | repos\tutorials-master\libraries-data-2\src\main\java\com\baeldung\suanshu\SuanShuMath.java | 1 |
请完成以下Java代码 | public String getEmail() {
return email;
}
@Override
public void setEmail(String email) {
// Not supported
}
@Override
public String getPassword() {
return password;
}
@Override
public void setPassword(String password) {
this.password = password;
... | @Override
public void setTenantId(String tenantId) {
// Not supported
}
@Override
public boolean isPictureSet() {
return false;
}
public static UserDto create(User user) {
return new UserDto(user.getId(), user.getPassword(), user.getFirstName(), user.getLastName(), user... | repos\flowable-engine-main\modules\flowable-spring-security\src\main\java\org\flowable\spring\security\UserDto.java | 1 |
请完成以下Java代码 | public Collection<Sentry> getExitCriterias() {
return exitCriteriaRefCollection.getReferenceTargetElements(this);
}
public Collection<Sentry> getExitCriteria() {
if (!isCmmn11()) {
return Collections.unmodifiableCollection(getExitCriterias());
}
else {
List<Sentry> sentries = new ArrayL... | .defaultValue(false)
.build();
exitCriteriaRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXIT_CRITERIA_REFS)
.namespace(CMMN10_NS)
.idAttributeReferenceCollection(Sentry.class, CmmnAttributeElementReferenceCollection.class)
.build();
SequenceBuilder sequenceBuilder... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\StageImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public CustomEndpoint customEndpoint() {
return new CustomEndpoint();
}
// tag::customization-http-headers-providers[]
@Bean
public HttpHeadersProvider customHttpHeadersProvider() {
return (instance) -> {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("X-CUSTOM", "My Custom Value");
retu... | return new InMemoryHttpExchangeRepository();
}
@Bean
public AuditEventRepository auditEventRepository() {
return new InMemoryAuditEventRepository();
}
@Bean
public EmbeddedDatabase dataSource() {
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL)
.addScript("org/springframework/sessi... | repos\spring-boot-admin-master\spring-boot-admin-samples\spring-boot-admin-sample-servlet\src\main\java\de\codecentric\boot\admin\sample\SpringBootAdminServletApplication.java | 2 |
请完成以下Java代码 | public class ListLoadedClassesAgent {
private static Instrumentation instrumentation;
public static void premain(String agentArgs, Instrumentation instrumentation) {
ListLoadedClassesAgent.instrumentation = instrumentation;
}
public static Class<?>[] listLoadedClasses(String classLoaderType) ... | switch (classLoaderType) {
case "SYSTEM":
classLoader = ClassLoader.getSystemClassLoader();
break;
case "EXTENSION":
classLoader = ClassLoader.getSystemClassLoader().getParent();
break;
// passing a null value to the Instrumentation : getInitiatedC... | repos\tutorials-master\core-java-modules\core-java-jvm-2\src\main\java\com\baeldung\loadedclasslisting\ListLoadedClassesAgent.java | 1 |
请完成以下Java代码 | public HistoricIdentityLinkLogQuery orderByProcessDefinitionId() {
orderBy(HistoricIdentityLinkLogQueryProperty.PROC_DEFINITION_ID);
return this;
}
@Override
public HistoricIdentityLinkLogQuery orderByProcessDefinitionKey() {
orderBy(HistoricIdentityLinkLogQueryProperty.PROC_DEFINITION_KEY);
retu... | public long executeCount(CommandContext commandContext) {
checkQueryOk();
return commandContext
.getHistoricIdentityLinkManager()
.findHistoricIdentityLinkLogCountByQueryCriteria(this);
}
@Override
public List<HistoricIdentityLinkLog> executeList(CommandContext commandContext, Page page) {
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\HistoricIdentityLinkLogQueryImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static class HUPIItemProductLUTUSpec implements LUTUSpec
{
public static final HUPIItemProductLUTUSpec VIRTUAL = new HUPIItemProductLUTUSpec(HUPIItemProductId.VIRTUAL_HU, null);
@NonNull HUPIItemProductId tuPIItemProductId;
@Nullable HuPackingInstructionsItemId luPIItemId;
public static HUPIItemProdu... | }
public boolean isTopLevelVHU()
{
return tuPIItemProductId.isVirtualHU() && luPIItemId == null;
}
}
@Value(staticConstructor = "of")
private static class PreciseTUSpec implements LUTUSpec
{
@NonNull HuPackingInstructionsId tuPackingInstructionsId;
@NonNull Quantity qtyCUsPerTU;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\pporder\api\impl\AbstractPPOrderReceiptHUProducer.java | 2 |
请完成以下Java代码 | public int getAD_Issue_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Issue_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public de.metas.async.model.I_C_Queue_WorkPackage getC_Queue_WorkPackage()
{
return get_ValueAsPO(COLUMNNAME_C_Queue_WorkPackage_ID, de.metas.async.model... | @return Workpackage audit/log table */
@Override
public int getC_Queue_WorkPackage_Log_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Queue_WorkPackage_Log_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Message Text.
@param MsgText
Textual Informational, Menu or Error Messa... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java-gen\de\metas\async\model\X_C_Queue_WorkPackage_Log.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SnapshottingInstanceRepository extends EventsourcingInstanceRepository {
private static final Logger log = LoggerFactory.getLogger(SnapshottingInstanceRepository.class);
private final ConcurrentMap<InstanceId, Instance> snapshots = new ConcurrentHashMap<>();
private final Set<InstanceId> outdatedSnap... | }
}
protected Mono<Instance> rehydrateSnapshot(InstanceId id) {
return super.find(id).map((instance) -> this.snapshots.compute(id, (key, snapshot) -> {
// check if the loaded version hasn't been already outdated by a snapshot
if (snapshot == null || instance.getVersion() >= snapshot.getVersion()) {
retur... | repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\domain\entities\SnapshottingInstanceRepository.java | 2 |
请完成以下Java代码 | class UnboundConfigurationPropertyFailureAnalyzer
extends AbstractFailureAnalyzer<UnboundConfigurationPropertiesException> {
@Override
protected FailureAnalysis analyze(Throwable rootFailure, UnboundConfigurationPropertiesException cause) {
BindException exception = findCause(rootFailure, BindException.class);
... | }
private void buildDescription(StringBuilder description, @Nullable ConfigurationProperty property) {
if (property != null) {
description.append(String.format("%n Property: %s", property.getName()));
description.append(String.format("%n Value: \"%s\"", property.getValue()));
description.append(Strin... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\diagnostics\analyzer\UnboundConfigurationPropertyFailureAnalyzer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PPOrderRequestedEventHandler implements MaterialEventHandler<PPOrderRequestedEvent>
{
private final IPPOrderBL ppOrderService = Services.get(IPPOrderBL.class);
private final IProductBL productBL = Services.get(IProductBL.class);
@Override
public Collection<Class<? extends PPOrderRequestedEvent>> getHa... | final ProductId productId = ProductId.ofRepoId(ppOrderData.getProductDescriptor().getProductId());
final I_C_UOM uom = productBL.getStockUOM(productId);
final Quantity qtyRequired = Quantity.of(ppOrderData.getQtyRequired(), uom);
return ppOrderService.createOrder(PPOrderCreateRequest.builder()
.cli... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\event\PPOrderRequestedEventHandler.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class WebConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/")
.setViewName("index");
}
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolve... | @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**")
.addResourceLocations("/", "/resources/")
.setCachePeriod(3600)
.resourceChain(true)
.addResolver(new PathResourceResolver());
}
@Bean
... | repos\tutorials-master\spring-web-modules\spring-mvc-basics-5\src\main\java\com\baeldung\spring\web\config\WebConfig.java | 2 |
请完成以下Java代码 | public ModelQuery createNewModelQuery() {
return new ModelQueryImpl(Context.getProcessEngineConfiguration().getCommandExecutor());
}
@SuppressWarnings("unchecked")
public List<Model> findModelsByQueryCriteria(ModelQueryImpl query, Page page) {
return getDbSqlSession().selectList("selectMode... | return null;
}
ByteArrayRef ref = new ByteArrayRef(model.getEditorSourceExtraValueId());
return ref.getBytes();
}
@SuppressWarnings("unchecked")
public List<Model> findModelsByNativeQuery(Map<String, Object> parameterMap, int firstResult, int maxResults) {
return getDbSqlSe... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\ModelEntityManager.java | 1 |
请完成以下Java代码 | public static POSOrderId ofRepoId(final int repoId)
{
return new POSOrderId(repoId);
}
@Nullable
public static POSOrderId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? new POSOrderId(repoId) : null;
}
public static int toRepoId(@Nullable final OrderId orderId)
{
return orderId != null ? orderId... | @Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public static boolean equals(@Nullable final POSOrderId id1, @Nullable final POSOrderId id2)
{
return Objects.equals(id1, id2);
}
public TableRecordReference toRecordRef() {return TableRecordReference.of(I_C_POS_Order.Table_Name, repoId);}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSOrderId.java | 1 |
请完成以下Java代码 | public void save(@NonNull final TreeNode treeNode)
{
final I_AD_TreeNode existingRecord = retrieveTreeNodeRecord(treeNode.getNodeId(), treeNode.getChartOfAccountsTreeId());
if (existingRecord == null)
{
createNew(treeNode);
}
else
{
updateRecordAndSave(existingRecord, treeNode);
}
}
private void... | .map(TreeNode::getChartOfAccountsTreeId)
.collect(ImmutableSet.toImmutableSet());
return CollectionUtils.singleElement(chartOfAccountsTreeIds);
}
private void deleteByTreeId(final AdTreeId chartOfAccountsTreeId)
{
queryBL.createQueryBuilder(I_AD_TreeNode.class)
.addEqualsFilter(I_AD_TreeNode.COLUMNNAME... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\treenode\TreeNodeRepository.java | 1 |
请完成以下Java代码 | public IFacetCollectorResult<ModelType> build()
{
// If there was nothing added to this builder, return the empty instance (optimization)
if (isEmpty())
{
return EmptyFacetCollectorResult.getInstance();
}
return new FacetCollectorResult<>(this);
}
/** @return true if this builder is empty */
... | {
addFacet(facet);
}
return this;
}
/** @return true if there was added at least one facet */
public boolean hasFacets()
{
return !facets.isEmpty();
}
public Builder<ModelType> addFacetCollectorResult(final IFacetCollectorResult<ModelType> facetCollectorResult)
{
// NOTE: we need to add ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\facet\impl\FacetCollectorResult.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class GemfireConfiguration {
@Autowired
EmployeeRepository employeeRepository;
@Autowired
FunctionExecution functionExecution;
@Bean
Properties gemfireProperties() {
Properties gemfireProperties = new Properties();
gemfireProperties.setProperty("name", "SpringDataGemFi... | CacheFactoryBean gemfireCache = new CacheFactoryBean();
gemfireCache.setClose(true);
gemfireCache.setProperties(gemfireProperties());
return gemfireCache;
}
@Bean(name="employee")
@Autowired
LocalRegionFactoryBean<String, Employee> getEmployee(final GemFireCache cache) {
... | repos\tutorials-master\persistence-modules\spring-data-gemfire\src\main\java\com\baeldung\spring\data\gemfire\function\GemfireConfiguration.java | 2 |
请完成以下Java代码 | public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public List<Comment> getComments() {
return comments;
}
public void setComments(List<Comment> comments) {
this.comments = comments;
} | @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Post)) {
return false;
}
Post post = (Post) o;
return getId().equals(post.getId());
}
@Override
public int hashCode() {
return O... | repos\tutorials-master\persistence-modules\spring-data-jpa-simple\src\main\java\com\baeldung\jpa\aggregation\model\Post.java | 1 |
请完成以下Java代码 | public DocumentFilterList getStickyFilters()
{
return DocumentFilterList.EMPTY;
}
@Override
public DocumentFilterList getFilters()
{
return DocumentFilterList.EMPTY;
}
@Override
public DocumentQueryOrderByList getDefaultOrderBys()
{
return DocumentQueryOrderByList.EMPTY;
}
@Override
public SqlViewR... | @NonNull final RowEditingContext ctx,
@NonNull final List<JSONDocumentChangedEvent> fieldChangeRequests)
{
final PurchaseRowId idOfChangedRow = PurchaseRowId.fromDocumentId(ctx.getRowId());
final PurchaseRowChangeRequest rowChangeRequest = PurchaseRowChangeRequest.of(fieldChangeRequests);
patchViewRow(idOfCha... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\sales\purchasePlanning\view\PurchaseView.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Result<String> edit(@RequestBody SysComment sysComment) {
sysCommentService.updateById(sysComment);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
//@AutoLog(value = "系统评论回复表-通过id删除")
@Operation(summary = "系统评论回复表-通过id删除")
//@Req... | * 导出excel
*
* @param request
* @param sysComment
*/
//@RequiresPermissions("org.jeecg.modules.demo:sys_comment:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, SysComment sysComment) {
return super.exportXls(request, sysC... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\controller\SysCommentController.java | 2 |
请完成以下Java代码 | public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean onSave(Object entity, Serializable id, Obje... | @Override
public String getEntityName(Object object) throws CallbackException {
// TODO Auto-generated method stub
return null;
}
@Override
public Object getEntity(String entityName, Serializable id) throws CallbackException {
// TODO Auto-generated method stub
return nu... | repos\tutorials-master\persistence-modules\hibernate5\src\main\java\com\baeldung\hibernate\interceptors\CustomInterceptorImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BookstoreService {
private final AuthorShallowRepository authorShallowRepository;
private final AuthorDeepRepository authorDeepRepository;
public BookstoreService(AuthorShallowRepository authorShallowRepository,
AuthorDeepRepository authorDeepRepository) {
this.authorShall... | re.setAge(46);
re.setGenre("Fantasy");
re.setAvatar(Files.readAllBytes(new File("avatars/re.png").toPath()));
authorDeepRepository.save(mt);
authorDeepRepository.save(cd);
authorDeepRepository.save(re);
}
public List<AuthorShallow> fetchAuthorsShallow() {
List<A... | repos\Hibernate-SpringBoot-master\HibernateSpringBootSubentities\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Java代码 | class DeepSeekModelOutputConverter implements StructuredOutputConverter<DeepSeekModelResponse> {
private static final Logger logger = LoggerFactory.getLogger(DeepSeekModelOutputConverter.class);
private static final String OPENING_THINK_TAG = "<think>";
private static final String CLOSING_THINK_TAG = "</th... | /**
* This method is used to define instructions for formatting the AI model's response,
* which are appended to the user prompt.
* See {@link org.springframework.ai.converter.BeanOutputConverter#getFormat()} for reference.
*
* However, in the current implementation, we extract only the AI resp... | repos\tutorials-master\spring-ai-modules\spring-ai\src\main\java\com\baeldung\springai\deepseek\DeepSeekModelOutputConverter.java | 1 |
请完成以下Java代码 | public void setCodeset ( String codeset )
{
this.codeset = codeset;
}
/**
* Gets the codeset for this XhtmlDocument
*
* @return the codeset
*/
public String getCodeset()
{
return this.codeset;
}
/**
Write the container to ... | return (sb.toString());
}
else
{
if (doctype != null)
sb.append (doctype.toString());
sb.append (html.toString());
return(sb.toString());
}
}
/**
Override the toString() method so that it prints something me... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\XhtmlDocument.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SecurityConfiguration {
private static final String[] WHITELISTED_API_ENDPOINTS = { "/users" };
private static final String CUSTOM_COMPROMISED_PASSWORD_CHECK_URL = "https://api.example.com/password-check";
@Bean
@SneakyThrows
public SecurityFilterChain configure(final HttpSecurity htt... | }
@Bean
@ConditionalOnMissingBean
public CompromisedPasswordChecker compromisedPasswordChecker() {
return new HaveIBeenPwnedRestApiPasswordChecker();
}
@Bean
@ConditionalOnMissingBean
public CompromisedPasswordChecker customCompromisedPasswordChecker() {
RestClient customRe... | repos\tutorials-master\spring-security-modules\spring-security-compromised-password\src\main\java\com\baeldung\security\configuration\SecurityConfiguration.java | 2 |
请完成以下Java代码 | public class CandidateStartersDeploymentConfigurer implements ProcessEngineConfigurationConfigurer {
private static final String EVERYONE_GROUP = "*";
@Override
public void configure(SpringProcessEngineConfiguration processEngineConfiguration) {
processEngineConfiguration.setBpmnDeploymentHelper(n... | super.addAuthorizationsForNewProcessDefinition(process, processDefinition);
if (
process != null &&
!process.isCandidateStarterUsersDefined() &&
!process.isCandidateStarterGroupsDefined()
) {
addAuthorizationsFromIterator(
... | repos\Activiti-develop\activiti-core\activiti-spring-boot-starter\src\main\java\org\activiti\spring\boot\CandidateStartersDeploymentConfigurer.java | 1 |
请完成以下Java代码 | public String getName()
{
return "AD_ChangeLog_ID";
}
@Override
public String getIcon()
{
return "ChangeLog16";
}
@Override
public boolean isAvailable()
{
return true;
}
@Override
public boolean isRunnable()
{ | final GridField gridField = getEditor().getField();
if (gridField == null)
{
return false;
}
return true;
}
@Override
public void run()
{
final GridField gridField = getEditor().getField();
FieldRecordInfo.start(gridField);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\grid\ed\menu\RecordInfoContextMenuAction.java | 1 |
请完成以下Java代码 | public static ApplicationContext getApplicationContext() {
return applicationContext;
}
/**
* 获取HttpServletRequest
*/
public static HttpServletRequest getHttpServletRequest() {
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
}
/**
* 获取HttpServletResponse
... | */
public static Object getBean(String name) {
return getApplicationContext().getBean(name);
}
/**
* 通过class获取Bean.
*
* @param clazz
* @param <T>
* @return
*/
public static <T> T getBean(Class<T> clazz) {
return getApplicationContext().getBean(clazz);
}
/**
* 通过name,以及Clazz返回指定的Bean
*
... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\SpringContextUtils.java | 1 |
请完成以下Java代码 | public class BigramTokenizer implements ITokenizer
{
public String[] segment(String text)
{
if (text.length() == 0) return new String[0];
char[] charArray = text.toCharArray();
CharTable.normalization(charArray);
// 先拆成字
List<int[]> atomList = new LinkedList<int[]>();
... | if (atomList.isEmpty()) return new String[0];
// 输出
String[] termArray = new String[atomList.size() - 1];
Iterator<int[]> iterator = atomList.iterator();
int[] pre = iterator.next();
int p = -1;
while (iterator.hasNext())
{
int[] cur = iterator.next();... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\classification\tokenizers\BigramTokenizer.java | 1 |
请完成以下Java代码 | protected static double Gser(double x, double A)
{
// Good for X<A+1.
double T9 = 1 / A;
double G = T9;
double I = 1;
while (T9 > G * 0.00001)
{
T9 = T9 * x / (A + I);
G = G + T9;
++I;
}
G = G * Math.exp(A * Math.log... | * http://www.fourmilab.ch/rpkp/experiments/analysis/chiCalc.js
*
* @param p p值(置信度)
* @param df
* @return
*/
public static double ChisquareInverseCdf(double p, int df)
{
final double CHI_EPSILON = 0.000001; /* Accuracy of critchi approximation */
final double CHI_MAX ... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\classification\statistics\ContinuousDistributions.java | 1 |
请完成以下Java代码 | class SumUpUtils
{
public static POSPaymentProcessResponse extractProcessResponse(final SumUpTransaction sumUpTrx)
{
return POSPaymentProcessResponse.builder()
.status(SumUpUtils.toResponseStatus(sumUpTrx.getStatus(), sumUpTrx.isRefunded()))
.config(extractPaymentProcessorConfig(sumUpTrx))
.cardReader(e... | if (SumUpTransactionStatus.SUCCESSFUL.equals(status))
{
return isRefunded
? POSPaymentProcessingStatus.DELETED
: POSPaymentProcessingStatus.SUCCESSFUL;
}
else if (SumUpTransactionStatus.CANCELLED.equals(status))
{
return POSPaymentProcessingStatus.CANCELLED;
}
else if (SumUpTransactionStatus... | repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\payment_gateway\sumup\SumUpUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private ImportIssuesRequest buildSpecificRequest(@NonNull final ImmutableList<ExternalProjectReference> allActiveGithubProjects,
@Nullable final String issueNumbers,
@Nullable final GithubIssueLinkMatcher githubIssueLinkMatcher)
{
final ExternalProjectReference externalProject =
allAc... | }
@Nullable
private GithubIssueLinkMatcher getGithubLinkMatcher(@NonNull final ImmutableList<ExternalProjectReference> externalProjectReferences)
{
final Boolean lookForParent = StringUtils.toBooleanOrNull(githubConfigRepository.getValueByName(LOOK_FOR_PARENT.getName()));
if (!Boolean.TRUE.equals(lookForParent... | repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\github\GithubImportProcess.java | 2 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
@Override
public void setAD_User_ID (final int AD_User_ID)
{
if (AD_User_ID < 0)
set_ValueNoCheck (COLUMNNAME_AD_User_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_User_ID, ... | public void setCRM_Occupation(final org.compiere.model.I_CRM_Occupation CRM_Occupation)
{
set_ValueFromPO(COLUMNNAME_CRM_Occupation_ID, org.compiere.model.I_CRM_Occupation.class, CRM_Occupation);
}
@Override
public void setCRM_Occupation_ID (final int CRM_Occupation_ID)
{
if (CRM_Occupation_ID < 1)
set_Va... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_User_Occupation_Specialization.java | 1 |
请完成以下Java代码 | public boolean tryAdvance(final Consumer<? super List<E>> action)
{
final List<E> batch = new ArrayList<>(batchSize);
for (int i = 0; i < batchSize && base.tryAdvance(batch::add); i++)
{
;
}
if (batch.isEmpty())
{
return false;
}
action.accept(batch);
return true;
}
@Override
public Spliter... | return splitBase == null ? null : new BatchSpliterator<>(splitBase, batchSize);
}
@Override
public long estimateSize()
{
final double baseSize = base.estimateSize();
return baseSize == 0 ? 0 : (long)Math.ceil(baseSize / batchSize);
}
@Override
public int characteristics()
{
return base.characteristics()... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\BatchSpliterator.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SecurPharmProduct
{
boolean error;
String resultCode;
String resultMessage;
@Nullable
ProductDetails productDetails;
@NonNull
HuId huId;
@Nullable
@NonFinal
@Setter
SecurPharmProductId id;
public boolean isActive()
{
return getProductDetails().isActive();
}
public boolean isFraud()
... | return getProductDetails().isFraud();
}
public boolean isDecommissioned()
{
return getProductDetails().isDecommissioned();
}
public String getDecommissionServerTransactionId()
{
return getProductDetails().getDecommissionedServerTransactionId();
}
public void productDecommissioned(@NonNull final String de... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.securpharm\src\main\java\de\metas\vertical\pharma\securpharm\product\SecurPharmProduct.java | 2 |
请完成以下Java代码 | private CommissionPoints extractCommissionPointsToInvoice(@NonNull final I_C_Invoice_Candidate icRecord)
{
final CommissionPoints commissionPointsToInvoice = CommissionPoints.of(icRecord.getNetAmtToInvoice());
return deductTaxAmount(commissionPointsToInvoice, icRecord);
}
@NonNull
private CommissionPoints ext... | @NonNull
private Optional<BPartnerId> getSalesRepId(@NonNull final I_C_Invoice_Candidate icRecord)
{
final BPartnerId invoiceCandidateSalesRepId = BPartnerId.ofRepoIdOrNull(icRecord.getC_BPartner_SalesRep_ID());
if (invoiceCandidateSalesRepId != null)
{
return Optional.of(invoiceCandidateSalesRepId);
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\commission\commissioninstance\businesslogic\sales\commissiontrigger\salesinvoicecandidate\SalesInvoiceCandidateFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isCachable() {
return true;
}
@Override
public boolean isAbleToStore(Object value) {
if (value == null) {
return true;
}
return Date.class.isAssignableFrom(value.getClass());
}
@Override
public Object getValue(ValueFields valueFields) ... | if (longValue != null) {
return new Date(longValue);
}
return null;
}
@Override
public void setValue(Object value, ValueFields valueFields) {
if (value != null) {
valueFields.setLongValue(((Date) value).getTime());
} else {
valueFields.set... | repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\impl\types\DateType.java | 2 |
请完成以下Java代码 | public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Set Processed.
@param Processed
The document has been processed
*/
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Processed.
@return The document ha... | return false;
}
/** Set Text.
@param Text Text */
public void setText (String Text)
{
set_Value (COLUMNNAME_Text, Text);
}
/** Get Text.
@return Text */
public String getText ()
{
return (String)get_Value(COLUMNNAME_Text);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Depreciation.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static SupplyRequiredDecreasedEvent createSupplyRequiredDecreasedEvent(
@NonNull final Candidate demandCandidate,
@NonNull final BigDecimal decreasedQty)
{
verifyCandidateType(demandCandidate);
return SupplyRequiredDecreasedEvent.builder()
.supplyRequiredDescriptor(createSupplyRequiredDescriptor(... | }
return descriptorBuilder.build();
}
@NonNull
private static SupplyRequiredDescriptorBuilder createAndInitSupplyRequiredDescriptor(
@NonNull final Candidate candidate,
@NonNull final BigDecimal qty)
{
final PPOrderRef ppOrderRef = candidate.getBusinessCaseDetail(ProductionDetail.class)
.map(Producti... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-service\src\main\java\de\metas\material\dispo\service\candidatechange\handler\SupplyRequiredEventCreator.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private static class MailboxEntry
{
@NonNull MailboxId id;
boolean active;
@NonNull Mailbox mailbox;
}
private static class MailboxesMap
{
private final ImmutableMap<MailboxId, MailboxEntry> byId;
private MailboxesMap(final List<MailboxEntry> list)
{
this.byId = Maps.uniqueIndex(list, MailboxEntry:... | {
return getEntryById(mailboxId).getMailbox();
}
private MailboxEntry getEntryById(final MailboxId mailboxId)
{
final MailboxEntry entry = byId.get(mailboxId);
if (entry == null)
{
throw new AdempiereException("No mailbox found for " + mailboxId);
}
return entry;
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\email\mailboxes\MailboxRepository.java | 2 |
请完成以下Java代码 | public void run()
{
while (true)
{
try
{
sleep();
}
catch (final InterruptedException e)
{
logger.info("Got interrupt request. Exiting.");
return;
}
try
{
processNow();
}
catch (final Exception ex)
{
logger.warn("Failed to process. Ignored.", ex);
}
}
}
... | {
final int retrieveBatchSize = sysConfigBL.getIntValue(SYSCONFIG_RetrieveBatchSize, -1);
return retrieveBatchSize > 0 ? QueryLimit.ofInt(retrieveBatchSize) : DEFAULT_RetrieveBatchSize;
}
@VisibleForTesting
FactAcctLogProcessResult processNow()
{
FactAcctLogProcessResult finalResult = FactAcctLogProcessResul... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\aggregation\FactAcctLogDBTableWatcher.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Payer timestamp(OffsetDateTime timestamp) {
this.timestamp = timestamp;
return this;
}
/**
* Der Zeitstempel der letzten Änderung
* @return timestamp
**/
@Schema(description = "Der Zeitstempel der letzten Änderung")
public OffsetDateTime getTimestamp() {
return timestamp;
}
pub... | StringBuilder sb = new StringBuilder();
sb.append("class Payer {\n");
sb.append(" _id: ").append(toIndentedString(_id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" ikNum... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-patient-api\src\main\java\io\swagger\client\model\Payer.java | 2 |
请完成以下Java代码 | public Integer getCollectSubjectCount() {
return collectSubjectCount;
}
public void setCollectSubjectCount(Integer collectSubjectCount) {
this.collectSubjectCount = collectSubjectCount;
}
public Integer getCollectTopicCount() {
return collectTopicCount;
}
public void s... | sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", memberId=").append(memberId);
sb.append(", consumeAmount=").append(consumeAmount);
sb.append(", orderCount=").append(orderCount);
... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\UmsMemberStatisticsInfo.java | 1 |
请完成以下Java代码 | public Object execute(CommandContext commandContext) {
AttachmentEntity attachment = commandContext
.getDbSqlSession()
.selectById(AttachmentEntity.class, attachmentId);
commandContext
.getDbSqlSession()
.delete(attachment);
if (a... | String processInstanceId = attachment.getProcessInstanceId();
if (attachment.getProcessInstanceId() != null) {
ExecutionEntity process = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId);
if (process != null) {
processDefiniti... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\cmd\DeleteAttachmentCmd.java | 1 |
请完成以下Java代码 | public UserQuery createNewUserQuery() {
return new UserQueryImpl(getCommandExecutor());
}
@Override
public Boolean checkPassword(String userId, String password, PasswordEncoder passwordEncoder, PasswordSalt salt) {
User user = null;
if (userId != null) {
user = findById... | @Override
public List<User> findUsersByPrivilegeId(String name) {
return dataManager.findUsersByPrivilegeId(name);
}
public UserDataManager getUserDataManager() {
return dataManager;
}
public void setUserDataManager(UserDataManager userDataManager) {
this.dataManager = user... | repos\flowable-engine-main\modules\flowable-idm-engine\src\main\java\org\flowable\idm\engine\impl\persistence\entity\UserEntityManagerImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
AsyncTaskExecutor delayedTaskExecutor() {
return new ThreadPoolTaskExecutor() {
@Override
public <T> Future<T> submit(Callable<T> task) {
... | }
@Bean
LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource, AsyncTaskExecutor delayedTaskExecutor) {
LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
factory.setPackagesToScan("com.baeldung.boot.bootstrapmode");
... | repos\tutorials-master\spring-boot-modules\spring-boot-data-2\src\main\java\com\baeldung\boot\bootstrapmode\Application.java | 2 |
请完成以下Java代码 | public ResponseEntity<FileList> getFiles() {
try {
String contextPath = httpServletRequest.getRequestURI();
Path filePath = Paths.get(contextPath.substring((URI_PREFIX + LIST_PREFIX).length()));
LOG.info("getFiles: {}", filePath);
FileList fileInfo = fileService.g... | }
}
@PostMapping(CREATEDIR_PREFIX + "**")
public ResponseEntity<Resource> createDirectory() {
try {
String contextPath = httpServletRequest.getRequestURI();
Path filePath = Paths.get(contextPath.substring((URI_PREFIX + CREATEDIR_PREFIX).length()));
LOG.info("crea... | repos\spring-examples-java-17\spring-fileserver\src\main\java\itx\examples\springboot\fileserver\rest\FileServerController.java | 1 |
请完成以下Java代码 | public long getReportingIntervalInSeconds() {
return reportingIntervalInSeconds;
}
public void setReportingIntervalInSeconds(long reportingIntervalInSeconds) {
this.reportingIntervalInSeconds = reportingIntervalInSeconds;
}
public MetricsRegistry getMetricsRegistry() {
return metricsRegistry;
}
... | protected class ReportDbMetricsValueCmd implements Command<Void> {
protected String name;
protected long value;
public ReportDbMetricsValueCmd(String name, long value) {
this.name = name;
this.value = value;
}
@Override
public Void execute(CommandContext commandContext) {
co... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\metrics\reporter\DbMetricsReporter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isHostnameVerificationEnabled() {
return this.hostnameVerificationEnabled;
}
public void setHostnameVerificationEnabled(boolean hostnameVerificationEnabled) {
this.hostnameVerificationEnabled = hostnameVerificationEnabled;
}
public enum TrustStrategy {
/**
* Trust all certificates... | /**
* Trust certificates that are signed by a trusted certificate.
*/
TRUST_CUSTOM_CA_SIGNED_CERTIFICATES,
/**
* Trust certificates that can be verified through the local system store.
*/
TRUST_SYSTEM_CA_SIGNED_CERTIFICATES
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-neo4j\src\main\java\org\springframework\boot\neo4j\autoconfigure\Neo4jProperties.java | 2 |
请完成以下Java代码 | public Article updateFavoriteByUser(User user) {
favorited = userFavorited.contains(user);
return this;
}
public User getAuthor() {
return author;
}
public ArticleContents getContents() {
return contents;
}
public Instant getCreatedAt() {
return created... | return favorited;
}
public Set<Comment> getComments() {
return comments;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
var article = (Article) o;
return author.equals(arti... | repos\realworld-springboot-java-master\src\main\java\io\github\raeperd\realworld\domain\article\Article.java | 1 |
请完成以下Java代码 | public class BpmPlatformSubsystemAdd extends AbstractBoottimeAddStepHandler {
public static final BpmPlatformSubsystemAdd INSTANCE = new BpmPlatformSubsystemAdd();
/** {@inheritDoc} */
@Override
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFail... | Consumer<RuntimeContainerDelegate> delegateProvider = processEngineBuilder.provides(ServiceNames.forMscRuntimeContainerDelegate());
processEngineBuilder.setInitialMode(Mode.ACTIVE);
MscRuntimeContainerDelegate processEngineService = new MscRuntimeContainerDelegate(delegateProvider);
processEngineBuilder.set... | repos\camunda-bpm-platform-master\distro\wildfly\subsystem\src\main\java\org\camunda\bpm\container\impl\jboss\extension\handler\BpmPlatformSubsystemAdd.java | 1 |
请完成以下Java代码 | public void setOrderDescription(String orderDescription) {
this.orderDescription = orderDescription;
}
public void setPaymentDescription(String paymentDescription) {
this.paymentDescription = paymentDescription;
}
public void setBuyerName(String buyerName) {
this.buyerName = bu... | public String getUserId() {
return userId;
}
public String getOrderDescription() {
return orderDescription;
}
public String getPaymentDescription() {
return paymentDescription;
}
public String getBuyerName() {
return buyerName;
}
} | repos\tutorials-master\spring-web-modules\spring-resttemplate-1\src\main\java\com\baeldung\resttemplate\restcallscompletablefuture\Purchase.java | 1 |
请完成以下Java代码 | protected static List<Pinyin> segLongest(char[] charArray, AhoCorasickDoubleArrayTrie<Pinyin[]> trie)
{
return segLongest(charArray, trie, true);
}
protected static List<Pinyin> segLongest(char[] charArray, AhoCorasickDoubleArrayTrie<Pinyin[]> trie, boolean remainNone)
{
final Pinyin[][... | DoubleArrayTrie<Pinyin[]> trie;
protected Searcher(char[] c, DoubleArrayTrie<Pinyin[]> trie)
{
super(c);
this.trie = trie;
}
protected Searcher(String text, DoubleArrayTrie<Pinyin[]> trie)
{
super(text);
this.trie = trie;
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dictionary\py\PinyinDictionary.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.