instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
/* package */class HUTrxQuery implements IHUTrxQuery { private int M_HU_Trx_Hdr_ID = -1; private int Exclude_M_HU_Trx_Line_ID = -1; private int Parent_M_HU_Trx_Line_ID = -1; private int Ref_HU_Item_ID = -1; private int AD_Table_ID = -1; private int Record_ID = -1; private int M_HU_ID = -1; @Override public St...
return Ref_HU_Item_ID; } @Override public int getAD_Table_ID() { return AD_Table_ID; } @Override public void setAD_Table_ID(final int aD_Table_ID) { AD_Table_ID = aD_Table_ID; } @Override public int getRecord_ID() { return Record_ID; } @Override public void setRecord_ID(final int record_ID) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\hutransaction\impl\HUTrxQuery.java
1
请完成以下Java代码
public MRPQueryBuilder setPP_Plant_ID(final Integer ppPlantId) { this._ppPlantId = ppPlantId; return this; } private Set<Integer> getPP_Plant_IDs_ToUse() { int ppPlantId = -1; if (_ppPlantId != null) { ppPlantId = _ppPlantId; } if (ppPlantId <= 0) { return Collections.emptySet(); } fina...
public MRPQueryBuilder setOnlyActiveRecords(final boolean onlyActiveRecords) { this._onlyActiveRecords = onlyActiveRecords; return this; } @Override public MRPQueryBuilder setOrderType(final String orderType) { this._orderTypes.clear(); if (orderType != null) { this._orderTypes.add(orderType); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\mrp\api\impl\MRPQueryBuilder.java
1
请在Spring Boot框架中完成以下Java代码
public class LoginController { @Autowired private SystemProperties properties; @PostMapping("/login") public Response login( @NotBlank(message = "{required}") String username, @NotBlank(message = "{required}") String password, HttpServletRequest request) throws Exception { ...
* 2. user * * @param token token * @param user 用户信息 * @return UserInfo */ private Map<String, Object> generateUserInfo(String token, User user) { String username = user.getUsername(); Map<String, Object> userInfo = new HashMap<>(); userInfo.put("token", token); ...
repos\SpringAll-master\62.Spring-Boot-Shiro-JWT\src\main\java\com\example\demo\controller\LoginController.java
2
请完成以下Java代码
public int getC_Cycle_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Cycle_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Description. @param Description Optional short description of the record */ public void setDescription (String Description) { set_Value (COLUMNNAME_D...
{ 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 KeyNamePair getKeyNamePair() { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Cycle.java
1
请完成以下Java代码
public String getRootCauseIncidentActivityId() { return rootCauseIncidentActivityId; } public void setRootCauseIncidentActivityId(String rootCauseIncidentActivityId) { this.rootCauseIncidentActivityId = rootCauseIncidentActivityId; } public String getRootCauseIncidentFailedActivityId() { return ro...
public String getRootCauseIncidentConfiguration() { return rootCauseIncidentConfiguration; } public void setRootCauseIncidentConfiguration(String rootCauseIncidentConfiguration) { this.rootCauseIncidentConfiguration = rootCauseIncidentConfiguration; } public String getRootCauseIncidentMessage() { ...
repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\cockpit\impl\plugin\base\dto\IncidentDto.java
1
请完成以下Java代码
protected String buildUrl() { return String.format("%s/bot%s/sendmessage?chat_id={chat_id}&text={text}&parse_mode={parse_mode}" + "&disable_notification={disable_notification}", this.apiUrl, this.authToken); } private Map<String, Object> createMessage(InstanceEvent event, Instance instance) { Map<String, Obj...
} public void setChatId(@Nullable String chatId) { this.chatId = chatId; } @Nullable public String getAuthToken() { return authToken; } public void setAuthToken(@Nullable String authToken) { this.authToken = authToken; } public boolean isDisableNotify() { return disableNotify; } public void setDi...
repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\notify\TelegramNotifier.java
1
请完成以下Java代码
public Integer getFinishOrderCount() { return finishOrderCount; } public void setFinishOrderCount(Integer finishOrderCount) { this.finishOrderCount = finishOrderCount; } public BigDecimal getFinishOrderAmount() { return finishOrderAmount; } public void setFinishOrderAm...
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", name=").append(name); sb.append(", finishO...
repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\UmsMemberTag.java
1
请完成以下Java代码
public boolean isEligibleForAutoCarrierAdvise(@NonNull final I_M_ShipmentSchedule shipmentSchedule) { final EligibleCarrierAdviseRequest request = EligibleCarrierAdviseRequest.of(shipmentSchedule, shipmentScheduleEffectiveBL); return isEligibleForCarrierAdvise(request.toBuilder().isAuto(true).build()); } public...
if (carrierAdviseStatus != null && !carrierAdviseStatus.isEligibleForAutoEnqueue()) {return false;} } else { // Manual if (carrierAdviseStatus == null || !carrierAdviseStatus.isEligibleForManualEnqueue()) {return false;} if (!request.isIncludeCarrierAdviseManual && carrierAdviseStatus.isManual()) {return fa...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\ShipmentScheduleService.java
1
请完成以下Spring Boot application配置
nacos: # Nacos 配置中心的配置项,对应 NacosConfigProperties 配置类 config: server-addr: 127.0.0.1:18848 # Nacos 服务器地址 bootstrap: enable: true # 是否开启 Nacos 配置预加载功能。默认为 false。 log-enable: true # 是否开启 Nacos 支持日志级别的加载时机。默认为 false。 data-id: example # 使用的 Nacos 配置集的 dataId。 type: YAML # 使用的 Na
cos 配置集的配置格式。默认为 PROPERTIES。 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP。 namespace: # 使用的 Nacos 的命名空间,默认为 null。
repos\SpringBoot-Labs-master\lab-44\lab-44-nacos-config-demo\src\main\resources\application.yaml
2
请完成以下Java代码
protected Collection<T> getElements() { return ModelUtil.getModelElementCollection(getDomElement().getChildElements(), getModelInstance()); } public int size() { return getElements().size(); } public boolean isEmpty() { return getElements().isEmpty(); } pub...
} } return true; } public boolean addAll(Collection<? extends T> c) { for (T element : c) { add(element); } return true; } public boolean removeAll(Collection<?> c) { boolean result = false; for (Object o : c) { result...
repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\camunda\CamundaListImpl.java
1
请完成以下Java代码
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) { TypeDescriptor sourceElementType = sourceType.getElementTypeDescriptor(); if (targetType == null || sourceElementType == null) { return true; } return this.conversionService.canConvert(sourceElementType, targetType) || sourceE...
if (source.isEmpty()) { return ""; } return source.stream() .map((element) -> convertElement(element, sourceType, targetType)) .collect(Collectors.joining(getDelimiter(sourceType))); } private CharSequence getDelimiter(TypeDescriptor sourceType) { Delimiter annotation = sourceType.getAnnotation(Delimi...
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\convert\CollectionToDelimitedStringConverter.java
1
请完成以下Java代码
public class CaseParameterImpl extends ParameterImpl implements CaseParameter { protected static AttributeReference<CaseFileItem> bindingRefAttribute; protected static ChildElement<BindingRefinementExpression> bindingRefinementChild; public CaseParameterImpl(ModelTypeInstanceContext instanceContext) { super...
public static void registerType(ModelBuilder modelBuilder) { ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseParameter.class, CMMN_ELEMENT_CASE_PARAMETER) .namespaceUri(CMMN11_NS) .extendsType(Parameter.class) .instanceProvider(new ModelTypeInstanceProvider<CaseParameter>()...
repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\CaseParameterImpl.java
1
请在Spring Boot框架中完成以下Java代码
public void setMessageReceivedAt(XMLGregorianCalendar value) { this.messageReceivedAt = value; } /** * Contains details about the digital signature, which may be applied to an ERPEL message. Deprecated. * * @return * possible object is * {@link SignatureVerificationTyp...
* allowed object is * {@link String } * */ public void setID(String value) { this.id = value; } /** * This segment contains references related to the message. * * @return * possible object is * {@link String } * */ pub...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\messaging\header\ErpelBusinessDocumentHeaderType.java
2
请完成以下Java代码
protected boolean isHistoricDetailVariableInstanceUpdateEntity(HistoricVariableUpdate variableUpdate) { return variableUpdate instanceof HistoricDetailVariableInstanceUpdateEntity; } protected List<String> getByteArrayIds(List<HistoricVariableUpdate> variableUpdates) { List<String> byteArrayIds = new Array...
for (HistoricVariableUpdate variableUpdate : variableUpdates) { if (isHistoricDetailVariableInstanceUpdateEntity(variableUpdate)) { HistoricDetailVariableInstanceUpdateEntity entity = (HistoricDetailVariableInstanceUpdateEntity) variableUpdate; if (shouldFetchValue(entity)) { try { ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\optimize\OptimizeHistoricVariableUpdateQueryCmd.java
1
请完成以下Java代码
public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } public void setProperty(String property) { this.property = property; } public void setOrgValue(String orgValue) { this.orgValue = orgValue; } public void setNewValue(String newValue) { this.newValue = newValue; } ...
public void setRootProcessInstanceId(String rootProcessInstanceId) { this.rootProcessInstanceId = rootProcessInstanceId; } public String getExternalTaskId() { return externalTaskId; } public void setExternalTaskId(String externalTaskId) { this.externalTaskId = externalTaskId; } public String ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\UserOperationLogEntryEventEntity.java
1
请完成以下Spring Boot application配置
spring.datasource.url=jdbc:mysql://localhost:3306/numberdb?createDatabaseIfNotExist=true spring.datasource.username=root spring.datasource.password=root spring.datasource.initialization-mode=always spring.datasource.platform=mysql spring.datasource.hikari.connectionTimeout=50000 spring.datasource.hikari.idleTimeout=30...
be added as spring.datasource.hikari.* spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect logging.level.com.zaxxer.hikari.HikariConfig=DEBUG logging.level.com.zaxxer.hikari=TRACE spring.jpa.open-in-view=false spring.jpa.hibernate.ddl-auto=create
repos\Hibernate-SpringBoot-master\HibernateSpringBootHikariCPPropertiesKickoff\src\main\resources\application.properties
2
请完成以下Java代码
public void setSalt(String salt) { this.salt = salt; } public Date getCreated() { return created; } public void setCreated(Date created) { this.created = created; } public Date getUpdated() { return updated; } public void setUpdated(Date updated) { this.updated = updated; } public Set<String> g...
return roles; } public void setRoles(Set<String> roles) { this.roles = roles; } public Set<String> getPerms() { return perms; } public void setPerms(Set<String> perms) { this.perms = perms; } }
repos\spring-boot-quick-master\quick-spring-shiro\src\main\java\com\shiro\entity\User.java
1
请完成以下Java代码
public class PayPalErrorResponse { @JsonProperty("name") String errorCode; @JsonProperty("details") List<Detail> details; @JsonProperty("message") String message; @JsonProperty("debug_id") String debug_id; @JsonProperty("links") List<Link> links; public static final String ERROR_CODE_UKNOWN = "METASFRES...
return ERROR_CODE_RESOURCE_NOT_FOUND.equals(getErrorCode()); } @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) @Data private static class Detail { String issue; String description; } @JsonAutoDet...
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.paypal\src\main\java\de\metas\payment\paypal\client\PayPalErrorResponse.java
1
请完成以下Java代码
protected Map<String, byte[]> findResources(final ClassLoader processApplicationClassloader, String paResourceRoot, String[] additionalResourceSuffixes) { return ProcessApplicationScanningUtil.findResources(processApplicationClassloader, paResourceRoot, metaFileUrl, additionalResourceSuffixes); } @Override p...
String processEngineName = processArchive.getProcessEngineName(); if (processEngineName != null) { ProcessEngine processEngine = serviceContainer.getServiceValue(ServiceTypes.PROCESS_ENGINE, processEngineName); ensureNotNull("Cannot deploy process archive '" + processArchive.getName() + "' to process en...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\container\impl\deployment\DeployProcessArchiveStep.java
1
请完成以下Java代码
public boolean isEligibleForPicking() {return getQtyInTransit().isLessThan(qtyToMove);} private Quantity getQtyInTransit() { return steps.stream() .map(DistributionJobStep::getQtyInTransit) .reduce(Quantity::add) .orElseGet(qtyToMove::toZero); } public boolean isFullyMoved() { return !steps.isEmp...
changedSteps.add(stepToAdd); changed = true; } return changed ? toBuilder().steps(ImmutableList.copyOf(changedSteps)).build() : this; } public DistributionJobLine withChangedSteps(@NonNull final UnaryOperator<DistributionJobStep> stepMapper) { final ImmutableList<DistributionJobStep> changedSteps ...
repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\job\model\DistributionJobLine.java
1
请完成以下Java代码
public static void registerMapper(String mapperPath, RuntimeHints hints, ClassLoader classLoader) { ResourceHints resourceHints = hints.resources(); ClassPathResource mapperResource = new ClassPathResource(mapperPath); resourceHints.registerResource(mapperResource); ReflectionHints refl...
} String resultType = statement.getStringAttribute("resultType"); if (resultType != null) { if (resultType.equals("long")) { reflectionHints.registerType(long.class, memberCategories); reflectionHints.registerType(Long....
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\aot\FlowableMyBatisResourceHintsRegistrar.java
1
请完成以下Java代码
public void setHeightInCm (final int HeightInCm) { set_Value (COLUMNNAME_HeightInCm, HeightInCm); } @Override public int getHeightInCm() { return get_ValueAsInt(COLUMNNAME_HeightInCm); } @Override public void setLengthInCm (final int LengthInCm) { set_Value (COLUMNNAME_LengthInCm, LengthInCm); } @O...
{ return (byte[])get_Value(COLUMNNAME_PdfLabelData); } @Override public void setTrackingURL (final @Nullable java.lang.String TrackingURL) { set_Value (COLUMNNAME_TrackingURL, TrackingURL); } @Override public java.lang.String getTrackingURL() { return get_ValueAsString(COLUMNNAME_TrackingURL); } @Ov...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_Carrier_ShipmentOrder_Parcel.java
1
请完成以下Java代码
public Response index() { return Response.status(200).header("Access-Control-Allow-Origin", "*") .header("Access-Control-Allow-Headers", "origin, content-type, accept, authorization") .header("Access-Control-Allow-Credentials", "true") .header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIO...
.entity("Movie is not in the database.\nUnable to Update").build(); } inventory.put(movie.getImdbId(), movie); return Response.status(Response.Status.OK).build(); } @DELETE @Path("/deletemovie") public Response deleteMovie(@QueryParam("imdbId") String imdbId) { System.out.println("*** Calling deleteMovi...
repos\tutorials-master\web-modules\resteasy\src\main\java\com\baeldung\server\MovieCrudService.java
1
请完成以下Java代码
public void setType (String obscureType) { if (obscureType == null || obscureType.equals("904") || obscureType.equals("944") || obscureType.equals("A44") || obscureType.equals("A04")) { m_type = obscureType; m_obscuredValue = null; return; } throw new IllegalArgumentException ("ObscureType Invalid val...
public String getObscuredValue () { if (m_obscuredValue != null) return m_obscuredValue; if (m_clearValue == null || m_clearValue.length() == 0) return m_clearValue; // boolean alpha = m_type.charAt(0) == 'A'; int clearStart = Integer.parseInt(m_type.substring(1,2)); int clearEnd = Integer.parseInt(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\Obscure.java
1
请完成以下Java代码
private static class RoutingDurationsAndYield { private Percent yield = Percent.ONE_HUNDRED; private Duration queuingTime = Duration.ZERO; private Duration setupTime = Duration.ZERO; private Duration durationPerOneUnit = Duration.ZERO; private Duration waitingTime = Duration.ZERO; private Duration movingTi...
@lombok.Value(staticConstructor = "of") private static class RoutingActivitySegmentCost { public static Collector<RoutingActivitySegmentCost, ?, Map<CostElementId, BigDecimal>> groupByCostElementId() { return Collectors.groupingBy(RoutingActivitySegmentCost::getCostElementId, sumCostsAsBigDecimal()); } pr...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\process\RollupWorkflow.java
1
请完成以下Java代码
public I_M_HU_PI retrievePIDefaultForPicking() { return handlingUnitsRepo.retrievePIDefaultForPicking(); } @Override public boolean isTUIncludedInLU(@NonNull final I_M_HU tu, @NonNull final I_M_HU expectedLU) { final I_M_HU actualLU = getLoadingUnitHU(tu); return actualLU != null && actualLU.getM_HU_ID() ==...
return Optionals.firstPresentOfSuppliers( () -> getHUIdByValue(scannedCode.getAsString()), () -> getByExternalBarcode(scannedCode) ); } private Optional<HuId> getHUIdByValue(final String value) { final HuId huId = HuId.ofHUValueOrNull(value); return huId != null && existsById(huId) ? Optional.of(huId)...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\HandlingUnitsBL.java
1
请完成以下Java代码
public static WebuiASIEditingInfo readonlyASI(final AttributeSetInstanceId attributeSetInstanceId) { final ASIEditingInfo info = ASIEditingInfo.builder() .type(WindowType.StrictASIAttributes) .soTrx(SOTrx.SALES) .attributeSetInstanceId(attributeSetInstanceId) .build(); return builder(info).build()...
DocumentPath contextDocumentPath; @NonNull AttributeSetId attributeSetId; String attributeSetName; String attributeSetDescription; @NonNull AttributeSetInstanceId attributeSetInstanceId; ProductId productId; @NonNull SOTrx soTrx; String callerTableName; int callerAdColumnId; @NonNull @Singular Immutabl...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pattribute\WebuiASIEditingInfo.java
1
请完成以下Java代码
public int getAD_ReportView_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_AD_ReportView_ID); if (ii == null) return 0; return ii.intValue(); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get...
return (String)get_Value(COLUMNNAME_FunctionColumn); } /** Set SQL Group Function. @param IsGroupFunction This function will generate a Group By Clause */ public void setIsGroupFunction (boolean IsGroupFunction) { set_Value (COLUMNNAME_IsGroupFunction, Boolean.valueOf(IsGroupFunction)); } /** Get SQL ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_ReportView_Col.java
1
请完成以下Java代码
public VatCodeId getIdByCodeAndOrgId( @NonNull final String code, @NonNull final OrgId orgId) { return queryBL.createQueryBuilder(I_C_VAT_Code.class) .addOnlyActiveRecordsFilter() .addEqualsFilter(I_C_VAT_Code.COLUMNNAME_VATCode, code) .addInArrayFilter(I_C_VAT_Code.COLUMNNAME_AD_Org_ID, orgId, Org...
// Match Date if (!TimeUtil.isBetween(request.getDate(), matching.getValidFrom(), matching.getValidTo())) { logger.debug("=> not matching (Date)"); return false; } logger.debug("=> matching"); return true; } /** * Retries all active {@link I_C_VAT_Code}s for given C_AcctSchema_ID. * * @param a...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\vatcode\impl\VATCodeDAO.java
1
请在Spring Boot框架中完成以下Java代码
public class LocationUpdateReq extends AbsReq { /** 收货地址ID */ private String locationId; /** 详细地址 */ private String location; /** 收货人姓名 */ private String name; /** 收货人手机号 */ private String phone; /** 邮编 */ private String postCode; public String getLocationId() { ...
return phone; } public void setPhone(String phone) { this.phone = phone; } public String getPostCode() { return postCode; } public void setPostCode(String postCode) { this.postCode = postCode; } @Override public String toString() { return "Location...
repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Common-Service-Facade\src\main\java\com\gaoxi\req\user\LocationUpdateReq.java
2
请完成以下Java代码
public final I_M_HU_PI getTU_HU_PI() { return _tuPI; } @Override public IHandlingUnitsInfo add(final IHandlingUnitsInfo infoToAdd) { if (infoToAdd == null) { return this; } // // TU PI final I_M_HU_PI tuPI = getTU_HU_PI(); // TODO make sure tuPIs are compatible // // Qty TU final int qt...
final int qtyTU_New = qtyTU + qtyTU_ToAdd; final boolean isReadWrite = false; final HUHandlingUnitsInfo infoNew = new HUHandlingUnitsInfo(tuPI, qtyTU_New, isReadWrite); return infoNew; } protected void setQtyTUInner(final int qtyTU) { Check.errorIf(!_isQtyWritable, "This instance {} is read-only", this); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\materialtracking\spi\impl\HUHandlingUnitsInfo.java
1
请完成以下Java代码
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BPMNMessageImpl that = (BPMNMessageImpl) o; return ( Objects.equals(getElementId(), that.getElementId()) &...
} @Override public String toString() { return ( "BPMNMessageImpl{" + ", elementId='" + getElementId() + '\'' + ", messagePayload='" + (messagePayload != null ? messagePayload.toString() : null) + '\'' + '}' ...
repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-process-model-impl\src\main\java\org\activiti\api\runtime\model\impl\BPMNMessageImpl.java
1
请完成以下Java代码
/* package */abstract class AbstractHUStorageDAO implements IHUStorageDAO { @Override public final I_C_UOM getC_UOMOrNull(final I_M_HU hu) { if (hu == null) { // // Null HU; consider that the UOMType is incompatible return null; } final List<I_M_HU_Storage> storages = retrieveStorages(hu); return...
if (Objects.equals(foundUOMType, storageUOMType)) { if (Check.isEmpty(storageUOMType, true)) { // if both UOMs' types are empty/null, then we have to thread them as incompatible; exit loop & return null return null; } // We don't care about it if it's the same UOMType continue; } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\storage\impl\AbstractHUStorageDAO.java
1
请完成以下Java代码
public class WEBUI_Picking_M_Picking_Candidate_Unprocess extends PickingSlotViewBasedProcess { private final PickingCandidateService pickingCandidateService = SpringContextHolder.instance.getBean(PickingCandidateService.class); @Override protected ProcessPreconditionsResolution checkPreconditionsApplicable() { i...
@Override protected String doIt() { final PickingSlotRow rowToProcess = getSingleSelectedRow(); final HuId huId = rowToProcess.getHuId(); pickingCandidateService.unprocessAndRestoreSourceHUsByHUId(huId); return MSG_OK; } @Override protected void postProcess(final boolean success) { if (!success) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\pickingslot\process\WEBUI_Picking_M_Picking_Candidate_Unprocess.java
1
请完成以下Java代码
public int getC_BPartner_Location_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_Location_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Abholung. @param IsToBeFetched Abholung */ @Override public void setIsToBeFetched (boolean IsToBeFetched) { set_Value (COLUMNNAM...
else set_ValueNoCheck (COLUMNNAME_M_TourVersionLine_ID, Integer.valueOf(M_TourVersionLine_ID)); } /** Get Tour Version Line. @return Tour Version Line */ @Override public int getM_TourVersionLine_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_TourVersionLine_ID); if (ii == null) return 0; ...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\tourplanning\model\X_M_TourVersionLine.java
1
请完成以下Java代码
public int compare(EventSubscriptionEntity o1, EventSubscriptionEntity o2) { return o2.getCreated().compareTo(o1.getCreated()); } }); for (CompensateEventSubscriptionEntity compensateEventSubscriptionEntity : eventSubscriptions) { compensateEventSubscriptionEntit...
for (Entry<String, Object> variable : variables.entrySet()) { eventScopeExecution.setVariableLocal(variable.getKey(), variable.getValue()); } // set event subscriptions to the event scope execution: for (CompensateEventSubscriptionEntity eventSubscriptionEntity : eve...
repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\bpmn\helper\ScopeUtil.java
1
请完成以下Java代码
public boolean isInboundTrx() { return !isOutboundTrx(); } public boolean isOutboundTrx() { final Boolean outboundTrx = getDocumentRef().getOutboundTrx(); if (outboundTrx != null) { return outboundTrx; } else { return getQty().signum() < 0; } } public CostAmountAndQtyDetailed getAmtAndQtyD...
{ if (qty.equalsIgnoreSource(this.qty)) { return amt; } else if (qty.isZero()) { return amt.toZero(); } else { final CostAmount price = amt.divide(this.qty, CurrencyPrecision.ofInt(12)); return price.multiply(qty.toBigDecimal()).roundToPrecisionIfNeeded(precision); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\CostDetail.java
1
请完成以下Java代码
private I_M_HU_PI_Item_Product getM_HU_PI_Item_Product() { final de.metas.handlingunits.model.I_C_OrderLine huOrderLine = InterfaceWrapperHelper.create(orderLine, de.metas.handlingunits.model.I_C_OrderLine.class); return huOrderLine.getM_HU_PI_Item_Product(); } @Override public I_C_Flatrate_DataEntry getC_Fla...
} @Override public void setM_PriceList_ID(int M_PriceList_ID) { throw new NotImplementedException(); } /** * Sets a private member variable to the given {@code price}. */ @Override public void setPrice(BigDecimal price) { this.price = price; } /** * * @return the value that was set via {@link ...
repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\order\impl\PMMPricingAware_C_OrderLine.java
1
请在Spring Boot框架中完成以下Java代码
public GetUserResponse createGetUserResponse() { return new GetUserResponse(); } /** * Create an instance of {@link SayHello } * */ public SayHello createSayHello() { return new SayHello(); } /** * Create an instance of {@link GetUser } * */ publ...
} /** * Create an instance of {@link JAXBElement }{@code <}{@link GetUserResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://model.webservice.xncoding.com/", name = "getUserResponse") public JAXBElement<GetUserResponse> createGetUserResponse(GetUserResponse value) { return...
repos\SpringBootBucket-master\springboot-cxf\src\main\java\com\xncoding\webservice\client\ObjectFactory.java
2
请完成以下Java代码
private List<String> getColumnHeaders() { final List<String> columnHeaders = new ArrayList<>(); columnHeaders.add("ProductName"); columnHeaders.add("CustomerLabelName"); columnHeaders.add("Additional_produktinfos"); columnHeaders.add("ProductValue"); columnHeaders.add("UPC"); columnHeaders.add("NetWeight...
columnHeaders.add("NutritionQty"); return columnHeaders; } @Override public ProcessPreconditionsResolution checkPreconditionsApplicable(final IProcessPreconditionsContext context) { if (!context.isSingleSelection()) { return ProcessPreconditionsResolution.rejectBecauseNotSingleSelection(); } return ...
repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\de\metas\fresh\product\process\ExportProductSpecifications.java
1
请完成以下Java代码
public List<HistoricTaskInstanceReportResult> countByTaskName() { CommandContext commandContext = Context.getCommandContext(); if(commandContext == null) { return commandExecutor.execute(new HistoricTaskInstanceCountByNameCmd()); } else { return executeCountByTaskName(commandContext); }...
public HistoricTaskInstanceReport completedAfter(Date completedAfter) { ensureNotNull(NotValidException.class, "completedAfter", completedAfter); this.completedAfter = completedAfter; return this; } @Override public HistoricTaskInstanceReport completedBefore(Date completedBefore) { ensureNotNull(...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\HistoricTaskInstanceReportImpl.java
1
请完成以下Java代码
public List<Case> getCases() { return cases; } public void setCases(List<Case> cases) { this.cases = cases; } public List<Process> getProcesses() { return processes; } public void setProcesses(List<Process> processes) { this.processes = processes; } public...
return definitionsAttributes; } public String getDefinitionsAttributeValue(String namespace, String name) { List<ExtensionAttribute> attributes = getDefinitionsAttributes().get(name); if (attributes != null && !attributes.isEmpty()) { for (ExtensionAttribute attribute : attributes) ...
repos\flowable-engine-main\modules\flowable-cmmn-model\src\main\java\org\flowable\cmmn\model\CmmnModel.java
1
请完成以下Java代码
public org.eevolution.model.I_PP_Product_BOM getPP_Product_BOM() throws RuntimeException { return (org.eevolution.model.I_PP_Product_BOM)MTable.get(getCtx(), org.eevolution.model.I_PP_Product_BOM.Table_Name) .getPO(getPP_Product_BOM_ID(), get_TrxName()); } /** Set BOM & Formula. @param PP_Product_BOM_ID ...
/** Set Processed. @param Processed The document has been processed */ public void setProcessed (boolean Processed) { set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed)); } /** Get Processed. @return The document has been processed */ public boolean isProcessed () { Object oo = get_Val...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_ChangeRequest.java
1
请完成以下Java代码
public String getDbType() { return getProperty(PROP_DB_TYPE, "postgresql"); } public String getDbHostname() { return getProperty(PROP_DB_SERVER, "localhost"); } public String getDbPort() { return getProperty(PROP_DB_PORT, "5432"); } public String getDbPassword() { return getProperty(PROP_DB_PASSWOR...
final HashMap<Object, Object> result = new HashMap<>(properties); result.put(PROP_DB_PASSWORD, "******"); return result.toString(); } public DBConnectionSettings toDBConnectionSettings() { return DBConnectionSettings.builder() .dbHostname(getDbHostname()) .dbPort(getDbPort()) .dbName(getDbName()) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.cli\src\main\java\de\metas\migration\cli\rollout_migrate\DBConnectionSettingProperties.java
1
请完成以下Java代码
public class FlatrateUserNotificationsProducer { public static final FlatrateUserNotificationsProducer newInstance() { return new FlatrateUserNotificationsProducer(); } private static final transient Logger logger = LogManager.getLogger(FlatrateUserNotificationsProducer.class); public static final Topic EVENTB...
final UserId recipientUserId, @NonNull final AdMessageKey message) { if (recipientUserId == null) { // nothing to do return null; } final TableRecordReference flatrateTermRef = TableRecordReference.of(contract); return newUserNotificationRequest() .recipientUserId(recipientUserId) .content...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\event\FlatrateUserNotificationsProducer.java
1
请完成以下Java代码
public Task getTask() { ensureCommandContextNotActive(); return getScopedAssociation().getTask(); } public void setTask(Task task) { ensureCommandContextNotActive(); getScopedAssociation().setTask(task); } public VariableMap getCachedVariables() { ensureCommandContextNotActive(); retur...
ensureCommandContextNotActive(); return getScopedAssociation().getCachedVariablesLocal(); } public void flushVariableCache() { ensureCommandContextNotActive(); getScopedAssociation().flushVariableCache(); } protected void ensureCommandContextNotActive() { if(Context.getCommandContext() != null...
repos\camunda-bpm-platform-master\engine-cdi\core\src\main\java\org\camunda\bpm\engine\cdi\impl\context\DefaultContextAssociationManager.java
1
请完成以下Java代码
public SignalEventListenerInstanceQuery caseDefinitionId(String caseDefinitionId) { innerQuery.caseDefinitionId(caseDefinitionId); return this; } @Override public SignalEventListenerInstanceQuery elementId(String elementId) { innerQuery.planItemInstanceElementId(elementId); ...
innerQuery.asc(); return this; } @Override public SignalEventListenerInstanceQuery desc() { innerQuery.desc(); return this; } @Override public SignalEventListenerInstanceQuery orderBy(QueryProperty property) { innerQuery.orderBy(property); return this; ...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\runtime\SignalEventListenerInstanceQueryImpl.java
1
请完成以下Java代码
default Optional<WindowId> getZoomIntoWindowId() { return Optional.empty(); } @Override boolean equals(Object obj); @Override int hashCode(); LookupDataSourceFetcher getLookupDataSourceFetcher(); boolean isHighVolume(); LookupSource getLookupSourceType(); boolean hasParameters(); boolean isNumericKe...
} default <T extends LookupDescriptor> T cast(final Class<T> ignoredLookupDescriptorClass) { @SuppressWarnings("unchecked") final T thisCasted = (T)this; return thisCasted; } default <T extends LookupDescriptor> T castOrNull(final Class<T> lookupDescriptorClass) { if (lookupDescriptorClass.isAssignableFr...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\LookupDescriptor.java
1
请完成以下Java代码
public int getStart() { return this.start; } public int getEnd() { return this.end; } public int size() { return end - start + 1; } /** * 是否与另一个区间交叉(有一部分重叠) * @param other * @return */ public boolean overlapsWith(Interval other) ...
return this.start % 100 + this.end % 100; } @Override public int compareTo(Object o) { if (!(o instanceof Intervalable)) { return -1; } Intervalable other = (Intervalable) o; int comparison = this.start - other.getStart(); return comparison !=...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\algorithm\ahocorasick\interval\Interval.java
1
请完成以下Java代码
public class PushMessageDTO implements Serializable { private static final long serialVersionUID = 7431775881170684867L; /** * 消息标题 */ private String title; /** * 消息内容 */ private String content; /** * 推送形式:all:全推送 single:单用户推送 */
private String pushType; /** * 用户名usernameList */ List<String> usernames; /** * 用户名idList */ List<String> userIds; /** * 消息附加参数 */ Map<String,Object> payload; }
repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\api\dto\PushMessageDTO.java
1
请完成以下Java代码
public class ConsumerStoppingEvent extends KafkaEvent { private static final long serialVersionUID = 1L; private transient final Consumer<?, ?> consumer; private transient final @Nullable Collection<TopicPartition> partitions; /** * Construct an instance with the provided source, consumer and partitions. * ...
super(source, container); this.consumer = consumer; this.partitions = partitions; } public Consumer<?, ?> getConsumer() { return this.consumer; } public @Nullable Collection<TopicPartition> getPartitions() { return this.partitions; } @Override public String toString() { return "ConsumerStoppingEvent...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\event\ConsumerStoppingEvent.java
1
请完成以下Java代码
public List<Customer> findAll3() { String sql = "SELECT * FROM CUSTOMER"; List<Customer> customers = jdbcTemplate.query( sql, new BeanPropertyRowMapper(Customer.class)); return customers; } public List<Customer> findAll4() { String sql = "SELE...
} public int count() { String sql = "SELECT COUNT(*) FROM CUSTOMER"; // queryForInt() is Deprecated // https://www.mkyong.com/spring/jdbctemplate-queryforint-is-deprecated/ //int total = jdbcTemplate.queryForInt(sql); return jdbcTemplate.queryForObject(sql, Integer.class)...
repos\spring-boot-master\spring-jdbc\src\main\java\com\mkyong\customer\CustomerRepository.java
1
请完成以下Java代码
private I_C_OrderLine createOrderLine(final PurchaseCandidate candidate) { final int flatrateDataEntryId = candidate.getC_Flatrate_DataEntry_ID(); final int huPIItemProductId = candidate.getM_HU_PI_Item_Product_ID(); final Timestamp datePromised = candidate.getDatePromised(); final BigDecimal price = candidate...
else { asi = null; } orderLine.setPMM_Contract_ASI(contractASI); orderLine.setM_AttributeSetInstance(asi); // // Quantities orderLine.setQtyEntered(BigDecimal.ZERO); orderLine.setQtyOrdered(BigDecimal.ZERO); // // Dates orderLine.setDatePromised(datePromised); // // Pricing orderLine.s...
repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\order\impl\OrderLineAggregation.java
1
请在Spring Boot框架中完成以下Java代码
public class SpringWebConfig implements WebMvcConfigurer { // , ApplicationContextAware { @Autowired public SpringWebConfig(SpringResourceTemplateResolver templateResolver) { super(); templateResolver.setPrefix("/WEB-INF/templates/"); templateResolver.setSuffix(".html"); templa...
WebMvcConfigurer.super.addResourceHandlers(registry); registry.addResourceHandler("/images/**") .addResourceLocations("/images/"); registry.addResourceHandler("/css/**") .addResourceLocations("/css/"); registry.addResourceHandler("/js/**") .addResourceLocation...
repos\tutorials-master\spring-web-modules\spring-thymeleaf-attributes\accessing-session-attributes\src\main\java\com\baeldung\accesing_session_attributes\web\SpringWebConfig.java
2
请在Spring Boot框架中完成以下Java代码
public class Publisher { @Id private ObjectId id; private String name; public Publisher() { } public Publisher(ObjectId id, String name) { this.id = id; this.name = name; } public ObjectId getId() { return id; } public void setId(ObjectId id) { ...
int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) ...
repos\tutorials-master\persistence-modules\java-mongodb\src\main\java\com\baeldung\bsontojson\Publisher.java
2
请完成以下Java代码
protected List<Term> roughSegSentence(char[] sentence) { char[] tag = model.tag(sentence); List<Term> termList = new LinkedList<Term>(); int offset = 0; for (int i = 0; i < tag.length; offset += 1, ++i) { switch (tag[i]) { case 'b': ...
if (i == tag.length) { termList.add(new Term(new String(sentence, begin, offset - begin), null)); } else termList.add(new Term(new String(sentence, begin, offset - begin + 1), null)); } ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\seg\HMM\HMMSegment.java
1
请完成以下Java代码
public SetMultimap<PaymentId, InvoiceId> retrieveInvoiceIdsByPaymentIds(@NonNull final Collection<PaymentId> paymentIds) { if (paymentIds.isEmpty()) { return ImmutableSetMultimap.of(); } final IQuery<I_C_AllocationHdr> completedAllocations = queryBL.createQueryBuilder(I_C_AllocationHdr.class) .addOnlyA...
.collect(ImmutableSetMultimap.toImmutableSetMultimap( record -> PaymentId.ofRepoId(record.getC_Payment_ID()), record -> InvoiceId.ofRepoIdOrNull(record.getC_Invoice_ID()))); } @Override public @NonNull I_C_AllocationHdr getById(@NonNull final PaymentAllocationId allocationId) { return InterfaceWrappe...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\allocation\api\impl\AllocationDAO.java
1
请完成以下Java代码
public class ImageFile extends GenericFile { private int height; private int width; public ImageFile(String name, int height, int width, byte[] content, String version) { this.setHeight(height); this.setWidth(width); this.setContent(content); this.setName(name); this...
} public int getWidth() { return width; } public void setWidth(int width) { this.width = width; } public String getFileInfo() { return "Image File Impl"; } public String read() { return this.getContent() .toString(); } }
repos\tutorials-master\core-java-modules\core-java-lang-oop-inheritance-2\src\main\java\com\baeldung\polymorphism\ImageFile.java
1
请完成以下Java代码
protected boolean deploymentsDiffer(DeploymentEntity deployment, DeploymentEntity saved) { if (deploymentBuilder.hasEnforcedAppVersion()) { return deploymentsDifferWhenEnforcedAppVersionIsSet(saved); } else if (deploymentBuilder.hasProjectManifestSet()) { return deploymentsDiffer...
protected void scheduleProcessDefinitionActivation(CommandContext commandContext, DeploymentEntity deployment) { for (ProcessDefinitionEntity processDefinitionEntity : deployment.getDeployedArtifacts( ProcessDefinitionEntity.class )) { // If activation date is set, we first suspe...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cmd\DeployCmd.java
1
请在Spring Boot框架中完成以下Java代码
public SecurityFilterChain filterChain(HttpSecurity http, MvcRequestMatcher.Builder mvc) throws Exception { http.csrf(AbstractHttpConfigurer::disable) .authorizeHttpRequests(authorizationManagerRequestMatcherRegistry -> authorizationManagerRequestMatcherRegistry ...
} @Bean public HttpSessionEventPublisher httpSessionEventPublisher() { return new HttpSessionEventPublisher(); } @Bean public PasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(); } @Bean MvcRequestMatcher.Builder mvc(HandlerMappingIntrospector intros...
repos\tutorials-master\spring-security-modules\spring-security-web-mvc\src\main\java\com\baeldung\session\security\config\SecSecurityConfig.java
2
请完成以下Java代码
public void setRevision (final @Nullable java.lang.String Revision) { set_Value (COLUMNNAME_Revision, Revision); } @Override public java.lang.String getRevision() { return get_ValueAsString(COLUMNNAME_Revision); } @Override public org.compiere.model.I_AD_Sequence getSerialNo_Sequence() { return get_Va...
@Override public void setValidFrom (final java.sql.Timestamp ValidFrom) { set_Value (COLUMNNAME_ValidFrom, ValidFrom); } @Override public java.sql.Timestamp getValidFrom() { return get_ValueAsTimestamp(COLUMNNAME_ValidFrom); } @Override public void setValidTo (final @Nullable java.sql.Timestamp ValidTo)...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Order_BOM.java
1
请在Spring Boot框架中完成以下Java代码
public class HystrixAspect { private HystrixCommand.Setter config; private HystrixCommandProperties.Setter commandProperties; private HystrixThreadPoolProperties.Setter threadPoolProperties; @Value("${remoteservice.command.execution.timeout}") private int executionTimeout; @Value("${remoteser...
this.commandProperties = HystrixCommandProperties.Setter(); this.commandProperties.withExecutionTimeoutInMilliseconds(executionTimeout); this.commandProperties.withCircuitBreakerSleepWindowInMilliseconds(sleepWindow); this.threadPoolProperties = HystrixThreadPoolProperties.Setter(); thi...
repos\tutorials-master\hystrix\src\main\java\com\baeldung\hystrix\HystrixAspect.java
2
请完成以下Java代码
public I_M_HU current() { Check.assume(currentItemSet, "has current item"); return currentItem; } public void closeCurrent() { currentItemSet = false; currentItem = null; } public boolean hasCurrent() { return currentItemSet; } public boolean hasNext() { final int size = list.size(); if (curr...
nextIndex = 0; } else { nextIndex = currentIndex + 1; } // Make sure the new index is valid final int size = list.size(); if (nextIndex >= size) { throw new NoSuchElementException("index=" + nextIndex + ", size=" + size); } // Update status this.currentIndex = nextIndex; this.currentItem...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\util\HUListCursor.java
1
请在Spring Boot框架中完成以下Java代码
public class BookstoreService { private final AuthorRepository authorRepository; public BookstoreService(AuthorRepository authorRepository) { this.authorRepository = authorRepository; } @Transactional public void registerAuthor() { Author a1 = new Author(); a1.setName("Q...
authorRepository.save(a1); authorRepository.save(a2); } @Transactional public void updateAuthor() { Author author = authorRepository.findByName("Mark Janel"); author.setAge(45); } @Transactional public void updateBooks() { Author author = authorRepository.findB...
repos\Hibernate-SpringBoot-master\HibernateSpringBootAudit\src\main\java\com\bookstore\service\BookstoreService.java
2
请完成以下Java代码
public class LargestSubarraySumZero { public static int maxLenBruteForce(int[] arr) { int maxLength = 0; for (int i = 0; i < arr.length; i++) { int sum = 0; for (int j = i; j < arr.length; j++) { sum += arr[j]; if (sum == 0) { ...
int sum = 0; int maxLength = 0; for (int i = 0; i < arr.length; i++) { sum += arr[i]; if (sum == 0) { maxLength = i + 1; } if (map.containsKey(sum)) { maxLength = Math.max(maxLength, i - map.get(sum)); } else ...
repos\tutorials-master\algorithms-modules\algorithms-numeric\src\main\java\com\baeldung\algorithms\subarraysumzero\LargestSubarraySumZero.java
1
请完成以下Java代码
public class Password implements CharSequence { private @Delegate final String password; private @Getter transient boolean encrypted; Password() { this.password = null; this.encrypted = true; } /** * Creates a new raw {@link Password} for the given source {@link String}. * * @param password must not b...
* @param password must not be {@literal null} or empty. * @return */ static Password encrypted(String password) { return new Password(password, true); } /* * (non-Javadoc) * @see java.lang.Object#toString() */ public String toString() { return encrypted ? password : "********"; } }
repos\spring-data-examples-main\web\example\src\main\java\example\users\Password.java
1
请完成以下Java代码
public boolean isLwm2mServer() { return isLwm2mServer; } /** * Checks whether a given ID represents a valid LwM2M Server (1–65534). * @param id Short Server ID value. * @return true if the ID belongs to a standard LwM2M Server. */ public static boolean isLwm2mServer(Integer id) ...
* @throws IllegalArgumentException if no constant matches the given ID. */ public static Lwm2mServerIdentifier fromId(Integer id) { for (Lwm2mServerIdentifier s : values()) { if (s.id == id) { return s; } } throw new IllegalArgumentException("Unkn...
repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\device\credentials\lwm2m\Lwm2mServerIdentifier.java
1
请完成以下Java代码
public class GeodbObject { final private int geodb_loc_id; final private String city; private String city_7bitlc; final private String zip; final private double lon; final private double lat; private int C_Country_ID = -1; private String countryName = null; // private String stringRepresentation = null; pu...
} public String getCity_7bitlc() { return city_7bitlc; } public void setCity_7bitlc(String city_7bitlc) { this.city_7bitlc = city_7bitlc; } public String getStringRepresentation() { return stringRepresentation; } public void setStringRepresentation(String stringRepresentation) { this.stringRepresen...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\de\metas\adempiere\gui\search\GeodbObject.java
1
请完成以下Java代码
public PurchaseRowId toGroupRowId() { if (isGroupRowId()) { return this; } else { return groupId(purchaseDemandId); } } public PurchaseRowId toLineRowId() { if (isLineRowId()) { return this; } else { final boolean readonly = false; return lineId(purchaseDemandId, vendorId, read...
public boolean isGroupRowId() { return type == PurchaseRowType.GROUP; } public boolean isLineRowId() { return type == PurchaseRowType.LINE; } public boolean isAvailabilityRowId() { return type == PurchaseRowType.AVAILABILITY_DETAIL; } public boolean isAvailableOnVendor() { assertRowType(PurchaseRow...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\sales\purchasePlanning\view\PurchaseRowId.java
1
请完成以下Java代码
public static boolean hasPermission(String permission) { return getSubject() != null && permission != null && permission.length() > 0 && getSubject().isPermitted(permission); } /** * 与hasPermission标签逻辑相反,当前用户没有制定权限时,验证通过。 * * @param permission 权限名 * @...
/** * 认证通过或已记住的用户。与guset搭配使用。 * * @return 用户:true,否则 false */ public static boolean isUser() { return getSubject() != null && getSubject().getPrincipal() != null; } /** * 验证当前用户是否为“访客”,即未认证(包含未记住)的用户。用user搭配使用 * * @return 访客:true,否则false */ public static ...
repos\SpringBootBucket-master\springboot-jwt\src\main\java\com\xncoding\jwt\shiro\ShiroKit.java
1
请在Spring Boot框架中完成以下Java代码
class ReactiveOAuth2ClientConfigurations { @Configuration(proxyBeanMethods = false) @EnableConfigurationProperties(OAuth2ClientProperties.class) @ConditionalOnOAuth2ClientRegistrationProperties @ConditionalOnMissingBean(ReactiveClientRegistrationRepository.class) static class ReactiveClientRegistrationRepositoryC...
} @Configuration(proxyBeanMethods = false) @ConditionalOnBean(ReactiveClientRegistrationRepository.class) static class ReactiveOAuth2AuthorizedClientServiceConfiguration { @Bean @ConditionalOnMissingBean ReactiveOAuth2AuthorizedClientService reactiveAuthorizedClientService( ReactiveClientRegistrationRepo...
repos\spring-boot-4.0.1\module\spring-boot-security-oauth2-client\src\main\java\org\springframework\boot\security\oauth2\client\autoconfigure\reactive\ReactiveOAuth2ClientConfigurations.java
2
请在Spring Boot框架中完成以下Java代码
public class OwnerController { @Value("${lottery.contract.owner-address}") private String ownerAddress; @Autowired private Web3j web3j; @Autowired private LotteryService lotteryService; @GetMapping("/owner") public String getAddress() { return ownerAddress; } @GetMap...
public Balance getBalance() throws IOException { EthGetBalance wei = web3j.ethGetBalance(ownerAddress, DefaultBlockParameterName.LATEST).send(); return new Balance(wei.getBalance()); } @GetMapping("/owner/lottery/players") public List<String> getPlayers() throws Exception { return ...
repos\springboot-demo-master\Blockchain\src\main\java\com\et\bc\controller\OwnerController.java
2
请完成以下Java代码
public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0];} } }; public static void main(String... args) { try { new EmailService("smtp.mailtrap.io", 25, "87ba3d9555fae8", "91cb4379af43ed").sendMail(); } catch (Exception e) { e.printStackTrace...
String msgStyled = "This is my <b style='color:red;'>bold-red email</b> using JavaMailer"; MimeBodyPart mimeBodyPartWithStyledText = new MimeBodyPart(); mimeBodyPartWithStyledText.setContent(msgStyled, "text/html; charset=utf-8"); MimeBodyPart attachmentBodyPart = new MimeBodyPart(); a...
repos\tutorials-master\core-java-modules\core-java-networking\src\main\java\com\baeldung\mail\EmailService.java
1
请完成以下Java代码
public static List<Date> getDateRangeList(Date begin, Date end) { List<Date> dateList = new ArrayList<>(); if (begin == null || end == null) { return dateList; } // 清除时间部分,只比较日期 Calendar beginCal = Calendar.getInstance(); beginCal.setTime(begin); begi...
endCal.set(Calendar.MILLISECOND, 0); if (endCal.before(beginCal)) { return dateList; } dateList.add(beginCal.getTime()); while (beginCal.before(endCal)) { beginCal.add(Calendar.DAY_OF_YEAR, 1); dateList.add(beginCal.getTime()); } retu...
repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\DateUtils.java
1
请完成以下Java代码
class DBConnectionMaker { public IDatabase createDb( @NonNull final DBConnectionSettings settings, @NonNull final String dbName) { final IDatabase db = new SQLDatabase( settings.getDbType(), settings.getDbHostname(), settings.getDbPort(), dbName, settings.getDbUser(), settings.getDbPas...
dbName, settings.getDbUser(), settings.getDbPassword()) { // @formatter:off @Override public IScriptsRegistry getScriptsRegistry() { return new IScriptsRegistry() { @Override public void markIgnored(final IScript script) { } @Override public void markApplied(final IScript script)...
repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.cli\src\main\java\de\metas\migration\cli\rollout_migrate\DBConnectionMaker.java
1
请完成以下Java代码
public int getFact_Acct_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_Fact_Acct_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Zeile Nr.. @param Line Unique line for this document */ @Override public void setLine (int Line) {
set_Value (COLUMNNAME_Line, Integer.valueOf(Line)); } /** Get Zeile Nr.. @return Unique line for this document */ @Override public int getLine () { Integer ii = (Integer)get_Value(COLUMNNAME_Line); if (ii == null) return 0; return ii.intValue(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_TaxDeclarationAcct.java
1
请完成以下Java代码
public class FailureRequestDto extends RequestDto { protected String errorMessage; protected String errorDetails; protected int retries; protected long retryTimeout; protected Map<String, TypedValueField> variables; protected Map<String, TypedValueField> localVariables; public FailureRequestDto(String w...
} public int getRetries() { return retries; } public long getRetryTimeout() { return retryTimeout; } public Map<String, TypedValueField> getVariables() { return variables; } public Map<String, TypedValueField> getLocalVariables() { return localVariables; } }
repos\camunda-bpm-platform-master\clients\java\client\src\main\java\org\camunda\bpm\client\task\impl\dto\FailureRequestDto.java
1
请完成以下Java代码
public OrderPaymentReservationCreateResult createPaymentReservationIfNeeded(@NonNull final I_C_Order salesOrder) { Check.assume(salesOrder.isSOTrx(), "expected sales order but got purchase order: {}", salesOrder); final PaymentRule paymentRule = PaymentRule.ofCode(salesOrder.getPaymentRule()); if (!paymentReser...
return paymentReservationService.createReservation(PaymentReservationCreateRequest.builder() .clientId(ClientId.ofRepoId(salesOrder.getAD_Client_ID())) .orgId(OrgId.ofRepoId(salesOrder.getAD_Org_ID())) .amount(extractGrandTotal(salesOrder)) .payerContactId(payerContactId) .payerEmail(bpartnersRepo.g...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\payment_reservation\OrderPaymentReservationService.java
1
请在Spring Boot框架中完成以下Java代码
public class ObjectFactory { private final static QName _ErpelMessage_QNAME = new QName("http://erpel.at/schemas/1p0/messaging/message", "ErpelMessage"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: at.erpel.schemas._1p0.messaging.messag...
return new ErpelMessageType(); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ErpelMessageType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link ErpelMessage...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\messaging\message\ObjectFactory.java
2
请完成以下Java代码
public void setSeqNo (int SeqNo) { set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); } /** Get Reihenfolge. @return Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst */ @Override public int getSeqNo () { Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo); if (ii == null) ...
*/ public static final int TYPE_AD_Reference_ID=540910; /** widget = widget */ public static final String TYPE_Widget = "widget"; /** tooltip = tooltip */ public static final String TYPE_Tooltip = "tooltip"; /** Set Art. @param Type Art */ @Override public void setType (java.lang.String Type) { set_Valu...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_UI_ElementField.java
1
请完成以下Java代码
public void setEntityType (java.lang.String EntityType) { set_Value (COLUMNNAME_EntityType, EntityType); } /** Get Entitäts-Art. @return Dictionary Entity Type; Determines ownership and synchronization */ @Override public java.lang.String getEntityType () { return (java.lang.String)get_Value(COLUMNNAM...
SQL FROM clause */ @Override public void setFromClause (java.lang.String FromClause) { set_Value (COLUMNNAME_FromClause, FromClause); } /** Get Sql FROM. @return SQL FROM clause */ @Override public java.lang.String getFromClause () { return (java.lang.String)get_Value(COLUMNNAME_FromClause); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_InfoWindow_From.java
1
请完成以下Java代码
public class MigrationLoader { private final transient Logger logger = LogManager.getLogger(getClass()); public void load(Properties ctx) { scanClasspath(); scanMetasfreshHome(); } private void scanClasspath() { final String resourceName = "/org/adempiere/migration/Migration.xml"; final InputStream inpu...
} private void load(final XMLLoader loader) { loader.load(ITrx.TRXNAME_None); for (Object o : loader.getObjects()) { if (o instanceof I_AD_Migration) { final I_AD_Migration migration = (I_AD_Migration)o; execute(migration); } else { logger.warn("Unhandled type " + o + " [SKIP]"); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\process\MigrationLoader.java
1
请完成以下Java代码
protected static <T> T getDefaultValue(MailServerInfo serverInfo, MailServerInfo fallbackServerInfo, Function<MailServerInfo, T> valueProvider) { T value = null; if (serverInfo != null) { value = valueProvider.apply(serverInfo); } if (value == null) { value = val...
forceTo = serverInfo.getMailServerForceTo(); } if (forceTo == null) { forceTo = fallbackServerInfo.getMailServerForceTo(); } if (forceTo == null) { return Collections.emptyList(); } return Arrays.stream(forceTo.split(",")).map(String::trim).toLi...
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\cfg\mail\FlowableMailClientCreator.java
1
请完成以下Java代码
public int getC_Project_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Project_ID); if (ii == null) return 0; return ii.intValue(); } public I_C_Recurring getC_Recurring() throws RuntimeException { return (I_C_Recurring)MTable.get(getCtx(), I_C_Recurring.Table_Name) .getPO(getC_Recurring_I...
@return Date of the Document */ public Timestamp getDateDoc () { return (Timestamp)get_Value(COLUMNNAME_DateDoc); } public I_GL_JournalBatch getGL_JournalBatch() throws RuntimeException { return (I_GL_JournalBatch)MTable.get(getCtx(), I_GL_JournalBatch.Table_Name) .getPO(getGL_JournalBatch_ID(), get...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Recurring_Run.java
1
请在Spring Boot框架中完成以下Java代码
public class TodoControllerWithSessionAttributes { @GetMapping("/form") public String showForm( Model model, @ModelAttribute("todos") TodoList todos) { if (!todos.isEmpty()) { model.addAttribute("todo", todos.peekLast()); } else { model.addAttribu...
todos.add(todo); attributes.addFlashAttribute("todos", todos); return new RedirectView("/sessionattributes/todos.html"); } @GetMapping("/todos.html") public String list( Model model, @ModelAttribute("todos") TodoList todos) { model.addAttribute("todos", todo...
repos\tutorials-master\spring-web-modules\spring-mvc-forms-thymeleaf\src\main\java\com\baeldung\sessionattrs\TodoControllerWithSessionAttributes.java
2
请在Spring Boot框架中完成以下Java代码
public class AssetProfileInfo extends EntityInfo { @Schema(description = "Either URL or Base64 data of the icon. Used in the mobile application to visualize set of asset profiles in the grid view. ") private final String image; @Schema(description = "Reference to the dashboard. Used in the mobile applicati...
this.defaultDashboardId = defaultDashboardId; } public AssetProfileInfo(UUID uuid, UUID tenantId, String name, String image, UUID defaultDashboardId) { super(EntityIdFactory.getByTypeAndUuid(EntityType.ASSET_PROFILE, uuid), name); this.tenantId = TenantId.fromUUID(tenantId); this.image ...
repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\asset\AssetProfileInfo.java
2
请在Spring Boot框架中完成以下Java代码
private void getCurrencies(final Exchange exchange) { final GetCurrenciesRequest getCurrenciesRequest = exchange.getIn().getBody(GetCurrenciesRequest.class); if (getCurrenciesRequest == null) { throw new RuntimeException("No getCurrenciesRequest provided!"); } final PInstanceLogger pInstanceLogger = PIns...
if (CollectionUtils.isEmpty(currencies.getCurrencyList())) { throw new RuntimeException("No currencies return from Shopware!"); } final ImmutableMap<String, String> currencyId2IsoCode = currencies.getCurrencyList().stream() .collect(ImmutableMap.toImmutableMap(JsonCurrency::getId, JsonCurrency::getIsoCode...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-shopware6\src\main\java\de\metas\camel\externalsystems\shopware6\currency\GetCurrenciesRoute.java
2
请完成以下Java代码
public static I_C_Order extend(@NonNull final I_C_Order existentOrder) { if (I_C_Order.CONTRACTSTATUS_Extended.equals(existentOrder.getContractStatus())) { throw new AdempiereException(MSG_EXTEND_CONTRACT_ALREADY_PROLONGED); } else { final I_C_Order newOrder = InterfaceWrapperHelper.newInstance(I_C_Ord...
newOrder.setDatePromised(addDays); newOrder.setPreparationDate(addDays); } InterfaceWrapperHelper.save(newOrder); // link the existent order to the new one existentOrder.setRef_FollowupOrder_ID(newOrder.getC_Order_ID()); InterfaceWrapperHelper.save(existentOrder); return newOrder; } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\subscription\impl\subscriptioncommands\ExtendContractOrder.java
1
请完成以下Java代码
public class JeecgOneToMainUtil { /** * 一对多(父子表)数据模型,生成方法 * @param args */ public static void main(String[] args) { //第一步:设置主表配置 MainTableVo mainTable = new MainTableVo(); //表名 mainTable.setTableName("jeecg_order_main"); //实体名 mainTable.setEntityName("GuiTestOrderMain"); //包名 ...
//包名 po2.setEntityPackage("gui"); //描述 po2.setFtlDescription("产品明细"); //子表外键参数配置 /*说明: * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾; * b) 主表和子表的外键字段名字,必须相同(除主键ID外); * c) 多个外键字段,采用逗号分隔; */ po2.setForeignKeys(new String[]{"order_id"}); subTables.add(po2); mainTable.setSubTables(subTables); //第三...
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-start\src\main\java\org\jeecg\codegenerate\JeecgOneToMainUtil.java
1
请完成以下Java代码
private ExplainedOptional<NameAndGreeting> computeForTwoContacts( @NonNull final ComputeNameAndGreetingRequest.Contact person1, @NonNull final ComputeNameAndGreetingRequest.Contact person2, @NonNull final String adLanguage) { final GreetingId greetingId = greetingRepo.getComposite(person1.getGreetingId(), p...
.build()); } else { final String nameComposite = TranslatableStrings.builder() .append(person1.getFirstName()) .append(" ") .appendADMessage(MSG_And) .append(" ") .append(person2.getFirstName()) .append(" ") .append(person1.getLastName()) .build() .translate(adLangu...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\bpartner\name\strategy\MembershipContactBPartnerNameAndGreetingStrategy.java
1
请完成以下Java代码
public static int[] KnuthMorrisPrattShift(char[] pattern) { int patternSize = pattern.length; int[] shift = new int[patternSize]; shift[0] = 1; int i = 1, j = 0; while ((i + j) < patternSize) { if (pattern[i + j] == pattern[j]) { shift[i + j] = i; ...
int shift[] = new int[256]; for (int k = 0; k < 256; k++) { shift[k] = pattern.length; } for (int k = 0; k < pattern.length - 1; k++) { shift[pattern[k]] = pattern.length - 1 - k; } int i = 0, j = 0; while ((i + pattern.length) <= text.length) ...
repos\tutorials-master\algorithms-modules\algorithms-searching\src\main\java\com\baeldung\algorithms\textsearch\TextSearchAlgorithms.java
1
请完成以下Java代码
public int getC_DirectDebit_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_DirectDebit_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Dtafile. @param Dtafile Copy of the *.dta stored as plain text */ public void setDtafile (String Dtafile) { set_Value (COLUMNNAME_Dtafile...
{ set_Value (COLUMNNAME_IsRemittance, Boolean.valueOf(IsRemittance)); } /** Get IsRemittance. @return IsRemittance */ public boolean isRemittance () { Object oo = get_Value(COLUMNNAME_IsRemittance); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java-gen\org\compiere\model\X_C_DirectDebit.java
1
请完成以下Java代码
public class TaskReportManager extends AbstractManager { @SuppressWarnings("unchecked") public List<TaskCountByCandidateGroupResult> createTaskCountByCandidateGroupReport(TaskReportImpl query) { configureQuery(query); return getDbEntityManager().selectListWithRawParameter("selectTaskCountByCandidateGroupRe...
@SuppressWarnings("unchecked") public List<DurationReportResult> createHistoricTaskDurationReport(HistoricTaskInstanceReportImpl query) { configureQuery(query); return getDbEntityManager().selectListWithRawParameter("selectHistoricTaskInstanceDurationReport", query, 0, Integer.MAX_VALUE); } protected voi...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\TaskReportManager.java
1
请在Spring Boot框架中完成以下Java代码
public class ScopesConfig { @Bean @Scope("singleton") public Person personSingleton() { return new Person(); } @Bean @Scope("prototype") public Person personPrototype() { return new Person(); } @Bean @RequestScope public HelloMessageGenerator requestScopedB...
return new HelloMessageGenerator(); } @Bean @ApplicationScope public HelloMessageGenerator applicationScopedBean() { return new HelloMessageGenerator(); } @Bean @Scope(scopeName = "websocket", proxyMode = ScopedProxyMode.TARGET_CLASS) public HelloMessageGenerator websocketScope...
repos\tutorials-master\spring-core\src\main\java\com\baeldung\beanscopes\ScopesConfig.java
2
请完成以下Java代码
public void setCompanyName(final String companyName) { this.companyName = companyName; this.companyNameSet = true; } public void setLookupLabel(@Nullable final String lookupLabel) { this.lookupLabel = lookupLabel; this.lookupLabelSet = true; } public void setVendor(final Boolean vendor) { this.vend...
} public void setUrl2(final String url2) { this.url2 = url2; this.url2Set = true; } public void setUrl3(final String url3) { this.url3 = url3; this.url3Set = true; } public void setGroup(final String group) { this.group = group; this.groupSet = true; } public void setGlobalId(final String glob...
repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-bpartner\src\main\java\de\metas\common\bpartner\v2\request\JsonRequestBPartner.java
1
请完成以下Java代码
public AppDeploymentEntity findLatestDeploymentByName(String deploymentName) { return dataManager.findLatestDeploymentByName(deploymentName); } @Override public List<String> getDeploymentResourceNames(String deploymentId) { return dataManager.getDeploymentResourceNames(deploymentId); ...
} @Override public long findDeploymentCountByQueryCriteria(AppDeploymentQuery deploymentQuery) { return dataManager.findDeploymentCountByQueryCriteria((AppDeploymentQueryImpl) deploymentQuery); } protected AppResourceEntityManager getAppResourceEntityManager() { return engineConfig...
repos\flowable-engine-main\modules\flowable-app-engine\src\main\java\org\flowable\app\engine\impl\persistence\entity\AppDeploymentEntityManagerImpl.java
1
请完成以下Java代码
public class SemaphoreDemo { public static void main(String[] args) { // Create a Semaphore with a fixed number of permits int NUM_PERMITS = 3; Semaphore semaphore = new Semaphore(NUM_PERMITS); // Simulate resource access by worker threads for (int i = 1; i <= 5; i++) { ...
semaphore.release(); } }).start(); } // Simulate resetting the Semaphore by releasing additional permits after a delay try { Thread.sleep(5000); // Resetting the semaphore permits to the initial count semaphore.release(NUM_PERMITS...
repos\tutorials-master\core-java-modules\core-java-concurrency-advanced-5\src\main\java\com\baeldung\countdownlatchvssemaphore\SemaphoreDemo.java
1
请完成以下Java代码
public class C_Invoice_PO_CreateAdjustmentCharge extends JavaProcess implements IProcessPrecondition { private final IInvoiceBL invoiceBL = Services.get(IInvoiceBL.class); public String doIt() { final DocBaseAndSubType docBaseAndSubType = DocBaseAndSubType.of(X_C_DocType.DOCBASETYPE_APInvoice, X_C_DocType.DOCSUBT...
public ProcessPreconditionsResolution checkPreconditionsApplicable(final IProcessPreconditionsContext context) { if (context.isNoSelection()) { return ProcessPreconditionsResolution.rejectBecauseNoSelection(); } if (!context.isSingleSelection()) { return ProcessPreconditionsResolution.rejectBecauseNo...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\org\adempiere\invoice\process\C_Invoice_PO_CreateAdjustmentCharge.java
1
请完成以下Java代码
public Optional<ProductBarcodeFilterData> createDataFromHU( final @Nullable String barcode, final @Nullable I_M_HU hu) { if (hu == null) { return Optional.empty(); } final ImmutableSet<ProductId> productIds = extractProductIds(hu); if (productIds.isEmpty()) { return Optional.empty(); } fi...
.huId(HuId.ofRepoId(hu.getM_HU_ID())) .sqlWhereClause(toSqlAndParams(filter)) .build()); } private ImmutableSet<ProductId> extractProductIds(@NonNull final I_M_HU hu) { final IMutableHUContext huContext = handlingUnitsBL.createMutableHUContext(PlainContextAware.newWithThreadInheritedTrx()); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\packageable\filters\ProductBarcodeFilterServicesFacade.java
1
请完成以下Java代码
public class BFSMazeSolver { private static final int[][] DIRECTIONS = { { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, 0 } }; public List<Coordinate> solve(Maze maze) { LinkedList<Coordinate> nextToVisit = new LinkedList<>(); Coordinate start = maze.getEntry(); nextToVisit.add(start); w...
for (int[] direction : DIRECTIONS) { Coordinate coordinate = new Coordinate(cur.getX() + direction[0], cur.getY() + direction[1], cur); nextToVisit.add(coordinate); maze.setVisited(cur.getX(), cur.getY(), true); } } return Collections.emptyList...
repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-2\src\main\java\com\baeldung\algorithms\maze\solver\BFSMazeSolver.java
1