instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public String toString() {
return this.name;
}
/**
* Returns the {@link JavaVersion} of the current runtime.
* @return the {@link JavaVersion}
*/
public static JavaVersion getJavaVersion() {
List<JavaVersion> candidates = Arrays.asList(JavaVersion.values());
Collections.reverse(candidates);
for (JavaV... | /**
* Return if this version is older than a given version.
* @param version the version to compare
* @return {@code true} if this version is older than {@code version}
*/
public boolean isOlderThan(JavaVersion version) {
return compareTo(version) < 0;
}
static class Hints implements RuntimeHintsRegistrar... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\system\JavaVersion.java | 1 |
请完成以下Java代码 | public RecordChangeLog getSummaryByRecordId(@NonNull final ComposedRecordId recordId)
{
final RecordChangeLog.RecordChangeLogBuilder changeLogsBuilder = RecordChangeLog.builder()
.tableName(poInfo.getTableName())
.recordId(recordId);
loadRecordSummary(changeLogsBuilder, recordId);
return changeLogsBuil... | .lastChangedTimestamp(rs.getTimestamp("Updated").toInstant()));
}
private List<RecordChangeLogEntry> retrieveLogEntries(@NonNull final ComposedRecordId recordId)
{
if (!recordId.isSingleKey())
{
return ImmutableList.of();
}
final int singleRecordId = recordId.getSingleRecordId().orElse(-1);
final Tab... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\table\RecordChangeLogLoader.java | 1 |
请完成以下Java代码 | public BPartnerLocation newLocation(@NonNull final IdentifierString locationIdentifier)
{
final BPartnerLocationBuilder locationBuilder = BPartnerLocation.builder();
final BPartnerLocation location;
switch (locationIdentifier.getType())
{
case METASFRESH_ID:
if (bpartnerId != null)
{
final BPa... | bpartnerComposite
.getLocations()
.add(location);
return location;
}
public Collection<BPartnerLocation> getUnusedLocations()
{
return id2UnusedLocation.values();
}
public void resetBillToDefaultFlags()
{
for (final BPartnerLocation bpartnerLocation : getUnusedLocations())
{
bpartnerLocation.... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v1\bpartner\bpartnercomposite\jsonpersister\ShortTermLocationIndex.java | 1 |
请完成以下Java代码 | public String getName() {
return "boolean";
}
public String getMimeType() {
return "plain/text";
}
@Override
public Object convertFormValueToModelValue(String propertyValue) {
if (propertyValue == null || "".equals(propertyValue)) {
return null;
}
... | @Override
public String convertModelValueToFormValue(Object modelValue) {
if (modelValue == null) {
return null;
}
if (Boolean.class.isAssignableFrom(modelValue.getClass())
|| boolean.class.isAssignableFrom(modelValue.getClass())) {
return modelValue... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\form\BooleanFormType.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void afterPropertiesSet() {
this.inventory = new ConcurrentHashMap<>(Map.of(productIdProperties.getSmartphone(), 10,
productIdProperties.getWirelessHeadphones(), 15,
productIdProperties.getLaptop(), 5));
}
public void checkInventory(UUID productId, int quantity) {
... | }
public void slowCheckInventory(UUID productId, int quantity) {
simulateBusyConnection();
checkInventory(productId, quantity);
}
private void simulateBusyConnection() {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
Thread.currentThrea... | repos\tutorials-master\spring-cloud-modules\spring-cloud-aws-v3\src\main\java\com\baeldung\spring\cloud\aws\sqs\acknowledgement\service\InventoryService.java | 2 |
请完成以下Java代码 | public void run(
@NonNull final RunParameters parameters,
@NonNull final IDevice device,
@NonNull final IDeviceRequest<? extends IDeviceResponse> acquireValueRequest)
{
if (!ACCEPTED_REQUEST_TYPES.contains(acquireValueRequest.getClass().getSimpleName()))
{
return;
}
final BigDecimal targetWeight =... | .build();
device.accessDevice(sendTargetWeightRequest);
}
@NonNull
private Optional<I_C_UOM> getQtyUOM(@NonNull final RunParameters parameters)
{
return parameters.getSingle(QTY_UOM_SYMBOL_PARAM_NAME)
.flatMap(uomDAO::getBySymbol);
}
@NonNull
private BigDecimal convertToScaleUOM(@NonNull final Quantit... | repos\metasfresh-new_dawn_uat\backend\de.metas.device.scales\src\main\java\de\metas\device\scales\impl\soehenle\SendTargetWeightHook.java | 1 |
请完成以下Java代码 | public void cleanup() {
if (compressedFile.exists()) {
compressedFile.delete();
}
}
}
@Benchmark
public static void readAllEntriesByZipFile(SourceState sourceState, Blackhole blackhole) throws IOException {
try (ZipFile zipFile = new ZipFile(sourceSt... | BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceState.compressedFile));
ZipInputStream zipInputStream = new ZipInputStream(bis)
) {
ZipEntry entry;
while ((entry = zipInputStream.getNextEntry()) != null) {
if (Objects.equals(entry.g... | repos\tutorials-master\core-java-modules\core-java-io-5\src\main\java\com\baeldung\zip\ZipBenchmark.java | 1 |
请完成以下Java代码 | public class ReladomoApplication {
public static void main(String[] args) {
try {
ReladomoConnectionManager.getInstance().createTables();
} catch (Exception e1) {
e1.printStackTrace();
}
MithraManager mithraManager = MithraManagerProvider.getMithraManager()... | mithraManager.executeTransactionalCommand(tx -> {
Department dep = new Department(2, "HR");
Employee emp = new Employee(2, "Jim");
dep.getEmployees().add(emp);
dep.cascadeInsert();
return null;
});
} catch (... | repos\tutorials-master\libraries-data-db-2\src\main\java\com\baeldung\libraries\reladomo\ReladomoApplication.java | 1 |
请完成以下Java代码 | public QtyTU subtractOrZero(@NonNull final QtyTU toSubtract)
{
if (toSubtract.intValue == 0)
{
return this;
}
else
{
return ofInt(Math.max(this.intValue - toSubtract.intValue, 0));
}
}
public QtyTU min(@NonNull final QtyTU other)
{
return this.intValue <= other.intValue ? this : other;
}
pub... | else if (isOne())
{
return qtyCUsTotal;
}
else
{
return qtyCUsTotal.divide(toInt());
}
}
public Quantity computeTotalQtyCUsUsingQtyCUsPerTU(@NonNull final Quantity qtyCUsPerTU)
{
return qtyCUsPerTU.multiply(toInt());
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\QtyTU.java | 1 |
请完成以下Java代码 | public void logSqlMigrationContextInfo(final I_AD_Table_Process record)
{
if (MigrationScriptFileLoggerHolder.isDisabled())
{
return;
}
final AdProcessId adProcessId = AdProcessId.ofRepoId(record.getAD_Process_ID());
final ADProcessName processName = Names.ADProcessName_Loader.retrieve(adProcessId);
Mi... | if (adTabId != null)
{
final ADTabNameFQ tabNameFQ = Names.ADTabNameFQ_Loader.retrieve(adTabId);
MigrationScriptFileLoggerHolder.logComment("Tab: " + tabNameFQ.toShortString());
}
final AdWindowId adWindowId = AdWindowId.ofRepoIdOrNull(record.getAD_Window_ID());
if (adWindowId != null)
{
final ADWin... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\migration\validator\sql_migration_context_info\interceptor\AD_Table_Process.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected final C chainRequestMatchers(List<RequestMatcher> requestMatchers) {
this.unmappedMatchers = requestMatchers;
return chainRequestMatchersInternal(requestMatchers);
}
/**
* Subclasses should implement this method for returning the object that is chained to
* the creation of the {@link RequestMatcher... | */
static final class UrlMapping {
private final RequestMatcher requestMatcher;
private final Collection<ConfigAttribute> configAttrs;
UrlMapping(RequestMatcher requestMatcher, Collection<ConfigAttribute> configAttrs) {
this.requestMatcher = requestMatcher;
this.configAttrs = configAttrs;
}
Request... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\AbstractConfigAttributeRequestMatcherRegistry.java | 2 |
请完成以下Java代码 | public String getId() {
return String.valueOf(System.identityHashCode(this));
}
// getters and setters //////////////////////////////////////////////////////
protected VariableStore<CoreVariableInstance> getVariableStore() {
return variableStore;
}
@Override
protected VariableInstanceFactory<Core... | public BpmnModelInstance getBpmnModelInstance() {
throw new UnsupportedOperationException(BpmnModelExecutionContext.class.getName() +" is unsupported in transient ExecutionImpl");
}
public ProcessEngineServices getProcessEngineServices() {
throw new UnsupportedOperationException(ProcessEngineServicesAware.... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\pvm\runtime\ExecutionImpl.java | 1 |
请完成以下Java代码 | public void setAttributeValue (final java.lang.String AttributeValue)
{
set_Value (COLUMNNAME_AttributeValue, AttributeValue);
}
@Override
public java.lang.String getAttributeValue()
{
return get_ValueAsString(COLUMNNAME_AttributeValue);
}
@Override
public void setDescription (final java.lang.String Desc... | * EntityType AD_Reference_ID=389
* Reference name: _EntityTypeNew
*/
public static final int ENTITYTYPE_AD_Reference_ID=389;
@Override
public void setEntityType (final java.lang.String EntityType)
{
set_Value (COLUMNNAME_EntityType, EntityType);
}
@Override
public java.lang.String getEntityType()
{
re... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_Node_Para.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_AD_Task getAD_Task() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_AD_Task_ID, org.compiere.model.I_AD_Task.class);
}
@Override
public void setAD_Task(org.compiere.model.I_AD_Task AD_Task)
{
set_ValueFromPO(COLUMNNAME_AD_Task_ID, org.compiere.model.I_AD_Task.class, AD_T... | if (ii == null)
return 0;
return ii.intValue();
}
/** Set Lesen und Schreiben.
@param IsReadWrite
Field is read / write
*/
@Override
public void setIsReadWrite (boolean IsReadWrite)
{
set_Value (COLUMNNAME_IsReadWrite, Boolean.valueOf(IsReadWrite));
}
/** Get Lesen und Schreiben.
@return Fiel... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Task_Access.java | 1 |
请完成以下Java代码 | public void setFact_Acct_ID (int Fact_Acct_ID)
{
if (Fact_Acct_ID < 1)
set_ValueNoCheck (COLUMNNAME_Fact_Acct_ID, null);
else
set_ValueNoCheck (COLUMNNAME_Fact_Acct_ID, Integer.valueOf(Fact_Acct_ID));
}
/** Get Accounting Fact.
@return Accounting Fact */
@Override
public int getFact_Acct_ID ()
{... | public static final String POSTINGTYPE_Commitment = "E";
/** Statistical = S */
public static final String POSTINGTYPE_Statistical = "S";
/** Reservation = R */
public static final String POSTINGTYPE_Reservation = "R";
/** Actual Year End = Y */
public static final String POSTINGTYPE_ActualYearEnd = "Y";
/** Set... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-gen\de\metas\acct\model\X_Fact_Acct_EndingBalance.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ConditionMessage getConditionMessage() {
return this.message;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() == obj.getClass()) {
ConditionOutcome other = (ConditionOutcome) obj;
return (this.match ==... | }
return super.equals(obj);
}
@Override
public int hashCode() {
return Boolean.hashCode(this.match) * 31 + ObjectUtils.nullSafeHashCode(this.message);
}
@Override
public String toString() {
return (this.message != null) ? this.message.toString() : "";
}
} | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\condition\ConditionOutcome.java | 2 |
请完成以下Java代码 | public boolean isRegular()
{
return repoId > NONE.repoId;
}
public static boolean isRegular(@Nullable final AttributeSetInstanceId asiId)
{
return asiId != null && asiId.isRegular();
}
@Nullable
public AttributeSetInstanceId asRegularOrNull() {return isRegular() ? this : null;}
/**
* Note that currentl... | {
return Objects.equals(id1, id2);
}
@SuppressWarnings("unused")
public void assertRegular()
{
if (!isRegular())
{
throw new AdempiereException("Expected regular ASI but got " + this);
}
}
@Contract("!null -> !null")
public AttributeSetInstanceId orElseIfNone(final AttributeSetInstanceId other) {ret... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\mm\attributes\AttributeSetInstanceId.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class GS1ProductCodes
{
private static final GS1ProductCodes EMPTY = builder().build();
@Nullable GTIN gtin;
@Nullable EAN13 ean13;
@Nullable EAN13ProductCode ean13ProductCode;
public boolean isEmpty() {return this.equals(EMPTY);}
public boolean isMatching(@NonNull final EAN13ProductCode expectedProduct... | public boolean endsWith(final @NonNull EAN13ProductCode expectedProductCode)
{
return (gtin != null && gtin.productCodeEndsWith(expectedProductCode))
|| (ean13 != null && ean13.productCodeEndsWith(expectedProductCode))
|| (ean13ProductCode != null && ean13ProductCode.endsWith(expectedProductCode));
}
publ... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\gs1\GS1ProductCodes.java | 2 |
请在Spring Boot框架中完成以下Java代码 | static class GridFsMongoDatabaseFactory implements MongoDatabaseFactory {
private final MongoDatabaseFactory mongoDatabaseFactory;
private final DataMongoProperties properties;
GridFsMongoDatabaseFactory(MongoDatabaseFactory mongoDatabaseFactory, DataMongoProperties properties) {
Assert.notNull(mongoDatabas... | return this.mongoDatabaseFactory.getSession(options);
}
@Override
public MongoDatabaseFactory withSession(ClientSession session) {
return this.mongoDatabaseFactory.withSession(session);
}
private @Nullable String getGridFsDatabase() {
return this.properties.getGridfs().getDatabase();
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-data-mongodb\src\main\java\org\springframework\boot\data\mongodb\autoconfigure\MongoDatabaseFactoryDependentConfiguration.java | 2 |
请完成以下Java代码 | public String getImportTableName()
{
return I_I_Postal.Table_Name;
}
@Override
protected String getTargetTableName()
{
return I_C_Postal.Table_Name;
}
@Override
protected void updateAndValidateImportRecordsImpl()
{
}
@Override
protected String getImportOrderBySql()
{
return I_I_Postal.COLUMNNAME_P... | // the current handling for duplicates (postal code + country) is nonexistent.
// we blindly try to insert in db, and if there are unique constraints failing the records will automatically be marked as failed.
//noinspection UnusedAssignment
ImportRecordResult importResult = ImportRecordResult.Nothing;
final ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\location\impexp\PostalCodeImportProcess.java | 1 |
请完成以下Java代码 | public class X_M_Indication extends org.compiere.model.PO implements I_M_Indication, org.compiere.model.I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 1020806982L;
/** Standard Constructor */
public X_M_Indication (Properties ctx, int M_Indication_ID, String trxName)
{
s... | /** Get Indication.
@return Indication */
@Override
public int getM_Indication_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Indication_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
@Override
public void se... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma\src\main\java-gen\de\metas\vertical\pharma\model\X_M_Indication.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public CommonResult<PmsBrand> getItem(@PathVariable("id") Long id) {
return CommonResult.success(brandService.getBrand(id));
}
@ApiOperation(value = "批量删除品牌")
@RequestMapping(value = "/delete/batch", method = RequestMethod.POST)
@ResponseBody
public CommonResult deleteBatch(@RequestParam("i... | if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation(value = "批量更新厂家制造商状态")
@RequestMapping(value = "/update/factoryStatus", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateFactoryS... | repos\mall-master\mall-admin\src\main\java\com\macro\mall\controller\PmsBrandController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Object visitPrimitiveAsDouble(PrimitiveType type, Void parameter) {
return 0D;
}
}
/**
* Visitor that gets the default using coercion.
*/
private static final class DefaultValueCoercionTypeVisitor extends TypeKindVisitor8<Object, String> {
static final DefaultValueCoercionTypeVisitor INSTANCE = ... | @Override
public Object visitPrimitiveAsChar(PrimitiveType type, String value) {
if (value.length() > 1) {
throw new IllegalArgumentException(String.format("Invalid character representation '%s'", value));
}
return value;
}
@Override
public Object visitPrimitiveAsFloat(PrimitiveType type, String v... | repos\spring-boot-4.0.1\configuration-metadata\spring-boot-configuration-processor\src\main\java\org\springframework\boot\configurationprocessor\ParameterPropertyDescriptor.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Mono<ResponseEntity<Object>> handle(ServerWebExchange exchange, @Nullable Map<String, String> body) {
return this.securityInterceptor.preHandle(exchange, this.endpointId.toLowerCaseString())
.flatMap((securityResponse) -> flatMapResponse(exchange, body, securityResponse));
}
private Mono<ResponseEnti... | static class CloudFoundryWebFluxEndpointHandlerMappingRuntimeHints implements RuntimeHintsRegistrar {
private final ReflectiveRuntimeHintsRegistrar reflectiveRegistrar = new ReflectiveRuntimeHintsRegistrar();
private final BindingReflectionHintsRegistrar bindingRegistrar = new BindingReflectionHintsRegistrar();
... | repos\spring-boot-4.0.1\module\spring-boot-cloudfoundry\src\main\java\org\springframework\boot\cloudfoundry\autoconfigure\actuate\endpoint\reactive\CloudFoundryWebFluxEndpointHandlerMapping.java | 2 |
请完成以下Java代码 | public Criteria andNoteIn(List<String> values) {
addCriterion("note in", values, "note");
return (Criteria) this;
}
public Criteria andNoteNotIn(List<String> values) {
addCriterion("note not in", values, "note");
return (Criteria) this;
}
... | }
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.conditi... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\OmsOrderOperateHistoryExample.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ReactiveAuthorizationManager<AuthorizationContext> opaAuthManager(WebClient opaWebClient) {
return (auth, context) -> opaWebClient.post()
.accept(MediaType.APPLICATION_JSON)
.contentType(MediaType.APPLICATION_JSON)
.body(toAuthorizationPayload(auth, context), Map.class... | .put("principal", a.getName())
.put("authorities", a.getAuthorities()
.stream()
.map(GrantedAuthority::getAuthority)
.collect(Collectors.toList()))
.put("uri", context.getExchange()
.g... | repos\tutorials-master\spring-security-modules\spring-security-opa\src\main\java\com\baeldung\security\opa\config\SecurityConfiguration.java | 2 |
请完成以下Java代码 | public String getName() {
return name;
}
@Override
public void setName(String name) {
this.name = name;
}
@Override
public byte[] getBytes() {
return bytes;
}
@Override
public void setBytes(byte[] bytes) {
this.bytes = bytes;
}
@Override
... | this.deploymentId = deploymentId;
}
@Override
public Object getPersistentState() {
return AppResourceEntityImpl.class;
}
@Override
public boolean isGenerated() {
return false;
}
@Override
public void setGenerated(boolean generated) {
this.generated = genera... | repos\flowable-engine-main\modules\flowable-app-engine\src\main\java\org\flowable\app\engine\impl\persistence\entity\AppResourceEntityImpl.java | 1 |
请完成以下Java代码 | public void setChrgsAcct(CashAccount16CHIdAndCurrency value) {
this.chrgsAcct = value;
}
/**
* Gets the value of the cdtTrfTxInf property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* r... | * </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CreditTransferTransactionInformation10CH }
*
*
*/
public List<CreditTransferTransactionInformation10CH> getCdtTrfTxInf() {
if (cdtTrfTxInf == null) {
cdtTrfTxInf = n... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\PaymentInstructionInformation3CH.java | 1 |
请完成以下Java代码 | public int getAD_WF_NodeNext_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_WF_NodeNext_ID);
}
@Override
public void setDescription (final java.lang.String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
@Override
public java.lang.String getDescription()
{
return get_ValueAsString(COLUM... | set_Value (COLUMNNAME_IsStdUserWorkflow, IsStdUserWorkflow);
}
@Override
public boolean isStdUserWorkflow()
{
return get_ValueAsBoolean(COLUMNNAME_IsStdUserWorkflow);
}
@Override
public void setSeqNo (final int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, SeqNo);
}
@Override
public int getSeqNo()
{
retu... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_NodeNext.java | 1 |
请完成以下Java代码 | public ImmutableFactoryGroupBuilder addAll(@NonNull final Set<ParentChildInfo> parentChildInfos)
{
parentChildInfos.forEach(this::add);
return this;
}
public ImmutableFactoryGroupBuilder add(@NonNull final ParentChildInfo info)
{
addForParentTable(info);
addForChildTable(info);
return this;
}
... | final ParentChildModelCacheInvalidateRequestFactory factory = info.toGenericModelCacheInvalidateRequestFactoryOrNull();
if (factory != null)
{
factoriesByTableName.put(childTableName, factory);
}
}
catch (final Exception ex)
{
logger.warn("Failed to create model cache invalidate for {}: {}... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\model\WindowBasedModelCacheInvalidateRequestFactoryGroup.java | 1 |
请完成以下Java代码 | private int countBPartners()
{
return createICQueryBuilder()
.create()
.listDistinct(I_C_Invoice_Candidate.COLUMNNAME_Bill_BPartner_ID)
.size();
}
private IQueryBuilder<I_C_Invoice_Candidate> createICQueryBuilder()
{
// Get the user selection filter (i.e. what user filtered in his window)
final ... | // .addEqualsFilter(I_C_Invoice_Candidate.COLUMNNAME_IsError, false)
// .addEqualsFilter(I_C_Invoice_Candidate.COLUMNNAME_IsInDispute, false)
//
;
//
// Consider only approved invoices (if we were asked to do so)
if (invoicingParams != null && invoicingParams.isOnlyApprovedForInvoicing())
{
quer... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\process\C_Invoice_Candidate_EnqueueSelectionForInvoicing.java | 1 |
请完成以下Spring Boot application配置 | spring:
application:
name: user-service # 服务名
# Zipkin 配置项,对应 ZipkinProperties 类
zipkin:
base-url: http://127.0.0.1:9411 # Zipkin 服务的地址
# Spring Cloud Sleuth 配置项
sleuth:
# Spring Cloud Sleuth 针对 Web 组件的配置项,例如说 SpringMVC
web:
enabled: true # 是否开启,默认为 true
| # Spring Cloud Sleuth 针对抽样收集的配置项
sampler:
probability: 0.1 # 采样百分比,默认为空。
# rate: 1 # 限流采样,即每秒可收集链路的数量,默认为 10。 | repos\SpringBoot-Labs-master\labx-13\labx-13-sc-sleuth-sampler\src\main\resources\application.yml | 2 |
请完成以下Java代码 | public CommandInterceptor createTransactionInterceptor() {
if (transactionManager == null) {
throw new FlowableException("transactionManager is required property for SpringIdmEngineConfiguration, use " + StandaloneIdmEngineConfiguration.class.getName() + " otherwise");
}
return new ... | return transactionManager;
}
public void setTransactionManager(PlatformTransactionManager transactionManager) {
this.transactionManager = transactionManager;
}
public ApplicationContext getApplicationContext() {
return applicationContext;
}
@Override
public void setApplica... | repos\flowable-engine-main\modules\flowable-idm-spring\src\main\java\org\flowable\idm\spring\SpringIdmEngineConfiguration.java | 1 |
请完成以下Java代码 | public Collection<? extends Cache> getCache(Set<String> annotatedCacheNames) {
Collection<String> cacheNames = generateValue(annotatedCacheNames);
if (cacheNames == null) {
return Collections.emptyList();
} else {
Collection<Cache> result = new ArrayList<Cache>();
... | /**
* 获取注解上的value属性值(cacheNames)
*
* @param annotatedCacheNames
* @return
*/
private Collection<String> generateValue(Set<String> annotatedCacheNames) {
Collection<String> cacheNames = new HashSet<>();
for (final String cacheName : annotatedCacheNames) {
String[]... | repos\spring-boot-student-master\spring-boot-student-cache-redis\src\main\java\com\xiaolyuh\redis\cache\CacheSupportImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private SingleLogoutService buildSingleLogoutService(RelyingPartyRegistration registration,
Saml2MessageBinding binding) {
SingleLogoutService singleLogoutService = this.saml.build(SingleLogoutService.DEFAULT_ELEMENT_NAME);
singleLogoutService.setLocation(registration.getSingleLogoutServiceLocation());
singleL... | static final class EntityDescriptorParameters {
private final EntityDescriptor entityDescriptor;
private final RelyingPartyRegistration registration;
EntityDescriptorParameters(EntityDescriptor entityDescriptor, RelyingPartyRegistration registration) {
this.entityDescriptor = entityDescriptor;
this.regis... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\provider\service\metadata\BaseOpenSamlMetadataResolver.java | 2 |
请完成以下Java代码 | public void serializeWithType(Collection<?> value, JsonGenerator jsonGenerator,
SerializerProvider serializerProvider, TypeSerializer typeSerializer) throws IOException {
serialize(value, jsonGenerator, serializerProvider);
}
@Override
public boolean hasSingleElement(Collection<?> value) {
return value != n... | if (Objects.isNull(resolvedSerializer)) {
PropertySerializerMap dynamicSerializers = this._dynamicSerializers;
resolvedSerializer = dynamicSerializers.serializerFor(type);
if (Objects.isNull(resolvedSerializer)) {
resolvedSerializer = Objects.nonNull(this._elementType) && this._elementType.hasGenericTyp... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\jackson\databind\serializer\TypelessCollectionSerializer.java | 1 |
请完成以下Java代码 | public List<Resource> getLocations() {
return this.locations;
}
/**
* Return a read-only list with the file extensions to try when checking
* for documents by name.
*/
public List<String> getExtensions() {
return this.extensions;
}
@Override
public Mono<String> getDocument(String name) {
return Flu... | })
.collect(Collectors.toList());
}
private String resourceToString(Resource resource) {
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
FileCopyUtils.copy(resource.getInputStream(), outputStream);
return outputStream.toString(StandardCharsets.UTF_8);
}
catch (IOException e... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\support\ResourceDocumentSource.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setRefreshTask(ScheduledFuture<?> task) {
if (!stopped) {
this.refreshTask = task;
} else {
task.cancel(true);
}
}
public void cancelTasks() {
if (this.refreshTask != null) {
log.trace("[{}][{}] Canceling old refresh task", session... | protected TsValue getLatest(List<TsValue> values) {
return values.stream()
.max(Comparator.comparing(TsValue::getTs))
.orElse(null);
}
@Data
public static class DynamicValueKey {
@Getter
private final FilterPredicateType predicateType;
@Getter... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\subscription\TbAbstractEntityQuerySubCtx.java | 2 |
请完成以下Java代码 | public void setMovementQty (final BigDecimal MovementQty)
{
set_Value (COLUMNNAME_MovementQty, MovementQty);
}
@Override
public BigDecimal getMovementQty()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_MovementQty);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setPosted ... | @Override
public void setProcessing (final boolean Processing)
{
set_Value (COLUMNNAME_Processing, Processing);
}
@Override
public boolean isProcessing()
{
return get_ValueAsBoolean(COLUMNNAME_Processing);
}
@Override
public org.compiere.model.I_S_TimeExpenseLine getS_TimeExpenseLine()
{
return get_V... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_ProjectIssue.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static List<JsonCustomerContact> toJsonCustomerContacts(@NonNull final List<JsonResponseContact> contacts)
{
return contacts.stream()
.map(contact -> JsonCustomerContact.builder()
.metasfreshId(contact.getMetasfreshId())
.fullName(contact.getFirstName() + " " + contact.getLastName())
.l... | .shipTo(location.isShipTo())
.billTo(location.isBillTo())
.mainAddress(isMainAddress.apply(location) ? 1 : 0)
.build())
.collect(ImmutableList.toImmutableList());
}
@Nullable
private static List<String> toBPartnerProductExternalReferences(@Nullable final JsonExternalReferenceLookupResponse jso... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-grssignum\src\main\java\de\metas\camel\externalsystems\grssignum\to_grs\bpartner\processor\ExportCustomerProcessor.java | 2 |
请在Spring Boot框架中完成以下Java代码 | default <A> A getFirstAttribute(String name) {
List<A> values = getAttribute(name);
return CollectionUtils.firstElement(values);
}
/**
* Get the Saml2 token attribute by name
* @param name the name of the attribute
* @param <A> the type of the attribute
* @return the attribute or {@code null} otherwise
... | return Collections.emptyMap();
}
/**
* Get the {@link RelyingPartyRegistration} identifier
* @return the {@link RelyingPartyRegistration} identifier
* @since 5.6
*/
default String getRelyingPartyRegistrationId() {
return null;
}
default List<String> getSessionIndexes() {
return Collections.emptyList(... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\provider\service\authentication\Saml2AuthenticatedPrincipal.java | 2 |
请完成以下Java代码 | public IAllocationRequestBuilder setClearanceStatusInfo(@Nullable final ClearanceStatusInfo clearanceStatusInfo)
{
this.clearanceStatusInfo = clearanceStatusInfo;
return this;
}
@Override
@Nullable
public ClearanceStatusInfo getClearanceStatusInfo()
{
if (clearanceStatusInfo != null)
{
return clearanc... | return baseAllocationRequest.isDeleteEmptyAndJustCreatedAggregatedTUs();
}
return false;
}
@Override
public IAllocationRequest create()
{
final IHUContext huContext = getHUContextToUse();
final ProductId productId = getProductIdToUse();
final Quantity quantity = getQuantityToUse();
final ZonedDateTime... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\AllocationRequestBuilder.java | 1 |
请完成以下Java代码 | public static void displayFactorial(int number) {
long result = factorial(number);
System.out.println(result);
}
@Loggable
@Async
public static Future<Long> getFactorial(int number) {
Future<Long> factorialFuture = CompletableFuture.supplyAsync(() -> factorial(number));
... | e.printStackTrace();
}
return result;
}
@LogExceptions
public static void divideByZero() {
int x = 1/0;
}
@RetryOnFailure(attempts = 2, types = { NumberFormatException.class})
@Quietly
public static void divideByZeroQuietly() {
int x = 1/0;
}
@Unite... | repos\tutorials-master\libraries-6\src\main\java\com\baeldung\jcabi\JcabiAspectJ.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setPayTypeCode(String payTypeCode) {
this.payTypeCode = payTypeCode == null ? null : payTypeCode.trim();
}
public String getPayTypeName() {
return payTypeName;
}
public void setPayTypeName(String payTypeName) {
this.payTypeName = payTypeName == null ? null : payType... | public Integer getSorts() {
return sorts;
}
public void setSorts(Integer sorts) {
this.sorts = sorts;
}
public Double getPayRate() {
return payRate;
}
public void setPayRate(Double payRate) {
this.payRate = payRate;
}
} | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\user\entity\RpPayWay.java | 2 |
请完成以下Java代码 | protected void notifyTransformListeners(Definitions definitions, DmnDecisionRequirementsGraphImpl dmnDecisionRequirementsGraph) {
for (DmnTransformListener transformListener : transformListeners) {
transformListener.transformDecisionRequirementsGraph(definitions, dmnDecisionRequirementsGraph);
}
}
pr... | return parent;
}
public DmnDecision getDecision() {
return decision;
}
public DmnDataTypeTransformerRegistry getDataTypeTransformerRegistry() {
return dataTypeTransformerRegistry;
}
public DmnHitPolicyHandlerRegistry getHitPolicyHandlerRegistry() {
return hitPolicyHandlerRegistry;
}
} | repos\camunda-bpm-platform-master\engine-dmn\engine\src\main\java\org\camunda\bpm\dmn\engine\impl\transform\DefaultDmnTransform.java | 1 |
请完成以下Java代码 | private static Properties newTemporaryCtx(final @NonNull SumUpTransactionStatusChangedEvent event)
{
final Properties ctx = Env.newTemporaryCtx();
Env.setClientId(ctx, event.getClientId());
Env.setOrgId(ctx, event.getOrgId());
return ctx;
}
private void fireLocalAndRemoteListenersAfterTrxCommit(final @NonNu... | fireLocalAndRemoteListenersAfterTrxCommit(SumUpTransactionStatusChangedEvent.ofNewTransaction(trx));
}
public void fireStatusChangedIfNeeded(
@NonNull final SumUpTransaction trx,
@NonNull final SumUpTransaction trxPrev)
{
if (!isForceSendingChangeEvents() && hasChanges(trx, trxPrev))
{
return;
}
f... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sumup\src\main\java\de\metas\payment\sumup\SumUpEventsDispatcher.java | 1 |
请完成以下Java代码 | public Dimension getFromRecord(@NonNull final I_C_OrderLine record)
{
OrderId salesOrderId = OrderId.ofRepoIdOrNull(record.getC_OrderSO_ID());
if (salesOrderId == null
&& record.getC_Order().isSOTrx())
{
salesOrderId = OrderId.ofRepoId(record.getC_Order_ID());
}
return Dimension.builder()
.projec... | @Override
public void updateRecord(final I_C_OrderLine record, final Dimension from)
{
record.setC_Project_ID(ProjectId.toRepoId(from.getProjectId()));
record.setC_Campaign_ID(from.getCampaignId());
record.setC_Activity_ID(ActivityId.toRepoId(from.getActivityId()));
record.setC_OrderSO_ID(OrderId.toRepoId(fro... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\document\dimension\OrderLineDimensionFactory.java | 1 |
请完成以下Java代码 | public class M_ShipmentSchedule_ShowMatchingStorages extends JavaProcess
{
private I_M_ShipmentSchedule shipmentSchedule;
private final transient ShipmentScheduleQtyOnHandStorageFactory //
shipmentScheduleQtyOnHandStorageFactory = SpringContextHolder.instance.getBean(ShipmentScheduleQtyOnHandStorageFactory.class);
... | addLog("@QtyOnHand@ (@Total@): " + storageDetails.getTotalQtyAvailable());
for (int storageIndex = 0; storageIndex < storageDetails.size(); storageIndex++)
{
final ShipmentScheduleAvailableStockDetail storageDetail = storageDetails.getStorageDetail(storageIndex);
addLog("------------------------------------... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\process\M_ShipmentSchedule_ShowMatchingStorages.java | 1 |
请完成以下Java代码 | public abstract class AstNode implements ExpressionNode {
/**
* evaluate and return the (optionally coerced) result.
*/
public final Object getValue(Bindings bindings, ELContext context, Class<?> type) {
Object value = eval(bindings, context);
if (type != null) {
value = b... | mth = findPublicAccessibleMethod(cls.getMethod(method.getName(), method.getParameterTypes()));
if (mth != null) {
return mth;
}
} catch (NoSuchMethodException ignore) {
// do nothing
}
}
Class<?> cls = method.get... | repos\Activiti-develop\activiti-core-common\activiti-juel-jakarta\src\main\java\org\activiti\core\el\juel\tree\impl\ast\AstNode.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class OrderLinePriceUpdateRequest
{
public static OrderLinePriceUpdateRequest ofOrderLine(final org.compiere.model.I_C_OrderLine orderLine)
{
return prepare(orderLine).build();
}
public static OrderLinePriceUpdateRequestBuilder prepare(final org.compiere.model.I_C_OrderLine orderLine)
{
return builder(... | PricingConditionsBreak pricingConditionsBreakOverride;
//
// Result options
@NonNull
ResultUOM resultUOM;
//
// Updating the order line options
boolean updatePriceEnteredAndDiscountOnlyIfNotAlreadySet; // task 06727
boolean updateLineNetAmt;
@Default
boolean applyPriceLimitRestrictions = true;
boolean ... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\OrderLinePriceUpdateRequest.java | 2 |
请完成以下Java代码 | public XMLGregorianCalendar getDtOfSgntr() {
return dtOfSgntr;
}
/**
* Sets the value of the dtOfSgntr property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDtOfSgntr(XMLGregorianCalendar value) {
... | public AmendmentInformationDetailsSDD getAmdmntInfDtls() {
return amdmntInfDtls;
}
/**
* Sets the value of the amdmntInfDtls property.
*
* @param value
* allowed object is
* {@link AmendmentInformationDetailsSDD }
*
*/
public void setAmdmntInfDtls(Am... | 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\MandateRelatedInformationSDD.java | 1 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
@Override
public void setC_UOM_ID (final int C_UOM_ID)
{
if (C_UOM_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_UOM_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_UOM_ID, C_UOM_ID);... | }
@Override
public int getPP_Order_ID()
{
return get_ValueAsInt(COLUMNNAME_PP_Order_ID);
}
@Override
public void setPP_OrderCandidate_PP_Order_ID (final int PP_OrderCandidate_PP_Order_ID)
{
if (PP_OrderCandidate_PP_Order_ID < 1)
set_ValueNoCheck (COLUMNNAME_PP_OrderCandidate_PP_Order_ID, null);
else... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_OrderCandidate_PP_Order.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Privilege {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(nullable = false, unique = true)
private String name;
public Privilege() {
}
public Privilege(String name) {
this.name = name;
}
public Long getId() {
return... | if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Privilege other = (Privilege) obj;
if (id == null) {
if (other.id != null) {
... | repos\tutorials-master\spring-security-modules\spring-security-web-boot-1\src\main\java\com\baeldung\roles\custom\persistence\model\Privilege.java | 2 |
请完成以下Java代码 | public TableRecordReference getRecordEffective()
{
if (childTableName != null && childRecordId >= 0)
{
return TableRecordReference.of(childTableName, childRecordId);
}
else if (rootTableName != null && rootRecordId >= 0)
{
return TableRecordReference.of(rootTableName, rootRecordId);
}
else
{
t... | }
public CacheInvalidateRequest build()
{
final String debugFrom = DEBUG ? Trace.toOneLineStackTraceString() : null;
return new CacheInvalidateRequest(rootTableName, rootRecordId, childTableName, childRecordId, debugFrom);
}
public Builder rootRecord(@NonNull final String tableName, final int recordId)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\model\CacheInvalidateRequest.java | 1 |
请完成以下Java代码 | public String evaluate(final Evaluatee ctx, final OnVariableNotFound onVariableNotFound) throws ExpressionEvaluationException
{
try
{
//
// Get the permissionsKey parameter
final OnVariableNotFound permissionsKeyOnVariableNoFound = getOnVariableNotFoundForInternalParameter(onVariableNotFound);
final St... | {
private final String tableNameIn;
private final boolean fullyQualified;
private final Access access;
private Wrapper(final String TableNameIn, final boolean fullyQualified, final Access access)
{
Check.assumeNotEmpty(TableNameIn, "TableNameIn is not empty");
tableNameIn = TableNameIn;
this.fullyQ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\impl\AccessSqlStringExpression.java | 1 |
请完成以下Java代码 | public List<Employee> getMainEmployees() {
return mainEmployees;
}
public void setMainEmployees(List<Employee> mainEmployees) {
this.mainEmployees = mainEmployees;
}
public List<Employee> getSubEmployees() {
return subEmployees;
}
public void setSubEmployees(List<Emplo... | public void addMainEmployee(Employee employee) {
if (this.mainEmployees == null) {
this.mainEmployees = new ArrayList<>();
}
this.mainEmployees.add(employee);
}
public void addSubEmployee(Employee employee) {
if (this.subEmployees == null) {
this.subEmplo... | repos\tutorials-master\persistence-modules\hibernate-annotations-2\src\main\java\com\baeldung\hibernate\lazycollection\model\Branch.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MainWebAppInitializer implements WebApplicationInitializer {
public MainWebAppInitializer() {
super();
}
@Override
public void onStartup(final ServletContext sc) {
System.out.println("MyWebAppInitializer.onStartup()");
final AnnotationConfigWebApplicationContext r... | childWebApplicationContext.scan("com.baeldung.config.child");
final ServletRegistration.Dynamic appServlet = sc.addServlet("api", new DispatcherServlet(childWebApplicationContext));
appServlet.setLoadOnStartup(1);
final Set<String> mappingConflicts = appServlet.addMapping("/");
if (!mapp... | repos\tutorials-master\spring-security-modules\spring-security-web-rest-custom\src\main\java\com\baeldung\config\MainWebAppInitializer.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class DictionaryController {
private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);
private final DictionaryService dictionaryService;
@Autowired
OpenTelemetry openTelemetry;
public DictionaryController(DictionaryService dictionaryService) {
this.d... | .startSpan();
try (Scope scope = span.makeCurrent()) {
logger.info("Processing received request for a random word");
String word = dictionaryService.getRandomWord();
String meaning = dictionaryService.getWordMeaning(word);
logger.info("Generated result: {} , {}",... | repos\tutorials-master\libraries-open-telemetry\otel-collector\dictionary-service\src\main\java\com\baeldung\DictionaryController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class ConfigManager {
private static final Log LOG = LogFactory.getLog(ConfigManager.class);
private Map<String,Object> config;
private final String filePath;
public ConfigManager(@Value("${config.file.path}") String filePath) {
this.filePath = filePath;
initConfigs();
}
... | }
config = new HashMap<>();
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
config.put(String.valueOf(entry.getKey()), entry.getValue());
}
}
public Object getConfig(String key) {
return config.get(key);
}
public void reinitializeConfig() {
... | repos\tutorials-master\spring-core-2\src\main\java\com\baeldung\reinitializebean\cache\ConfigManager.java | 2 |
请完成以下Java代码 | public WFActivityType getHandledActivityType() {return HANDLED_ACTIVITY_TYPE;}
@Override
public UIComponent getUIComponent(final @NonNull WFProcess wfProcess, final @NonNull WFActivity wfActivity, final @NonNull JsonOpts jsonOpts)
{
final ManufacturingJob job = ManufacturingMobileApplication.getManufacturingJob(w... | {
return productHazardSymbolService.getHazardSymbolsByProductId(productId)
.stream()
.map(hazardSymbol -> JsonHazardSymbol.of(hazardSymbol, adLanguage))
.collect(ImmutableList.toImmutableList());
}
private ImmutableList<JsonAllergen> getJsonAllergens(final @NonNull ProductId productId, final String adL... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\workflows_api\activity_handlers\issue\RawMaterialsIssueActivityHandler.java | 1 |
请完成以下Java代码 | public class SentryImpl extends CmmnElementImpl implements Sentry {
protected static Attribute<String> nameAttribute;
protected static ChildElementCollection<OnPart> onPartCollection;
protected static ChildElement<IfPart> ifPartChild;
public SentryImpl(ModelTypeInstanceContext instanceContext) {
super(ins... | public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Sentry.class, CMMN_ELEMENT_SENTRY)
.extendsType(CmmnElement.class)
.namespaceUri(CMMN11_NS)
.instanceProvider(new ModelTypeInstanceProvider<Sentry>() {
public ... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\SentryImpl.java | 1 |
请完成以下Java代码 | public boolean isAsyncExecutorIsMessageQueueMode() {
return asyncExecutorMessageQueueMode;
}
public ProcessEngineConfigurationImpl setAsyncExecutorMessageQueueMode(boolean asyncExecutorMessageQueueMode) {
this.asyncExecutorMessageQueueMode = asyncExecutorMessageQueueMode;
return this;
... | return eventSubscriptionPayloadMappingProvider;
}
public void setEventSubscriptionPayloadMappingProvider(
EventSubscriptionPayloadMappingProvider eventSubscriptionPayloadMappingProvider
) {
this.eventSubscriptionPayloadMappingProvider = eventSubscriptionPayloadMappingProvider;
}
pu... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cfg\ProcessEngineConfigurationImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserService {
@Resource
private UserMapper userMapper;
public User getById(int id) {
return userMapper.selectById(id);
}
/**
* 增删改要写 ReadOnly=false 为可写
* @param user 用户
*/
@Transactional(readOnly = false)
public void updateUserError(User user) {
... | @Transactional(readOnly = false, noRollbackFor = {MyException.class})
public void updateUserError2(User user) {
userMapper.updateById(user);
errMethod2(); // 执行一个会抛出自定义异常的方法
}
private void errMethod() {
System.out.println("error");
throw new RuntimeException("runtime");
... | repos\SpringBootBucket-master\springboot-transaction\src\main\java\com\xncoding\trans\service\UserService.java | 2 |
请完成以下Java代码 | public class AllocatePayment extends de.metas.process.JavaProcess
{
private int p_C_Payment_ID;
private int p_C_Invoice_ID;
@Override
protected void prepare()
{
if (I_C_Payment.Table_Name.equals(getTableName()))
{
p_C_Payment_ID = getRecord_ID();
}
for (ProcessInfoParameter para : getParametersAsArra... | @Override
protected String doIt() throws Exception
{
if (p_C_Payment_ID <= 0)
{
throw new FillMandatoryException(I_C_Payment.COLUMNNAME_C_Payment_ID);
}
if (p_C_Invoice_ID <= 0)
{
throw new FillMandatoryException(I_C_Payment.COLUMNNAME_C_Invoice_ID);
}
final I_C_Payment payment = InterfaceWrapp... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java\de\metas\payment\esr\process\AllocatePayment.java | 1 |
请完成以下Java代码 | protected void closeGroup(final I_M_Material_Tracking_Report_Line reportLine)
{
// save the line
final BigDecimal qtyReceived = reportLine.getQtyReceived().setScale(1, RoundingMode.HALF_UP);
final BigDecimal qtyIssued = reportLine.getQtyIssued().setScale(1, RoundingMode.HALF_UP);
final BigDecimal qtyDifferenc... | else
{
// receipt side
reportLine.setQtyReceived(reportLine.getQtyReceived().add(items.getQty()));
}
InterfaceWrapperHelper.save(reportLine);
}
@Override
public String toString()
{
return ObjectUtils.toString(this);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\process\CreateMaterialTrackingReportLineFromMaterialTrackingRefAggregator.java | 1 |
请完成以下Spring Boot application配置 | spring:
datasource:
driverClassName: org.h2.Driver
url: jdbc:h2:mem:test;INIT=CREATE SCHEMA IF NOT EXISTS test
jpa:
hibernate:
ddl- | auto: create
show-sql: true
sql:
init:
mode: never | repos\tutorials-master\persistence-modules\spring-boot-persistence-h2-2\src\main\resources\application-schema-url.yaml | 2 |
请完成以下Java代码 | public boolean isPrinted ()
{
Object oo = get_Value(COLUMNNAME_IsPrinted);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setN... | /** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Sequence.
@param SeqNo
Method of ordering records; lowest number comes first
*/
public void setSeqNo (int SeqNo)
{
set_... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_HR_PayrollConcept.java | 1 |
请完成以下Java代码 | public @Nullable Boolean getHttpOnly() {
return this.httpOnly;
}
public void setHttpOnly(@Nullable Boolean httpOnly) {
this.httpOnly = httpOnly;
}
public @Nullable Boolean getSecure() {
return this.secure;
}
public void setSecure(@Nullable Boolean secure) {
this.secure = secure;
}
public @Nullable D... | /**
* SameSite attribute will be omitted when creating the cookie.
*/
OMITTED(null),
/**
* SameSite attribute will be set to None. Cookies are sent in both first-party
* and cross-origin requests.
*/
NONE("None"),
/**
* SameSite attribute will be set to Lax. Cookies are sent in a first-party... | repos\spring-boot-4.0.1\module\spring-boot-web-server\src\main\java\org\springframework\boot\web\server\Cookie.java | 1 |
请完成以下Java代码 | public class Node {
private int noOfBones;
private boolean isMaxPlayer;
private int score;
private List<Node> children;
public Node(int noOfBones, boolean isMaxPlayer) {
this.noOfBones = noOfBones;
this.isMaxPlayer = isMaxPlayer;
children = new ArrayList<>();
}
int ... | return score;
}
void setScore(int score) {
this.score = score;
}
List<Node> getChildren() {
return children;
}
void addChild(Node newNode) {
children.add(newNode);
}
} | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-9\src\main\java\com\baeldung\algorithms\minimax\Node.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void deleteHistoricIdentityLinksByTaskId(String taskId) {
List<HistoricIdentityLinkEntity> identityLinks = findHistoricIdentityLinksByTaskId(taskId);
for (HistoricIdentityLinkEntity identityLink : identityLinks) {
delete(identityLink);
}
}
@Override
public void de... | dataManager.bulkDeleteHistoricIdentityLinksForProcessInstanceIds(processInstanceIds);
}
@Override
public void bulkDeleteHistoricIdentityLinksForTaskIds(Collection<String> taskIds) {
dataManager.bulkDeleteHistoricIdentityLinksForTaskIds(taskIds);
}
@Override
public void bulkDeleteHistor... | repos\flowable-engine-main\modules\flowable-identitylink-service\src\main\java\org\flowable\identitylink\service\impl\persistence\entity\HistoricIdentityLinkEntityManagerImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public MongoDatabase getMongoDatabase() throws DataAccessException {
String gridFsDatabase = getGridFsDatabase();
if (StringUtils.hasText(gridFsDatabase)) {
return this.mongoDatabaseFactory.getMongoDatabase(gridFsDatabase);
}
return this.mongoDatabaseFactory.getMongoDatabase();
}
@Override
public... | return this.mongoDatabaseFactory.getSession(options);
}
@Override
public MongoDatabaseFactory withSession(ClientSession session) {
return this.mongoDatabaseFactory.withSession(session);
}
private @Nullable String getGridFsDatabase() {
return this.properties.getGridfs().getDatabase();
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-data-mongodb\src\main\java\org\springframework\boot\data\mongodb\autoconfigure\MongoDatabaseFactoryDependentConfiguration.java | 2 |
请完成以下Java代码 | public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Int... | StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", commentId=").append(commentId);
sb.append(", memberNickName=").append(memberNickName);
... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\PmsCommentReplay.java | 1 |
请完成以下Java代码 | public String getFrstTx() {
return frstTx;
}
/**
* Sets the value of the frstTx property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setFrstTx(String value) {
this.frstTx = value;
}
/**
* Gets the va... | * {@link String }
*
*/
public String getLastTx() {
return lastTx;
}
/**
* Sets the value of the lastTx property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setLastTx(String value) {
this.las... | 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\CardSequenceNumberRange1.java | 1 |
请完成以下Java代码 | public class RelationshipImpl extends CmmnElementImpl implements Relationship {
protected static Attribute<String> typeAttribute;
protected static Attribute<RelationshipDirection> directionAttribute;
protected static ChildElementCollection<Source> sourceCollection;
protected static ChildElementCollection<Targe... | typeAttribute.setValue(this, type);
}
public RelationshipDirection getDirection() {
return directionAttribute.getValue(this);
}
public void setDirection(RelationshipDirection direction) {
directionAttribute.setValue(this, direction);
}
public Collection<Source> getSources() {
return sourceCol... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\RelationshipImpl.java | 1 |
请完成以下Java代码 | protected void applyFilters(HistoricVariableInstanceQuery query) {
if (processInstanceId != null) {
query.processInstanceId(processInstanceId);
}
if (processDefinitionId != null) {
query.processDefinitionId(processDefinitionId);
}
if (processDefinitionKey != null) {
query.processDe... | }
if (tenantIds != null && !tenantIds.isEmpty()) {
query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
}
if (TRUE.equals(withoutTenantId)) {
query.withoutTenantId();
}
if (includeDeleted) {
query.includeDeleted();
}
if (variableNameIn != null && variableNameI... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\HistoricVariableInstanceQueryDto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void init() {
initFlowRules();
initDegradeRules();
initSystemProtectionRules();
}
private void initFlowRules() {
List<FlowRule> flowRules = new ArrayList<>();
FlowRule flowRule = new FlowRule();
// Defined resource
flowRule.setResource(RESOURCE_NAM... | DegradeRule rule = new DegradeRule();
rule.setResource(RESOURCE_NAME);
rule.setCount(10);
rule.setTimeWindow(10);
rules.add(rule);
DegradeRuleManager.loadRules(rules);
}
private void initSystemProtectionRules() {
List<SystemRule> rules = new ArrayList<>();
... | repos\tutorials-master\spring-cloud-modules\spring-cloud-sentinel\src\main\java\com\baeldung\spring\cloud\sentinel\config\SentinelAspectConfiguration.java | 2 |
请完成以下Java代码 | public int getM_HU_ID()
{
return get_ValueAsInt(COLUMNNAME_M_HU_ID);
}
@Override
public void setM_HU_Item_ID (final int M_HU_Item_ID)
{
if (M_HU_Item_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_HU_Item_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_HU_Item_ID, M_HU_Item_ID);
}
@Override
public int g... | }
@Override
public void setM_HU_PI_Item(final de.metas.handlingunits.model.I_M_HU_PI_Item M_HU_PI_Item)
{
set_ValueFromPO(COLUMNNAME_M_HU_PI_Item_ID, de.metas.handlingunits.model.I_M_HU_PI_Item.class, M_HU_PI_Item);
}
@Override
public void setM_HU_PI_Item_ID (final int M_HU_PI_Item_ID)
{
if (M_HU_PI_Item_I... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Item.java | 1 |
请完成以下Java代码 | public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getCalledProcessInstanceId() {
return calledProcessInstanceId;
}
public void setCalledProcessInstanceId(String calledProcessInstanceId) {
this.calledProcessInstanceId ... | return caseActivityInstanceState == SUSPENDED.getStateCode();
}
public boolean isCompleted() {
return caseActivityInstanceState == COMPLETED.getStateCode();
}
public boolean isTerminated() {
return caseActivityInstanceState == TERMINATED.getStateCode();
}
public String toString() {
return thi... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\HistoricCaseActivityInstanceEventEntity.java | 1 |
请完成以下Java代码 | public List<DependencyGroup> getDependencies() {
return this.dependencies;
}
public List<Type> getTypes() {
return this.types;
}
public List<DefaultMetadataElement> getPackagings() {
return this.packagings;
}
public List<DefaultMetadataElement> getJavaVersions() {
return this.javaVersions;
}
public ... | private String description;
/**
* Element default value.
*/
private String value;
/**
* Create a new instance with the given value.
* @param value the value
*/
public SimpleElement(String value) {
this.value = value;
}
public String getTitle() {
return this.title;
}
public void ... | repos\initializr-main\initializr-metadata\src\main\java\io\spring\initializr\metadata\InitializrProperties.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_AD_Sequence getLotNo_Sequence()
{
return get_ValueAsPO(COLUMNNAME_LotNo_Sequence_ID, org.compiere.model.I_AD_Sequence.class);
}
@Override
public void setLotNo_Sequence(final org.compiere.model.I_AD_Sequence LotNo_Sequence)
{
set_ValueFromPO(COLUMNNAME_LotNo_Sequence_ID, org.compier... | set_Value (COLUMNNAME_PrintName, PrintName);
}
@Override
public java.lang.String getPrintName()
{
return get_ValueAsString(COLUMNNAME_PrintName);
}
@Override
public org.compiere.model.I_R_RequestType getR_RequestType()
{
return get_ValueAsPO(COLUMNNAME_R_RequestType_ID, org.compiere.model.I_R_RequestType... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_DocType.java | 1 |
请完成以下Java代码 | public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getFormKey() {
return formKey;
}
public void setFormKey(String formKey) {
this.formKey = formKey;
}
public String getA... | public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public List<String> getCandidateUsers() {
return candidateUsers;
}
public void setCandidateUsers(List<String> candidateUsers) {
this.candidateUsers = candidate... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\interceptor\CreateHumanTaskBeforeContext.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ResponseEntity<byte[]> getAttachmentContent(@ApiParam(name = "taskId") @PathVariable("taskId") String taskId, @ApiParam(name = "attachmentId") @PathVariable("attachmentId") String attachmentId, HttpServletResponse response) {
HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
Attach... | mediaType = MediaType.valueOf(attachment.getType());
responseHeaders.set("Content-Type", attachment.getType());
} catch (Exception e) {
// ignore if unknown media type
}
}
if (mediaType == null) {
responseHeaders.set("Content-Type", "a... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\task\TaskAttachmentContentResource.java | 2 |
请完成以下Java代码 | public OffsetDateTime getStartDate() {
return startDate;
}
public void setStartDate(OffsetDateTime startDate) {
this.startDate = startDate;
}
public OffsetDateTime getEndDate() {
return endDate;
}
public void setEndDate(OffsetDateTime endDate) {
this.endDate = ... | }
public void setRenewalRequired(boolean renewalRequired) {
this.renewalRequired = renewalRequired;
}
public enum LicenseType {
INDIVIDUAL, FAMILY
}
public LicenseType getLicenseType() {
return licenseType;
}
public void setLicenseType(LicenseType licenseType) {
... | repos\tutorials-master\mapstruct\src\main\java\com\baeldung\expression\model\License.java | 1 |
请完成以下Java代码 | public void addProcessDefinitionCacheEntry(String processDefinitionId, ProcessDefinitionCacheEntry processDefinitionCacheEntry) {
processDefinitionCache.put(processDefinitionId, processDefinitionCacheEntry);
}
@Override
public ProcessDefinitionCacheEntry getProcessDefinitionCacheEntry(String proces... | }
@Override
public String getDerivedFrom() {
return derivedFrom;
}
@Override
public void setDerivedFrom(String derivedFrom) {
this.derivedFrom = derivedFrom;
}
@Override
public String getDerivedFromRoot() {
return derivedFromRoot;
}
@Override
p... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\persistence\entity\DeploymentEntityImpl.java | 1 |
请完成以下Java代码 | public int getM_PriceList_ID()
{
return get_ValueAsInt(COLUMNNAME_M_PriceList_ID);
}
@Override
public void setM_PriceList_Version_ID (final int M_PriceList_Version_ID)
{
if (M_PriceList_Version_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_PriceList_Version_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_P... | }
@Override
public void setValidFrom (final java.sql.Timestamp ValidFrom)
{
set_ValueNoCheck (COLUMNNAME_ValidFrom, ValidFrom);
}
@Override
public java.sql.Timestamp getValidFrom()
{
return get_ValueAsTimestamp(COLUMNNAME_ValidFrom);
}
@Override
public void setValidTo (final java.sql.Timestamp ValidTo... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_purchase_prices_in_stock_uom_plv_v.java | 1 |
请完成以下Java代码 | public String toString()
{
return "implementationVendor=" + implementationVendor
+ ", implementationTitle=" + implementationTitle
+ ", implementationVersion=" + implementationVersion
+ ", ciBuildNo=" + ciBuildNo
+ ", ciBuildTag=" + ciBuildTag;
}
public String getImplementationVendor()
{
return ... | public String getImplementationVersion()
{
return implementationVersion;
}
public String getCiBuildNo()
{
return ciBuildNo;
}
public String getCiBuildTag()
{
return ciBuildTag;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.cli\src\main\java\de\metas\migration\cli\rollout_migrate\BinaryVersion.java | 1 |
请完成以下Java代码 | public byte[] getG() {
return g;
}
/**
* Sets the value of the g property.
*
* @param value
* allowed object is
* byte[]
*/
public void setG(byte[] value) {
this.g = value;
}
/**
* Gets the value of the y property.
*
* @return
... | * allowed object is
* byte[]
*/
public void setJ(byte[] value) {
this.j = value;
}
/**
* Gets the value of the seed property.
*
* @return
* possible object is
* byte[]
*/
public byte[] getSeed() {
return seed;
}
/**
... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\DSAKeyValueType.java | 1 |
请完成以下Java代码 | public static String rewrite(String text)
{
return dictionary.rewrite(text);
}
/**
* 语义距离
* @param itemA
* @param itemB
* @return
*/
public static long distance(CommonSynonymDictionary.SynonymItem itemA, CommonSynonymDictionary.SynonymItem itemB)
{
return it... | {
if (withUndefinedItem)
{
item = CommonSynonymDictionary.SynonymItem.createUndefined(term.word);
synonymItemList.add(item);
}
}
else
{
synonymItemList.add(item);
}
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dictionary\CoreSynonymDictionary.java | 1 |
请完成以下Spring Boot application配置 | spring.datasource.url = jdbc:h2:mem:springKatharsis;DB_CLOSE_DELAY=-1
spring.datasource.username = sa
spring.datasource.password =
spring.jpa.show-sql = false
spring.jpa.hibernate.ddl-auto = create-drop
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.H2Dialect
spring.jpa.properties.hibernate.globally_q... |
server.port=8082
server.servlet.context-path=/spring-katharsis
katharsis.domainName=http://localhost:8082/spring-katharsis
katharsis.pathPrefix=/ | repos\tutorials-master\spring-katharsis\src\main\resources\application.properties | 2 |
请在Spring Boot框架中完成以下Java代码 | public Result thread(String arg) {
redisTemplate.opsForValue().get("thread2");
Person person1 = new Person();
person1.setAge(23);
person1.setId(5L);
person1.setName("名称thread-2");
person1.setAddress("地址thread-3");
redisTemplate.opsForValue().get("thread");
... | public Result fallbackMethodSemaphore(String arg, Throwable throwable) {
// 获取断路器状态
HystrixCircuitBreaker circuitBreaker = HystrixCircuitBreaker.Factory.getInstance(
HystrixCommandKey.Factory.asKey("hystrixThreadTestCommandKey"));
logger.info("熔断降级 Circuit is open {}", !circuitBr... | repos\spring-boot-student-master\spring-boot-student-hystrix\src\main\java\com\xiaolyuh\service\impl\PersonServiceImpl.java | 2 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public void ... | public static Long genId() {
Long id = 1L;
try {
List<User> users = new UserHandler().getUsers();
for (User user : users)
id = (user.getId() > id ? user.getId() : id) + 1;
} catch (Exception e) {
e.printStackTrace();
}
... | repos\tutorials-master\graphql-modules\graphql-java\src\main\java\com\baeldung\graphql\entity\User.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[]{};
}
}
private static class TrustAnyHostnameVerifier implements HostnameVerifier {
public boolean verify(String hostname, SSLSession session) {
return true;
}
}
private ... | return null;
}
}
public static TrustKeyStore loadTrustKeyStore(String keyStorePath, String keyStorePass){
try{
return loadTrustKeyStore(new FileInputStream(keyStorePath), keyStorePass);
}catch(Exception e){
logger.error("loadTrustCertFactory fail : "+e.getMessage(), e);
ret... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\trade\utils\httpclient\SimpleHttpUtils.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public PickingSlotIdAndCaption getPickingSlotIdAndCaption(@NonNull final PickingSlotId pickingSlotId)
{
return pickingSlotIdAndCaptionsCache.computeIfAbsent(pickingSlotId, pickingSlotService::getPickingSlotIdAndCaption);
}
@Override
public String getProductNo(@NonNull final ProductId productId)
{
return getPr... | return huService.getPackingInfo(huPIItemProductId);
}
@Override
public String getPICaption(@NonNull final HuPackingInstructionsId piId)
{
return huService.getPI(piId).getName();
}
@Override
public String getLocatorName(@NonNull final LocatorId locatorId)
{
return locatorNamesCache.computeIfAbsent(locatorI... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\repository\DefaultPickingJobLoaderSupportingServices.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class ActivitiSpringSecurityAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public GrantedAuthoritiesResolver grantedAuthoritiesResolver() {
return new SimpleGrantedAuthoritiesResolver();
}
@Bean
@ConditionalOnMissingBean
public GrantedAuthoritiesGroupsMapper grantedAuth... | ) {
return new AuthenticationPrincipalRolesProvider(grantedAuthoritiesResolver, grantedAuthoritiesRolesMapper);
}
@Bean
@ConditionalOnMissingBean
public SecurityManager securityManager(
SecurityContextPrincipalProvider securityContextPrincipalProvider,
PrincipalIdentityProvider ... | repos\Activiti-develop\activiti-core-common\activiti-spring-security\src\main\java\org\activiti\core\common\spring\security\config\ActivitiSpringSecurityAutoConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | protected void validateParameters() {
ensureOnlyOneNotNull("Need to specify either a process instance id or a process definition key.", processDefinitionId, processDefinitionKey);
if(processDefinitionId != null && isTenantIdSet) {
throw LOG.exceptionUpdateSuspensionStateForTenantOnlyByProcessDefinitionKe... | public boolean isIncludeProcessInstances() {
return includeProcessInstances;
}
public Date getExecutionDate() {
return executionDate;
}
public String getProcessDefinitionTenantId() {
return processDefinitionTenantId;
}
public boolean isTenantIdSet() {
return isTenantIdSet;
}
} | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\repository\UpdateProcessDefinitionSuspensionStateBuilderImpl.java | 2 |
请完成以下Java代码 | protected boolean doProcessCfMsg(ToCalculatedFieldSystemMsg msg) throws CalculatedFieldException {
switch (msg.getMsgType()) {
case CF_PARTITIONS_CHANGE_MSG:
processor.process((CalculatedFieldPartitionChangeMsg) msg);
break;
case CF_STATE_RESTORE_MSG:
... | case CF_ALARM_ACTION_MSG:
processor.process((CalculatedFieldAlarmActionMsg) msg);
break;
case CF_ARGUMENT_RESET_MSG:
processor.process((CalculatedFieldArgumentResetMsg) msg);
break;
default:
return false;
}
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\actors\calculatedField\CalculatedFieldEntityActor.java | 1 |
请完成以下Java代码 | public class CorporateAction1 {
@XmlElement(name = "Cd")
protected String cd;
@XmlElement(name = "Nb")
protected String nb;
@XmlElement(name = "Prtry")
protected String prtry;
/**
* Gets the value of the cd property.
*
* @return
* possible object is
* {@li... | *
*/
public void setNb(String value) {
this.nb = value;
}
/**
* Gets the value of the prtry property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPrtry() {
return prtry;
}
/**
* Sets th... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\CorporateAction1.java | 1 |
请完成以下Java代码 | public class ActuatorMemoryController {
/**
* 内存详情
* @return
*/
@GetMapping("/info")
public Result<?> getRedisInfo() {
Runtime runtime = Runtime.getRuntime();
Map<String,Number> result = new HashMap<>();
result.put("memory.runtime.total", runtime.totalMemory());
result.put("memory.r... | // 代码逻辑说明: [TV360X-1695]内存信息-立即更新 功能报错 #6635------------
OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();
if (operatingSystemMXBean instanceof com.sun.management.OperatingSystemMXBean) {
com.sun.management.OperatingSystemMXBean opBean = (com.sun.management.OperatingSyst... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\monitor\controller\ActuatorMemoryController.java | 1 |
请完成以下Java代码 | public <T> void createSelectionFromModelsCollection(final PInstanceId selectionId, final Collection<T> models)
{
if (models == null || models.isEmpty())
{
return;
}
final Set<Integer> selection = new HashSet<>(models.size());
for (final T model : models)
{
final int modelId = InterfaceWrapperHelper.... | sb.append("=====================[ SELECTIONS ]============================================================");
for (final PInstanceId selectionId : selectionId2selection.keySet())
{
sb.append("\n\t").append(selectionId).append(": ").append(selectionId2selection.get(selectionId));
}
sb.append("\n");
System.... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\wrapper\POJOLookupMap.java | 1 |
请完成以下Java代码 | public Set<String> listFilesUsingFileWalk(String dir, int depth) throws IOException {
try (Stream<Path> stream = Files.walk(Paths.get(dir), depth)) {
return stream
.filter(file -> !Files.isDirectory(file))
.map(Path::getFileName)
.map(Path:... | return FileVisitResult.CONTINUE;
}
});
return fileList;
}
public Set<String> listFilesUsingDirectoryStream(String dir) throws IOException {
Set<String> fileSet = new HashSet<>();
try (DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get(dir))) {
... | repos\tutorials-master\core-java-modules\core-java-io\src\main\java\com\baeldung\listfiles\ListFiles.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.