instruction
string
input
string
output
string
source_file
string
priority
int64
请在Spring Boot框架中完成以下Java代码
public class StartupEventHandler { // logger, constructor private static Logger logger = LoggerFactory.getLogger(StartupEventHandler.class); public StartupEventHandler(MeterRegistry registry) { this.meterRegistry = registry; } private String[] METRICS = { "jvm.memory.used", ...
private Map<Statistic, Double> getSamples(Meter meter) { Map<Statistic, Double> samples = new LinkedHashMap<>(); mergeMeasurements(samples, meter); return samples; } private void mergeMeasurements(Map<Statistic, Double> samples, Meter meter) { meter.measure().forEach((measuremen...
repos\tutorials-master\spring-boot-modules\spring-boot-deployment\src\main\java\com\baeldung\compare\StartupEventHandler.java
2
请完成以下Java代码
public void afterPropertiesSet() throws Exception { buildClient(); } protected void buildClient() throws Exception { // 创建可追踪的 TracingPreBuiltTransportClient client = new TracingPreBuiltTransportClient(tracer, settings()); clusterNodes.stream() // .peek(it -> lo...
} public void setClientTransportSniff(Boolean clientTransportSniff) { this.clientTransportSniff = clientTransportSniff; } public String getClientNodesSamplerInterval() { return clientNodesSamplerInterval; } public void setClientNodesSamplerInterval(String clientNodesSamplerInterva...
repos\SpringBoot-Labs-master\lab-40\lab-40-elasticsearch\src\main\java\cn\iocoder\springboot\lab40\zipkindemo\spring\TracingTransportClientFactoryBean.java
1
请完成以下Java代码
public void setGO_DeliveryOrder_Package_ID (int GO_DeliveryOrder_Package_ID) { if (GO_DeliveryOrder_Package_ID < 1) set_ValueNoCheck (COLUMNNAME_GO_DeliveryOrder_Package_ID, null); else set_ValueNoCheck (COLUMNNAME_GO_DeliveryOrder_Package_ID, Integer.valueOf(GO_DeliveryOrder_Package_ID)); } /** Get GO ...
*/ @Override public void setM_Package_ID (int M_Package_ID) { if (M_Package_ID < 1) set_ValueNoCheck (COLUMNNAME_M_Package_ID, null); else set_ValueNoCheck (COLUMNNAME_M_Package_ID, Integer.valueOf(M_Package_ID)); } /** Get Packstück. @return Shipment Package */ @Override public int getM_Packag...
repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.go\src\main\java-gen\de\metas\shipper\gateway\go\model\X_GO_DeliveryOrder_Package.java
1
请完成以下Java代码
public XMLGregorianCalendar getGestationWeek13() { return gestationWeek13; } /** * Sets the value of the gestationWeek13 property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setGestationWeek13(XMLGregorianCa...
* Sets the value of the reason property. * * @param value * allowed object is * {@link String } * */ public void setReason(String value) { this.reason = value; } /** * Gets the value of the apid property. * * @return * possible ob...
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_450_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_450\request\TreatmentType.java
1
请完成以下Java代码
public void setRegistry(ActivitiStateHandlerRegistry registry) { this.registry = registry; } public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException { // first sift through and get all the methods // then get all the annotations // ...
} else if (pa instanceof ProcessVariables) { pvMapIndex = ctr; } else if (pa instanceof ProcessId ) { procIdIndex = ctr; } } } ActivitiStateHandlerRegistration registration = new ActivitiStateHandlerRegistration(vars, method, bean, stateName, beanName, pvMa...
repos\camunda-bpm-platform-master\engine-spring\core\src\main\java\org\camunda\bpm\engine\spring\components\aop\ActivitiStateAnnotationBeanPostProcessor.java
1
请完成以下Java代码
private long toPartitionTs(long ts) { LocalDateTime time = LocalDateTime.ofInstant(Instant.ofEpochMilli(ts), ZoneOffset.UTC); return time.truncatedTo(ChronoUnit.DAYS).withDayOfMonth(1).toInstant(ZoneOffset.UTC).toEpochMilli(); } private void processPartitions(List<Object> values) { Stri...
private List<Object> castToNumericIfPossible(List<Object> values) { try { if (values.get(6) != null && NumberUtils.isNumber(values.get(6).toString())) { Double casted = NumberUtils.createDouble(values.get(6).toString()); List<Object> numeric = Lists.newArrayList(); ...
repos\thingsboard-master\tools\src\main\java\org\thingsboard\client\tools\migrator\PgCaMigrator.java
1
请在Spring Boot框架中完成以下Java代码
public static class SpringSessionPropertiesEnvironmentPostProcessor implements EnvironmentPostProcessor { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { if (isNotSet(environment, SPRING_SESSION_DATA_GEMFIRE_SESSION_EXPIRATION_TIMEOUT)) { ...
return String.valueOf(toSeconds(duration)); } protected static boolean isNotSet(ConfigurableEnvironment environment, String propertyName) { return !isSet(environment, propertyName); } protected static boolean isSet(ConfigurableEnvironment environment, String propertyName) { return environment.containsPropert...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\SpringSessionAutoConfiguration.java
2
请完成以下Java代码
public void setProcessed (final boolean Processed) { set_Value (COLUMNNAME_Processed, Processed); } @Override public boolean isProcessed() { return get_ValueAsBoolean(COLUMNNAME_Processed); } @Override public void setQtyDeliveredCatch (final @Nullable BigDecimal QtyDeliveredCatch) { set_Value (COLUMNN...
public BigDecimal getQtyPicked() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyPicked); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setQtyTU (final @Nullable BigDecimal QtyTU) { set_Value (COLUMNNAME_QtyTU, QtyTU); } @Override public BigDecimal getQtyTU() { final...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\inoutcandidate\model\X_M_ShipmentSchedule_QtyPicked.java
1
请完成以下Java代码
public void setM_Product_ID (final int M_Product_ID) { if (M_Product_ID < 1) set_ValueNoCheck (COLUMNNAME_M_Product_ID, null); else set_ValueNoCheck (COLUMNNAME_M_Product_ID, M_Product_ID); } @Override public int getM_Product_ID() { return get_ValueAsInt(COLUMNNAME_M_Product_ID); } @Override pu...
@Override public void setQty (final BigDecimal Qty) { set_Value (COLUMNNAME_Qty, Qty); } @Override public BigDecimal getQty() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty); return bd != null ? bd : BigDecimal.ZERO; } /** * RevaluationType AD_Reference_ID=541641 * Reference name: M_...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_CostRevaluation_Detail.java
1
请在Spring Boot框架中完成以下Java代码
static class GridFsReactiveMongoDatabaseFactory implements ReactiveMongoDatabaseFactory { private final ReactiveMongoDatabaseFactory delegate; private final DataMongoProperties properties; GridFsReactiveMongoDatabaseFactory(ReactiveMongoDatabaseFactory delegate, DataMongoProperties properties) { this.delega...
@Override public <T> Optional<Codec<T>> getCodecFor(Class<T> type) { return this.delegate.getCodecFor(type); } @Override public PersistenceExceptionTranslator getExceptionTranslator() { return this.delegate.getExceptionTranslator(); } @Override public CodecRegistry getCodecRegistry() { return t...
repos\spring-boot-4.0.1\module\spring-boot-data-mongodb\src\main\java\org\springframework\boot\data\mongodb\autoconfigure\DataMongoReactiveAutoConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
public void setMarketPrice(String marketPrice) { this.marketPrice = marketPrice; } public String getShopPrice() { return shopPrice; } public void setShopPrice(String shopPrice) { this.shopPrice = shopPrice; } public int getStock() { return stock; } pub...
public void setBrandEntityID(String brandEntityID) { this.brandEntityID = brandEntityID; } public Integer getProdState() { return prodState; } public void setProdState(Integer prodState) { this.prodState = prodState; } public String getContent() { return conten...
repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Common-Service-Facade\src\main\java\com\gaoxi\req\product\ProdInsertReq.java
2
请在Spring Boot框架中完成以下Java代码
public class Child { @EmbeddedId private ChildPK childPK = new ChildPK(); @ManyToOne(cascade = CascadeType.PERSIST) @MapsId("fatherId") private Father father; @ManyToOne(cascade = CascadeType.PERSIST) @MapsId("motherId") private Mother mother; private String name; private Str...
public void setMother(Mother mother) { this.mother = mother; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || g...
repos\springboot-demo-master\olingo\src\main\java\com\et\olingo\entity\Child.java
2
请完成以下Java代码
public void setMappingAttributeValue (final java.lang.String MappingAttributeValue) { set_Value (COLUMNNAME_MappingAttributeValue, MappingAttributeValue); } @Override public java.lang.String getMappingAttributeValue() { return get_ValueAsString(COLUMNNAME_MappingAttributeValue); } @Override public void s...
@Override public void setM_Shipper_ID (final int M_Shipper_ID) { if (M_Shipper_ID < 1) set_ValueNoCheck (COLUMNNAME_M_Shipper_ID, null); else set_ValueNoCheck (COLUMNNAME_M_Shipper_ID, M_Shipper_ID); } @Override public int getM_Shipper_ID() { return get_ValueAsInt(COLUMNNAME_M_Shipper_ID); } @O...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Shipper_Mapping_Config.java
1
请完成以下Java代码
public List<CmmnOnPartDeclaration> getOnParts() { return onParts; } public List<CmmnOnPartDeclaration> getOnParts(String sourceId) { return onPartMap.get(sourceId); } public void addOnPart(CmmnOnPartDeclaration onPart) { CmmnActivity source = onPart.getSource(); if (source == null) { // ...
// variableOnParts public void addVariableOnParts(CmmnVariableOnPartDeclaration variableOnPartDeclaration) { variableOnParts.add(variableOnPartDeclaration); } public boolean hasVariableOnPart(String variableEventName, String variableName) { for(CmmnVariableOnPartDeclaration variableOnPartDeclaration: var...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\model\CmmnSentryDeclaration.java
1
请在Spring Boot框架中完成以下Java代码
public class SyncContract implements IConfirmableDTO { String uuid; boolean deleted; long syncConfirmationId; LocalDate dateFrom; LocalDate dateTo; List<SyncContractLine> contractLines; String rfq_uuid; // optional @Builder(toBuilder = true) @JsonCreator public SyncContract( @JsonProperty("uuid") final S...
this.syncConfirmationId = syncConfirmationId; this.dateFrom = dateFrom; this.dateTo = dateTo; this.contractLines = contractLines; this.rfq_uuid = rfq_uuid; } @Override public String toString() { return "SyncContract [" + "dateFrom=" + dateFrom + ", dateTo=" + dateTo + ", rfq_uuid=" + rfq_uuid ...
repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-procurement\src\main\java\de\metas\common\procurement\sync\protocol\dto\SyncContract.java
2
请完成以下Java代码
public int getRetries() { return retries; } public void setRetries(int retries) { this.retries = retries; } public String getErrorDetails() { return errorDetails; } public void setErrorDetails(String errorDetails) { this.errorDetails = errorDetails; } public Map<String, VariableValue...
return variables; } public void setVariables(Map<String, VariableValueDto> variables) { this.variables = variables; } public Map<String, VariableValueDto> getLocalVariables() { return localVariables; } public void setLocalVariables(Map<String, VariableValueDto> localVariables) { this.localVar...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\externaltask\ExternalTaskFailureDto.java
1
请完成以下Java代码
protected boolean beforeSave(final boolean newRecord) { if (getLine() == 0) { setLine(); } // Planned Amount setPlannedAmt(getPlannedQty().multiply(getPlannedPrice())); // Planned Margin if (is_ValueChanged(COLUMNNAME_M_Product_ID) || is_ValueChanged(COLUMNNAME_M_Product_Category_ID) || is_V...
protected boolean afterSave(final boolean newRecord, final boolean success) { updateHeader(); return success; } @Override protected boolean afterDelete(final boolean success) { updateHeader(); return success; } private void updateHeader() { final String sql = DB.convertSqlToNative("UPDATE C_Project ...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MProjectLine.java
1
请在Spring Boot框架中完成以下Java代码
public ExternalWorkerJobAcquireBuilder forUserOrGroups(String userId, Collection<String> groups) { if (userId == null && (groups == null || groups.isEmpty())) { throw new FlowableIllegalArgumentException("at least one of userId or groups must be provided"); } this.authorizedUser = u...
return scopeType; } public String getTenantId() { return tenantId; } public String getAuthorizedUser() { return authorizedUser; } public Collection<String> getAuthorizedGroups() { return authorizedGroups; } }
repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\ExternalWorkerJobAcquireBuilderImpl.java
2
请在Spring Boot框架中完成以下Java代码
public class ProductsController extends AppController { private ObjectMapper mapper = new ObjectMapper(); public void index() { try { view("products", Product.findAll()); render().contentType("application/json"); } catch (Exception e) { view("message", "Ther...
public void destroy() { try { String id = getId(); Product p = Product.findById(id); if (p == null) { view("message", "Product id " + id + " not found.", "code", 200); render("message"); return; } p.delet...
repos\tutorials-master\web-modules\java-lite\src\main\java\app\controllers\ProductsController.java
2
请完成以下Java代码
public static TableRecordReferenceSelection ofSelectionId(@NonNull final PInstanceId selectionId) { return new TableRecordReferenceSelection(selectionId, null); } public static TableRecordReferenceSelection ofRecordRefs(@NonNull final TableRecordReferenceSet recordRefs) { return new TableRecordReferenceSelecti...
public <T> T map(@NonNull final CaseMapper<T> mapper) { if (selectionId != null) { return mapper.selectionId(selectionId); } else if (recordRefs != null) { return mapper.recordRefs(recordRefs); } else { throw new IllegalStateException("No case mapped"); // shall not happen } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\util\lang\impl\TableRecordReferenceSelection.java
1
请完成以下Java代码
private OidcClientRegistrationAuthenticationToken findRegistration( OidcClientRegistrationAuthenticationToken clientRegistrationAuthentication, OAuth2Authorization authorization) { RegisteredClient registeredClient = this.registeredClientRepository .findByClientId(clientRegistrationAuthentication.getClientI...
return new OidcClientRegistrationAuthenticationToken( (Authentication) clientRegistrationAuthentication.getPrincipal(), clientRegistration); } @SuppressWarnings("unchecked") private static void checkScope(OAuth2Authorization.Token<OAuth2AccessToken> authorizedAccessToken, Set<String> requiredScope) { Colle...
repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\oidc\authentication\OidcClientConfigurationAuthenticationProvider.java
1
请完成以下Java代码
public JSONAddressDocument getAddressDocument(@PathVariable("docId") final int docId) { userSession.assertLoggedIn(); final Document addressDoc = addressRepo.getAddressDocumentForReading(docId); return toJson(addressDoc); } @PatchMapping("/{docId}") public List<JSONDocument> processChanges( @PathVariable...
{ userSession.assertLoggedIn(); return addressRepo.getAddressDocumentForReading(docId) .getFieldLookupValues(attributeName) .transform(list -> JSONLookupValuesList.ofLookupValuesList(list, userSession.getAD_Language())); } @PostMapping("/{docId}/complete") public JSONLookupValue complete( @PathVaria...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\address\AddressRestController.java
1
请完成以下Java代码
public class GlobalExceptionHandler { @ResponseBody @ExceptionHandler(value = ApiException.class) public CommonResult handle(ApiException e) { if (e.getErrorCode() != null) { return CommonResult.failed(e.getErrorCode()); } return CommonResult.failed(e.getMessage()); ...
BindingResult bindingResult = e.getBindingResult(); String message = null; if (bindingResult.hasErrors()) { FieldError fieldError = bindingResult.getFieldError(); if (fieldError != null) { message = fieldError.getField()+fieldError.getDefaultMessage(); ...
repos\mall-master\mall-common\src\main\java\com\macro\mall\common\exception\GlobalExceptionHandler.java
1
请完成以下Java代码
public String getPattern() { return pattern; } public TemporalUnit getTruncateUnit() { return truncateUnit; } public LocalDateTime trancateTo(LocalDateTime time) { switch (this) { case DAYS: return time.truncatedTo(ChronoUnit.DAYS); case ...
case DAYS: return time.plusDays(1); case MONTHS: return time.plusMonths(1); case YEARS: return time.plusYears(1); default: throw new RuntimeException("Failed to parse partitioning property!"); } } public...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\timeseries\SqlTsPartitionDate.java
1
请完成以下Java代码
public List<Group> get(String userId) { LDAPGroupCacheEntry cacheEntry = groupCache.get(userId); if (cacheEntry != null) { if ((clockReader.get().getCurrentTime().getTime() - cacheEntry.getTimestamp().getTime()) < expirationTime) { if (ldapCacheListener != null) { ...
public LDAPGroupCacheEntry(Date timestamp, List<Group> groups) { this.timestamp = timestamp; this.groups = groups; } public Date getTimestamp() { return timestamp; } public void setTimestamp(Date timestamp) { this.timestamp = timestamp; ...
repos\flowable-engine-main\modules\flowable-ldap\src\main\java\org\flowable\ldap\LDAPGroupCache.java
1
请完成以下Java代码
public void setUser2(org.compiere.model.I_C_ElementValue User2) { set_ValueFromPO(COLUMNNAME_User2_ID, org.compiere.model.I_C_ElementValue.class, User2); } /** Set User List 2. @param User2_ID User defined list element #2 */ @Override public void setUser2_ID (int User2_ID) { if (User2_ID < 1) set...
@Override public int getUserElement1_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_UserElement1_ID); if (ii == null) return 0; return ii.intValue(); } /** Set User Element 2. @param UserElement2_ID User defined accounting Element */ @Override public void setUserElement2_ID (int UserElemen...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-gen\de\metas\acct\model\X_Fact_Acct_Summary.java
1
请完成以下Java代码
public class ParticipantAssociationImpl extends BaseElementImpl implements ParticipantAssociation { protected static ElementReference<Participant, InnerParticipantRef> innerParticipantRefChild; protected static ElementReference<Participant, OuterParticipantRef> outerParticipantRefChild; public static void regis...
public Participant getInnerParticipant() { return innerParticipantRefChild.getReferenceTargetElement(this); } public void setInnerParticipant(Participant innerParticipant) { innerParticipantRefChild.setReferenceTargetElement(this, innerParticipant); } public Participant getOuterParticipant() { retu...
repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\ParticipantAssociationImpl.java
1
请完成以下Java代码
public class QuartzJob implements Serializable { private static final long serialVersionUID = 1L; /**id*/ @TableId(type = IdType.ASSIGN_ID) private java.lang.String id; /**创建人*/ private java.lang.String createBy; /**创建时间*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeForm...
/**cron表达式*/ @Excel(name="cron表达式",width=30) private java.lang.String cronExpression; /**参数*/ @Excel(name="参数",width=15) private java.lang.String parameter; /**描述*/ @Excel(name="描述",width=40) private java.lang.String description; /**状态 0正常 -1停止*/ @Excel(name="状态",width=15,dicCode="quartz_status") @Dict(dicCo...
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\quartz\entity\QuartzJob.java
1
请完成以下Java代码
public void operation1() { while (true) { tryLock(lock1, 50); print("lock1 acquired, trying to acquire lock2."); sleep(50); if (tryLock(lock2)) { print("lock2 acquired."); } else { print("cannot acquire lock2, releasing...
.getName() + ": " + message); } public void sleep(long millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { e.printStackTrace(); } } public void tryLock(Lock lock, long millis) { try { lock.tryLock(millis, TimeUnit...
repos\tutorials-master\core-java-modules\core-java-concurrency-advanced-3\src\main\java\com\baeldung\deadlockAndLivelock\LivelockExample.java
1
请在Spring Boot框架中完成以下Java代码
public abstract class ResourceCondition extends SpringBootCondition { private final String name; private final String property; private final String[] resourceLocations; /** * Create a new condition. * @param name the name of the component * @param property the configuration property * @param resourceLo...
/** * Check if one of the default resource locations actually exists. * @param context the condition context * @param metadata the annotation metadata * @return the condition outcome */ protected ConditionOutcome getResourceOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { List<String> fo...
repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\condition\ResourceCondition.java
2
请在Spring Boot框架中完成以下Java代码
public class TaskDecoratorConfiguration { @Bean @Order(2) TaskDecorator loggingTaskConfigurator() { return runnable -> () -> { log.info("Running Task: {}", runnable); try { runnable.run(); } finally { log.info("Finished Task: {}", ...
@Bean @Order(1) TaskDecorator measuringTaskConfigurator() { return runnable -> () -> { final var ts1 = System.currentTimeMillis(); try { runnable.run(); } finally { final var ts2 = System.currentTimeMillis(); log.info("F...
repos\tutorials-master\spring-boot-modules\spring-boot-4\src\main\java\com\baeldung\spring\mvc\TaskDecoratorConfiguration.java
2
请完成以下Java代码
private String buildFinalSql() { final StringBuilder finalSql = new StringBuilder(); final String sqlComment = toSqlCommentLine(comment); if (sqlComment != null) { finalSql.append(sqlComment); } if (sqlCommand2 != null && !sqlCommand2.isEmpty()) { finalSql.append(toSqlCommentLine(timestamp.toStri...
return finalSql.toString(); } private static String toSqlCommentLine(@Nullable final String comment) { final String commentNorm = StringUtils.trimBlankToNull(comment); if (commentNorm == null) { return null; } return "-- " + commentNorm .replace("\r\n", "\n") .replace("\n", "\n-- ") + "...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\migration\logger\Sql.java
1
请完成以下Java代码
private static boolean canRepresentInNBits(BigInteger number, int numBits) { BigInteger minValue = BigInteger.ONE.shiftLeft(numBits - 1).negate(); // -2^(numBits-1) BigInteger maxValue = BigInteger.ONE.shiftLeft(numBits - 1).subtract(BigInteger.ONE); // 2^(numBits-1) - 1 return number.compareTo(...
return formatInNibbles(binary); } private static String performTwosComplementUsingShortCut(String binary) { int firstOneIndexFromRight = binary.lastIndexOf('1'); if (firstOneIndexFromRight == -1) { return binary; } String rightPart = binary.substring(firstOneIndexFro...
repos\tutorials-master\core-java-modules\core-java-numbers-7\src\main\java\com\baeldung\twoscomplement\TwosComplement.java
1
请完成以下Java代码
protected Method findMethod(String name, Class<?> clazz, Class<?> returnType, Class<?>[] paramTypes) { Method method = null; try { method = clazz.getMethod(name, paramTypes); } catch (NoSuchMethodException e) { throw new MethodNotFoundException(LocalMessages.get("error.property.method.notfound", name, clazz...
String name = bindings.convert(property, String.class); Method method = findMethod(name, base.getClass(), returnType, paramTypes); try { return method.invoke(base, paramValues); } catch (IllegalAccessException e) { throw new ELException(LocalMessages.get("error.property.method.access", name, base.getClass()...
repos\camunda-bpm-platform-master\juel\src\main\java\org\camunda\bpm\impl\juel\AstProperty.java
1
请完成以下Java代码
private void addExchangeOnCommit(ServerWebExchange exchange, PrincipalAndSession principalAndSession) { RecordableServerHttpRequest sourceRequest = new RecordableServerHttpRequest(exchange.getRequest()); HttpExchange.Started startedHttpExchange = HttpExchange.start(sourceRequest); exchange.getResponse().beforeCom...
this.principal = (zipped[0] != NONE) ? (Principal) zipped[0] : null; this.session = (zipped[1] != NONE) ? (WebSession) zipped[1] : null; } @Nullable Principal getPrincipal() { return this.principal; } @Nullable String getSessionId() { return (this.session != null && this.session.isStarted()) ? this.s...
repos\spring-boot-4.0.1\module\spring-boot-webflux\src\main\java\org\springframework\boot\webflux\actuate\web\exchanges\HttpExchangesWebFilter.java
1
请完成以下Java代码
public void setPreUpgradeExpression(String preUpgradeExpression) { this.preUpgradeExpression = preUpgradeExpression; } public void setPostUpgradeExpression(String postUpgradeExpression) { this.postUpgradeExpression = postUpgradeExpression; } @Override public String getMigrateToCase...
return changePlanItemDefinitionWithNewTargetIdsMappings; } @Override public String getPreUpgradeExpression() { return preUpgradeExpression; } @Override public String getPostUpgradeExpression() { return postUpgradeExpression; } @Override public Map<String, Map<Strin...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\migration\CaseInstanceMigrationDocumentImpl.java
1
请完成以下Java代码
public String getStr() { throw new RuntimeException(NOT_SUPPORTED); } @Override public long getLong() { throw new RuntimeException(NOT_SUPPORTED); } @Override public double getDouble() { throw new RuntimeException(NOT_SUPPORTED); } @Override public boolean ...
@Override public String getJson() { throw new RuntimeException(NOT_SUPPORTED); } public String toString() { return valueToString(); } @Override public int compareTo(DataPoint dataPoint) { return StringUtils.compareIgnoreCase(valueToString(), dataPoint.valueToString()); ...
repos\thingsboard-master\common\edqs\src\main\java\org\thingsboard\server\edqs\data\dp\AbstractDataPoint.java
1
请完成以下Java代码
public boolean isMissing() { return this.reason == Reason.MISSING; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } RequiredFactorError that = (RequiredFactorError) o; return Objects.equals(this.requiredFactor, that.requiredFactor) && this.rea...
public static RequiredFactorError createExpired(RequiredFactor requiredFactor) { return new RequiredFactorError(requiredFactor, Reason.EXPIRED); } /** * The reason that the error occurred. * * @author Rob Winch * @since 7.0 */ private enum Reason { /** * The authority was missing. * @see #isMis...
repos\spring-security-main\core\src\main\java\org\springframework\security\authorization\RequiredFactorError.java
1
请完成以下Java代码
private ImmutableMap<WarehouseId, WarehouseInfo> retrieveByIds(final Set<WarehouseId> ids) { if (ids.isEmpty()) {return ImmutableMap.of();} return dao.getByIds(ids) .stream() .map(WarehousesLoadingCache::fromRecord) .collect(ImmutableMap.toImmutableMap(WarehouseInfo::getWarehouseId, Function.identity(...
.locators(dao.getLocators(warehouseId) .stream() .map(WarehousesLoadingCache::fromRecord) .collect(ImmutableList.toImmutableList())) .build(); } private static LocatorInfo fromRecord(final I_M_Locator record) { return LocatorInfo.builder() .locatorId(LocatorId.ofRepoId(record.getM_Wareh...
repos\metasfresh-new_dawn_uat\backend\de.metas.inventory.mobileui\src\main\java\de\metas\inventory\mobileui\deps\warehouse\WarehousesLoadingCache.java
1
请完成以下Java代码
public boolean isSelfService () { Object oo = get_Value(COLUMNNAME_IsSelfService); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } public I_R_Category getR_Category() throws RuntimeException { return (I_R_Cate...
*/ public void setR_Category_ID (int R_Category_ID) { if (R_Category_ID < 1) set_ValueNoCheck (COLUMNNAME_R_Category_ID, null); else set_ValueNoCheck (COLUMNNAME_R_Category_ID, Integer.valueOf(R_Category_ID)); } /** Get Category. @return Request Category */ public int getR_Category_ID () { In...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_R_CategoryUpdates.java
1
请完成以下Java代码
protected ImportRecordType fetch(final ResultSet rs) throws SQLException { return recordLoader.retrieveImportRecord(ctx, rs); } }); } @Override public void runSQLAfterRowImport(@NonNull final ImportRecordType importRecord) { final List<DBFunction> functions = dbFunctions.getAvailableAfterRowFunctions...
{ final AdempiereException metasfreshEx = AdempiereException.wrapIfNeeded(ex); final AdIssueId issueId = errorManager.createIssue(metasfreshEx); loggable.addLog("Failed running " + function + ": " + AdempiereException.extractMessage(metasfreshEx) + " (AD_Issue_ID=" + issueId.getRepoId() + ")"); throw me...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\processing\SqlImportSource.java
1
请在Spring Boot框架中完成以下Java代码
public class WeekDayCalendarIncrementor implements ICalendarIncrementor { private final int weeksToAdd; private final DayOfWeek dayOfWeek; public WeekDayCalendarIncrementor(final int weeksToAdd, @NonNull final DayOfWeek dayOfWeek) { Check.assume(weeksToAdd > 0, "weeksToAdd({}) > 0", weeksToAdd); this.weeksToA...
{ if (weeksToAdd > 1) { throw new UnsupportedOperationException("Decrementing using a step greater than one is not supported"); } if (date.getDayOfWeek().getValue() <= dayOfWeek.getValue()) { return date.with(TemporalAdjusters.nextOrSame(dayOfWeek)).minusWeeks(weeksToAdd); } else { return da...
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\time\generator\WeekDayCalendarIncrementor.java
2
请完成以下Java代码
public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * Gets the value o...
* */ public void setType(String value) { this.type = value; } /** * Gets the value of the code property. * * @return * possible object is * {@link String } * */ public String getCode() { return code; } /** * Sets t...
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\DiagnosisType.java
1
请完成以下Java代码
public class WebDeliveryMethodNotificationTemplate extends DeliveryMethodNotificationTemplate implements HasSubject { @NoXss(fieldName = "web notification subject") @Length(fieldName = "web notification subject", max = 150, message = "cannot be longer than 150 chars") @NotEmpty private String subject; ...
@JsonIgnore public String getButtonLink() { return getButtonConfigProperty("link"); } @JsonIgnore public void setButtonLink(String buttonLink) { getButtonConfig().ifPresent(buttonConfig -> { buttonConfig.set("link", new TextNode(buttonLink)); }); } private S...
repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\notification\template\WebDeliveryMethodNotificationTemplate.java
1
请完成以下Java代码
public OrderGroupInfo getGroupInfoById(@NonNull final GroupId groupId) { final I_C_Order_CompensationGroup groupRecord = retrieveGroupRecord(groupId); return OrderGroupInfo.builder() .groupId(groupId) .name(groupRecord.getName()) .bomId(ProductBOMId.optionalOfRepoId(groupRecord.getPP_Product_BOM_ID()))...
final I_C_OrderLine orderLine = orderLineBL.createOrderLine(targetOrder); final ProductId productId = from.getProductId(); orderLine.setM_Product_ID(productId.getRepoId()); orderLine.setM_AttributeSetInstance_ID(AttributeSetInstanceId.NONE.getRepoId()); orderLine.setC_UOM_ID(from.getQty().getUomId().getRepoId()...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\compensationGroup\OrderGroupRepository.java
1
请完成以下Java代码
public SqlAndParams toSqlAndParams() { if (noRecords) { return SQL_ALWAYS_FALSE; } else { SqlAndParams viewSelectionWhereClause; if (rowsPresentInViewSelection == null || rowsPresentInViewSelection.isEmpty()) { viewSelectionWhereClause = null; } else if (isRowsNotPresentInViewSelection)...
{ return toSqlAndParams().toSqlStringInlineParams(); } public <T> IQueryFilter<T> toQueryFilter() { final SqlAndParams sqlAndParams = toSqlAndParams(); return TypedSqlQueryFilter.of(sqlAndParams.getSql(), sqlAndParams.getSqlParams()); } public SqlViewRowsWhereClause withRowsNotPresentInViewSelection() { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\descriptor\SqlViewRowsWhereClause.java
1
请在Spring Boot框架中完成以下Java代码
public HttpResponse buildRequest(Map<String, String> sParaTemp) throws Exception { // 待请求参数数组 Map<String, String> sPara = AlipaySubmit.buildRequestPara(sParaTemp); HttpProtocolHandler httpProtocolHandler = HttpProtocolHandler.getInstance(); HttpRequest request = new HttpRequest(HttpResultType.BYTES); // 设置编...
file = new File(dir, bill_date + "_" + index + ".xml"); index++; } // 判断父文件是否存在,不存在就创建 if (!file.getParentFile().exists()) { if (!file.getParentFile().mkdirs()) { // 新建文件目录失败,抛异常 throw new IOException("创建文件(父层文件夹)失败, filepath: " + file.getAbsolutePath()); } } // 判断文件是否存在,不存在则创建 if (!file.e...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\fileDown\impl\AlipayFileDown.java
2
请完成以下Java代码
public class GL_JournalBatch { private final IDocTypeBL docTypeBL = Services.get(IDocTypeBL.class); @CalloutMethod(columnNames = I_GL_JournalBatch.COLUMNNAME_DateDoc) public void onDateDoc(final I_GL_JournalBatch glJournalBatch) { final Timestamp dateDoc = glJournalBatch.getDateDoc(); if (dateDoc == null) { ...
glJournalBatch.setDocumentNo(documentNoInfo.getDocumentNo()); } } private Optional<I_C_DocType> getDocType(final I_GL_JournalBatch glJournalBatch) { return DocTypeId.optionalOfRepoId(glJournalBatch.getC_DocType_ID()) .map(docTypeBL::getById); } // Old/missing callouts // "GL_JournalBatch";"C_Period_ID";...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\callout\GL_JournalBatch.java
1
请在Spring Boot框架中完成以下Java代码
public BigDecimal getQtyTUs() { return qtyTUs; } public BigDecimal getQtyInUOM() { return qtyInUOM; } public String getUOM_x12de355() { return UOM_x12de355; } public String getPriceUOM_x12de355() { return priceUOM_x12de355; } public BigDecimal getPrice() { return price; } public String get...
} public int getM_ProductPrice_ID() { return M_ProductPrice_ID; } public int getM_ProductPrice_Attribute_ID() { return M_ProductPrice_Attribute_ID; } public int getM_HU_PI_Item_Product_ID() { return M_HU_PI_Item_Product_ID; } public int getC_BPartner_ID() { return C_BPartner_ID; } public int g...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\excelimport\Excel_OLCand_Row.java
2
请完成以下Java代码
public void windowLostFocus(WindowEvent e) { } }); card.first(cardContainer); if (page > 1) { JXPanel ctrl = new JXPanel(); JXButton previous = new JXButton("<"); JXButton next = new JXButton(">"); previous.addActionListener(new ActionListener() { @Override public void action...
private JDialog dialog; private Window window; PreviewMouseAdapter(JDialog d, Window w) { dialog = d; window = w; } @Override public void mouseClicked(MouseEvent e) { dialog.dispose(); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { AEnv.showWin...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\WindowMenu.java
1
请完成以下Java代码
public Map<String, Object> getCustomColumnsAsMap(@NonNull final PO po) { final ZoneId zoneId = orgDAO.getTimeZone(OrgId.ofRepoId(po.getAD_Org_ID())); final POInfo poInfo = po.getPOInfo(); final ImmutableMap.Builder<String, Object> customColumnsCollector = ImmutableMap.builder(); streamCustomRestAPIColumns(p...
} } @NonNull public CustomColumnsJsonValues getCustomColumnsJsonValues(@NonNull final PO record) { final ZoneId zoneId = extractZoneId(record); return convertToJsonValues(record, zoneId); } @NonNull private CustomColumnsJsonValues convertToJsonValues(final @NonNull PO record, final ZoneId zoneId) { fina...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\persistence\custom_columns\CustomColumnService.java
1
请完成以下Java代码
public String[] getActivityInstanceIds() { return activityInstanceIds; } public String[] getActivityIds() { return activityIds; } public String[] getTenantIds() { return tenantIds; } public HistoricDecisionInstanceQuery includeInputs() { includeInput = true; return this; } @Overr...
public String getRootDecisionInstanceId() { return rootDecisionInstanceId; } public HistoricDecisionInstanceQuery rootDecisionInstanceId(String rootDecisionInstanceId) { ensureNotNull(NotValidException.class, "rootDecisionInstanceId", rootDecisionInstanceId); this.rootDecisionInstanceId = rootDecisionI...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\HistoricDecisionInstanceQueryImpl.java
1
请完成以下Java代码
public class VTextBeanInfo extends SimpleBeanInfo { private Class beanClass = VText.class; private String iconColor16x16Filename; private String iconColor32x32Filename; private String iconMono16x16Filename; private String iconMono32x32Filename; public VTextBeanInfo() { } public PropertyDescriptor[] getPropert...
} catch(IntrospectionException ex) { ex.printStackTrace(); return null; } } public java.awt.Image getIcon(int iconKind) { switch (iconKind) { case BeanInfo.ICON_COLOR_16x16: return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null; case BeanInfo.ICON_COLOR_32x32: r...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VTextBeanInfo.java
1
请完成以下Java代码
public void setFinishedProcessInstanceCount(long finishedProcessInstanceCount) { this.finishedProcessInstanceCount = finishedProcessInstanceCount; } public void setCleanableProcessInstanceCount(long cleanableProcessInstanceCount) { this.cleanableProcessInstanceCount = cleanableProcessInstanceCount; } ...
public String getTenantId() { return tenantId; } protected CleanableHistoricProcessInstanceReport createNewReportQuery(ProcessEngine engine) { return engine.getHistoryService().createCleanableHistoricProcessInstanceReport(); } public static List<CleanableHistoricProcessInstanceReportResultDto> convert...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\CleanableHistoricProcessInstanceReportResultDto.java
1
请完成以下Java代码
public class MigratingEventSubscriptionInstance implements MigratingInstance, RemovingInstance, EmergingInstance { public static final MigrationLogger MIGRATION_LOGGER = ProcessEngineLogger.MIGRATION_LOGGER; protected EventSubscriptionEntity eventSubscriptionEntity; protected ScopeImpl targetScope; protected ...
public void attachState(MigratingScopeInstance newOwningInstance) { eventSubscriptionEntity.setExecution(newOwningInstance.resolveRepresentativeExecution()); } @Override public void attachState(MigratingTransitionInstance targetTransitionInstance) { throw MIGRATION_LOGGER.cannotAttachToTransitionInstance...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\migration\instance\MigratingEventSubscriptionInstance.java
1
请完成以下Java代码
public static final UpdateAssignmentResult noUpdateDone(@NonNull final AssignableInvoiceCandidate candidate) { return new UpdateAssignmentResult(false, candidate, ImmutableList.of()); } /** {@code false} means that no update was required since the data as loaded from the DB was already up to date. */ boolea...
* Note that this candidate has no assignments anymore. */ @NonNull AssignableInvoiceCandidate assignableCandidate; /** * Each pair's {@link AssignCandidatesRequest#getAssignableInvoiceCandidate()} is this result's {@link #assignableCandidate}. */ @Singular List<UnassignedPairOfCandidates> unassigned...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\refund\CandidateAssignmentService.java
1
请完成以下Java代码
public @Nullable Object getParameterDefaultValue(final IProcessDefaultParameter parameter) { if (parameter.getColumnName().equals(PARAM_QtyToPick)) { final ShipmentScheduleAndJobScheduleId shipmentScheduleAndJobScheduleId = getShipmentScheduleAndJobScheduleIds().singleOrNull(); if (shipmentScheduleAndJobSche...
{ throw AdempiereException.noSelection(); } pickingJobScheduleService.createOrUpdate(CreateOrUpdatePickingJobSchedulesRequest.builder() .shipmentScheduleAndJobScheduleIds(ids) .workplaceId(workplaceId) .qtyToPickBD(qtyToPickBD) .build()); return MSG_OK; } @Override protected void postProc...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pickingJobSchedule\process\PickingJobScheduleView_Schedule.java
1
请完成以下Java代码
public java.lang.String getDocBaseType () { return (java.lang.String)get_Value(COLUMNNAME_DocBaseType); } @Override public org.compiere.model.I_M_Warehouse getM_Warehouse() throws RuntimeException { return get_ValueAsPO(COLUMNNAME_M_Warehouse_ID, org.compiere.model.I_M_Warehouse.class); } @Override publi...
if (ii == null) return 0; return ii.intValue(); } /** Set Lagerzuordnung. @param M_Warehouse_Routing_ID Lagerzuordnung */ @Override public void setM_Warehouse_Routing_ID (int M_Warehouse_Routing_ID) { if (M_Warehouse_Routing_ID < 1) set_ValueNoCheck (COLUMNNAME_M_Warehouse_Routing_ID, null); els...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_M_Warehouse_Routing.java
1
请完成以下Java代码
public static boolean isAccessContainer (Properties ctx, int CM_Container_ID, int AD_User_ID) { // NIT return true; } // isAccessContainer /** * Access to Container * @param ctx context * @param CM_Container_ID * @param AD_Role_ID 0 or role to checl * @param C_BPGroup_ID 0 or bpartner to check * ...
* Standard Constructor * @param ctx context * @param CM_AccessProfile_ID id * @param trxName transaction */ public MAccessProfile (Properties ctx, int CM_AccessProfile_ID, String trxName) { super (ctx, CM_AccessProfile_ID, trxName); } // MAccessProfile /** * Load Constructor * @param ctx context ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MAccessProfile.java
1
请完成以下Java代码
private void index() { this.indexedDependencies.clear(); this.content.forEach((group) -> group.content.forEach((dependency) -> { // Apply defaults if (dependency.getCompatibilityRange() == null && group.getCompatibilityRange() != null) { dependency.setCompatibilityRange(group.getCompatibilityRange()); ...
for (String alias : dependency.getAliases()) { indexDependency(alias, dependency); } })); } private void indexDependency(String id, Dependency dependency) { Dependency existing = this.indexedDependencies.get(id); if (existing != null) { throw new IllegalArgumentException("Could not register " + depen...
repos\initializr-main\initializr-metadata\src\main\java\io\spring\initializr\metadata\DependenciesCapability.java
1
请完成以下Java代码
public void bpmnError(String errorCode, String errorMessage, Map<String, Object> variables) { ensureTaskActive(); ActivityExecution activityExecution = getExecution(); BpmnError bpmnError = null; if (errorMessage != null) { bpmnError = new BpmnError(errorCode, errorMessage); } else { bpm...
if (variables != null && !variables.isEmpty()) { activityExecution.setVariables(variables); } EscalationHandler.propagateEscalation(activityExecution, escalationCode); } public static enum TaskState { STATE_INIT ("Init"), STATE_CREATED ("Created"), STATE_COMPLETED ("Completed"), STAT...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\TaskEntity.java
1
请完成以下Java代码
private void startProcess(final int AD_Process_ID, final boolean IsSOTrx) { ProcessDialog.builder() .setAD_Process_ID(AD_Process_ID) .setIsSOTrx(IsSOTrx) .show(); } private void startWorkflow(final WorkflowId workflowId) { if (m_menu == null) { new AdempiereException("Cannot start workflow bec...
{ task = new MTask(Env.getCtx(), AD_Task_ID, ITrx.TRXNAME_None); } if (task.getAD_Task_ID() != AD_Task_ID) { task = null; } if (task == null) { return; } m_menu.getWindowManager().add(new ATask(m_name, task)); // ATask.start(m_name, task); } // startTask /** * Start Form * * @para...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\AMenuStartItem.java
1
请完成以下Java代码
protected synchronized void getNewBlock() { // TODO http://jira.codehaus.org/browse/ACT-45 use a separate 'requiresNew' command executor IdBlock idBlock = commandExecutor.execute(new GetNextIdBlockCmd(idBlockSize)); this.nextId = idBlock.getNextId(); this.lastId = idBlock.getLastId(); } public int ...
} public void setCommandExecutor(CommandExecutor commandExecutor) { this.commandExecutor = commandExecutor; } /** * Reset inner state so that the generator fetches a new block of IDs from the database * when the next ID generation request is received. */ public void reset() { nextId = 0; ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\db\DbIdGenerator.java
1
请在Spring Boot框架中完成以下Java代码
public class CandidateSaveResult { @NonNull Candidate candidate; @Nullable DateAndSeqNo previousTime; @Nullable BigDecimal previousQty; public CandidateId getId() {return candidate.getId();} public Optional<MaterialDispoGroupId> getEffectiveGroupId() {return Optional.ofNullable(candidate.getEffectiveGroupId());}...
/** * Convenience method that returns a new instance whose included {@link Candidate} has the given id. */ public CandidateSaveResult withCandidateId(@Nullable final CandidateId candidateId) { return toBuilder() .candidate(candidate.withId(candidateId)) .build(); } /** * Convenience method that ret...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java\de\metas\material\dispo\commons\repository\CandidateSaveResult.java
2
请完成以下Java代码
public void setDescription (String Description) { set_Value (COLUMNNAME_Description, Description); } /** Get Description. @return Optional short description of the record */ public String getDescription () { return (String)get_Value(COLUMNNAME_Description); } /** Set Name. @param Name Alphanumer...
/** ShareType AD_Reference_ID=365 */ public static final int SHARETYPE_AD_Reference_ID=365; /** Client (all shared) = C */ public static final String SHARETYPE_ClientAllShared = "C"; /** Org (not shared) = O */ public static final String SHARETYPE_OrgNotShared = "O"; /** Client or Org = x */ public static final ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_ClientShare.java
1
请完成以下Java代码
public class RfQEventListenerAdapter implements IRfQEventListener { protected RfQEventListenerAdapter() { super(); } @Override public void onAfterComplete(final I_C_RfQ rfq) { // nothing } @Override public void onAfterClose(final I_C_RfQ rfq) { // nothing } @Override public void onBeforeComplete(f...
public void onAfterClose(final I_C_RfQResponse rfqResponse) { // nothing } @Override public void onBeforeUnClose(final I_C_RfQ rfq) { // nothing } @Override public void onAfterUnClose(final I_C_RfQ rfq) { // nothing } @Override public void onBeforeUnClose(final I_C_RfQResponse rfqResponse) { // ...
repos\metasfresh-new_dawn_uat\backend\de.metas.rfq\src\main\java\de\metas\rfq\event\RfQEventListenerAdapter.java
1
请完成以下Java代码
public IMutableAllocationResult copy() { final MutableAllocationResult resultNew = new MutableAllocationResult(qtyToAllocateInitial); resultNew.qtyToAllocate = qtyToAllocate; resultNew.transactions.addAll(transactions); resultNew.attributeTransactions.addAll(attributeTransactions); return resultNew; } @...
@Override public BigDecimal getQtyToAllocate() { return qtyToAllocate; } @Override public BigDecimal getQtyAllocated() { return qtyToAllocateInitial.subtract(qtyToAllocate); } @Override public void addTransaction(final IHUTransactionCandidate trx) { transactions.add(trx); } @Override public void a...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\MutableAllocationResult.java
1
请完成以下Java代码
public class Post { /** * Title of the post. Must be unique. */ private String title; /** * Author of the post. */ private String author; /** * Tags of the post. */ private List<String> tags; /** * Gets the {@link #title}. * * @return the {@link #title} */ public String getTitle() { re...
/* * (non-Javadoc) * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((author == null) ? 0 : author.hashCode()); result = prime * result + ((tags == null) ? 0 : tags.hashCode()); result = prime * result + ((titl...
repos\tutorials-master\persistence-modules\java-mongodb-3\src\main\java\com\baeldung\mongo\tagging\Post.java
1
请在Spring Boot框架中完成以下Java代码
public DataSource dataSource() { return initDruidDataSource(druidOneConfig); } @Bean(name = "secondaryDataSource") @Primary public DataSource secondaryDataSource() { return initDruidDataSource(druidTwoConfig); } private DruidDataSource initDruidDataSource(DruidConfig config) { ...
datasource.setTestWhileIdle(druidConfig.isTestWhileIdle()); datasource.setTestOnBorrow(druidConfig.isTestOnBorrow()); datasource.setTestOnReturn(druidConfig.isTestOnReturn()); datasource.setPoolPreparedStatements(druidConfig.isPoolPreparedStatements()); datasource.setMaxPoolPreparedState...
repos\spring-boot-leaning-master\2.x_42_courses\第 3-7 课: Spring Boot 集成 Druid 监控数据源\spring-boot-multi-Jpa-druid\src\main\java\com\neo\config\druid\DruidDBConfig.java
2
请在Spring Boot框架中完成以下Java代码
private static class ContributorDataLoaderContext implements ConfigDataLoaderContext { private final ConfigDataEnvironmentContributors contributors; ContributorDataLoaderContext(ConfigDataEnvironmentContributors contributors) { this.contributors = contributors; } @Override public ConfigurableBootstrapCo...
} } private class InactiveSourceChecker implements BindHandler { private final @Nullable ConfigDataActivationContext activationContext; InactiveSourceChecker(@Nullable ConfigDataActivationContext activationContext) { this.activationContext = activationContext; } @Override public Object onSuccess(Con...
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\config\ConfigDataEnvironmentContributors.java
2
请在Spring Boot框架中完成以下Java代码
public ResponseEntity<?> unaquireJob(@PathVariable String jobId, @RequestBody UnacquireExternalWorkerJobsRequest request) { String workerId = request.getWorkerId(); if (StringUtils.isEmpty(workerId)) { throw new FlowableIllegalArgumentException("worker id is required"); } Ex...
throw new FlowableException("Cannot unacquire CMMN job. There is no CMMN engine available"); } } else { throw new FlowableIllegalArgumentException( "Can only unacquire BPMN or CMMN external job. Job with id '" + jobId + "' is from scope '" + job.getScopeT...
repos\flowable-engine-main\modules\flowable-external-job-rest\src\main\java\org\flowable\external\job\rest\service\api\acquire\ExternalWorkerUnacquireJobResource.java
2
请在Spring Boot框架中完成以下Java代码
public class SenderToMetasfresh { private final RabbitTemplate rabbitTemplate; private final RabbitMQAuditService auditService; private final Queue queue; public SenderToMetasfresh( @NonNull final RabbitTemplate rabbitTemplate, @NonNull final RabbitMQAuditService auditService, @NonNull @Qualifier(Constant...
{ messageAsBytes = Constants.PROCUREMENT_WEBUI_OBJECT_MAPPER.writeValueAsBytes(requestToMetasfresh); } catch (final JsonProcessingException e) { throw new SendSyncException(requestToMetasfresh,e); } final MessageProperties messageProperties = new MessageProperties(); messageProperties.setContentEncod...
repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\sync\rabbitmq\SenderToMetasfresh.java
2
请完成以下Java代码
void updateESRImportReconciledStatus(@NonNull final Set<ESRImportId> esrImportIds) { if (esrImportIds.isEmpty()) { // shall NOT happen return; } final ImmutableSet<ESRImportId> notReconciledESRImportIds = esrImportDAO.retrieveNotReconciledESRImportIds(esrImportIds); for (final I_ESR_Import esrImport ...
esrImportDAO.save(esrImportLine); } private void unlinkESRImportLineFromBankStatement(final I_ESR_ImportLine esrImportLine) { esrImportLine.setC_BankStatement_ID(-1); esrImportLine.setC_BankStatementLine_ID(-1); esrImportLine.setC_BankStatementLine_Ref_ID(-1); esrImportDAO.save(esrImportLine); } @Overrid...
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java\de\metas\payment\esr\api\impl\ESRImportBL.java
1
请完成以下Java代码
WebServer start() { WebHandler webHandler = (WebHandler) toHttpHandler(routingFunction()); HttpHandler httpHandler = WebHttpHandlerBuilder.webHandler(webHandler) .filter(new IndexRewriteFilter()) .build(); Tomcat tomcat = new Tomcat(); tomcat.setHostname("localho...
TomcatWebServer server = new TomcatWebServer(tomcat); server.start(); return server; } public static void main(String[] args) { try { new FunctionalWebApplication().start(); } catch (Exception e) { e.printStackTrace(); } } }
repos\tutorials-master\spring-reactive-modules\spring-reactive-2\src\main\java\com\baeldung\reactive\urlmatch\ExploreSpring5URLPatternUsingRouterFunctions.java
1
请完成以下Java代码
private void buildAllContractOrderList(@NonNull final OrderId orderId, @NonNull final Set<OrderId> contractOrderIds) { final I_C_Order order = InterfaceWrapperHelper.load(orderId, I_C_Order.class); final OrderId nextAncestorId = OrderId.ofRepoIdOrNull(order.getRef_FollowupOrder_ID()); if (nextAncestorId != null)...
public boolean isContractSalesOrder(@NonNull final OrderId orderId) { return Services.get(IQueryBL.class) .createQueryBuilder(I_C_OrderLine.class) .addOnlyActiveRecordsFilter() .addEqualsFilter(I_C_OrderLine.COLUMNNAME_C_Order_ID, orderId) .addNotNull(I_C_OrderLine.COLUMNNAME_C_Flatrate_Conditions_ID...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\order\ContractOrderService.java
1
请在Spring Boot框架中完成以下Java代码
public int valence(int head) { return rightValency(head) + leftValency(head); } /** * @param head * @return the current index of right modifiers */ public int rightValency(int head) { return rightValency[head]; } /** * @param head * @return the curr...
public void setBufferHead(int bufferHead) { this.bufferHead = bufferHead; } @Override public State clone() { State state = new State(arcs.length - 1); state.stack = new ArrayDeque<Integer>(stack); for (int dependent = 0; dependent < arcs.length; dependent++) ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dependency\perceptron\transition\configuration\State.java
2
请在Spring Boot框架中完成以下Java代码
Mono<String> getFile(@PathVariable("name") String fileName) { return fileService.getFileContentAsString(fileName); } @GetMapping(value = "/{name}/blocking-search") Mono<Boolean> blockingSearch(@PathVariable("name") String fileName, @RequestParam String term) { return fileContentSearchServic...
return fileContentSearchService.blockingSearchOnCustomThreadPool(fileName, term) .doOnNext(aBoolean -> ThreadLogger.log("1. In Controller")) .map(Function.identity()) .doOnNext(aBoolean -> ThreadLogger.log("2. In Controller")); } @GetMapping(value = "/{name}/blocking-search-...
repos\tutorials-master\spring-reactive-modules\spring-reactive-4\src\main\java\com\baeldung\webflux\block\controller\FileController.java
2
请在Spring Boot框架中完成以下Java代码
public boolean isGlobalAcquireLockEnabled() { return false; } @Override public String getGlobalAcquireLockPrefix() { return ""; } @Override public Duration getLockWaitTime() { return lockWaitTime; } @Override ...
@Override public Duration getLockForceAcquireAfter() { return lockForceAcquireAfter; } }; boolean isGlobalAcquireLockEnabled(); String getGlobalAcquireLockPrefix(); Duration getLockWaitTime(); Duration getLockPollRate(); Duration getLockForceAcquireAfter(); }
repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\asyncexecutor\AcquireJobsRunnableConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
public ResponseEntity<String> postToTopic(@RequestBody String message, @PathVariable("topic") String topic) throws FirebaseMessagingException { Message msg = Message.builder() .setTopic(topic) .putData("body", message) .build(); String id = fcm.send(msg); ...
BatchResponse response = fcm.sendMulticast(msg); List<String> ids = response.getResponses() .stream() .map(r->r.getMessageId()) .collect(Collectors.toList()); return ResponseEntity .status(HttpStatus.ACCEPTED) .body(ids); } ...
repos\tutorials-master\gcp-firebase\src\main\java\com\baeldung\gcp\firebase\publisher\controller\FirebasePublisherController.java
2
请在Spring Boot框架中完成以下Java代码
public List<HADRE1> getHADRE1() { if (hadre1 == null) { hadre1 = new ArrayList<HADRE1>(); } return this.hadre1; } /** * Gets the value of the hcurr1 property. * * @return * possible object is * {@link HCURR1 } * */ public ...
/** * Sets the value of the htrsd1 property. * * @param value * allowed object is * {@link HTRSD1 } * */ public void setHTRSD1(HTRSD1 value) { this.htrsd1 = value; } /** * Gets the value of the htrsc1 property. * * @return * ...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_stepcom_orders\de\metas\edi\esb\jaxb\stepcom\orders\HEADERXbest.java
2
请完成以下Java代码
public void setTextValue2(String textValue2) { this.textValue2 = textValue2; } public Object getCachedValue() { return cachedValue; } public void setCachedValue(Object cachedValue) { this.cachedValue = cachedValue; } // misc methods ////////////////////////////////////...
sb.append(", longValue=").append(longValue); } if (doubleValue != null) { sb.append(", doubleValue=").append(doubleValue); } if (textValue != null) { sb.append(", textValue=").append(StringUtils.abbreviate(textValue, 40)); } if (textValue2 != null)...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\VariableInstanceEntityImpl.java
1
请完成以下Java代码
private void sendMessage(Address destination, String messageString) { try { System.out.println("Sending " + messageString + " to " + destination); Message message = new Message(destination, messageString); channel.send(message); } catch (Exception exception) { ...
// messageCount. For production code it should be synchronized! try { // Deserialize messageCount = Util.objectFromStream(new DataInputStream(input)); } catch (Exception e) { System.out.println("Error deserialing state!"); } System.out.println(messageC...
repos\tutorials-master\messaging-modules\jgroups\src\main\java\com\baeldung\jgroups\JGroupsMessenger.java
1
请完成以下Java代码
public void handleFailure(ExternalTask externalTask, String errorMessage, String errorDetails, int retries, long retryTimeout) { handleFailure(externalTask.getId(), errorMessage, errorDetails, retries, retryTimeout); } @Override public void handleFailure(String externalTaskId, String errorMessage, String err...
} @Override public void handleBpmnError(String externalTaskId, String errorCode, String errorMessage, Map<String, Object> variables) { try { engineClient.bpmnError(externalTaskId, errorCode, errorMessage, variables); } catch (EngineClientException e) { throw LOG.handledEngineClientException("no...
repos\camunda-bpm-platform-master\clients\java\client\src\main\java\org\camunda\bpm\client\task\impl\ExternalTaskServiceImpl.java
1
请完成以下Spring Boot application配置
# Database Configuration spring.datasource.url=jdbc:h2:mem:testdb spring.datasource.username=sa spring.datasource.password=password spring.datasource.driver-class-name=org.h2.Driver # Hibernate Configuration spring.jpa.database-platform=org.hibernate.dialect.H2Dialect spring.jpa.hibernate.ddl-auto=update spring.jpa.sh...
hibernate.id.db_structure_naming_strategy=legacy #spring.jpa.properties.hibernate.id.db_structure_naming_strategy=single #spring.jpa.properties.hibernate.id.db_structure_naming_strategy=com.baeldung.sequencenaming.CustomSequenceNamingStrategy
repos\tutorials-master\persistence-modules\hibernate6\src\main\resources\application-test.properties
2
请完成以下Java代码
public String getName() { return "Invoking @PostDeploy"; } public void performOperationStep(DeploymentOperation operationContext) { final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION); final String paName = processApplication.getName();...
throw LOG.exceptionWhileInvokingPaLifecycleCallback(CALLBACK_NAME, paName, e); } catch (InvocationTargetException e) { Throwable cause = e.getCause(); if(cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { throw LOG.exceptionWhileInvokingPaLifecy...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\container\impl\deployment\PostDeployInvocationStep.java
1
请完成以下Java代码
public void setPO_PaymentTerm_ID (final int PO_PaymentTerm_ID) { if (PO_PaymentTerm_ID < 1) set_Value (COLUMNNAME_PO_PaymentTerm_ID, null); else set_Value (COLUMNNAME_PO_PaymentTerm_ID, PO_PaymentTerm_ID); } @Override public int getPO_PaymentTerm_ID() { return get_ValueAsInt(COLUMNNAME_PO_PaymentTe...
public boolean isProcessed() { return get_ValueAsBoolean(COLUMNNAME_Processed); } @Override public void setReferrer (final @Nullable java.lang.String Referrer) { set_Value (COLUMNNAME_Referrer, Referrer); } @Override public java.lang.String getReferrer() { return get_ValueAsString(COLUMNNAME_Referrer...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_BPartner_QuickInput.java
1
请完成以下Java代码
public java.lang.String getSW6_Customer_Group() { return get_ValueAsString(COLUMNNAME_SW6_Customer_Group); } /** * SW6_Payment_Method AD_Reference_ID=541295 * Reference name: _SW6_Payment_Method */ public static final int SW6_PAYMENT_METHOD_AD_Reference_ID=541295; /** Nachnahme = cash_payment */ public...
/** PayPal = pay_pal_payment_handler */ public static final String SW6_PAYMENT_METHOD_PayPal = "pay_pal_payment_handler"; /** Rechnungskauf Paypal = pay_pal_pui_payment_handler */ public static final String SW6_PAYMENT_METHOD_RechnungskaufPaypal = "pay_pal_pui_payment_handler"; @Override public void setSW6_Payment...
repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Config_Shopware6Mapping.java
1
请完成以下Java代码
public Money fromNotAdjustedAmount(@NonNull final Money money) { final int multiplier = computeFromNotAdjustedAmountMultiplier(); return multiplier > 0 ? money : money.negate(); } private int computeFromNotAdjustedAmountMultiplier() { int multiplier = 1; // Do we have to SO adjust? if (isAPAdjusted) {...
public boolean isOutgoingMoney() { return isCreditMemo ^ soTrx.isPurchase(); } public InvoiceAmtMultiplier withAPAdjusted(final boolean isAPAdjustedNew) { return isAPAdjusted == isAPAdjustedNew ? this : toBuilder().isAPAdjusted(isAPAdjustedNew).build().intern(); } public InvoiceAmtMultiplier withCMAdjusted(...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\InvoiceAmtMultiplier.java
1
请完成以下Java代码
public class ListenerExecutionFailedException extends KafkaException { private final @Nullable String groupId; /** * Construct an instance with the provided properties. * @param message the exception message. */ public ListenerExecutionFailedException(String message) { this(message, null, null); } /** ...
* @param groupId the container's group.id property. * @param cause the cause. * @since 2.2.4 */ public ListenerExecutionFailedException(String message, @Nullable String groupId, @Nullable Throwable cause) { super(message, cause); this.groupId = groupId; } /** * Return the consumer group.id property of t...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\listener\ListenerExecutionFailedException.java
1
请完成以下Java代码
public String getMsgId() { return msgId; } /** * Sets the value of the msgId property. * * @param value * allowed object is * {@link String } * */ public void setMsgId(String value) { this.msgId = value; } /** * Gets the value o...
/** * Sets the value of the msgPgntn property. * * @param value * allowed object is * {@link Pagination } * */ public void setMsgPgntn(Pagination value) { this.msgPgntn = value; } /** * Gets the value of the addtlInf property. * * @re...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\GroupHeader42.java
1
请完成以下Java代码
public static List toList() { PayWayEnum[] ary = PayWayEnum.values(); List list = new ArrayList(); for (int i = 0; i < ary.length; i++) { Map<String, String> map = new HashMap<String, String>(); map.put("desc", ary[i].getDesc()); map.put("name", ary[i].name()); list.add(map); } return list; } p...
*/ public static String getJsonStr() { PayWayEnum[] enums = PayWayEnum.values(); StringBuffer jsonStr = new StringBuffer("["); for (PayWayEnum senum : enums) { if (!"[".equals(jsonStr.toString())) { jsonStr.append(","); } jsonStr.append("{id:'").append(senum).append("',desc:'").append(senum.getDesc(...
repos\roncoo-pay-master\roncoo-pay-common-core\src\main\java\com\roncoo\pay\common\core\enums\PayWayEnum.java
1
请在Spring Boot框架中完成以下Java代码
public class BookstoreService { private final JdbcTemplate jdbcTemplate; public BookstoreService(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } @PostConstruct void init() { jdbcTemplate.setResultsMapCaseInsensitive(true); } public List<AuthorDto> fetchNi...
.returningResultSet("AuthorResultSet", BeanPropertyRowMapper.newInstance(Author.class)); Map<String, Object> authors = simpleJdbcCall.execute(Map.of("p_genre", "Anthology")); return (List<Author>) authors.get("AuthorResultSet"); } public AuthorDto fetchNicknameAndAgeBy...
repos\Hibernate-SpringBoot-master\HibernateSpringBootCallStoredProcedureJdbcTemplateBeanPropertyRowMapper\src\main\java\com\bookstore\service\BookstoreService.java
2
请完成以下Java代码
public class Pagination { @XmlElement(name = "PgNb", required = true) protected String pgNb; @XmlElement(name = "LastPgInd") protected boolean lastPgInd; /** * Gets the value of the pgNb property. * * @return * possible object is * {@link String } * ...
} /** * Gets the value of the lastPgInd property. * */ public boolean isLastPgInd() { return lastPgInd; } /** * Sets the value of the lastPgInd property. * */ public void setLastPgInd(boolean value) { this.lastPgInd = value; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\Pagination.java
1
请在Spring Boot框架中完成以下Java代码
public class DocumentPostingLogRepository { public void create(@NonNull final DocumentPostingLogRequest request) { create(ImmutableList.of(request)); } public void create(@NonNull final List<DocumentPostingLogRequest> requests) { if (requests.isEmpty()) {return;} final List<I_Document_Acct_Log> records = r...
{ final I_Document_Acct_Log record = InterfaceWrapperHelper.newInstanceOutOfTrx(I_Document_Acct_Log.class); updateRecord(record, from); return record; } private void updateRecord(final I_Document_Acct_Log record, final @NonNull DocumentPostingLogRequest from) { InterfaceWrapperHelper.setValue(record, I_Docu...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\posting\log\DocumentPostingLogRepository.java
2
请在Spring Boot框架中完成以下Java代码
public class R_Request { private final RecordAccessConfigService recordAccessConfigService; private final RecordAccessService recordAccessService; public R_Request( @NonNull final RecordAccessConfigService recordAccessConfigService, @NonNull final RecordAccessService recordAccessService) { this.recordAcces...
{ if (recordAccessConfigService.isFeatureEnabled(RecordAccessFeature.BPARTNER_HIERARCHY)) { recordAccessService.grantAccess( RecordAccessGrantRequest.builder() .recordRef(TableRecordReference.of(I_R_Request.Table_Name, requestRecord.getR_Request_ID())) .principal(Principal.userId(UserId.ofRepo...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\permissions\record_access\interceptor\R_Request.java
2
请完成以下Java代码
private CostSegmentAndElement createCostSegment(final CostSegmentAndElement costSegmentAndElement, final ResourceId resourceId) { final I_M_Product product = resourceProductService.getProductByResourceId(resourceId); final ProductId productId = ProductId.ofRepoId(product.getM_Product_ID()); final AcctSchema acc...
} @lombok.Value(staticConstructor = "of") private static class RoutingActivitySegmentCost { public static Collector<RoutingActivitySegmentCost, ?, Map<CostElementId, BigDecimal>> groupByCostElementId() { return Collectors.groupingBy(RoutingActivitySegmentCost::getCostElementId, sumCostsAsBigDecimal()); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\process\RollupWorkflow.java
1
请完成以下Java代码
public Optional<Quantity> getQtyToIssueMin() { return issuingToleranceSpec != null ? Optional.of(issuingToleranceSpec.subtractFrom(qtyToIssue)) : Optional.empty(); } public Optional<Quantity> getQtyToIssueMax() { return issuingToleranceSpec != null ? Optional.of(issuingToleranceSpec.addTo(qtyToIssu...
.append(" ") .append(getProductName()); return message.build(); } @NonNull public Quantity getQtyLeftToIssue() { return qtyToIssue.subtract(qtyIssued); } public boolean isAllowManualIssue() { return !issueMethod.isIssueOnlyForReceived(); } public boolean isIssueOnlyForReceived() {return issueMeth...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\job\model\RawMaterialsIssueLine.java
1
请完成以下Spring Boot application配置
## tomcat\u914D\u7F6E server.port=8009 #server.tomcat.maxHttpHeaderSize=8192 server.tomcat.uri-encoding=UTF-8 spring.http.encoding.charset=UTF-8 spring.http.encoding.enabled=true spring.http.encoding.force=true spring.abel.encoding=UTF-8 # tomcat\u6700\u5927\u7EBF\u7A0B\u6570\uFF0C\u9ED8\u8BA4\u4E3A200 server.tomcat....
.datasource.max-left-time=60000 #\u751F\u6548\u8D85\u65F6 spring.datasource.validation-time-out=3000 #\u4E00\u4E2A\u8FDE\u63A5idle\u72B6\u6001\u7684\u6700\u5927\u65F6\u957F\uFF08\u6BEB\u79D2\uFF09 spring.datasource.idle-time-out=60000 #\u8BBE\u7F6E\u9ED8\u8BA4\u5B57\u7B26\u96C6 spring.datasource.connection-init-sql= se...
repos\springBoot-master\springboot-dynamicDataSource\src\main\resources\local\application.properties
2
请完成以下Java代码
public class MqttTransportServerInitializer extends ChannelInitializer<SocketChannel> { private final MqttTransportContext context; private final boolean sslEnabled; public MqttTransportServerInitializer(MqttTransportContext context, boolean sslEnabled) { this.context = context; this.sslEn...
} if (sslEnabled && context.getSslHandlerProvider() != null) { sslHandler = context.getSslHandlerProvider().getSslHandler(); pipeline.addLast(sslHandler); } pipeline.addLast("decoder", new MqttDecoder(context.getMaxPayloadSize())); pipeline.addLast("encoder", Mqtt...
repos\thingsboard-master\common\transport\mqtt\src\main\java\org\thingsboard\server\transport\mqtt\MqttTransportServerInitializer.java
1
请完成以下Java代码
public int getWorkerIdBits() { return workerIdBits; } public int getSequenceBits() { return sequenceBits; } public long getMaxDeltaSeconds() { return maxDeltaSeconds; } public long getMaxWorkerId() { return maxWorkerId; } public long getMaxSequence() {
return maxSequence; } public int getTimestampShift() { return timestampShift; } public int getWorkerIdShift() { return workerIdShift; } @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); }...
repos\Spring-Boot-In-Action-master\id-spring-boot-starter\src\main\java\com\baidu\fsg\uid\BitsAllocator.java
1