instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public class ESRReceiptLineMatcherUtil
{
public final static AdMessageKey ERR_WRONG_CTRL_AMT = AdMessageKey.of("ESR_Wrong_Ctrl_Amt");
public final static AdMessageKey ERR_WRONG_CTRL_QTY = AdMessageKey.of("ESR_Wrong_Ctrl_Qty");
public final static AdMessageKey ERR_WRONG_TRX_TYPE = AdMessageKey.of("ESR_Wrong_Tr... | }
}
/**
* If there is a problem extracting the qty, it logs an error message to {@link Loggables#get()}.
*
* @param esrImportLineText
* @return
*/
public BigDecimal extractCtrlQty(@NonNull final String esrImportLineText)
{
final String trxQtysStr = esrImportLineText.substring(51, 63);
try
{
fin... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java\de\metas\payment\esr\dataimporter\impl\v11\ESRReceiptLineMatcherUtil.java | 1 |
请完成以下Java代码 | public String getIdAsString()
{
return String.valueOf(id);
}
public String getMessage(final String adLanguage)
{
return adLanguage2message.computeIfAbsent(adLanguage, this::buildMessage);
}
private String buildMessage(final String adLanguage)
{
//
// Build detail message
final StringBuilder detailBuf... | }
public boolean isNotRead()
{
return !isRead();
}
public synchronized boolean setRead(final boolean read)
{
final boolean readOld = this.read;
this.read = read;
return readOld;
}
@Nullable
public String getTargetWindowIdAsString()
{
return targetWindowId != null ? String.valueOf(targetWindowId.ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\notification\UserNotification.java | 1 |
请完成以下Java代码 | public static class BigArray {
int[] data;
@Setup(Level.Iteration)
public void prepare() {
data = new int[ARRAY_SIZE];
for(int j = 0; j< ARRAY_SIZE; j++) {
data[j] = 1;
}
}
@TearDown(Level.Iteration)
public void destroy() {
data = null;
} | }
@Benchmark
public void largeArrayLoopSum(BigArray bigArray, Blackhole blackhole) {
for (int i = 0; i < ARRAY_SIZE - 1; i++) {
bigArray.data[i + 1] += bigArray.data[i];
}
blackhole.consume(bigArray.data);
}
@Benchmark
public void largeArrayParallelPrefixSum(BigArray bigArray, Blackhole bl... | repos\tutorials-master\core-java-modules\core-java-arrays-guides\src\main\java\com\baeldung\arrays\ParallelPrefixBenchmark.java | 1 |
请完成以下Java代码 | public void setM_Product_Category_Parent_ID (int M_Product_Category_Parent_ID)
{
if (M_Product_Category_Parent_ID < 1)
set_Value (COLUMNNAME_M_Product_Category_Parent_ID, null);
else
set_Value (COLUMNNAME_M_Product_Category_Parent_ID, Integer.valueOf(M_Product_Category_Parent_ID));
}
/** Get Parent Prod... | @return Alphanumeric identifier of the entity
*/
@Override
public java.lang.String getName ()
{
return (java.lang.String)get_Value(COLUMNNAME_Name);
}
/** Set DB1 %.
@param PlannedMargin
Project's planned margin as a percentage
*/
@Override
public void setPlannedMargin (java.math.BigDecimal Planne... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Product_Category.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PackagingDetailsType {
@XmlElement(name = "NumberOfPackages")
protected BigDecimal numberOfPackages;
@XmlElement(name = "CustomersPackagingNumber")
protected String customersPackagingNumber;
@XmlElement(name = "SuppliersPackagingNumber")
protected String suppliersPackagingNumber;
... | return suppliersPackagingNumber;
}
/**
* Sets the value of the suppliersPackagingNumber property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSuppliersPackagingNumber(String value) {
this.suppliersPackagingNumber = valu... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\PackagingDetailsType.java | 2 |
请完成以下Java代码 | public HistoricVariableInstanceQuery orderByVariableName() {
wrappedHistoricVariableInstanceQuery.orderByVariableName();
return this;
}
@Override
public HistoricVariableInstanceQuery asc() {
wrappedHistoricVariableInstanceQuery.asc();
return this;
}
@Override
pu... | public HistoricVariableInstance singleResult() {
return wrappedHistoricVariableInstanceQuery.singleResult();
}
@Override
public List<HistoricVariableInstance> list() {
return wrappedHistoricVariableInstanceQuery.list();
}
@Override
public List<HistoricVariableInstance> listPage... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\history\CmmnHistoricVariableInstanceQueryImpl.java | 1 |
请完成以下Java代码 | public TenantProfile get(TenantId tenantId) {
TenantProfileId profileId = tenantsMap.get(tenantId);
if (profileId == null) {
Tenant tenant = tenantService.findTenantById(tenantId);
if (tenant != null) {
profileId = tenant.getTenantProfileId();
tena... | @Override
public void evict(TenantId tenantId) {
tenantsMap.remove(tenantId);
TenantProfile tenantProfile = get(tenantId);
if (tenantProfile != null) {
ConcurrentMap<EntityId, Consumer<TenantProfile>> tenantListeners = profileListeners.get(tenantId);
if (tenantListene... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\tenant\DefaultTbTenantProfileCache.java | 1 |
请完成以下Java代码 | public L getLeft() {
return left;
}
/**
* @return the right element
*/
public R getRight() {
return right;
}
/**
* Create a pair of elements.
*
* @param left
* the left element
* @param right
* the right element
*/
public ImmutablePair(L left, R right) ... | protected int compare(Comparable original, Comparable other) {
if (original == other) {
return 0;
}
if (original == null) {
return -1;
}
if (other == null) {
return 1;
}
return original.compareTo(other);
}
@Override
public boolean equals(Object obj) {
if (obj ... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\util\ImmutablePair.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Boolean getWithoutTenantId() {
return withoutTenantId;
}
public void setWithoutTenantId(Boolean withoutTenantId) {
this.withoutTenantId = withoutTenantId;
}
public Boolean getWithoutProcessInstanceId() {
return withoutProcessInstanceId;
}
public void setWithoutP... | this.rootScopeId = rootScopeId;
}
public String getParentScopeId() {
return parentScopeId;
}
public void setParentScopeId(String parentScopeId) {
this.parentScopeId = parentScopeId;
}
public Set<String> getScopeIds() {
return scopeIds;
}
public void setScopeId... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\history\task\HistoricTaskInstanceQueryRequest.java | 2 |
请完成以下Java代码 | public static boolean isEntityTypeDisplayedInUIOrTrueIfNull(
@NonNull final IUserRolePermissions role,
@NonNull final String entityType)
{
final UIDisplayedEntityTypes constraint = role
.getConstraint(UIDisplayedEntityTypes.class)
.orElse(null);
// If no constraint => return default (true)
if (con... | /**
* @return true if UI elements for given entity type shall be displayed
*/
public boolean isDisplayedInUI(final String entityType)
{
if (showAllEntityTypes)
{
return EntityTypesCache.instance.isActive(entityType);
}
else
{
return EntityTypesCache.instance.isDisplayedInUI(entityType);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\permissions\UIDisplayedEntityTypes.java | 1 |
请完成以下Java代码 | public void setC_CountryArea_Assign_ID (int C_CountryArea_Assign_ID)
{
if (C_CountryArea_Assign_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_CountryArea_Assign_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_CountryArea_Assign_ID, Integer.valueOf(C_CountryArea_Assign_ID));
}
/** Get Country area assign.
@ret... | /** Set Gültig ab.
@param ValidFrom
Gültig ab inklusiv (erster Tag)
*/
@Override
public void setValidFrom (java.sql.Timestamp ValidFrom)
{
set_Value (COLUMNNAME_ValidFrom, ValidFrom);
}
/** Get Gültig ab.
@return Gültig ab inklusiv (erster Tag)
*/
@Override
public java.sql.Timestamp getValidF... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_CountryArea_Assign.java | 1 |
请完成以下Java代码 | public class HandleExternalTaskFailureCmd extends HandleExternalTaskCmd {
protected String errorMessage;
protected String errorDetails;
protected long retryDuration;
protected int retries;
protected Map<String, Object> variables;
protected Map<String, Object> localVariables;
/**
* Overloaded construc... | externalTask.failed(errorMessage, errorDetails, retries, retryDuration, variables, localVariables);
}
@Override
protected void validateInput() {
super.validateInput();
EnsureUtil.ensureGreaterThanOrEqual("retries", retries, 0);
EnsureUtil.ensureGreaterThanOrEqual("retryDuration", retryDuration, 0);
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\HandleExternalTaskFailureCmd.java | 1 |
请完成以下Java代码 | public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNam... | */
public void setProductColumn (String ProductColumn)
{
set_Value (COLUMNNAME_ProductColumn, ProductColumn);
}
/** Get Product Column.
@return Fully qualified Product column (M_Product_ID)
*/
public String getProductColumn ()
{
return (String)get_Value(COLUMNNAME_ProductColumn);
}
/** Set Sql SELEC... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_MeasureCalc.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isOpen() {
return this.resource.isOpen();
}
@Override
public URL getURL() throws IOException {
return this.resource.getURL();
}
@Override
public URI getURI() throws IOException {
return this.resource.getURI();
}
@Override
public File getFile() throws IOException ... | public String getFilename() {
return this.resource.getFilename();
}
@Override
public String getDescription() {
return this.resource.getDescription();
}
}
}
private static final class CriteriaSetResolverWrapper extends MetadataResolverAdapter {
CriteriaSetResolverWrapper(MetadataResolver m... | repos\spring-security-main\saml2\saml2-service-provider\src\opensaml5Main\java\org\springframework\security\saml2\provider\service\registration\OpenSaml5AssertingPartyMetadataRepository.java | 2 |
请完成以下Java代码 | public class KafkaOutboundChannelModel extends OutboundChannelModel {
protected String topic;
protected RecordKey recordKey;
protected KafkaPartition partition;
public KafkaOutboundChannelModel() {
super();
setType("kafka");
}
public String getTopic() {
return topic;
... | public String getDelegateExpression() {
return delegateExpression;
}
public void setDelegateExpression(String delegateExpression) {
this.delegateExpression = delegateExpression;
}
}
@JsonInclude(Include.NON_NULL)
public static class RecordKey {
prot... | repos\flowable-engine-main\modules\flowable-event-registry-model\src\main\java\org\flowable\eventregistry\model\KafkaOutboundChannelModel.java | 1 |
请完成以下Java代码 | private static Object convertToPOValue(final String value, final PO po, final String columnName)
{
final int displayType = po.getPOInfo().getColumnDisplayType(po.get_ColumnIndex(columnName));
return DisplayType.convertToDisplayType(value, columnName, displayType);
}
private static String resolveAppendSuffix(fin... | final int fieldLength = context.getToFieldLength();
if (fieldLength > 0 && valueUnique.length() > fieldLength)
{
valueUnique = valueUnique.substring(0, fieldLength);
}
return valueUnique;
}
else
{
final String oldValue = String.valueOf(context.getFromValue());
return oldValue.concat(suffixT... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\copy\ValueToCopy.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setStrictness(@Nullable Strictness strictness) {
this.strictness = strictness;
}
public void setLenient(@Nullable Boolean lenient) {
setStrictness((lenient != null && lenient) ? Strictness.LENIENT : Strictness.STRICT);
}
public @Nullable Boolean getDisableHtmlEscaping() {
return this.disableHtml... | */
LENIENT,
/**
* Strict compliance with some small deviations for legacy reasons.
*/
LEGACY_STRICT,
/**
* Strict compliance.
*/
STRICT
}
} | repos\spring-boot-4.0.1\module\spring-boot-gson\src\main\java\org\springframework\boot\gson\autoconfigure\GsonProperties.java | 2 |
请完成以下Java代码 | private AllocableHU toAllocableHU(@NonNull final PickFromHU pickFromHU, @NonNull final ProductId productId)
{
final HUsLoadingCache husCache = pickFromHUsSupplier.getHusCache();
final HuId topLevelHUId = pickFromHU.getTopLevelHUId();
//
// Make sure our top level HU is not already reserved to somebody else
... | : qtyStorage;
}
private Quantity getStorageQty()
{
Quantity storageQty = this._storageQty;
if (storageQty == null)
{
storageQty = this._storageQty = storageFactory.getStorage(topLevelHU).getProductStorage(productId).getQty();
}
return storageQty;
}
public void addQtyAllocated(@NonNull fin... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\distribution\ddorder\movement\schedule\plan\DDOrderMovePlanCreateCommand.java | 1 |
请完成以下Java代码 | public int getQM_SpecificationLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_QM_SpecificationLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Sequence.
@param SeqNo
Method of ordering records; lowest number comes first
*/
public void setSeqNo (int SeqNo)
{
set_Valu... | return (String)get_Value(COLUMNNAME_ValidFrom);
}
/** Set Valid to.
@param ValidTo
Valid to including this date (last day)
*/
public void setValidTo (Timestamp ValidTo)
{
set_Value (COLUMNNAME_ValidTo, ValidTo);
}
/** Get Valid to.
@return Valid to including this date (last day)
*/
public Timest... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_QM_SpecificationLine.java | 1 |
请完成以下Java代码 | public Flux<Instance> findAll() {
return this.eventStore.findAll()
.groupBy(InstanceEvent::getInstance)
.flatMap((f) -> f.reduce(Instance.create(f.key()), Instance::apply));
}
@Override
public Mono<Instance> find(InstanceId id) {
return this.eventStore.find(id)
.collectList()
.filter((e) -> !e.isEmp... | .flatMap((application) -> remappingFunction.apply(id, application))
.switchIfEmpty(Mono.defer(() -> remappingFunction.apply(id, null)))
.flatMap(this::save)
.retryWhen(this.retryOptimisticLockException);
}
@Override
public Mono<Instance> computeIfPresent(InstanceId id,
BiFunction<InstanceId, Instance, M... | repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\domain\entities\EventsourcingInstanceRepository.java | 1 |
请完成以下Java代码 | default V evaluate(final Evaluatee ctx, final boolean ignoreUnparsable)
{
// backward compatibility
final OnVariableNotFound onVariableNotFound = ignoreUnparsable ? OnVariableNotFound.Empty : OnVariableNotFound.ReturnNoResult;
return evaluate(ctx, onVariableNotFound);
}
/**
* Evaluates expression in given c... | */
default boolean isNoResult(final Object result)
{
return result == null;
}
/**
* @return true if this expression is constant and always evaluated "NO RESULT"
* @see #isNoResult(Object)
*/
default boolean isNullExpression()
{
return false;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\IExpression.java | 1 |
请完成以下Java代码 | public boolean isLiteralText() {
return false;
}
public Class<?> getType(Bindings bindings, ELContext context) {
return null;
}
public boolean isReadOnly(Bindings bindings, ELContext context) {
return true;
}
public void setValue(Bindings bindings, ELContext context, O... | throw new MethodNotFoundException(
LocalMessages.get("error.property.method.notfound", name, base.getClass())
);
}
return result;
}
@Override
public Object eval(Bindings bindings, ELContext context) {
return eval(bindings, context, true);
}
publi... | repos\Activiti-develop\activiti-core-common\activiti-juel-jakarta\src\main\java\org\activiti\core\el\juel\tree\impl\ast\AstMethod.java | 1 |
请完成以下Java代码 | public String getErrorMessageAsStringOrNull()
{
return getErrorMessageAsStringOrNull(-1);
}
public String getErrorMessageAsStringOrNull(final int maxLength)
{
final int maxLengthEffective = maxLength > 0 ? maxLength : Integer.MAX_VALUE;
final StringBuilder result = new StringBuilder();
if (parseError != ... | }
return nulls;
}
else
{
final ArrayList<Object> values = new ArrayList<>(columnsCount);
final int cellsCount = cells.size();
for (int i = 0; i < columnsCount; i++)
{
if (i < cellsCount)
{
values.add(cells.get(i).getJdbcValue());
}
else
{
values.add(null);
}
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\parser\ImpDataLine.java | 1 |
请完成以下Java代码 | public void execute(InterpretableExecution execution) {
ActivityImpl activity = (ActivityImpl) execution.getActivity();
ActivityBehavior activityBehavior = activity.getActivityBehavior();
if (activityBehavior == null) {
throw new PvmException("no behavior specified in " + activity);... | (String) activity.getProperties().get("type"),
activity.getActivityBehavior().getClass().getCanonicalName()),
EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);
}
activityBehavior.execute(execution);
} catch (ActivitiExcepti... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\pvm\runtime\AtomicOperationActivityExecute.java | 1 |
请完成以下Java代码 | public void setAD_Error_ID (int AD_Error_ID)
{
if (AD_Error_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_Error_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_Error_ID, Integer.valueOf(AD_Error_ID));
}
/** Get Error.
@return Error */
public int getAD_Error_ID ()
{
Integer ii = (Integer)get_Value(COL... | @return Validation Code
*/
public String getCode ()
{
return (String)get_Value(COLUMNNAME_Code);
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Error.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class EmployeeService {
@PersistenceContext
private EntityManager entityManager;
public List<Employee> getAllEmployeesUsingJPQL() {
String jpqlQuery = "SELECT e FROM Employee e";
Query query = entityManager.createQuery(jpqlQuery, Employee.class);
return query.getResultList()... | criteriaQuery.select(employeeRoot);
Query query = entityManager.createQuery(criteriaQuery);
return query.getResultList();
}
public List<Employee> getAllEmployeesByDepartmentUsingCriteriaAPI(String department) {
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
... | repos\tutorials-master\persistence-modules\hibernate-queries-2\src\main\java\com\baeldung\hibernate\listentity\service\EmployeeService.java | 2 |
请完成以下Java代码 | public class FlowableServices {
private ProcessEngine processEngine;
public void setProcessEngine(ProcessEngine processEngine) {
this.processEngine = processEngine;
}
@Produces
@Named
@ApplicationScoped
public ProcessEngine processEngine() {
return processEngine;
}
... | @ApplicationScoped
public HistoryService historyService() {
return processEngine().getHistoryService();
}
@Produces
@Named
@ApplicationScoped
public IdentityService identityService() {
return processEngine().getIdentityService();
}
@Produces
@Named
@ApplicationS... | repos\flowable-engine-main\modules\flowable-cdi\src\main\java\org\flowable\cdi\impl\util\FlowableServices.java | 1 |
请完成以下Java代码 | public static int toIntegerOrZero(final String str)
{
if (str == null || str.isEmpty())
{
return 0;
}
try
{
return Integer.valueOf(str);
}
catch (NumberFormatException e)
{
return 0;
}
}
/**
* Casts a string to BigDecimal. Returns BigDecimal.ZERO if the operation fails.
*
* @para... | * @param s original string
* @return string without diacritics
*/
// note: we just moved the method here, and left it unchanges. as of now idk why all this code is commented out
public static String stripDiacritics(String s)
{
/* JAVA5 behaviour */
return s;
/*
* JAVA6 behaviour * if (s == null) { retur... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing.common\de.metas.printing.esb.base\src\main\java\de\metas\printing\esb\base\util\StringUtils.java | 1 |
请完成以下Java代码 | public static int genRandomNum(int length) {
int num = 1;
double random = Math.random();
if (random < 0.1) {
random = random + 0.1;
}
for (int i = 0; i < length; i++) {
num = num * 10;
}
return (int) ((random * num));
}
/**
* ... | StringBuffer buffer = new StringBuffer(String.valueOf(System.currentTimeMillis()));
int num = genRandomNum(4);
buffer.append(num);
return buffer.toString();
}
public static String formatMoney2Str(Double money) {
java.text.DecimalFormat df = new java.text.DecimalFormat("0.00");
... | repos\spring-boot-projects-main\SpringBoot前后端分离实战项目源码\spring-boot-project-front-end&back-end\src\main\java\cn\lanqiao\springboot3\utils\NumberUtil.java | 1 |
请完成以下Java代码 | public class TbMsgPackCallback implements TbMsgCallback {
private final UUID id;
private final TenantId tenantId;
private final TbMsgPackProcessingContext ctx;
private final long startMsgProcessing;
private final Timer successfulMsgTimer;
private final Timer failedMsgTimer;
public TbMsgPack... | @Override
public void onFailure(RuleEngineException e) {
if (ExceptionUtil.lookupExceptionInCause(e, AbstractRateLimitException.class) != null) {
onRateLimit(e);
return;
}
log.trace("[{}] ON FAILURE", id, e);
if (failedMsgTimer != null) {
failedMs... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\queue\TbMsgPackCallback.java | 1 |
请完成以下Java代码 | private IQueryBuilder<I_M_HU> retrieveActiveSourceHusQuery(@NonNull final MatchingSourceHusQuery query)
{
if (query.getProductIds().isEmpty())
{
return null;
}
final ICompositeQueryFilter<I_M_HU> huFilters = createHuFilter(query);
return Services.get(IQueryBL.class).createQueryBuilder(I_M_Source_HU.class... | final IHandlingUnitsDAO handlingUnitsDAO = Services.get(IHandlingUnitsDAO.class);
final ICompositeQueryFilter<I_M_HU> huFilters = queryBL.createCompositeQueryFilter(I_M_HU.class)
.setJoinOr();
final IHUQueryBuilder huQueryBuilder = handlingUnitsDAO.createHUQueryBuilder()
.setOnlyActiveHUs(true)
.setAl... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\sourcehu\impl\SourceHuDAO.java | 1 |
请完成以下Java代码 | private boolean isBoolean(Object value) {
if (value == null) {
return false;
}
return Boolean.class.isAssignableFrom(value.getClass()) || boolean.class.isAssignableFrom(value.getClass());
}
protected void ensureVariablesInitialized() {
if (!getQueryVariableValues().isEmpty()) {
ProcessE... | }
}
public List<QueryVariableValue> getQueryVariableValues() {
return queryVariableValues;
}
public Boolean isVariableNamesIgnoreCase() {
return variableNamesIgnoreCase;
}
public Boolean isVariableValuesIgnoreCase() {
return variableValuesIgnoreCase;
}
} | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\AbstractVariableQueryImpl.java | 1 |
请完成以下Java代码 | private I_C_BPartner updateExistingBPartner(@NonNull final I_I_Pharma_BPartner importRecord)
{
final I_C_BPartner bpartner;
bpartner = InterfaceWrapperHelper.create(importRecord.getC_BPartner(), I_C_BPartner.class);
if (!Check.isEmpty(importRecord.getb00name1(), true))
{
bpartner.setIsCompany(true);
bpa... | }
if (!Check.isEmpty(importRecord.getb00adrnr()))
{
bpartner.setIFA_Manufacturer(importRecord.getb00adrnr());
bpartner.setDescription("IFA " + importRecord.getb00adrnr());
}
bpartner.setIsManufacturer(true);
if (!Check.isEmpty(importRecord.getb00homepag()))
{
bpartner.setURL(importRecord.getb00h... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma\src\main\java\de\metas\impexp\bpartner\IFABPartnerImportHelper.java | 1 |
请完成以下Java代码 | public POSOrder changeStatusTo(
@NonNull final POSTerminalId posTerminalId,
@NonNull final POSOrderExternalId externalId,
@NonNull final POSOrderStatus nextStatus,
@NonNull final UserId userId)
{
return ordersService.changeStatusTo(posTerminalId, externalId, nextStatus, userId);
}
public POSOrder upda... | }
public POSOrder refundPayment(
@NonNull final POSTerminalId posTerminalId,
@NonNull final POSOrderExternalId posOrderExternalId,
@NonNull final POSPaymentExternalId posPaymentExternalId,
@NonNull final UserId userId)
{
return ordersService.refundPayment(posTerminalId, posOrderExternalId, posPaymentEx... | repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getUsername()
{
return username;
}
public void setUsername(String username)
{
this.username = username;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{ | this.password = password;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams)
{
if (username == null && password == null)
{
return;
}
headerParams.put("Authorization", Credentials.basic(
username == null ? "" : username,
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-ebay\ebay-api-client\src\main\java\de\metas\camel\externalsystems\ebay\api\invoker\auth\HttpBasicAuth.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public LwM2MServerSecurityConfigDefault getServerSecurityInfo(boolean bootstrapServer) {
LwM2MSecureServerConfig bsServerConfig = bootstrapServer ? bootstrapConfig.orElse(null) : serverConfig;
if (bsServerConfig!= null) {
LwM2MServerSecurityConfigDefault result = getServerSecurityConfig(bsSe... | private byte[] getPublicKey(LwM2MSecureServerConfig config) {
try {
SslCredentials sslCredentials = config.getSslCredentials();
if (sslCredentials != null) {
return sslCredentials.getPublicKey().getEncoded();
}
} catch (Exception e) {
log.t... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\lwm2m\LwM2MServiceImpl.java | 2 |
请完成以下Java代码 | public java.lang.String getUserLevel ()
{
return (java.lang.String)get_Value(COLUMNNAME_UserLevel);
}
/** Set Is webui role.
@param WEBUI_Role Is webui role */
@Override
public void setWEBUI_Role (boolean WEBUI_Role)
{
set_Value (COLUMNNAME_WEBUI_Role, Boolean.valueOf(WEBUI_Role));
}
/** Get Is webui... | return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
@Override
public void setIsAllowPasswordChangeForOthers (final boolean IsAllowPasswordChangeForOthers)
{
set_Value (COLUMNNAME_IsAllowPasswordChangeForOthers, IsAllowPasswordChangeForOthers);
}
@Override
public boolean isAl... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Role.java | 1 |
请完成以下Spring Boot application配置 | logging:
level:
org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter: error
server:
port: 8040
turbine:
stream:
port: 8041
eureka:
instance:
hostname: registry
prefer-ip-address: true
metadata-map:
user.name: ${security.user.name}
user.password: ${security.user.... | logfile,refresh,flyway,liquibase,heapdump,loggers,auditevents,hystrix.stream
turbine:
clusters: default
location: http://monitor:${turbine.stream.port}
security:
user:
name: admin
password: ${MONITOR_SERVER_PASSWORD:admin} | repos\spring-boot-cloud-master\monitor\src\main\resources\application.yml | 2 |
请完成以下Java代码 | private Optional<HUTraceForReturnedQtyRequest> buildRequest(@NonNull final I_M_HU_Trx_Line trxLine)
{
final I_M_HU returnedVHU = trxLine.getM_HU();
final I_M_InOutLine returnLine = trxBL.getReferencedObjectOrNull(trxLine, I_M_InOutLine.class);
final I_M_InOut returnHeader = returnLine.getM_InOut();
final InO... | final HuId topLevelReturnedHUId = HuId.ofRepoId(handlingUnitsBL.getTopLevelParent(returnedVHU).getM_HU_ID());
final UomId uomIdToUse = UomId.ofRepoId(CoalesceUtil.firstGreaterThanZero(trxLine.getC_UOM_ID(),
returnLine.getC_UOM_ID()));
final HUTraceForReturnedQtyRequest addTraceRequest = HUTra... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inout\returns\customer\CreateReturnedHUsTrxListener.java | 1 |
请完成以下Java代码 | public JsonGetNextEligibleLineResponse getNextEligibleLineToPack(@RequestBody @NonNull final JsonGetNextEligibleLineRequest request)
{
assertApplicationAccess();
return pickingMobileApplication.getNextEligibleLineToPack(request, getLoggedUserId());
}
@PostMapping("/job/{wfProcessId}/pickAll")
public WFProcess ... | public JsonPickingJobQtyAvailable getQtyAvailable(@PathVariable("wfProcessId") final String wfProcessIdStr)
{
assertApplicationAccess();
final WFProcessId wfProcessId = WFProcessId.ofString(wfProcessIdStr);
final PickingJobQtyAvailable qtyAvailable = pickingMobileApplication.getQtyAvailable(wfProcessId, getLogge... | repos\metasfresh-new_dawn_uat\backend\de.metas.picking.rest-api\src\main\java\de\metas\picking\rest_api\PickingRestController.java | 1 |
请完成以下Java代码 | private static Duration extractSkipTimeout(final I_C_Async_Batch_Type asyncBatchType)
{
final int skipTimeoutMillis = asyncBatchType.getSkipTimeoutMillis();
return skipTimeoutMillis > 0 ? Duration.ofMillis(skipTimeoutMillis) : Duration.ZERO;
}
private void updateProcessedFlag(@NonNull final I_C_Async_Batch asyn... | return 0;
}
lock.lock();
try
{
final I_C_Async_Batch asyncBatch = asyncBatchDAO.retrieveAsyncBatchRecordOutOfTrx(asyncBatchId);
final Timestamp enqueued = SystemTime.asTimestamp();
if (asyncBatch.getFirstEnqueued() == null)
{
asyncBatch.setFirstEnqueued(enqueued);
}
asyncBatch.setLastEnq... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\api\impl\AsyncBatchBL.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public int maxScale() {
return obtain(OtlpMetricsProperties::getMaxScale, OtlpConfig.super::maxScale);
}
@Override
public int maxBucketCount() {
return obtain(OtlpMetricsProperties::getMaxBucketCount, OtlpConfig.super::maxBucketCount);
}
@Override
public TimeUnit baseTimeUnit() {
return obtain(OtlpMetrics... | return null;
}
Map<String, V> perMeter = new LinkedHashMap<>();
properties.getMeter().forEach((key, meterProperties) -> {
V value = getter.get(meterProperties);
if (value != null) {
perMeter.put(key, value);
}
});
return (!perMeter.isEmpty()) ? perMeter : null;
};
}
} | repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\otlp\OtlpMetricsPropertiesConfigAdapter.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public ToAPIProcessCandidateStarterGroupAddedEventConverter processCandidateStarterGroupAddedEventConverter(
APIProcessCandidateStarterGroupConverter processCandidateStarterGroupConverter
) {
return new ToAPIProcessCandidateStarterGroupAddedEventConverter(processCandidateStarterGroupConverter);
... | ToAPIProcessCandidateStarterGroupRemovedEventConverter processCandidateStarterGroupRemovedEventConverter
) {
return () ->
runtimeService.addEventListener(
new ProcessCandidateStarterGroupRemovedListenerDelegate(
getInitializedListeners(listeners),
... | repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-process-runtime-impl\src\main\java\org\activiti\runtime\api\conf\ProcessRuntimeAutoConfiguration.java | 2 |
请完成以下Java代码 | public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getNamespace() {
return namespace;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
} | @Override
public Import clone() {
Import clone = new Import();
clone.setValues(this);
return clone;
}
public void setValues(Import otherElement) {
super.setValues(otherElement);
setImportType(otherElement.getImportType());
setLocation(otherElement.getLocation... | repos\flowable-engine-main\modules\flowable-bpmn-model\src\main\java\org\flowable\bpmn\model\Import.java | 1 |
请完成以下Java代码 | public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;... | public Role getRole() {
return role;
}
public void setRole(Role role) {
this.role = role;
}
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
@Override
public String toString() {
re... | repos\springBoot-master\springboot-springSecurity4\src\main\java\com\yy\example\bean\User.java | 1 |
请完成以下Java代码 | public class CreditCardEditor extends PropertyEditorSupport {
@Override
public String getAsText() {
CreditCard creditCard = (CreditCard) getValue();
return creditCard == null ? "" : creditCard.getRawCardNumber();
}
@Override
public void setAsText(String text) throws Il... | String cardNo = text.replaceAll("-", "");
if (cardNo.length() != 16)
throw new IllegalArgumentException("Credit card format should be xxxx-xxxx-xxxx-xxxx");
try {
creditCard.setBankIdNo( Integer.valueOf(cardNo.substring(0, 6)) );
credi... | repos\tutorials-master\spring-boot-modules\spring-boot-data-3\src\main\java\com\baeldung\propertyeditor\creditcard\CreditCardEditor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class AttachmentType {
@XmlElement(name = "Name", required = true)
protected String name;
@XmlElement(name = "Description")
protected String description;
@XmlElement(name = "MimeType", required = true)
protected String mimeType;
@XmlElement(name = "AttachmentData", required = true)
... | return mimeType;
}
/**
* Sets the value of the mimeType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMimeType(String value) {
this.mimeType = value;
}
/**
* The actual attachment data as base64-en... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ext\AttachmentType.java | 2 |
请完成以下Java代码 | public ImmutableList<InOutCost> getByIds(@NonNull final Set<InOutCostId> inoutCostIds)
{
if (inoutCostIds.isEmpty())
{
return ImmutableList.of();
}
return queryBL.createQueryBuilder(I_M_InOut_Cost.class)
.addInArrayFilter(I_M_InOut_Cost.COLUMNNAME_M_InOut_Cost_ID, inoutCostIds)
.orderBy(I_M_InOut_C... | queryBuilder.addEqualsFilter(I_M_InOut_Cost.COLUMNNAME_C_Cost_Type_ID, query.getCostTypeId());
}
if (!query.isIncludeReversed())
{
queryBuilder.addIsNull(I_M_InOut_Cost.COLUMNNAME_Reversal_ID);
}
if (query.isOnlyWithOpenAmountToInvoice())
{
queryBuilder.addEqualsFilter(I_M_InOut_Cost.COLUMNNAME_IsInvo... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\costs\inout\InOutCostRepository.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static boolean isAssignable(String target, Class<?> type, ClassLoader classLoader) {
try {
return ClassUtils.resolveClassName(target, classLoader).isAssignableFrom(type);
} catch (Throwable ex) {
return false;
}
}
protected void await() {
// has ... | }
private void shutdown() {
if (!executorService.isShutdown()) {
// Shutdown executorService
executorService.shutdown();
}
}
private void executeMutually(Runnable runnable) {
try {
lock.lock();
runnable.run();
} finally {
... | repos\dubbo-spring-boot-project-master\dubbo-spring-boot-compatible\autoconfigure\src\main\java\org\apache\dubbo\spring\boot\context\event\AwaitingNonWebApplicationListener.java | 2 |
请在Spring Boot框架中完成以下Java代码 | class ReactiveMethodSecuritySelector implements ImportSelector {
private static final boolean isDataPresent = ClassUtils
.isPresent("org.springframework.security.data.aot.hint.AuthorizeReturnObjectDataHintsRegistrar", null);
private static final boolean isObservabilityPresent = ClassUtils
.isPresent("io.microme... | }
imports.add(AuthorizationProxyConfiguration.class.getName());
return imports.toArray(new String[0]);
}
private static final class AutoProxyRegistrarSelector
extends AdviceModeImportSelector<EnableReactiveMethodSecurity> {
private static final String[] IMPORTS = new String[] { AutoProxyRegistrar.class.get... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\method\configuration\ReactiveMethodSecuritySelector.java | 2 |
请完成以下Java代码 | static class Attribute
{
final static Attribute NULL = new Attribute("未知", 10000.0f);
/**
* 依存关系
*/
public String[] dependencyRelation;
/**
* 概率
*/
public float[] p;
public Attribute(int size)
{
dependencyRelati... | {
p[i] *= boost;
}
}
@Override
public String toString()
{
final StringBuilder sb = new StringBuilder(dependencyRelation.length * 10);
for (int i = 0; i < dependencyRelation.length; ++i)
{
sb.append(dependenc... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\bigram\WordNatureDependencyModel.java | 1 |
请完成以下Java代码 | private void exportDunning(@NonNull final DunningToExport dunningToExport)
{
final ILoggable loggable = Loggables.withLogger(logger, Level.DEBUG);
final List<DunningExportClient> exportClients = dunningExportServiceRegistry.createExportClients(dunningToExport);
if (exportClients.isEmpty())
{
loggable.addLo... | byteArrayData = ByteStreams.toByteArray(exportResult.getData());
}
catch (final IOException e)
{
throw AdempiereException.wrapIfNeeded(e);
}
final AttachmentTags attachmentTags = AttachmentTags.builder()
.tag(AttachmentTags.TAGNAME_IS_DOCUMENT, StringUtils.ofBoolean(true)) // other than the "input" xml... | repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java\de\metas\dunning\export\DunningExportService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SignalResource {
@Autowired
protected RestResponseFactory restResponseFactory;
@Autowired
protected RuntimeService runtimeService;
@Autowired(required=false)
protected BpmnRestApiInterceptor restApiInterceptor;
@ApiOperation(value = "Signal event received", tags = { "Run... | throw new FlowableIllegalArgumentException("Async signals cannot take variables as payload");
}
if (signalRequest.isCustomTenantSet()) {
runtimeService.signalEventReceivedAsyncWithTenantId(signalRequest.getSignalName(), signalRequest.getTenantId());
} else {
... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\SignalResource.java | 2 |
请完成以下Java代码 | public PurchaseOrderItem copy(final PurchaseCandidate newPurchaseCandidate)
{
return new PurchaseOrderItem(this, newPurchaseCandidate);
}
@Override
public PurchaseCandidateId getPurchaseCandidateId()
{
return getPurchaseCandidate().getId();
}
public ProductId getProductId()
{
return getPurchaseCandidate... | }
public void setPurchaseOrderLineId(@NonNull final OrderAndLineId purchaseOrderAndLineId)
{
this.purchaseOrderAndLineId = purchaseOrderAndLineId;
}
public void markPurchasedIfNeeded()
{
if (purchaseMatchesOrExceedsRequiredQty())
{
purchaseCandidate.markProcessed();
}
}
public void markReqCreatedIf... | repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\remotepurchaseitem\PurchaseOrderItem.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String prefix() {
return "management.prometheus.metrics.export";
}
@Override
public @Nullable String get(String key) {
return null;
}
@Override
public boolean descriptions() {
return obtain(PrometheusProperties::isDescriptions, PrometheusConfig.super::descriptions);
}
@Override
public Duration ... | public @Nullable Properties prometheusProperties() {
return get(this::fromPropertiesMap, PrometheusConfig.super::prometheusProperties);
}
private @Nullable Properties fromPropertiesMap(PrometheusProperties prometheusProperties) {
Map<String, String> additionalProperties = prometheusProperties.getProperties();
... | repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\prometheus\PrometheusPropertiesConfigAdapter.java | 2 |
请完成以下Java代码 | private Boolean isCreatedBeforeLastPasswordReset(Date created, Date lastPasswordReset) {
return (lastPasswordReset != null && created.before(lastPasswordReset));
}
public String generateToken(UserDetails userDetails) {
Map<String, Object> claims = new HashMap<>();
claims.put(CLAIM_KEY_U... | refreshedToken = null;
}
return refreshedToken;
}
public Boolean validateToken(String token, UserDetails userDetails) {
User user = (User) userDetails;
final String username = getUsernameFromToken(token);
return (
username.equals(user.getUsername())
... | repos\Spring-Boot-In-Action-master\springbt_security_jwt\src\main\java\cn\codesheep\springbt_security_jwt\util\JwtTokenUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void signatureCheckPointCut() {
}
/**
* 开始验签
*/
@Before("signatureCheckPointCut()")
public void doSignatureValidation(JoinPoint point) throws Exception {
// 获取方法上的注解
MethodSignature signature = (MethodSignature) point.getSignature();
Method method = signature.g... | try {
// 直接调用SignAuthInterceptor的验证逻辑
signAuthInterceptor.validateSignature(request);
log.info("AOP签名验证通过");
} catch (IllegalArgumentException e) {
// 使用注解中配置的错误消息,或者保留原始错误消息
String errorMessage = signatureCheck.errorMessage();
... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\config\sign\aspect\SignatureCheckAspect.java | 2 |
请完成以下Java代码 | public Optional<BankId> getBankIdBySwiftCode(final String swiftCode)
{
return bankIdsBySwiftCode.getOrLoad(swiftCode, this::retrieveBankIdBySwiftCode);
}
@NonNull
private Optional<BankId> retrieveBankIdBySwiftCode(final String swiftCode)
{
final int bankRepoId = queryBL.createQueryBuilderOutOfTrx(I_C_Bank.cla... | }
@NonNull
public DataImportConfigId retrieveDataImportConfigIdForBank(@Nullable final BankId bankId)
{
if (bankId == null)
{
return retrieveDefaultBankDataImportConfigId();
}
final Bank bank = getById(bankId);
return CoalesceUtil.coalesceSuppliersNotNull(
bank::getDataImportConfigId,
this::r... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\banking\api\BankRepository.java | 1 |
请完成以下Java代码 | public final class SeqNo implements Comparable<SeqNo>
{
private static final ImmutableMap<Integer, SeqNo> cache = createCache(300);
private static final int STEP = 10;
private final int value;
private SeqNo(final int value)
{
this.value = value;
}
@SuppressWarnings("SameParameterValue")
private static Immut... | @JsonValue
public int toInt()
{
return value;
}
public SeqNo next()
{
return ofInt(value / STEP * STEP + STEP);
}
@Override
public int compareTo(@NonNull final SeqNo other)
{
return this.value - other.value;
}
public static boolean equals(@Nullable final SeqNo seqNo1, @Nullable final SeqNo seqNo2)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\lang\SeqNo.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ViewResolver viewResolver() {
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
bean.setViewClass(JstlView.class);
bean.setPrefix("/WEB-INF/view/");
bean.setSuffix(".jsp");
bean.setOrder(2);
return bean;
}
@Bean
public Bean... | @Bean
public View sample() {
return new JstlView("/WEB-INF/view/sample.jsp");
}
@Bean
public View sample2() {
return new JstlView("/WEB-INF/view2/sample2.jsp");
}
@Bean
public View sample3(){
return new JstlView("/WEB-INF/view3/sample3.jsp");
}
} | repos\tutorials-master\spring-web-modules\spring-mvc-basics-4\src\main\java\com\baeldung\config\WebConfig.java | 2 |
请完成以下Java代码 | public class FormView extends HorizontalLayout {
public FormView() {
addBeanValidationExample();
addCustomValidationExample();
}
private void addBeanValidationExample() {
var nameField = new TextField("Name");
var emailField = new TextField("Email");
var phoneField ... | .bind(Contact::getName, Contact::setName);
binder.forField(emailField)
.withValidator(email -> email.contains("@"), "Not a valid email address")
.bind(Contact::getEmail, Contact::setEmail);
binder.forField(phoneField)
.withValidator(phone -> phone.matches(... | repos\tutorials-master\vaadin\src\main\java\com\baeldung\introduction\FormView.java | 1 |
请完成以下Java代码 | public class JSONBoardCard implements JSONViewRowBase
{
public static JSONBoardCard of(final BoardCard card, final String adLanguage)
{
final JSONBoardCardBuilder jsonCard = JSONBoardCard.builder()
.cardId(card.getCardId())
.laneId(card.getLaneId())
//
.caption(card.getCaption().translate(adLanguage... | return jsonCard.build();
}
private final int cardId;
private final int laneId;
private final String caption;
private final String description;
private final JSONDocumentPath documentPath;
@Singular
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private ImmutableList<JSONBoardCardUser> users;
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\board\json\JSONBoardCard.java | 1 |
请完成以下Java代码 | public class BytePrimitiveLookup extends Lookup {
private byte[] elements;
private final byte pivot = 2;
@Setup
@Override
public void prepare() {
byte common = 1;
elements = new byte[s];
for (int i = 0; i < s - 1; i++) {
elements[i] = common;
}
e... | int index = 0;
while (pivot != elements[index]) {
index++;
}
return index;
}
@Override
public String getSimpleClassName() {
return BytePrimitiveLookup.class.getSimpleName();
}
} | repos\tutorials-master\core-java-modules\core-java-lang-2\src\main\java\com\baeldung\primitive\BytePrimitiveLookup.java | 1 |
请完成以下Java代码 | public Class<ExternalTaskClient> getObjectType() {
return ExternalTaskClient.class;
}
@Override
public boolean isSingleton() {
return true;
}
@Override
public void afterPropertiesSet() throws Exception {
}
public ClientConfiguration getClientConfiguration() {
return clientConfiguration;
... | protected void setPropertyConfigurer(PropertySourcesPlaceholderConfigurer configurer) {
PropertySources appliedPropertySources = configurer.getAppliedPropertySources();
propertyResolver = new PropertySourcesPropertyResolver(appliedPropertySources);
}
protected String resolve(String property) {
if (prop... | repos\camunda-bpm-platform-master\spring-boot-starter\starter-client\spring\src\main\java\org\camunda\bpm\client\spring\impl\client\ClientFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | PersonService personService(PersonRepository personRepository) {
return new PersonService(personRepository);
}
@Provides
PersonRepository personRepository(DataSource dataSource) {
return new PersonRepository(dataSource);
}
@Provides
DataSource dataSource() {
return new ... | @Override
public <T> T unwrap(Class<T> iface) throws SQLException {
return null;
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return false;
}
@Override
public Logger get... | repos\tutorials-master\libraries\src\main\java\com\baeldung\activej\config\PersonModule.java | 2 |
请完成以下Java代码 | public static <R> CompletableFuture<R> newFailedFuture(Throwable ex) {
CompletableFuture<R> future = new CompletableFuture<>();
future.completeExceptionally(ex);
return future;
}
public static <R> CompletableFuture<List<R>> sequenceFuture(List<CompletableFuture<R>> futures) {
re... | );
}
public static <T> T getValue(CompletableFuture<T> future) {
try {
return future.get(10, TimeUnit.SECONDS);
} catch (Exception ex) {
LOG.error("getValue for async result failed", ex);
}
return null;
}
public static boolean isSuccessFuture(Com... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\util\AsyncUtils.java | 1 |
请完成以下Java代码 | private void setInvoiceCandsInDispute(final List<QuarantineInOutLine> lines)
{
final IInvoiceCandBL invoiceCandBL = Services.get(IInvoiceCandBL.class);
lines.stream()
.map(QuarantineInOutLine::getInOutLine)
.forEach(invoiceCandBL::markInvoiceCandInDisputeForReceiptLine);
}
private LotNumberQuarantine g... | final List<I_M_ReceiptSchedule> rsForInOutLine = receiptScheduleDAO.retrieveRsForInOutLine(inOutLine);
for (final I_M_ReceiptSchedule resceiptSchedule : rsForInOutLine)
{
final boolean createDistributionOrder = X_M_ReceiptSchedule.ONMATERIALRECEIPTWITHDESTWAREHOUSE_CreateDistributionOrder
.equals(resceiptS... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inout\impl\DistributeAndMoveReceiptCreator.java | 1 |
请完成以下Java代码 | protected void validateUnknownServiceTaskType(Process process, ServiceTask serviceTask, List<ValidationError> errors) {
addError(errors, Problems.SERVICE_TASK_INVALID_TYPE, process, serviceTask, "Invalid or unsupported service task type");
}
protected void verifyResultVariableName(Process process, Serv... | if (operation.getId() != null && operation.getId().equals(serviceTask.getOperationRef())) {
operationFound = true;
break;
}
}
}
}
}
if (!operat... | repos\flowable-engine-main\modules\flowable-process-validation\src\main\java\org\flowable\validation\validator\impl\ServiceTaskValidator.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void customizeConnectionTimeout(NettyReactiveWebServerFactory factory, Duration connectionTimeout) {
factory.addServerCustomizers((httpServer) -> httpServer.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,
(int) connectionTimeout.toMillis()));
}
private void customizeRequestDecoder(NettyReactiveWebServerFa... | }
private void customizeIdleTimeout(NettyReactiveWebServerFactory factory, Duration idleTimeout) {
factory.addServerCustomizers((httpServer) -> httpServer.idleTimeout(idleTimeout));
}
private void customizeMaxKeepAliveRequests(NettyReactiveWebServerFactory factory, int maxKeepAliveRequests) {
factory.addServer... | repos\spring-boot-4.0.1\module\spring-boot-reactor-netty\src\main\java\org\springframework\boot\reactor\netty\autoconfigure\NettyReactiveWebServerFactoryCustomizer.java | 2 |
请完成以下Java代码 | public String getField1() {
return field1;
}
public void setField1(String field1) {
this.field1 = field1;
}
public String getField2() {
return field2;
}
public void setField2(String field2) {
this.field2 = field2;
}
public String getField3() {
... | }
public void setField3(String field3) {
this.field3 = field3;
}
@Override
public String toString() {
return "TestData{" +
"id=" + id +
", field1='" + field1 + '\'' +
", field2='" + field2 + '\'' +
", field3='" + field3 + ... | repos\SpringAll-master\68.spring-batch-itemreader\src\main\java\cc\mrbird\batch\entity\TestData.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof PoolConnectionEndpoint)) {
return false;
}
PoolConnectionEndpoint that = (PoolConnectionEndpoint) obj;
return super.equals(that)
&& this.getPool().equals(that.getPool());
}
/**
* @inherit... | @Override
public String toString() {
return String.format("ConnectionEndpoint [%1$s] from Pool [%2$s]",
super.toString(), getPool().map(Pool::getName).orElse(""));
}
}
@SuppressWarnings("unused")
protected static class SocketCreationException extends RuntimeException {
protected SocketCreationExceptio... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\config\annotation\ClusterAwareConfiguration.java | 2 |
请完成以下Java代码 | public void setCU_TU_PLU (final String CU_TU_PLU)
{
set_Value (COLUMNNAME_CU_TU_PLU, CU_TU_PLU);
}
@Override
public String getCU_TU_PLU()
{
return get_ValueAsString(COLUMNNAME_CU_TU_PLU);
}
@Override
public void setExternalSystem_Config_LeichMehl_ProductMapping_ID (final int ExternalSystem_Config_LeichMe... | set_Value (COLUMNNAME_LeichMehl_PluFile_ConfigGroup_ID, null);
else
set_Value (COLUMNNAME_LeichMehl_PluFile_ConfigGroup_ID, LeichMehl_PluFile_ConfigGroup_ID);
}
@Override
public int getLeichMehl_PluFile_ConfigGroup_ID()
{
return get_ValueAsInt(COLUMNNAME_LeichMehl_PluFile_ConfigGroup_ID);
}
@Override
... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Config_LeichMehl_ProductMapping.java | 1 |
请完成以下Java代码 | public class AnnouncementSendModel implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
private java.lang.String id;
/**通告id*/
private java.lang.String anntId;
/**用户id*/
private java.lang.String userId;
/**标题*/
private java.lang.String ti... | /**
* 发布开始日期
*/
private java.lang.String sendTimeBegin;
/**
* 发布结束日期
*/
private java.lang.String sendTimeEnd;
/**
* 附件
*/
private java.lang.String files;
/**
* 访问量
*/
private java.lang.Integer visitsNum;
/**
* 是否置顶(0否 1是)
*/
private java.lang.Integer izTop;
/**
* 通知类型(plan:日程计划 | flow:... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\AnnouncementSendModel.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void checkIfTheEffortCanBeBooked(@NonNull final ImportTimeBookingInfo importTimeBookingInfo, @NonNull final IssueEntity targetIssue)
{
if (!targetIssue.isProcessed() || targetIssue.getProcessedTimestamp() == null)
{
return;//nothing else to check ( issues that are not processed yet are used for booking ... | @NonNull final OrgId orgId,
@NonNull final ImportTimeBookingInfo importTimeBookingInfo,
@NonNull final String errorMsg)
{
final FailedTimeBooking failedTimeBooking = FailedTimeBooking.builder()
.orgId(orgId)
.externalId(importTimeBookingInfo.getExternalTimeBookingId().getId())
.externalSystem(im... | repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\timebooking\importer\TimeBookingsImporterService.java | 2 |
请完成以下Java代码 | public int getOrder() {
return this.order;
}
public void setOrder(int order) {
this.order = order;
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public boolean isForEnabled() {
return forEnabled;
}
public void setForEnabled(... | return prefixEnabled;
}
public void setPrefixEnabled(boolean prefixEnabled) {
this.prefixEnabled = prefixEnabled;
}
public boolean isForAppend() {
return forAppend;
}
public void setForAppend(boolean forAppend) {
this.forAppend = forAppend;
}
public boolean isHostAppend() {
return hostAppend;
}
p... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\filter\XForwardedRequestHeadersFilterProperties.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public BigInteger getCBPartnerLocationID() {
return cbPartnerLocationID;
}
/**
* Sets the value of the cbPartnerLocationID property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setCBPartnerLocationID(BigInteger value) ... | * @return
* possible object is
* {@link String }
*
*/
public String getGLN() {
return gln;
}
/**
* Sets the value of the gln property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGLN... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_metasfreshinhousev1\de\metas\edi\esb\jaxb\metasfreshinhousev1\EDICctop000VType.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class OrchestratorWorkersWorkflow {
private final OpsOrchestratorClient opsOrchestratorClient;
private final OpsClient opsClient;
public OrchestratorWorkersWorkflow(OpsOrchestratorClient opsOrchestratorClient, OpsClient opsClient) {
this.opsOrchestratorClient = opsOrchestratorClient;
... | // execute the chain steps for 1) deployment and 2) test execution
String testExecutionChainInput = prLink + " on " + orchestratorResponse[i];
for (String prompt : OpsClientPrompts.EXECUTE_TEST_ON_DEPLOYED_ENV_STEPS) {
// Compose the request for the next step
Stri... | repos\tutorials-master\spring-ai-modules\spring-ai-agentic-patterns\src\main\java\com\baeldung\springai\agenticpatterns\workflows\orchestrator\OrchestratorWorkersWorkflow.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public boolean isWithoutProcessDefinitionId() {
return withoutProcessDefinitionId;
}
public String getSubScopeId() {
return subScopeId;
}
public String getScopeId() {
return scopeId;
}
public boolean isWithoutScopeId() {
return withoutScopeId;
}
pu... | public String getTenantId() {
return tenantId;
}
public Collection<String> getTenantIds() {
return tenantIds;
}
public boolean isWithoutTenantId() {
return withoutTenantId;
}
public String getConfiguration() {
return configuration;
}
public Collection<... | repos\flowable-engine-main\modules\flowable-eventsubscription-service\src\main\java\org\flowable\eventsubscription\service\impl\EventSubscriptionQueryImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private Set<EndpointExposureOutcomeContributor> getExposureOutcomeContributors(ConditionContext context) {
Environment environment = context.getEnvironment();
Set<EndpointExposureOutcomeContributor> contributors = exposureOutcomeContributorsCache.get(environment);
if (contributors == null) {
contributors = new... | this.exposure = exposure;
String name = exposure.name().toLowerCase(Locale.ROOT).replace('_', '-');
this.property = "management.endpoints." + name + ".exposure";
this.filter = new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, environment, this.property,
exposure.getDefaultIncludes());
}
@O... | repos\spring-boot-4.0.1\module\spring-boot-actuator-autoconfigure\src\main\java\org\springframework\boot\actuate\autoconfigure\endpoint\condition\OnAvailableEndpointCondition.java | 2 |
请完成以下Java代码 | protected void fireEntityInsertedEvent(Entity entity) {
FlowableEventDispatcher eventDispatcher = getEventDispatcher();
if (eventDispatcher != null && eventDispatcher.isEnabled()) {
eventDispatcher.dispatchEvent(createEntityEvent(FlowableEngineEventType.ENTITY_CREATED, entity), engineType);
... | @Override
public void delete(EntityImpl entity, boolean fireDeleteEvent) {
getDataManager().delete(entity);
FlowableEventDispatcher eventDispatcher = getEventDispatcher();
if (fireDeleteEvent && eventDispatcher != null && eventDispatcher.isEnabled()) {
fireEntityDeletedEvent(ent... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\persistence\entity\AbstractEntityManager.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BigIntegerType implements VariableType {
public static final String TYPE_NAME = "biginteger";
@Override
public String getTypeName() {
return TYPE_NAME;
}
@Override
public boolean isCachable() {
return true;
}
@Override
public Object getValue(ValueFiel... | @Override
public void setValue(Object value, ValueFields valueFields) {
if (value != null) {
valueFields.setTextValue(value.toString());
} else {
valueFields.setTextValue(null);
}
}
@Override
public boolean isAbleToStore(Object value) {
if (value ... | repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\impl\types\BigIntegerType.java | 2 |
请完成以下Java代码 | private Optional<String> extractAsString(final ScannedCode scannedCode)
{
int startIndex = startPosition - 1;
int endIndex = endPosition - 1 + 1;
if (endIndex > scannedCode.length())
{
return Optional.empty();
}
return Optional.of(scannedCode.substring(startIndex, endIndex));
}
private BigDecimal t... | private LocalDate toLocalDate(final String valueStr)
{
final PatternedDateTimeFormatter dateFormat = coalesceNotNull(this.dateFormat, DEFAULT_DATE_FORMAT);
return dateFormat.parseLocalDate(valueStr);
}
private static String trimLeadingZeros(final String valueStr)
{
int index = 0;
while (index < valueStr.le... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\scannable_code\format\ScannableCodeFormatPart.java | 1 |
请完成以下Java代码 | public Builder setCustomAttribute(final String attributeName, final Object value)
{
setAttribute(attributeName, value);
return this;
}
}
}
public interface SourceDocument
{
String NAME = "__SourceDocument";
default int getWindowNo()
{
return Env.WINDOW_None;
}
boolean hasFieldValue(St... | {
@NonNull
private final PO po;
@Override
public boolean hasFieldValue(final String fieldName)
{
return po.get_ColumnIndex(fieldName) >= 0;
}
@Override
public Object getFieldValue(final String fieldName)
{
return po.get_Value(fieldName);
}
}
@AllArgsConstructor
private static final class... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\letters\model\MADBoilerPlate.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ConsumerFactory<Integer, String> consumerFactory() {
return new DefaultKafkaConsumerFactory<>(consumerProps());
}
private Map<String, Object> consumerProps() {
Map<String, Object> props = new HashMap<>();
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
... | }
@Bean
public ProducerFactory<Integer, String> producerFactory() {
return new DefaultKafkaProducerFactory<>(senderProps());
}
private Map<String, Object> senderProps() {
Map<String, Object> props = new HashMap<>();
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:... | repos\spring-kafka-main\spring-kafka-docs\src\main\java\org\springframework\kafka\jdocs\started\noboot\Config.java | 2 |
请完成以下Java代码 | public class DmnDecisionImpl implements DmnDecision {
protected String key;
protected String name;
protected DmnDecisionLogic decisionLogic;
protected Collection<DmnDecision> requiredDecision = new ArrayList<DmnDecision>();
public String getKey() {
return key;
}
public void setKey(String key) {
... | public DmnDecisionLogic getDecisionLogic() {
return decisionLogic;
}
public void setRequiredDecision(List<DmnDecision> requiredDecision) {
this.requiredDecision = requiredDecision;
}
@Override
public Collection<DmnDecision> getRequiredDecisions() {
return requiredDecision;
}
@Override
pub... | repos\camunda-bpm-platform-master\engine-dmn\engine\src\main\java\org\camunda\bpm\dmn\engine\impl\DmnDecisionImpl.java | 1 |
请完成以下Java代码 | private List<MonitorInfo> lockedMonitorsForDepth(MonitorInfo[] lockedMonitors, int depth) {
return Stream.of(lockedMonitors).filter((candidate) -> candidate.getLockedStackDepth() == depth).toList();
}
private void writeStackTraceElement(PrintWriter writer, StackTraceElement element, ThreadInfo info,
List<Monito... | private String format(LockInfo lockInfo) {
return String.format("<%x> (a %s)", lockInfo.getIdentityHashCode(), lockInfo.getClassName());
}
private void writeMonitors(PrintWriter writer, List<MonitorInfo> lockedMonitorsAtCurrentDepth) {
for (MonitorInfo lockedMonitor : lockedMonitorsAtCurrentDepth) {
writer.pr... | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\management\PlainTextThreadDumpFormatter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public File fileDown(Date billDate, String dir) throws IOException {
// 时间格式转换
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
bill_date = sdf.format(billDate);
HttpResponse response = null;
try {
// 生成xml文件
String xml = this.generateXml();
LOG.info(xml);
response = HttpClientUtil.httpsR... | /**
* 根据微信接口要求,生成xml文件
*
* @param appId
* 必填
* @param mchId
* 必填
* @param billDate
* 必填, 下载对账单的日期(最小单位天)
* @param billType
* 下载单类型
* @param appSecret
* 必填, 供签名使用
* @return
*/
public String generateXml() {
HashMap<String, String> para... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\fileDown\impl\WinXinFileDown.java | 2 |
请完成以下Java代码 | public String getUserEmailAttribute() {
return userEmailAttribute;
}
public void setUserEmailAttribute(String userEmailAttribute) {
this.userEmailAttribute = userEmailAttribute;
}
public String getUserPasswordAttribute() {
return userPasswordAttribute;
}
public void setUserPasswordAttribute(S... | public String getGroupTypeAttribute() {
return groupTypeAttribute;
}
public void setGroupTypeAttribute(String groupTypeAttribute) {
this.groupTypeAttribute = groupTypeAttribute;
}
public boolean isAllowAnonymousLogin() {
return allowAnonymousLogin;
}
public void setAllowAnonymousLogin(boolean... | repos\camunda-bpm-platform-master\engine-plugins\identity-ldap\src\main\java\org\camunda\bpm\identity\impl\ldap\LdapConfiguration.java | 1 |
请完成以下Java代码 | public class RuntimeContainerJobExecutor extends JobExecutor {
protected void startExecutingJobs() {
final RuntimeContainerDelegate runtimeContainerDelegate = getRuntimeContainerDelegate();
// schedule job acquisition
if(!runtimeContainerDelegate.getExecutorService().schedule(acquireJobsRunnable, true)... | ((JmxManagedThreadPool) executorService).getActiveCount());
}
}
protected RuntimeContainerDelegate getRuntimeContainerDelegate() {
return RuntimeContainerDelegate.INSTANCE.get();
}
@Override
public Runnable getExecuteJobsRunnable(List<String> jobIds, ProcessEngineImpl processEngine) {
final Runt... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\RuntimeContainerJobExecutor.java | 1 |
请完成以下Java代码 | public TranslatableStringBuilder appendDateTime(@NonNull final ZonedDateTime value)
{
return append(DateTimeTranslatableString.ofDateTime(value));
}
public TranslatableStringBuilder appendTimeZone(
@NonNull final ZoneId zoneId,
@NonNull final TextStyle textStyle)
{
return append(TimeZoneTranslatableStrin... | }
public TranslatableStringBuilder insertFirstADMessage(
final AdMessageKey adMessage,
final Object... msgParameters)
{
final ITranslatableString value = msgBL.getTranslatableMsgText(adMessage, msgParameters);
return insertFirst(value);
}
@Deprecated
public TranslatableStringBuilder insertFirstADMessag... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\TranslatableStringBuilder.java | 1 |
请完成以下Java代码 | public CaseInstanceBuilder setVariables(Map<String, Object> variables) {
if (variables != null) {
if (this.variables == null) {
this.variables = Variables.fromMap(variables);
}
else {
this.variables.putAll(variables);
}
}
return this;
}
public CaseInstance create... | return caseDefinitionKey;
}
public String getCaseDefinitionId() {
return caseDefinitionId;
}
public String getBusinessKey() {
return businessKey;
}
public VariableMap getVariables() {
return variables;
}
public String getCaseDefinitionTenantId() {
return caseDefinitionTenantId;
}
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\CaseInstanceBuilderImpl.java | 1 |
请完成以下Java代码 | public void onC_DocType_ID(final I_GL_Journal glJournal)
{
final IDocumentNoInfo documentNoInfo = Services.get(IDocumentNoBuilderFactory.class)
.createPreliminaryDocumentNoBuilder()
.setNewDocType(getDocType(glJournal).orElse(null))
.setOldDocumentNo(glJournal.getDocumentNo())
.setDocumentModel(glJou... | final ClientId adClientId = ClientId.ofRepoId(glJournal.getAD_Client_ID());
final OrgId adOrgId = OrgId.ofRepoId(glJournal.getAD_Org_ID());
final AcctSchemaId acctSchemaId = AcctSchemaId.ofRepoId(glJournal.getC_AcctSchema_ID());
final AcctSchema acctSchema = Services.get(IAcctSchemaDAO.class).getById(acctSchemaId... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\callout\GL_Journal.java | 1 |
请完成以下Java代码 | protected void applySortBy(HistoricExternalTaskLogQuery query, String sortBy, Map<String, Object> parameters, ProcessEngine engine) {
if (sortBy.equals(SORT_BY_TIMESTAMP)) {
query.orderByTimestamp();
} else if (sortBy.equals(SORT_BY_EXTERNAL_TASK_ID)) {
query.orderByExternalTaskId();
} else if (... | }else if (sortBy.equals(SORT_BY_ACTIVITY_INSTANCE_ID)) {
query.orderByActivityInstanceId();
} else if (sortBy.equals(SORT_BY_EXECUTION_ID)) {
query.orderByExecutionId();
} else if (sortBy.equals(SORT_BY_PROCESS_INSTANCE_ID)) {
query.orderByProcessInstanceId();
} else if (sortBy.equals(SORT... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\HistoricExternalTaskLogQueryDto.java | 1 |
请完成以下Java代码 | public int getHR_ListVersion_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_HR_ListVersion_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Max Value.
@param MaxValue Max Value */
public void setMaxValue (BigDecimal MaxValue)
{
set_Value (COLUMNNAME_MaxValue, MaxValue);
}
/**... | @param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_HR_ListLine.java | 1 |
请完成以下Java代码 | default Optional<ClassLoader> getClassLoader() {
return Optional.ofNullable(ClassUtils.getDefaultClassLoader());
}
/**
* Tries to resolve a {@link Resource} handle from the given, {@literal non-null} {@link String location}
* (e.g. {@link String filesystem path}).
*
* @param location {@link String location... | * @param location {@link String location} identifying the {@link Resource} to resolve;
* must not be {@literal null}.
* @return a {@literal non-null}, {@literal existing} {@link Resource} handle for
* the resolved {@link String location}.
* @throws ResourceNotFoundException if a {@link Resource} cannot be resol... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\core\io\ResourceResolver.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DefaultDmnEngineConfiguration build() {
List<DmnDecisionEvaluationListener> decisionEvaluationListeners = createCustomPostDecisionEvaluationListeners();
dmnEngineConfiguration.setCustomPostDecisionEvaluationListeners(decisionEvaluationListeners);
// override the decision table handler
DmnTransf... | protected List<DmnDecisionEvaluationListener> createCustomPostDecisionEvaluationListeners() {
ensureNotNull("dmnHistoryEventProducer", dmnHistoryEventProducer);
// note that the history level may be null - see CAM-5165
HistoryDecisionEvaluationListener historyDecisionEvaluationListener = new HistoryDecisio... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\dmn\configuration\DmnEngineConfigurationBuilder.java | 2 |
请完成以下Java代码 | public void execute(final ActivityExecution execution) throws Exception {
ensureConnectorInitialized();
executeWithErrorPropagation(execution, new Callable<Void>() {
@Override
public Void call() throws Exception {
ConnectorRequest<?> request = connectorInstance.createRequest();
appl... | // map variables to parent scope.
ioMapping.executeOutputParameters(connectorOutputVariableScope);
}
}
protected void ensureConnectorInitialized() {
if(connectorInstance == null) {
synchronized (this) {
if(connectorInstance == null) {
connectorInstance = Connectors.getConnecto... | repos\camunda-bpm-platform-master\engine-plugins\connect-plugin\src\main\java\org\camunda\connect\plugin\impl\ServiceTaskConnectorActivityBehavior.java | 1 |
请完成以下Java代码 | public static ProductType ofNullableCode(@Nullable final String code)
{
return code != null ? ofCode(code) : null;
}
public static ProductType ofCode(@NonNull final String code)
{
ProductType type = typesByCode.get(code);
if (type == null)
{
throw new AdempiereException("No " + ProductType.class + " fou... | public boolean isItem()
{
return this == Item;
}
/** @return {@code true} <b>for every</b> non-item, not just {@link #Service}. */
public boolean isService()
{
return this != Item;
}
public boolean isFreightCost()
{
return this == FreightCost;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\product\ProductType.java | 1 |
请完成以下Java代码 | public void parseTransaction(Element transactionElement, ScopeImpl scope, ActivityImpl activity) {
parseActivity(transactionElement, activity);
}
protected boolean isAsync(ActivityImpl activity) {
return activity.isAsyncBefore() || activity.isAsyncAfter();
}
protected void parseActivity(Element elemen... | failedJobRetryTimeCycleElement = extensionElements.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, FAILED_JOB_RETRY_TIME_CYCLE);
}
if (failedJobRetryTimeCycleElement != null) {
failedJobRetryTimeCycleConfiguration = failedJobRetryTimeCycleElement.getText();
}
}
if (failedJobRetryTime... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\parser\DefaultFailedJobParseListener.java | 1 |
请完成以下Java代码 | public void onItemError(final Throwable e, final Object item)
{
Loggables.withLogger(logger, Level.DEBUG).addLog("Error while trying to process item={}; exception={}", item, e);
}
@Override
public void onCompleteChunkError(final Throwable e)
{
Loggables.withLogger(logger, Level.DEBUG).addLog("Error while comp... | // error was already logged by onCompleteChunkError
}
@Override
public void onCommitChunkError(final Throwable e)
{
Loggables.withLogger(logger, Level.DEBUG).addLog("Processor failed to commit current chunk => rollback transaction; exception={}", e);
}
@Override
public void onCancelChunkError(final Throwable... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\processor\api\LoggableTrxItemExceptionHandler.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.