instruction
string
input
string
output
string
source_file
string
priority
int64
请在Spring Boot框架中完成以下Java代码
public void setLastASNNumber(String value) { this.lastASNNumber = value; } /** * Gets the value of the lastASNDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getLastASNDate() { ...
* Gets the value of the lastASNDispatchDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getLastASNDispatchDate() { return lastASNDispatchDate; } /** * Sets the value of the lastASNDispat...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ForecastASNReferenceType.java
2
请完成以下Java代码
public CostAmount subtract(@NonNull final CostAmount amtToSubtract) { assertCurrencyMatching(amtToSubtract); if (amtToSubtract.isZero()) { return this; } return add(amtToSubtract.negate()); } public CostAmount toZero() { if (isZero()) { return this; } else { return new CostAmount(val...
return sourceValue; } public BigDecimal toBigDecimal() {return value.toBigDecimal();} public boolean compareToEquals(@NonNull final CostAmount other) { return this.value.compareTo(other.value) == 0; } public static CurrencyId getCommonCurrencyIdOfAll(@Nullable final CostAmount... costAmounts) { return Cur...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\CostAmount.java
1
请完成以下Java代码
private InputStream getInputStream(int size, InputStreamSupplier streamSupplier) throws IOException { InputStream inputStream = streamSupplier.get(); return (this.entry.getMethod() != ZipEntry.DEFLATED) ? inputStream : new ZipInflaterInputStream(inputStream, this.inflater, size); } private void assertSameCon...
private void fail(String check) { throw new IllegalStateException("Content mismatch when reading security info for entry '%s' (%s check)" .formatted(this.entry.getName(), check)); } @Override public void close() throws IOException { this.inflater.end(); this.in.close(); } @FunctionalInterface interface...
repos\spring-boot-4.0.1\loader\spring-boot-loader\src\main\java\org\springframework\boot\loader\jar\JarEntriesStream.java
1
请在Spring Boot框架中完成以下Java代码
public Greeting greeting() { Greeting greeting = new Greeting(); greeting.setMessage("Hello World !!"); return greeting; } @Bean public ObjectMapper objectMapper() { return new ObjectMapper(); } @Bean public ViewResolver viewResolver() { final InternalRe...
public View sample() { return new JstlView("/WEB-INF/view/sample.jsp"); } @Bean public View sample2() { return new JstlView("/WEB-INF/view2/sample2.jsp"); } @Bean public View sample3(){ return new JstlView("/WEB-INF/view3/sample3.jsp"); } }
repos\tutorials-master\spring-web-modules\spring-mvc-basics-4\src\main\java\com\baeldung\config\WebConfig.java
2
请完成以下Java代码
public void setAD_User_ID (int AD_User_ID) { if (AD_User_ID < 0) set_ValueNoCheck (COLUMNNAME_AD_User_ID, null); else set_ValueNoCheck (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID)); } /** Get Ansprechpartner. @return User within the system - Internal or Business Partner Contact */ @Override...
public void setAD_User_Roles_ID (int AD_User_Roles_ID) { if (AD_User_Roles_ID < 1) set_ValueNoCheck (COLUMNNAME_AD_User_Roles_ID, null); else set_ValueNoCheck (COLUMNNAME_AD_User_Roles_ID, Integer.valueOf(AD_User_Roles_ID)); } /** Get AD_User_Roles. @return AD_User_Roles */ @Override public int ge...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_User_Roles.java
1
请完成以下Java代码
public static List<Term> segment(char[] text) { List<Term> resultList = SEGMENT.seg(text); ListIterator<Term> listIterator = resultList.listIterator(); while (listIterator.hasNext()) { if (!CoreStopWordDictionary.shouldInclude(listIterator.next())) { ...
return SEGMENT.seg2sentence(text, shortest); } /** * 切分为句子形式 * * @param text * @param filterArrayChain 自定义过滤器链 * @return */ public static List<List<Term>> seg2sentence(String text, Filter... filterArrayChain) { List<List<Term>> sentenceList = SEGMENT.seg2sentence(t...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\tokenizer\NotionalTokenizer.java
1
请在Spring Boot框架中完成以下Java代码
public int hashCode() { return Objects.hash(type, therapyId, therapyTypeId, woundLocation, patientId, createdBy, createdAt, archived); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AttachmentMetadata {\n"); sb.append(" type: ").append(toI...
sb.append(" archived: ").append(toIndentedString(archived)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null)...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-document-api\src\main\java\io\swagger\client\model\AttachmentMetadata.java
2
请完成以下Java代码
public SqlLookupDescriptorFactory setDisplayType(final ReferenceId displayType) { this.displayType = displayType; this.filtersBuilder.setDisplayType(ReferenceId.toRepoId(displayType)); return this; } public SqlLookupDescriptorFactory setAD_Reference_Value_ID(final ReferenceId AD_Reference_Value_ID) { this....
if (I_AD_Client.Table_Name.equals(tableName.getAsString()) || I_AD_Org.Table_Name.equals(tableName.getAsString())) { return Access.WRITE; } // Default: all entries on which current user has at least readonly access return Access.READ; } SqlLookupDescriptorFactory addValidationRules(final Collection<I...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\sql\SqlLookupDescriptorFactory.java
1
请完成以下Java代码
public String getName () { return (String)get_Value(COLUMNNAME_Name); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getName()); } /** Set Page URL. @param PageURL Page URL */ public ...
*/ public void setW_CounterCount_ID (int W_CounterCount_ID) { if (W_CounterCount_ID < 1) set_ValueNoCheck (COLUMNNAME_W_CounterCount_ID, null); else set_ValueNoCheck (COLUMNNAME_W_CounterCount_ID, Integer.valueOf(W_CounterCount_ID)); } /** Get Counter Count. @return Web Counter Count Management */...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_CounterCount.java
1
请在Spring Boot框架中完成以下Java代码
public GatewayMetricsFilter gatewayMetricFilter(MeterRegistry meterRegistry, List<GatewayTagsProvider> tagsProviders, GatewayMetricsProperties properties) { return new GatewayMetricsFilter(meterRegistry, tagsProviders, properties.getPrefix()); } @Bean @ConditionalOnBean(MeterRegistry.class) @ConditionalOnProp...
@Bean @ConditionalOnMissingBean ObservedResponseHttpHeadersFilter observedResponseHttpHeadersFilter() { return new ObservedResponseHttpHeadersFilter(); } @Bean @Order(Ordered.HIGHEST_PRECEDENCE) ObservationClosingWebExceptionHandler observationClosingWebExceptionHandler() { return new ObservationClos...
repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\config\GatewayMetricsAutoConfiguration.java
2
请完成以下Java代码
private RESTApiTableInfoMap getMap() { return cache.getOrLoad(0, this::retrieveMap); } private RESTApiTableInfoMap retrieveMap() { final String sql = "SELECT " + " t." + I_AD_Table.COLUMNNAME_TableName + ", c." + I_AD_Column.COLUMNNAME_ColumnName + " FROM " + I_AD_Column.Table_Name + " c " + " ...
} @EqualsAndHashCode @ToString private static class RESTApiTableInfoMap { private final ImmutableMap<String, RESTApiTableInfo> byTableName; private RESTApiTableInfoMap(final List<RESTApiTableInfo> list) { this.byTableName = Maps.uniqueIndex(list, RESTApiTableInfo::getTableName); } public static Coll...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\persistence\custom_columns\CustomColumnRepository.java
1
请完成以下Java代码
public int compare(Integer o1, Integer o2) { return o2 - o1; } }); // add our values to the map for (final Entry<String, String> entry : valuesForPrefix.entrySet()) { final int sizeInt = parseInt(entry.getKey(), sysConfigPrefix); if (sizeInt < 0) { ...
return sortedMap; } }); return sortedMap; } private int parseInt(final String completeString, final String prefix) { final String sizeStr = completeString.substring(prefix.length()); int size = -1; try { size = Integer.parseInt(sizeStr); } catch (NumberFormatException e) { logger.w...
repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\spi\impl\SysconfigBackedSizeBasedWorkpackagePrioConfig.java
1
请完成以下Java代码
public int getScore() { return score; } public void setScore(int score) { this.score = score; } } static class UppercasingRequestConverter implements RequestConverterFunction { @Override public Object convertRe...
return HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, ((String) result).toUpperCase(), trailers); } return ResponseConverterFunction.fallthrough(); } } static class ConflictExceptionHandler implements ExceptionHandlerFunct...
repos\tutorials-master\server-modules\armeria\src\main\java\com\baeldung\armeria\AnnotatedServer.java
1
请完成以下Java代码
public static class VEditorDialogButtonAlignJsonSerializer extends UIResourceJsonSerializer<VEditorDialogButtonAlign> { @Override public JsonElement serialize(VEditorDialogButtonAlign src, Type typeOfSrc, JsonSerializationContext context) { final JsonObject jo = new JsonObject(); jo.addProperty(PROPERTY_C...
final String value = jo.get("value").getAsString(); try { return VEditorDialogButtonAlign.valueOf(value); } catch (Exception e) { logger.warn("Failed parsing value {}. Using default", value); } return VEditorDialogButtonAlign.DEFAULT_Value; } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\plaf\UIDefaultsSerializer.java
1
请完成以下Java代码
protected Map<String, String> getAsyncLeaveTransitionMetadata() { Map<String, String> metadata = new HashMap<>(); metadata.put(OperationSerializationMetadata.FIELD_PLAN_ITEM_INSTANCE_ID, planItemInstanceEntity.getId()); metadata.put(OperationSerializationMetadata.FIELD_EXIT_TYPE, exitType); ...
} public String getExitType() { return exitType; } public void setExitType(String exitType) { this.exitType = exitType; } public String getExitEventType() { return exitEventType; } public void setExitEventType(String exitEventType) { this.exitEventType = exit...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\agenda\operation\TerminatePlanItemInstanceOperation.java
1
请在Spring Boot框架中完成以下Java代码
public void setScopeId(String scopeId) { this.scopeId = scopeId; } @Override public void setScopeDefinitionId(String scopeDefinitionId) { this.scopeDefinitionId = scopeDefinitionId; } @Override public void setSubScopeId(String subScopeId) { this.subScopeId = subScopeId;...
return data; } @Override public String getExecutionId() { return executionId; } @Override public String getProcessInstanceId() { return processInstanceId; } @Override public String getProcessDefinitionId() { return processDefinitionId; } @Override ...
repos\flowable-engine-main\modules\flowable-task-service\src\main\java\org\flowable\task\service\impl\persistence\entity\HistoricTaskLogEntryEntityImpl.java
2
请完成以下Java代码
public ResponseEntity<JsonDataEntryResponse> getByRecordId( // with swagger 2.9.2, parameters are always ordered alphabetically, see https://github.com/springfox/springfox/issues/2418 @PathVariable("windowId") final int windowId, @PathVariable("recordId") final int recordId) { final Stopwatch w = Stopwatch....
{ return JsonDataEntryResponse.notFound(String.format("No dataentry for windowId '%d'.", windowId.getRepoId())); } final DataEntryRecordsMap records = dataRecords.get(recordId, layout.getSubTabIds()); if (records.getSubTabIds().isEmpty()) { return JsonDataEntryResponse.notFound(String.format("No dataentr...
repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\dataentry\impl\DataEntryRestController.java
1
请完成以下Java代码
public class LockTest { Object lock = new Object(); public static void main(String[] args) { LockTest lockTest = new LockTest(); User a = new User(), b = new User(); ThreadTaskUtils.run(() -> lockTest.deadlock(a, b)); ThreadTaskUtils.run(() -> lockTest.deadlock(b, a)); } ...
} } } finally { a.getLock().unlock(); } // 拿锁失败以后,休眠随机数,以避免活锁 sleep(random.nextInt()); } } private void deadlock(User a, User b) { synchronized (a) { sleep(1000); synchronized (b) { ...
repos\spring-boot-student-master\spring-boot-student-concurrent\src\main\java\com\xiaolyuh\LockTest.java
1
请完成以下Java代码
public void setMovementQty (final BigDecimal MovementQty) { set_Value (COLUMNNAME_MovementQty, MovementQty); } @Override public BigDecimal getMovementQty() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_MovementQty); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setQtyCUsP...
@Override public BigDecimal getQtyCUsPerTU_InInvoiceUOM() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyCUsPerTU_InInvoiceUOM); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setQtyItemCapacity (final @Nullable BigDecimal QtyItemCapacity) { set_Value (COLUMNNAME_QtyItemCap...
repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_Desadv_Pack_Item.java
1
请完成以下Java代码
public class IterativeCombinationGenerator { private static final int N = 5; private static final int R = 2; /** * Generate all combinations of r elements from a set * @param n the number of elements in input set * @param r the number of elements in a combination * @return the list con...
int t = r - 1; while (t != 0 && combination[t] == n - r + t) { t--; } combination[t]++; for (int i = t + 1; i < r; i++) { combination[i] = combination[i - 1] + 1; } } return combinations; } public stati...
repos\tutorials-master\core-java-modules\core-java-lang-math-2\src\main\java\com\baeldung\algorithms\combination\IterativeCombinationGenerator.java
1
请在Spring Boot框架中完成以下Java代码
CommandLineMetadataController commandLineMetadataController(InitializrMetadataProvider metadataProvider, TemplateRenderer templateRenderer) { return new CommandLineMetadataController(metadataProvider, templateRenderer); } @Bean @ConditionalOnMissingBean SpringCliDistributionController cliDistributionCon...
private static final class InitializrJCacheManagerCustomizer implements JCacheManagerCustomizer { @Override public void customize(javax.cache.CacheManager cacheManager) { createMissingCache(cacheManager, "initializr.metadata", () -> config().setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(Duration.TEN...
repos\initializr-main\initializr-web\src\main\java\io\spring\initializr\web\autoconfigure\InitializrAutoConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
public void save(SmsCode smsCode, ServletWebRequest request, String mobile) throws Exception { redisTemplate.opsForValue().set(key(request, mobile), smsCode.getCode(), TIME_OUT, TimeUnit.SECONDS); } /** * 获取验证码 * * @param request ServletWebRequest * @return 验证码 */ public St...
* 移除验证码 * * @param request ServletWebRequest */ public void remove(ServletWebRequest request, String mobile) throws Exception { redisTemplate.delete(key(request, mobile)); } private String key(ServletWebRequest request, String mobile) throws Exception { String deviceId = requ...
repos\SpringAll-master\64.Spring-Security-OAuth2-Customize\src\main\java\cc\mrbird\security\service\RedisCodeService.java
2
请在Spring Boot框架中完成以下Java代码
private boolean isIncluded(String name) { return this.include.isEmpty() || this.include.contains("*") || isIncludedName(name); } private boolean isIncludedName(String name) { if (this.include.contains(name)) { return true; } if (name.contains("/")) { String parent = name.substring(0, name.lastIndexOf("...
} return false; } private Set<String> clean(@Nullable Set<String> names) { if (names == null) { return Collections.emptySet(); } Set<String> cleaned = names.stream().map(this::clean).collect(Collectors.toCollection(LinkedHashSet::new)); return Collections.unmodifiableSet(cleaned); } @Contract("!null ...
repos\spring-boot-4.0.1\module\spring-boot-health\src\main\java\org\springframework\boot\health\autoconfigure\actuate\endpoint\IncludeExcludeGroupMemberPredicate.java
2
请完成以下Java代码
public int getTabNo() { return m_vo.TabNo; } /** * Enable events delaying. * So, from now on, all events will be enqueued instead of directly fired. * Later, when {@link #releaseDelayedEvents()} is called, all enqueued events will be fired. */ public void delayEvents() { m_propertyChangeListeners.bloc...
@Override public void fireDataStatusEEvent(final String AD_Message, final String info, final boolean isError) { final GridTab gridTab = getGridTab(); if(gridTab == null) { log.warn("Could not fire EEvent on {} because gridTab is not set. The event was: AD_Message={}, info={}, isError={}", this, AD_Message, i...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\GridField.java
1
请完成以下Java代码
public class GridTabSummaryInfoFactory implements IGridTabSummaryInfoFactory { private final Map<ArrayKey, IGridTabSummaryInfoProvider> providers = new HashMap<>(); private final IGridTabSummaryInfoProvider defaultProvider = new DefaultGridTabSummaryInfoProvider(); @Override public void register(final String table...
@Override public IGridTabSummaryInfoProvider getSummaryInfoProvider(final GridTab gridTab) { Check.assumeNotNull(gridTab, "gridTab not null"); final ArrayKey key = mkKey(gridTab.getTableName()); final IGridTabSummaryInfoProvider provider = providers.get(key); if (provider == null) { return defaultProvid...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ui\api\impl\GridTabSummaryInfoFactory.java
1
请完成以下Java代码
public static boolean equalsByRepoId(final int repoId1, final int repoId2) { final int repoId1Norm = repoId1 > 0 ? repoId1 : -1; final int repoId2Norm = repoId2 > 0 ? repoId2 : -1; return repoId1Norm == repoId2Norm; } private LocatorId(final int repoId, @NonNull final WarehouseId warehouseId) { Check.assum...
{ throw new IllegalArgumentException("Invalid json: " + json); } final int warehouseId = Integer.parseInt(parts[0]); final int locatorId = Integer.parseInt(parts[1]); return ofRepoId(warehouseId, locatorId); } public void assetWarehouseId(@NonNull final WarehouseId expectedWarehouseId) { if (!Warehouse...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\warehouse\LocatorId.java
1
请完成以下Java代码
public Bytes getAttestationObject() { return this.attestationObject; } /** * The <a href= * "https://www.w3.org/TR/webauthn-3/#dom-authenticatorattestationresponse-gettransports">transports</a> * returns the <a href= * "https://www.w3.org/TR/webauthn-3/#dom-authenticatorattestationresponse-transports-slot"...
/** * Sets the {@link #getTransports()} property. * @param transports the transports * @return the {@link AuthenticatorAttestationResponseBuilder} */ public AuthenticatorAttestationResponseBuilder transports(AuthenticatorTransport... transports) { return transports(Arrays.asList(transports)); } /*...
repos\spring-security-main\webauthn\src\main\java\org\springframework\security\web\webauthn\api\AuthenticatorAttestationResponse.java
1
请完成以下Java代码
public Optional<HasId<?>> findEntity(TenantId tenantId, EntityId entityId) { return Optional.ofNullable(findApiKeyById(tenantId, new ApiKeyId(entityId.getId()))); } @Override public FluentFuture<Optional<HasId<?>>> findEntityAsync(TenantId tenantId, EntityId entityId) { return FluentFuture....
@Override public ApiKey findApiKeyByValue(String value) { log.trace("Executing findApiKeyByValue [{}]", value); var cacheKey = ApiKeyCacheKey.of(value); return cache.getAndPutInTransaction(cacheKey, () -> apiKeyDao.findByValue(value), true); } private String generateApiKeySecret() {...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\pat\ApiKeyServiceImpl.java
1
请完成以下Spring Boot application配置
#server server.port=9000 spring.mvc.servlet.path=/ server.servlet.context-path=/ server.error.whitelabel.enabled=false #spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration #for Spring Boot 2.0+ #spri
ng.autoconfigure.exclude=org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration
repos\tutorials-master\spring-boot-modules\spring-boot-basic-customization\src\main\resources\application-errorhandling.properties
2
请完成以下Java代码
public static CommissionPoints sum(@NonNull final Collection<CommissionPoints> augents) { final BigDecimal sum = augents.stream() .map(CommissionPoints::toBigDecimal) .reduce(ONE, BigDecimal::add); return new CommissionPoints(sum); } private CommissionPoints(@NonNull final BigDecimal points) { this....
if (augent.isZero()) { return this; } return CommissionPoints.of(toBigDecimal().subtract(augent.toBigDecimal())); } @JsonIgnore public boolean isZero() { final boolean isZero = points.signum() == 0; return isZero; } public CommissionPoints computePercentageOf( @NonNull final Percent commissionPe...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\commission\commissioninstance\businesslogic\CommissionPoints.java
1
请完成以下Java代码
public BooleanWithReason checkEligibleToAddAsSourceHUs(@NonNull final Set<HuId> huIds) { final String notEligibleReason = handlingUnitsBL.getByIds(huIds) .stream() .map(this::checkEligibleToAddAsSourceHU) .filter(BooleanWithReason::isFalse) .map(BooleanWithReason::getReasonAsString) .collect(Coll...
public BooleanWithReason checkEligibleToAddToManufacturingOrder(@NonNull final PPOrderId ppOrderId) { final I_PP_Order ppOrder = ppOrderBL.getById(ppOrderId); final DocStatus ppOrderDocStatus = DocStatus.ofNullableCodeOrUnknown(ppOrder.getDocStatus()); if (!ppOrderDocStatus.isCompleted()) { return BooleanWi...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\pporder\source_hu\PPOrderSourceHUService.java
1
请完成以下Java代码
public class ExemptTaxNotFoundException extends AdempiereException { /** * */ private static final long serialVersionUID = -5489066603806460132L; private static final String AD_Message = "TaxNoExemptFound"; public ExemptTaxNotFoundException(int AD_Org_ID) { super(buildMessage(AD_Org_ID)); } private sta...
// return msg.toString(); } private static final String getOrgString(int AD_Org_ID) { if (AD_Org_ID <= 0) { return "*"; } return Services.get(IOrgDAO.class).retrieveOrgName(AD_Org_ID); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\exceptions\ExemptTaxNotFoundException.java
1
请完成以下Java代码
public final class OAuth2TokenClaimsContext implements OAuth2TokenContext { private final Map<Object, Object> context; private OAuth2TokenClaimsContext(Map<Object, Object> context) { this.context = Collections.unmodifiableMap(new HashMap<>(context)); } @SuppressWarnings("unchecked") @Nullable @Override publ...
/** * Constructs a new {@link Builder} with the provided claims. * @param claimsBuilder the claims to initialize the builder * @return the {@link Builder} */ public static Builder with(OAuth2TokenClaimsSet.Builder claimsBuilder) { return new Builder(claimsBuilder); } /** * A builder for {@link OAuth2Tok...
repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\token\OAuth2TokenClaimsContext.java
1
请完成以下Java代码
protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth .inMemoryAuthentication() .withUser("admin").password(passwordEncoder().encode("admin123")).roles("ADMIN") .and() .withUser("hamdamboy").password(passwordEncoder()....
.antMatchers("/profile/**").authenticated() .antMatchers("/admin/**").hasRole("ADMIN") // Admin .antMatchers("/management/**").hasAnyRole("ADMIN", "MANAGER") .antMatchers("/api/public/**").hasRole("ADMIN") // REST condition. // .antMatchers("/api/public/t...
repos\SpringBoot-Projects-FullStack-master\Part-6 Spring Boot Security\3. SpringSecureRestControl\src\main\java\spring\security\security\SpringSecurity.java
1
请在Spring Boot框架中完成以下Java代码
public boolean isZero() {return relativeValue.signum() == 0;} public InvoiceTotal subtract(@NonNull final InvoiceTotal other) { if (other.isZero()) {return this;} final Money otherValue = other.withAPAdjusted(isAPAdjusted()).withCMAdjusted(isCMAdjusted()).toMoney(); return ofRelativeValue(this.relativeValue.s...
{ if (!multiplier.isAPAdjusted()) { return this; } else if (multiplier.isAP()) { return new InvoiceTotal(relativeValue.negate(), multiplier.withAPAdjusted(false)); } else { return new InvoiceTotal(relativeValue, multiplier.withAPAdjusted(false)); } } public InvoiceTotal withCMAdjusted(fina...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\service\impl\InvoiceTotal.java
2
请在Spring Boot框架中完成以下Java代码
public class MongoInsertEventListener extends AbstractMongoEventListener<IncIdEntity> { /** * sequence - 集合名 */ private static final String SEQUENCE_COLLECTION_NAME = "sequence"; /** * sequence - 自增值的字段名 */ private static final String SEQUENCE_FIELD_VALUE = "value"; @Autowired ...
Query query = new Query(Criteria.where("_id").is(id)); // 创建 Update 对象 Update update = new Update(); update.inc(SEQUENCE_FIELD_VALUE, 1); // 自增值 // 创建 FindAndModifyOptions 对象 FindAndModifyOptions options = new FindAndModifyOptions(); options.upsert(true); // 如果不存在时,则进行插入 ...
repos\SpringBoot-Labs-master\lab-16-spring-data-mongo\lab-16-spring-data-mongodb\src\main\java\cn\iocoder\springboot\lab16\springdatamongodb\mongo\MongoInsertEventListener.java
2
请完成以下Java代码
public void setPA_Measure_ID (int PA_Measure_ID) { if (PA_Measure_ID < 1) set_ValueNoCheck (COLUMNNAME_PA_Measure_ID, null); else set_ValueNoCheck (COLUMNNAME_PA_Measure_ID, Integer.valueOf(PA_Measure_ID)); } /** Get Measure. @return Concrete Performance Measurement */ public int getPA_Measure_ID ...
public void setSeqNo (int SeqNo) { set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); } /** Get Sequence. @return Method of ordering records; lowest number comes first */ public int getSeqNo () { Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo); 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_PA_Achievement.java
1
请完成以下Java代码
public void hyperlinkUpdate( HyperlinkEvent event ) { if( event.getEventType() == HyperlinkEvent.EventType.ACTIVATED ) { //System.out.println("parsed url: " + event.getURL());// +" from: " +event.getDescription()); htmlUpdate(event.getURL()); } } /* (non-Javadoc) * @see java.awt.event.MouseL...
PageLoader( JEditorPane html, URL url, Cursor cursor ) { this.html = html; this.url = url; this.cursor = cursor; } @Override public void run() { if( url == null ) { // restore the original cursor html.setCursor( cursor ); // PENDING(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\adempiere\apps\graph\HtmlDashboard.java
1
请完成以下Java代码
final class TOTPUtils { public static boolean validate(@NonNull final SecretKey secretKey, @NonNull final OTP otp) {return validate(getStep(), secretKey, otp);} private static boolean validate(final long step, @NonNull final SecretKey secretKey, @NonNull final OTP otp) { return OTP.equals(computeOTP(step, secretK...
private static byte[] hexStr2Bytes(final CharSequence hex) { // Adding one byte to get the right conversion // values starting with "0" can be converted final byte[] bArray = new BigInteger("10" + hex, 16).toByteArray(); final byte[] ret = new byte[bArray.length - 1]; // Copy all the REAL bytes, not the "fi...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\user_2fa\totp\TOTPUtils.java
1
请完成以下Java代码
public BigDecimal getPages() { return pages; } public void setPages(BigDecimal pages) { this.pages = pages; } public UUID getId() { return id; } public void setId(UUID id) { this.id = id; }
public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public float getPrice() { return price; } public void setPrice(float price) { this.price = price; } }
repos\tutorials-master\jackson-modules\jackson-core\src\main\java\com\baeldung\jackson\deserialization\jsondeserialize\Book.java
1
请完成以下Java代码
public TaskCompletionBuilder transientVariableLocal(String variableName, Object variableValue) { if (this.transientVariablesLocal == null) { this.transientVariablesLocal = new HashMap<>(); } this.transientVariablesLocal.put(variableName, variableValue); return this; } ...
protected void completeTask() { this.commandExecutor.execute(new CompleteTaskCmd(this.taskId, variables, variablesLocal, transientVariables, transientVariablesLocal)); } protected void completeTaskWithForm() { this.commandExecutor.execute(new CompleteTaskWithFormCmd(this.taskId, formDefinitionI...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\task\TaskCompletionBuilderImpl.java
1
请在Spring Boot框架中完成以下Java代码
public String getScopeId() { return job.getScopeId(); } @Override public String getSubScopeId() { return job.getSubScopeId(); } @Override public String getScopeType() { return job.getScopeType(); } @Override public String getScopeDefinitionId() { re...
public String getJobHandlerType() { return job.getJobHandlerType(); } @Override public String getJobHandlerConfiguration() { return job.getJobHandlerConfiguration(); } @Override public String getCustomValues() { return job.getCustomValues(); } @Override pub...
repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\AcquiredExternalWorkerJobImpl.java
2
请完成以下Java代码
public int getC_Location_ID() { return get_ValueAsInt(COLUMNNAME_C_Location_ID); } @Override public void setDescription (final @Nullable java.lang.String Description) { set_Value (COLUMNNAME_Description, Description); } @Override public java.lang.String getDescription() { return get_ValueAsString(COL...
set_Value (COLUMNNAME_IsOwnBank, IsOwnBank); } @Override public boolean isOwnBank() { return get_ValueAsBoolean(COLUMNNAME_IsOwnBank); } @Override public void setName (final java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } @Override public java.lang.String getName() { return get_Valu...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Bank.java
1
请完成以下Java代码
public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Book getBook() { return book; } pu...
public void setArticle(Article article) { this.article = article; } public Magazine getMagazine() { return magazine; } public void setMagazine(Magazine magazine) { this.magazine = magazine; } @Override public String toString() { return "Review{" + "id=" + i...
repos\Hibernate-SpringBoot-master\HibernateSpringBootChooseOnlyOneAssociation\src\main\java\com\bookstore\entity\Review.java
1
请在Spring Boot框架中完成以下Java代码
public static class KubernetesConverterConfiguration { @Bean @ConfigurationProperties(prefix = "spring.boot.admin.discovery.converter") public KubernetesServiceInstanceConverter serviceInstanceConverter( KubernetesDiscoveryProperties discoveryProperties) { return new KubernetesServiceInstanceConverter(dis...
} @ConditionalOnBean(KubernetesInformerDiscoveryClient.class) static class OfficialKubernetesCondition { } @ConditionalOnBean(KubernetesDiscoveryClient.class) static class Fabric8KubernetesCondition { } } }
repos\spring-boot-admin-master\spring-boot-admin-server-cloud\src\main\java\de\codecentric\boot\admin\server\cloud\config\AdminServerDiscoveryAutoConfiguration.java
2
请完成以下Java代码
public abstract class AbstractSyncSessionCallback implements SessionMsgListener { protected final TbCoapClientState state; protected final CoapExchange exchange; protected final Request request; @Override public void onGetAttributesResponse(TransportProtos.GetAttributeResponseMsg getAttributesResp...
if (state != null) { return state.getExchange().advanced().getRequest().isConfirmable(); } else { return false; } } public static boolean isMulticastRequest(TbCoapObservationState state) { if (state != null) { return state.getExchange().advanced().getR...
repos\thingsboard-master\common\transport\coap\src\main\java\org\thingsboard\server\transport\coap\callback\AbstractSyncSessionCallback.java
1
请完成以下Java代码
public void stringBadPractice3() { synchronized (internedStringLock) { // ... } } private final Boolean booleanLock = Boolean.FALSE; public void booleanBadPractice() { synchronized (booleanLock) { // ... } } private int count = 0; ...
count++; // ... } } public void classBadPractice() throws InterruptedException { AnimalBadPractice animalObj = new AnimalBadPractice("Tommy", "John"); synchronized(animalObj) { while (true) { Thread.sleep(Integer.MAX_VALUE); } ...
repos\tutorials-master\core-java-modules\core-java-concurrency-advanced-4\src\main\java\com\baeldung\synchronizationbadpractices\SynchronizationBadPracticeExample.java
1
请在Spring Boot框架中完成以下Java代码
ClientRegistrationRepository dynamicClientRegistrationRepository( DynamicClientRegistrationRepository.RegistrationRestTemplate restTemplate) { log.info("Creating a dynamic client registration repository"); var registrationDetails = new DynamicClientRegistrationRepository.RegistrationDetails( ...
List<String> registrationScopes; List<String> grantTypes; List<String> redirectUris; URI tokenEndpoint; } @Bean public OAuth2AuthorizationRequestResolver pkceResolver(ClientRegistrationRepository repo) { var resolver = new DefaultOAuth2AuthorizationRequestResolver(repo, "/oa...
repos\tutorials-master\spring-security-modules\spring-security-dynamic-registration\oauth2-dynamic-client\src\main\java\com\baeldung\spring\security\dynreg\client\config\OAuth2DynamicClientConfiguration.java
2
请完成以下Java代码
public int getM_Attribute_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_Attribute_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Merkmals-Wert. @param M_AttributeValue_ID Product Attribute Value */ @Override public void setM_AttributeValue_ID (int M_AttributeValue_ID) { ...
/** Get Attribute price. @return Attribute price */ @Override public int getM_ProductPrice_Attribute_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_ProductPrice_Attribute_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Attribute price line. @param M_ProductPrice_Attribute_Lin...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\pricing\attributebased\X_M_ProductPrice_Attribute_Line.java
1
请完成以下Java代码
public int getM_Product_Category_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_Category_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name...
return "Y".equals(oo); } return false; } /** Set Training. @param S_Training_ID Repeated Training */ public void setS_Training_ID (int S_Training_ID) { if (S_Training_ID < 1) set_ValueNoCheck (COLUMNNAME_S_Training_ID, null); else set_ValueNoCheck (COLUMNNAME_S_Training_ID, Integer.valueOf(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_S_Training.java
1
请在Spring Boot框架中完成以下Java代码
public long listSize(String key) { return listOperations.size(key); } public Object listIndex(String key, long index) { return listOperations.index(key, index); } public void listRightPush(String key, Object value) { listOperations.rightPush(key, value); } public boole...
return expire(key, milliseconds); } return false; } public void listSet(String key, long index, Object value) { listOperations.set(key, index, value); } public long listRemove(String key, long count, Object value) { return listOperations.remove(key, count, value); }...
repos\spring-boot-best-practice-master\spring-boot-redis\src\main\java\cn\javastack\springboot\redis\service\RedisOptService.java
2
请在Spring Boot框架中完成以下Java代码
public RelyingPartyRegistration convert(HttpServletRequest request) { return resolve(request, null); } /** * {@inheritDoc} */ @Override public RelyingPartyRegistration resolve(HttpServletRequest request, String relyingPartyRegistrationId) { if (relyingPartyRegistrationId == null) { if (this.logger.isTra...
return null; } RelyingPartyRegistration registration = this.relyingPartyRegistrationRepository .findByRegistrationId(relyingPartyRegistrationId); if (registration == null) { return null; } UriResolver uriResolver = RelyingPartyRegistrationPlaceholderResolvers.uriResolver(request, registration); return...
repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\provider\service\web\DefaultRelyingPartyRegistrationResolver.java
2
请完成以下Java代码
public class SqlOptions { /** * advice the SQL code generators to use table alias (e.g. "master") instead of fully qualified table name */ public static SqlOptions usingTableAlias(@NonNull final String sqlTableAlias) { if (USE_TABLE_ALIAS_MASTER.tableAlias.equals(sqlTableAlias)) { return USE_TABLE_ALIAS_M...
this.useTableAlias = useTableAlias; if (useTableAlias) { Check.assumeNotEmpty(tableAlias, "tableAlias is not empty"); this.tableAlias = tableAlias; this.tableName = null; } else { Check.assumeNotEmpty(tableName, "tableName is not empty"); this.tableAlias = null; this.tableName = tableName; ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\sql\SqlOptions.java
1
请完成以下Java代码
public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void s...
return birthDate; } public void setBirthDate(ZonedDateTime birthDate) { this.birthDate = birthDate; } public Boolean getActive() { return active; } public void setActive(Boolean active) { this.active = active; } }
repos\tutorials-master\persistence-modules\spring-data-jpa-simple\src\main\java\com\baeldung\jpa\simple\model\User.java
1
请完成以下Java代码
protected String doIt() { final Duration duration = getDuration(); if (duration.isNegative() || duration.isZero()) { throw new FillMandatoryException("Duration"); } final PPOrderRoutingActivityId orderRoutingActivityId = getOrderRoutingActivityId(); final PPOrderId orderId = orderRoutingActivityId.getO...
private I_PP_Order getOrderById(@NonNull final PPOrderId orderId) { return ordersCache.computeIfAbsent(orderId, orderBL::getById); } private PPOrderRoutingActivityId getOrderRoutingActivityId() { return PPOrderRoutingActivityId.ofRepoId(getOrderId(), orderRoutingActivityRepoId); } private PPOrderId getOrder...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pporder\process\PP_Order_RecordWork.java
1
请完成以下Java代码
protected final void revokeAccessFromRecord() { final boolean revokeAllPermissions; final List<Access> permissionsToRevoke; final Access permission = getPermissionOrNull(); if (permission == null) { revokeAllPermissions = true; permissionsToRevoke = ImmutableList.of(); } else { revokeAllPermis...
if (Access.WRITE.equals(permission)) { return ImmutableSet.of(Access.READ, Access.WRITE); } else { return ImmutableSet.of(permission); } } private Access getPermissionOrNull() { if (Check.isEmpty(permissionCode)) { return null; } else { return Access.ofCode(permissionCode); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\process\UserGroupRecordAccess_Base.java
1
请在Spring Boot框架中完成以下Java代码
private int resolveDatabase() { if (ClassUtils.isPresent("io.lettuce.core.RedisClient", null) && getRedisConnectionFactory() instanceof LettuceConnectionFactory) { return ((LettuceConnectionFactory) getRedisConnectionFactory()).getDatabase(); } if (ClassUtils.isPresent("redis.clients.jedis.Jedis", null) ...
this.configure = configure; } @Override public void afterPropertiesSet() { if (this.configure == ConfigureRedisAction.NO_OP) { return; } RedisConnection connection = this.connectionFactory.getConnection(); try { this.configure.configure(connection); } finally { try { connection...
repos\spring-session-main\spring-session-data-redis\src\main\java\org\springframework\session\data\redis\config\annotation\web\http\RedisIndexedHttpSessionConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
public class MediatedCommissionConfig implements CommissionConfig { @NonNull Percent commissionPercent; @NonNull ProductId commissionProductId; @NonNull Integer pointsPrecision; @NonNull MediatedCommissionContract mediatedCommissionContract; @NonNull MediatedCommissionSettingsLineId mediatedCommissionSett...
} @Override public MediatedCommissionContract getContractFor(@NonNull final BPartnerId contractualBPartnerId) { if (contractualBPartnerId.equals(mediatedCommissionContract.getContractOwnerBPartnerId())) { return mediatedCommissionContract; } return null; } @Override @NonNull public ProductId getCom...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\commission\mediated\algorithm\MediatedCommissionConfig.java
2
请在Spring Boot框架中完成以下Java代码
public String getInternalProxies() { return this.internalProxies; } public void setInternalProxies(String internalProxies) { this.internalProxies = internalProxies; } public @Nullable String getProtocolHeader() { return this.protocolHeader; } public void setProtocolHeader(@Nullable String protoc...
} public @Nullable String getTrustedProxies() { return this.trustedProxies; } public void setTrustedProxies(@Nullable String trustedProxies) { this.trustedProxies = trustedProxies; } } /** * When to use APR. */ public enum UseApr { /** * Always use APR and fail if it's not available. *...
repos\spring-boot-4.0.1\module\spring-boot-tomcat\src\main\java\org\springframework\boot\tomcat\autoconfigure\TomcatServerProperties.java
2
请完成以下Java代码
public List<CostElement> getByClientId(@NonNull final ClientId clientId) { return getIndexedCostElements() .streamByClientId(clientId) .collect(ImmutableList.toImmutableList()); } @Override public Set<CostElementId> getIdsByClientId(@NonNull final ClientId clientId) { return getIndexedCostElements() ...
return getIndexedCostElements() .streamByClientId(clientId) .filter(ce -> ce.getCostingMethod() == costingMethod); } private static class IndexedCostElements { private final ImmutableMap<CostElementId, CostElement> costElementsById; private IndexedCostElements(final Collection<CostElement> costElements...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\impl\CostElementRepository.java
1
请完成以下Java代码
protected CaseInstanceBatchMigrationResult convertFromBatch(Batch batch, ObjectMapper objectMapper) { CaseInstanceBatchMigrationResult result = new CaseInstanceBatchMigrationResult(); result.setBatchId(batch.getId()); result.setSourceCaseDefinitionId(batch.getBatchSearchKey()); result.s...
} if (resultNode.has(BATCH_RESULT_STACKTRACE_LABEL)) { String resultStacktrace = resultNode.get(BATCH_RESULT_STACKTRACE_LABEL).asString(); partResult.setMigrationStacktrace(resultStacktrace); } } catch (JacksonExceptio...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\cmd\GetCaseInstanceMigrationBatchResultCmd.java
1
请完成以下Java代码
public static class JSONDisplayQRCodeAction extends JSONResultAction { private final String code; protected JSONDisplayQRCodeAction(@NonNull final String code) { super("displayQRCode"); this.code = code; } } @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, isGette...
public JSONNewRecordAction( @NonNull final WindowId windowId, @Nullable final Map<String, String> fieldValues, @NonNull final ProcessExecutionResult.WebuiNewRecord.TargetTab targetTab) { super("newRecord"); this.windowId = windowId; this.fieldValues = fieldValues != null && !fieldValues.isEmpty()...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\process\json\JSONProcessInstanceResult.java
1
请完成以下Java代码
public void setValues(Activity otherActivity) { super.setValues(otherActivity); setFailedJobRetryTimeCycleValue(otherActivity.getFailedJobRetryTimeCycleValue()); setDefaultFlow(otherActivity.getDefaultFlow()); setForCompensation(otherActivity.isForCompensation()); if (otherActivi...
} } dataOutputAssociations = new ArrayList<DataAssociation>(); if (otherActivity.getDataOutputAssociations() != null && !otherActivity.getDataOutputAssociations().isEmpty()) { for (DataAssociation association : otherActivity.getDataOutputAssociations()) { dataOutputA...
repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\Activity.java
1
请完成以下Java代码
public String getUsername() { return this.environment.getUsername(); } @Override public @Nullable String getPassword() { return this.environment.getPassword(); } @Override public String getJdbcUrl() { return this.jdbcUrl; } private static String addApplicationNameIfNecessary(String jdbcUrl, ...
StringBuilder jdbcUrlBuilder = new StringBuilder(jdbcUrl); if (!jdbcUrl.contains("?")) { jdbcUrlBuilder.append("?"); } else if (!jdbcUrl.endsWith("&")) { jdbcUrlBuilder.append("&"); } return jdbcUrlBuilder.append("ApplicationName") .append('=') .append(URLEncoder.encode(applicationName, S...
repos\spring-boot-4.0.1\module\spring-boot-jdbc\src\main\java\org\springframework\boot\jdbc\docker\compose\PostgresJdbcDockerComposeConnectionDetailsFactory.java
1
请完成以下Java代码
public Set<K> keySet() { return cache.asMap().keySet(); } // keySet /** * @see java.util.Map#size() */ @Override public long size() { return cache.size(); } // size /** * @see java.util.Map#values() */ public Collection<V> values() { return cache.asMap().values(); } // values @Over...
cache.invalidateAll(); } } public CCacheStats stats() { final CacheStats guavaStats = cache.stats(); return CCacheStats.builder() .cacheId(cacheId) .name(cacheName) .labels(labels) .config(config) .debugAcquireStacktrace(debugAcquireStacktrace) // .size(cache.size()) .hitCount(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\CCache.java
1
请完成以下Java代码
public class UserAuthentication extends Authentication { private static final long serialVersionUID = 1L; protected List<String> groupIds; protected List<String> tenantIds; protected Set<String> authorizedApps; protected Date cacheValidationTime; public UserAuthentication(String userId, String process...
public List<String> getTenantIds() { return tenantIds; } public void setTenantIds(List<String> tenantIds) { this.tenantIds = tenantIds; } public void setGroupIds(List<String> groupIds) { this.groupIds = groupIds; } public void setAuthorizedApps(Set<String> authorizedApps) { this.authorize...
repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\webapp\impl\security\auth\UserAuthentication.java
1
请在Spring Boot框架中完成以下Java代码
public void setReferenceNo(String value) { this.referenceNo = value; } /** * Gets the value of the setupPlaceNo property. * * @return * possible object is * {@link String } * */ public String getSetupPlaceNo() { return setupPlaceNo; } ...
public void setSiteName(String value) { this.siteName = value; } /** * Gets the value of the contact property. * * @return * possible object is * {@link String } * */ public String getContact() { return contact; } /** * Sets the...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_metasfreshinhousev1\de\metas\edi\esb\jaxb\metasfreshinhousev1\EDICctop119VType.java
2
请完成以下Java代码
public String getFilename() { return filename; } /** * Sets the value of the filename property. * * @param value * allowed object is * {@link String } * */ public void setFilename(String value) { this.filename = value; } /** * G...
this.mimeType = value; } /** * Gets the value of the viewer property. * * @return * possible object is * {@link String } * */ public String getViewer() { return viewer; } /** * Sets the value of the viewer property. * * @para...
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\DocumentType.java
1
请完成以下Java代码
public void setO(String organization) { ((InetOrgPerson) this.instance).o = organization; } public void setOu(String ou) { ((InetOrgPerson) this.instance).ou = ou; } public void setRoomNumber(String no) { ((InetOrgPerson) this.instance).roomNumber = no; } public void setTitle(String title) { ...
public void setStreet(String street) { ((InetOrgPerson) this.instance).street = street; } public void setPostalCode(String postalCode) { ((InetOrgPerson) this.instance).postalCode = postalCode; } public void setPostalAddress(String postalAddress) { ((InetOrgPerson) this.instance).postalAddress = post...
repos\spring-security-main\ldap\src\main\java\org\springframework\security\ldap\userdetails\InetOrgPerson.java
1
请完成以下Java代码
public void setJwtValidatorFactory(Function<ClientRegistration, OAuth2TokenValidator<Jwt>> jwtValidatorFactory) { Assert.notNull(jwtValidatorFactory, "jwtValidatorFactory cannot be null"); this.jwtValidatorFactory = jwtValidatorFactory; } /** * Sets the resolver that provides the expected {@link JwsAlgorithm J...
/** * Sets the factory that provides a {@link Converter} used for type conversion of * claim values for an {@link OidcIdToken}. The default is {@link ClaimTypeConverter} * for all {@link ClientRegistration clients}. * @param claimTypeConverterFactory the factory that provides a {@link Converter} used * for ty...
repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\oidc\authentication\ReactiveOidcIdTokenDecoderFactory.java
1
请完成以下Java代码
public class SecurityDataFetcherExceptionResolver extends DataFetcherExceptionResolverAdapter { private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl(); public SecurityDataFetcherExceptionResolver() { setThreadLocalContextAware(true); } /** * Set the resolver to use to che...
this.trustResolver = trustResolver; } @Override protected @Nullable GraphQLError resolveToSingleError(Throwable ex, DataFetchingEnvironment environment) { if (ex instanceof AuthenticationException) { return SecurityExceptionResolverUtils.resolveUnauthorized(environment); } if (ex instanceof AccessDeniedEx...
repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\execution\SecurityDataFetcherExceptionResolver.java
1
请完成以下Java代码
public HuId getLuIdNotNull() { return Check.assumeNotNull(luId, "LU shall be set for {}", this); } public interface CaseConsumer { void noLU(); void newLU(final HuPackingInstructionsId luPackingInstructionsId); void existingLU(final HuId luId, final HUQRCode luQRCode); } public interface CaseMapper<T>...
{ if (target == null) { return mapper.noLU(); } else if (target.isNewLU()) { return mapper.newLU(target.getLuPIIdNotNull()); } else if (target.isExistingLU()) { return mapper.existingLU(target.getLuIdNotNull(), target.getLuQRCode()); } else { throw new AdempiereException("Unsupported t...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\model\LUPickingTarget.java
1
请完成以下Java代码
public Mono<ZipCode> findById(@PathVariable String zipcode) { return getById(zipcode); } @GetMapping("/by_city") public Flux<ZipCode> postZipCode(@RequestParam String city) { return zipRepo.findByCity(city); } @PostMapping public Mono<ZipCode> create(@RequestBody ZipCode zipCod...
return zipRepo.findById(zipCode); } private boolean isKeyDuplicated(Throwable ex) { return ex instanceof DataIntegrityViolationException || ex instanceof UncategorizedR2dbcException; } private Function<? super Throwable, ? extends Mono<ZipCode>> recoverWith(ZipCode zipCode) { return th...
repos\tutorials-master\quarkus-modules\quarkus-vs-springboot\spring-project\src\main\java\com\baeldung\spring_project\ZipCodeApi.java
1
请完成以下Java代码
public String toString() { StringBuffer sb = new StringBuffer ("X_AD_LabelPrinter[") .append(get_ID()).append("]"); return sb.toString(); } /** Set Label printer. @param AD_LabelPrinter_ID Label Printer Definition */ public void setAD_LabelPrinter_ID (int AD_LabelPrinter_ID) { ...
/** Get Description. @return Optional short description of the record */ public String getDescription () { return (String)get_Value(COLUMNNAME_Description); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name)...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_LabelPrinter.java
1
请完成以下Java代码
public GatewayFilter apply(Config config) { String status = Objects.requireNonNull(config.status, "status must not be null"); HttpStatusHolder statusHolder = HttpStatusHolder.parse(status); return new GatewayFilter() { @Override public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain)...
} public @Nullable String getOriginalStatusHeaderName() { return originalStatusHeaderName; } public void setOriginalStatusHeaderName(String originalStatusHeaderName) { this.originalStatusHeaderName = originalStatusHeaderName; } public static class Config { // TODO: relaxed HttpStatus converter private ...
repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\SetStatusGatewayFilterFactory.java
1
请完成以下Java代码
default <ST> RT addInSubQueryFilter(final ModelColumn<T, ?> column, final ModelColumn<ST, ?> subQueryColumn, final IQuery<ST> subQuery) { return addFilter(InSubQueryFilter.<T>builder() .tableName(getModelTableName()) .subQuery(subQuery) .matchingColumnNames(column.getColumnName(), subQueryColumn.getColum...
return self(); } default RT addIntervalIntersection( @NonNull final String lowerBoundColumnName, @NonNull final String upperBoundColumnName, @Nullable final Instant lowerBoundValue, @Nullable final Instant upperBoundValue) { addFilter(new DateIntervalIntersectionQueryFilter<>( ModelColumnNameValue...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\ICompositeQueryFilterProxy.java
1
请完成以下Java代码
/* package */class ShipmentScheduleDeliveryDayAllocable implements IDeliveryDayAllocable { // // Services private final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class); private final IShipmentScheduleDeliveryDayBL shipmentScheduleDeliveryDayBL = Services.g...
return shipmentScheduleDeliveryDayBL.getDeliveryDateCurrent(sched); } @Override public BPartnerLocationId getBPartnerLocationId() { return shipmentScheduleEffectiveBL.getBPartnerLocationId(sched); } @Override public int getM_Product_ID() { return sched.getM_Product_ID(); } @Override public boolean isT...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\tourplanning\api\impl\ShipmentScheduleDeliveryDayAllocable.java
1
请完成以下Java代码
public java.lang.String getTextMsg () { return (java.lang.String)get_Value(COLUMNNAME_TextMsg); } /** Set View ID. @param ViewId View ID */ @Override public void setViewId (java.lang.String ViewId) { set_Value (COLUMNNAME_ViewId, ViewId); } /** Get View ID. @return View ID */ @Override public j...
/** * NotificationSeverity AD_Reference_ID=541947 * Reference name: NotificationSeverity */ public static final int NOTIFICATIONSEVERITY_AD_Reference_ID=541947; /** Notice = Notice */ public static final String NOTIFICATIONSEVERITY_Notice = "Notice"; /** Warning = Warning */ public static final String NOTIFI...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Note.java
1
请完成以下Java代码
private Object tryConsume(MethodInvocation invocation, Consumer<MessageAndChannel> successHandler, BiConsumer<MessageAndChannel, Throwable> errorHandler) throws Throwable { MessageAndChannel mac = new MessageAndChannel((Message) invocation.getArguments()[1], (Channel) invocation.getArguments()[0]); Obje...
props.setExpiration(String.valueOf(retryQueues.getTimeToWait(retryCount))); props.setHeader("x-retried-count", String.valueOf(retryCount + 1)); props.setHeader("x-original-exchange", props.getReceivedExchange()); props.setHeader("x-original-routing-key", props.getReceivedRoutingKey()...
repos\tutorials-master\messaging-modules\spring-amqp\src\main\java\com\baeldung\springamqp\exponentialbackoff\RetryQueuesInterceptor.java
1
请完成以下Java代码
protected ELResolver initProcessApplicationElResolver() { return DefaultElResolverLookup.lookupResolver(this); } public ExecutionListener getExecutionListener() { return null; } public TaskListener getTaskListener() { return null; } /** * see {@link ProcessApplicationScriptEnvironment#ge...
return variableSerializers; } public void setVariableSerializers(VariableSerializers variableSerializers) { this.variableSerializers = variableSerializers; } /** * <p>Provides the default Process Engine name to deploy to, if no Process Engine * was defined in <code>processes.xml</code>.</p> * ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\application\AbstractProcessApplication.java
1
请完成以下Java代码
private void validateDestinations(List<DestinationTopic> destinationsToAdd) { for (int i = 0; i < destinationsToAdd.size(); i++) { DestinationTopic destination = destinationsToAdd.get(i); if (destination.isReusableRetryTopic()) { // Allow multiple DLTs after REUSABLE_RETRY_TOPIC boolean isLastOrFollowed...
return this.contextRefreshed; } @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; } public static class DestinationTopicHolder { private final DestinationTopic sourceDestination; private final Destinati...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\retrytopic\DefaultDestinationTopicResolver.java
1
请完成以下Java代码
public class ElContextDelegate extends ELContext { protected final org.camunda.bpm.impl.juel.jakarta.el.ELContext delegateContext; protected final ELResolver elResolver; public ElContextDelegate(org.camunda.bpm.impl.juel.jakarta.el.ELContext delegateContext, ELResolver elResolver) { this.delegateContext = ...
@Override public boolean isPropertyResolved() { return delegateContext.isPropertyResolved(); } @Override @SuppressWarnings("rawtypes") public void putContext(Class key, Object contextObject) { delegateContext.putContext(key, contextObject); } @Override public void setLocale(Locale locale) { ...
repos\camunda-bpm-platform-master\engine-cdi\core\src\main\java\org\camunda\bpm\engine\cdi\impl\el\ElContextDelegate.java
1
请在Spring Boot框架中完成以下Java代码
public SmsHomeAdvertise getItem(Long id) { return advertiseMapper.selectByPrimaryKey(id); } @Override public int update(Long id, SmsHomeAdvertise advertise) { advertise.setId(id); return advertiseMapper.updateByPrimaryKeySelective(advertise); } @Override public List<Sms...
String endStr = endTime + " 23:59:59"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date start = null; try { start = sdf.parse(startStr); } catch (ParseException e) { e.printStackTrace(); } Dat...
repos\mall-master\mall-admin\src\main\java\com\macro\mall\service\impl\SmsHomeAdvertiseServiceImpl.java
2
请完成以下Java代码
public KeyPair getKeyPair(String alias) { return getKeyPair(alias, this.password); } public KeyPair getKeyPair(String alias, char[] password) { try { synchronized (this.lock) { if (this.store == null) { synchronized (this.lock) { this.store = KeyStore.getInstance(this.type); try (InputStr...
if (certificate != null) { publicKey = certificate.getPublicKey(); } else if (key != null) { RSAPublicKeySpec spec = new RSAPublicKeySpec(key.getModulus(), key.getPublicExponent()); publicKey = KeyFactory.getInstance("RSA").generatePublic(spec); } return new KeyPair(publicKey, key); } catch ...
repos\spring-security-main\crypto\src\main\java\org\springframework\security\crypto\encrypt\KeyStoreKeyFactory.java
1
请在Spring Boot框架中完成以下Java代码
public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public static List<Map<String, Object>> getList() { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); AccountFundDirectionEnum[] val = AccountFundDirectionEnum.values(); for (Ac...
} return list; } public static AccountFundDirectionEnum getEnum(String name) { AccountFundDirectionEnum resultEnum = null; AccountFundDirectionEnum[] enumAry = AccountFundDirectionEnum.values(); for (int i = 0; i < enumAry.length; i++) { if (enumAry[i].name().equals(name)) { resultEnum = enumAry[i]; ...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\account\enums\AccountFundDirectionEnum.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); } public I_M_Product getM_Product() throws ...
if (M_Product_ID < 1) set_ValueNoCheck (COLUMNNAME_M_Product_ID, null); else set_ValueNoCheck (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID)); } /** Get Product. @return Product, Service, Item */ public int getM_Product_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_RegistrationProduct.java
1
请完成以下Java代码
public void applyListener(@NonNull final I_C_Async_Batch asyncBatch) { final String internalName = asyncBatchBL.getAsyncBatchTypeInternalName(asyncBatch).orElse(null); if(internalName != null) { final IAsyncBatchListener listener = getListener(internalName); listener.createNotice(asyncBatch); } } priv...
public void registerAsyncBatchNotifier(INotifyAsyncBatch notifyAsyncBatch) { Check.assume(!asycnBatchNotifiers.contains(notifyAsyncBatch), "Every notifier is added only once"); asycnBatchNotifiers.add(notifyAsyncBatch); } @Override public void notify(I_C_Async_Batch asyncBatch) { for (INotifyAsyncBatch noti...
repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\api\impl\AsyncBatchListeners.java
1
请完成以下Java代码
private static I_C_BPartner createNewTemplateBPartner(final int clientId) { final I_C_BPartner bpartner = InterfaceWrapperHelper.newInstanceOutOfTrx(I_C_BPartner.class); final I_C_BPartner template = getBPartnerCashTrx(clientId); if (template != null) { InterfaceWrapperHelper.copyValues(bpartner, bpartne...
/** * @return Cash Trx Business Partner or null */ private static I_C_BPartner getBPartnerCashTrx(final int clientId) { final IClientDAO clientDAO = Services.get(IClientDAO.class); final I_AD_ClientInfo clientInfo = clientDAO.retrieveClientInfo(Env.getCtx(), clientId); final BPartnerId bpartnerId = BPartner...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VBPartner.java
1
请完成以下Java代码
public org.compiere.model.I_AD_Column getAD_Column() { return get_ValueAsPO(COLUMNNAME_AD_Column_ID, org.compiere.model.I_AD_Column.class); } @Override public void setAD_Column(final org.compiere.model.I_AD_Column AD_Column) { set_ValueFromPO(COLUMNNAME_AD_Column_ID, org.compiere.model.I_AD_Column.class, AD_C...
@Override public de.metas.ui.web.base.model.I_WEBUI_Board getWEBUI_Board() { return get_ValueAsPO(COLUMNNAME_WEBUI_Board_ID, de.metas.ui.web.base.model.I_WEBUI_Board.class); } @Override public void setWEBUI_Board(final de.metas.ui.web.base.model.I_WEBUI_Board WEBUI_Board) { set_ValueFromPO(COLUMNNAME_WEBUI_B...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java-gen\de\metas\ui\web\base\model\X_WEBUI_Board_CardField.java
1
请完成以下Java代码
public void setM_HU_ID (final int M_HU_ID) { if (M_HU_ID < 1) set_ValueNoCheck (COLUMNNAME_M_HU_ID, null); else set_ValueNoCheck (COLUMNNAME_M_HU_ID, M_HU_ID); } @Override public int getM_HU_ID() { return get_ValueAsInt(COLUMNNAME_M_HU_ID); } @Override public void setPIName (final @Nullable jav...
public java.lang.String getValue() { return get_ValueAsString(COLUMNNAME_Value); } @Override public void setValueNumber (final @Nullable BigDecimal ValueNumber) { set_ValueNoCheck (COLUMNNAME_ValueNumber, ValueNumber); } @Override public BigDecimal getValueNumber() { final BigDecimal bd = get_ValueAs...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Instance_Properties_v.java
1
请在Spring Boot框架中完成以下Java代码
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException { // 1. 从请求头中获取 ClientId String header = request.getHeader("Authorization"); if (header == null || !header.startsWith("Basic ")) { throw new...
response.setContentType("application/json;charset=UTF-8"); response.getWriter().write(new ObjectMapper().writeValueAsString(token)); } private String[] extractAndDecodeHeader(String header, HttpServletRequest request) { byte[] base64Token = header.substring(6).getBytes(StandardCharsets.UTF_8); ...
repos\SpringAll-master\65.Spring-Security-OAuth2-Config\src\main\java\cc\mrbird\security\handler\MyAuthenticationSucessHandler.java
2
请完成以下Java代码
public class AddResponseHeaderGatewayFilterFactory extends AbstractNameValueGatewayFilterFactory { private static final String OVERRIDE_KEY = "override"; @Override public Class getConfigClass() { return Config.class; } @Override public NameValueConfig newConfig() { return new Config(); } @Override publ...
override = ((Config) config).isOverride(); } if (override) { headers.add(name, value); } else { boolean headerIsMissingOrBlank = headers.getOrEmpty(name) .stream() .allMatch(h -> !StringUtils.hasText(h)); if (headerIsMissingOrBlank) { headers.add(name, value); } } } } ...
repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\AddResponseHeaderGatewayFilterFactory.java
1
请完成以下Java代码
public boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) { return getJarPathFileStore().supportsFileAttributeView(type); } @Override public boolean supportsFileAttributeView(String name) { return getJarPathFileStore().supportsFileAttributeView(name); } @Override public <V extends Fi...
catch (UncheckedIOException ex) { throw ex.getCause(); } } protected FileStore getJarPathFileStore() { try { return Files.getFileStore(this.fileSystem.getJarPath()); } catch (IOException ex) { throw new UncheckedIOException(ex); } } }
repos\spring-boot-4.0.1\loader\spring-boot-loader\src\main\java\org\springframework\boot\loader\nio\file\NestedFileStore.java
1
请完成以下Java代码
public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; }
public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public Boolean getCompleted() { return completed; } public void setCompleted(Boolean completed) { this.completed = completed; } }
repos\tutorials-master\spring-cloud-modules\spring-cloud-openfeign\src\main\java\com\baeldung\cloud\openfeign\model\Todo.java
1
请完成以下Java代码
protected void validateType(JavaType type, DeserializationTypeValidator validator) { if (validator != null) { List<String> invalidTypes = new ArrayList<>(); validateType(type, validator, invalidTypes); if (!invalidTypes.isEmpty()) { throw new SpinRuntimeException("The following classes are...
} if (type.isContainerType() || type.hasContentType()) { validateType(type.getContentType(), validator, invalidTypes); } } } protected void validateTypeInternal(JavaType type, DeserializationTypeValidator validator, List<String> invalidTypes) { String className = type.getRawClass().getN...
repos\camunda-bpm-platform-master\spin\dataformat-json-jackson\src\main\java\org\camunda\spin\impl\json\jackson\format\JacksonJsonDataFormatMapper.java
1
请完成以下Java代码
public int getRef_InOutLine_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_Ref_InOutLine_ID); if (ii == null) return 0; return ii.intValue(); } public org.compiere.model.I_M_InOutLine getReversalLine() throws RuntimeException { return (org.compiere.model.I_M_InOutLine)MTable.get(getCtx(), org.c...
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ScrappedQty); if (bd == null) return Env.ZERO; return bd; } /** Set Zielmenge. @param TargetQty Zielmenge der Warenbewegung */ public void setTargetQty (BigDecimal TargetQty) { set_ValueNoCheck (COLUMNNAME_TargetQty, TargetQty); } /** Get Zielme...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\org\adempiere\model\X_RV_M_InOutLine_Overview.java
1
请完成以下Java代码
public static Consumer<OAuth2AuthorizationRequest.Builder> withPkce() { return OAuth2AuthorizationRequestCustomizers::applyPkce; } private static void applyPkce(OAuth2AuthorizationRequest.Builder builder) { if (isPkceAlreadyApplied(builder)) { return; } String codeVerifier = DEFAULT_SECURE_KEY_GENERATOR....
} private static boolean isPkceAlreadyApplied(OAuth2AuthorizationRequest.Builder builder) { AtomicBoolean pkceApplied = new AtomicBoolean(false); builder.additionalParameters((params) -> { if (params.containsKey(PkceParameterNames.CODE_CHALLENGE)) { pkceApplied.set(true); } }); return pkceApplied.ge...
repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\web\OAuth2AuthorizationRequestCustomizers.java
1
请在Spring Boot框架中完成以下Java代码
public void afterReturning(Object result) { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletRequest request = attributes.getRequest(); Map<String, String> map = MDC.getCopyOfContextMap(); if (map != null) { ...
String method = req.getMethod(); requestInfo.put("method", method); if (req.getQueryString() != null) { requestInfo.put("queryString", URLDecoder.decode(req.getQueryString(), "UTF-8")); } String remoteAddr = req.getRemoteAddr(); requestInfo.put...
repos\SpringBoot-Shiro-Vue-master\back\src\main\java\com\heeexy\example\config\filter\WebLogAspect.java
2
请完成以下Java代码
class SplitLargeFile { public List<File> splitByFileSize(File largeFile, int maxSizeOfSplitFiles, String splitedFileDirPath) throws IOException { List<File> listOfSplitFiles = new ArrayList<>(); try (InputStream in = Files.newInputStream(largeFile.toPath())) { final byte[] b...
public List<File> splitByNumberOfFiles(File largeFile, int noOfFiles, String splitedFileDirPath) throws IOException { return splitByFileSize(largeFile, getSizeInBytes(largeFile.length(), noOfFiles), splitedFileDirPath); } private int getSizeInBytes(long largefileSizeInBytes,...
repos\tutorials-master\core-java-modules\core-java-io-5\src\main\java\com\baeldung\splitlargefile\SplitLargeFile.java
1
请完成以下Java代码
public class AddOnePage { public static void main(String[] args) { // Create a new document object Document document = new Document(); // Load a sample document from a file document.loadFromFile("/Users/liuhaihua/tmp/WordDocument.docx"); // Get the body of the last section ...
// Apply the paragraph style paragraph.applyStyle(paragraphStyle.getName()); // Add the paragraph to the body's content collection body.getChildObjects().add(paragraph); // Save the document to a specified path document.saveToFile("/Users/liuhaihua/tmp/Add a Page.docx", FileFor...
repos\springboot-demo-master\spire-doc\src\main\java\com\et\spire\doc\AddOnePage.java
1