instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | protected void registerCallouts(@NonNull final IProgramaticCalloutProvider programaticCalloutProvider)
{
// Do not initialize if the printing module is disabled
if (!checkPrintingEnabled())
{
return;
}
// task 09417
programaticCalloutProvider.registerAnnotatedCallout(de.metas.printing.callout.C_Doc_Out... | protected List<Topic> getAvailableUserNotificationsTopics()
{
return ImmutableList.of(Printing_Constants.USER_NOTIFICATIONS_TOPIC);
}
@Override
public void onUserLogin(final int AD_Org_ID, final int AD_Role_ID, final int AD_User_ID)
{
// make sure that the host key is set in the context
if (checkPrintingEna... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java\de\metas\printing\model\validator\Main.java | 1 |
请完成以下Java代码 | public static String encode(String password) {
password = password + SALT;
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
throw new RuntimeException(e);
}
char[] charArray = password.toCharArray();
... | int val = ((int) md5Bytes[i]) & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}
public static void main(String[] args) {
System.out.println(MD5Util.encode("abel"... | repos\springBoot-master\springboot-SpringSecurity0\src\main\java\com\us\example\util\MD5Util.java | 1 |
请完成以下Java代码 | private void captureMoneyIfNeeded(@NonNull final I_C_Invoice salesInvoice)
{
//
// We capture money only for sales invoices
if (!salesInvoice.isSOTrx())
{
return;
}
//
// Avoid reversals
if (invoiceBL.isReversal(salesInvoice))
{
return;
}
//
// We capture money only for regular invoices... | {
return;
}
final LocalDate dateTrx = TimeUtil.asLocalDate(salesInvoice.getDateInvoiced());
final Money grandTotal = extractGrandTotal(salesInvoice);
paymentReservationService.captureAmount(PaymentReservationCaptureRequest.builder()
.salesOrderId(salesOrderId)
.salesInvoiceId(InvoiceId.ofRepoId(sal... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\interceptor\C_Invoice.java | 1 |
请完成以下Java代码 | public T getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(T defaultValue) {
this.defaultValue = defaultValue;
}
public boolean isRequired() {
return isRequired;
}
/**
*/
public void setRequired(boolean required) {
this.isRequired = required;
}
/**
* @pa... | }
public void removeAttribute(ModelElementInstance modelElement) {
if (namespaceUri == null) {
modelElement.removeAttribute(attributeName);
}
else {
modelElement.removeAttributeNs(namespaceUri, attributeName);
}
}
public void unlinkReference(ModelElementInstance modelElement, Object ... | repos\camunda-bpm-platform-master\model-api\xml-model\src\main\java\org\camunda\bpm\model\xml\impl\type\attribute\AttributeImpl.java | 1 |
请完成以下Java代码 | public int getAD_User_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_User_ID);
}
@Override
public void setAD_User_MKTG_Channels_ID (final int AD_User_MKTG_Channels_ID)
{
if (AD_User_MKTG_Channels_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_User_MKTG_Channels_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_... | @Override
public void setMKTG_Channel(final de.metas.marketing.base.model.I_MKTG_Channel MKTG_Channel)
{
set_ValueFromPO(COLUMNNAME_MKTG_Channel_ID, de.metas.marketing.base.model.I_MKTG_Channel.class, MKTG_Channel);
}
@Override
public void setMKTG_Channel_ID (final int MKTG_Channel_ID)
{
if (MKTG_Channel_ID ... | repos\metasfresh-new_dawn_uat\backend\de.metas.marketing\base\src\main\java-gen\de\metas\marketing\base\model\X_AD_User_MKTG_Channels.java | 1 |
请完成以下Java代码 | public class DistributionFacetIdsCollection implements Iterable<DistributionFacetId>
{
public static final DistributionFacetIdsCollection EMPTY = new DistributionFacetIdsCollection(ImmutableSet.of());
private final ImmutableSet<DistributionFacetId> set;
private DistributionFacetIdsCollection(@NonNull final Immutabl... | public Set<PPOrderId> getManufacturingOrderIds() {return getValues(DistributionFacetGroupType.MANUFACTURING_ORDER_NO, DistributionFacetId::getManufacturingOrderId);}
public Set<LocalDate> getDatesPromised() {return getValues(DistributionFacetGroupType.DATE_PROMISED, DistributionFacetId::getDatePromised);}
public Se... | repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\launchers\facets\DistributionFacetIdsCollection.java | 1 |
请完成以下Java代码 | public class ESR_Main_Validator extends AbstractModuleInterceptor
{
@Override
protected void onAfterInit()
{
registerFactories();
}
@Override
protected void registerInterceptors(IModelValidationEngine engine)
{
engine.addModelValidator(new ESR_Import());
engine.addModelValidator(new ESR_ImportLine());
e... | esrImportBL.registerActionHandler(X_ESR_ImportLine.ESR_PAYMENT_ACTION_Unknown_Invoice, new UnknownInvoiceESRActionHandler());
//
// Register ESR Payment Parsers
final IPaymentStringParserFactory paymentStringParserFactory = Services.get(IPaymentStringParserFactory.class);
paymentStringParserFactory.registerP... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java\de\metas\payment\esr\model\validator\ESR_Main_Validator.java | 1 |
请完成以下Java代码 | public class Philosopher implements Runnable {
private final Object leftFork;
private final Object rightFork;
Philosopher(Object left, Object right) {
this.leftFork = left;
this.rightFork = right;
}
private void doAction(String action) throws InterruptedException {
System.... | try {
while (true) {
doAction(System.nanoTime() + ": Thinking"); // thinking
synchronized (leftFork) {
doAction(System.nanoTime() + ": Picked up left fork");
synchronized (rightFork) {
doAction(System.nanoTime() ... | repos\tutorials-master\core-java-modules\core-java-concurrency-advanced-7\src\main\java\com\baeldung\diningphilosophers\Philosopher.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private TenantProfile getTenantProfile(TenantId tenantId) {
TenantProfile profile = null;
TenantProfileId tenantProfileId = tenantIds.get(tenantId);
if (tenantProfileId != null) {
profile = profiles.get(tenantProfileId);
}
if (profile == null) {
tenantProf... | profile = existingProfile;
} else {
profiles.put(profile.getId(), profile);
}
tenantProfileIds.computeIfAbsent(profile.getId(), id -> ConcurrentHashMap.newKeySet()).add(tenantId);
tenantIds.put(tenantId, profile.getI... | repos\thingsboard-master\common\transport\transport-api\src\main\java\org\thingsboard\server\common\transport\service\DefaultTransportTenantProfileCache.java | 2 |
请完成以下Java代码 | public static Result removeOne(String desformCode, String dataId, String token) {
String url = getBaseUrl(desformCode, dataId).toString();
HttpHeaders headers = getHeaders(token);
ResponseEntity<JSONObject> result = RestUtil.request(url, HttpMethod.DELETE, headers, null, null, JSONObject.class);... | builder.append("/").append(desformCode);
if (dataId != null) {
builder.append("/").append(dataId);
}
return builder;
}
private static StringBuilder getBaseUrl(String desformCode) {
return getBaseUrl(desformCode, null);
}
private static HttpHeaders getHeaders... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\RestDesformUtil.java | 1 |
请完成以下Java代码 | public static boolean isExecutionRelatedEntityCountEnabled(ExecutionEntity executionEntity) {
if (executionEntity.isProcessInstanceType() || executionEntity instanceof CountingExecutionEntity) {
return isExecutionRelatedEntityCountEnabled((CountingExecutionEntity) executionEntity);
}
... | * F / T : F (execution was of time when counting was done. But this is overruled by the global flag and thus the queries will o
* be done)
* F / F : F (all disabled)
*
* From this table it is clear that only when both are true, the result should be true, which is the regular AND rule for booleans.... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\util\CountingEntityUtil.java | 1 |
请完成以下Java代码 | public int getStudentId() {
return studentId;
}
public void setStudentId(int studentId) {
this.studentId = studentId;
}
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}... | public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Student that = (Student) o;
return Objects.equals(studentId,that.studentId) &&
Objects.equals(studentName, that.studentName) &&
... | repos\tutorials-master\core-java-modules\core-java-lang-oop-patterns-2\src\main\java\com\baeldung\deepcopyarraylist\Student.java | 1 |
请完成以下Java代码 | public int logarithmicApproach(int number) {
int length = (int) Math.log10(number) + 1;
return length;
}
public int repeatedMultiplication(int number) {
int length = 0;
long temp = 1;
while(temp <= number) {
length++;
temp *= 10;
}
... | else
return 5;
}
}
} else {
// 6 digits or more
if (number < 10000000) {
// 6 or 7 digits
if (number < 1000000)
return 6;
else
return 7;
... | repos\tutorials-master\core-java-modules\core-java-numbers\src\main\java\com\baeldung\numberofdigits\NumberOfDigits.java | 1 |
请完成以下Java代码 | private List<HuForInventoryLine> loadEligibleHUs(
@NonNull final ProductId productId,
@Nullable final AttributeSetInstanceId attributeSetInstanceId,
@Nullable final WarehouseId warehouseId)
{
final LocatorAndProductStrategy husFinder = HUsForInventoryStrategies.locatorAndProduct()
.huForInventoryLineFac... | return JsonOutOfStockResponseItem.builder()
.warehouseId(JsonMetasfreshId.of(warehouseId.getRepoId()))
.closedShipmentSchedules(closedShipmentScheduleIds)
.inventoryDocNo(warehouseId2InventoryDocNo.get(warehouseId))
.build();
})
.filter(Objects::nonNull)
.forEach(responseBuilder:... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\warehouse\WarehouseService.java | 1 |
请完成以下Java代码 | public static PriceLimitRuleResult priceLimit(@NonNull final BigDecimal priceLimit, final String priceLimitExplanation)
{
return priceLimit(priceLimit, TranslatableStrings.anyLanguage(priceLimitExplanation));
}
public static PriceLimitRuleResult priceLimit(@NonNull final BigDecimal priceLimit, @NonNull final ITra... | public BooleanWithReason checkApplicableAndBelowPriceLimit(@NonNull final BigDecimal priceActual)
{
if (!applicable)
{
return BooleanWithReason.falseBecause(notApplicableReason);
}
if (priceLimit.signum() == 0)
{
return BooleanWithReason.falseBecause("limit price is ZERO");
}
final boolean belowP... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\limit\PriceLimitRuleResult.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CountryDto {
private final Long id;
private final String name;
private final String code;
private final String emoji;
public CountryDto(Long id, String name, String code, String emoji) {
this.id = id;
this.name = name;
this.code = code;
this.emoji = emo... | return id;
}
public String getName() {
return name;
}
public String getCode() {
return code;
}
public String getEmoji() {
return emoji;
}
} | repos\tutorials-master\docker-modules\docker-multi-module-maven\docker-rest-api\src\main\java\com\baeldung\api\controller\CountryDto.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class SessionConfiguration {
/**
* 创建 {@link RedisOperationsSessionRepository} 使用的 RedisSerializer Bean 。
*
* 具体可以看看 {@link RedisHttpSessionConfiguration#setDefaultRedisSerializer(RedisSerializer)} 方法,
* 它会引入名字为 "springSessionDefaultRedisSerializer" 的 Bean 。
*
* @return RedisSe... | // DefaultCookieSerializer cookieSerializer = new DefaultCookieSerializer();
// sessionIdResolver.setCookieSerializer(cookieSerializer); // 设置到 sessionIdResolver 中
// cookieSerializer.setCookieName("JSESSIONID");
//
// return sessionIdResolver;
// }
// @Bean
// public HeaderHttpSes... | repos\SpringBoot-Labs-master\lab-26\lab-26-distributed-session-01\src\main\java\cn\iocoder\springboot\lab26\distributedsession\config\SessionConfiguration.java | 2 |
请完成以下Java代码 | String bodyAsString() throws IOException {
InputStream byteStream = new ByteArrayInputStream(bodyAsByteArray());
if (headers.getOrEmpty(HttpHeaders.CONTENT_ENCODING).contains("gzip")) {
byteStream = new GZIPInputStream(byteStream);
}
return new String(FileCopyUtils.copyToByteArray(byteStream));
}
public s... | public Builder timestamp(Instant timestamp) {
this.timestamp = timestamp;
return this;
}
public Builder timestamp(Date timestamp) {
this.timestamp = timestamp.toInstant();
return this;
}
public Builder body(String data) {
return appendToBody(ByteBuffer.wrap(data.getBytes(StandardCharsets.UTF_8)... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\cache\CachedResponse.java | 1 |
请完成以下Java代码 | public SecurityInfo getByOscoreIdentity(OscoreIdentity oscoreIdentity) {
return null;
}
public SecurityInfo fetchAndPutSecurityInfo(String credentialsId) {
TbLwM2MSecurityInfo securityInfo = validator.getEndpointSecurityInfoByCredentialsId(credentialsId, CLIENT);
doPut(securityInfo);
... | @Override
public void registerX509(String endpoint, String registrationId) {
endpointRegistrations.computeIfAbsent(endpoint, ep -> new HashSet<>()).add(registrationId);
}
@Override
public void remove(String endpoint, String registrationId) {
Set<String> epRegistrationIds = endpointRegis... | repos\thingsboard-master\common\transport\lwm2m\src\main\java\org\thingsboard\server\transport\lwm2m\server\store\TbLwM2mSecurityStore.java | 1 |
请完成以下Java代码 | public Integer getState() {
return state;
}
/**
* 设置 状态 1:正常 2:禁用.
*
* @param state 状态 1:正常 2:禁用.
*/
public void setState(Integer state) {
this.state = state;
}
/**
* 获取 创建时间.
*
* @return 创建时间.
*/
public Date getCreatedTime() {
re... | public Date getUpdatedTime() {
return updatedTime;
}
/**
* 设置 更新时间.
*
* @param updatedTime 更新时间.
*/
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
protected Serializable pkVal() {
return this.id;
}
} | repos\SpringBootBucket-master\springboot-jwt\src\main\java\com\xncoding\jwt\dao\domain\Manager.java | 1 |
请完成以下Java代码 | protected String doIt()
{
final CopyColumnsResult result = CopyColumnsProducer.newInstance()
.setLogger(this)
.setTargetTable(getTargetTable())
.setSourceColumns(getSourceColumns())
.setEntityType(p_EntityType)
.setDryRun(p_IsTest)
.create();
//
return "" + result;
}
protected I_AD_Ta... | protected List<I_AD_Column> getSourceColumns()
{
final IQueryFilter<I_AD_Column> selectedColumnsFilter = getProcessInfo().getQueryFilterOrElseFalse();
final IQueryBuilder<I_AD_Column> queryBuilder = Services.get(IQueryBL.class).createQueryBuilder(I_AD_Column.class, this)
.filter(selectedColumnsFilter);
quer... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\table\process\AD_Column_CopySelectedToTable.java | 1 |
请完成以下Java代码 | private static final class OptionHelpFormatter implements HelpFormatter {
private final List<OptionHelp> help = new ArrayList<>();
@Override
public String format(Map<String, ? extends OptionDescriptor> options) {
Comparator<OptionDescriptor> comparator = Comparator
.comparing((optionDescriptor) -> option... | this.options = new LinkedHashSet<>();
for (String option : descriptor.options()) {
String prefix = (option.length() != 1) ? "--" : "-";
this.options.add(prefix + option);
}
if (this.options.contains("--cp")) {
this.options.remove("--cp");
this.options.add("-cp");
}
this.description = desc... | repos\spring-boot-4.0.1\cli\spring-boot-cli\src\main\java\org\springframework\boot\cli\command\options\OptionHandler.java | 1 |
请完成以下Java代码 | public class MetricsClientMeters {
private MeterProvider<Counter> attemptCounter;
private MeterProvider<DistributionSummary> sentMessageSizeDistribution;
private MeterProvider<DistributionSummary> receivedMessageSizeDistribution;
private MeterProvider<Timer> clientAttemptDuration;
private MeterProv... | public Builder setSentMessageSizeDistribution(MeterProvider<DistributionSummary> distribution) {
this.sentMessageSizeDistribution = distribution;
return this;
}
public Builder setReceivedMessageSizeDistribution(MeterProvider<DistributionSummary> distribution) {
this.... | repos\grpc-spring-master\grpc-client-spring-boot-starter\src\main\java\net\devh\boot\grpc\client\metrics\MetricsClientMeters.java | 1 |
请完成以下Java代码 | public class ActivityCompletedListenerDelegate implements ActivitiEventListener {
private List<BPMNElementEventListener<BPMNActivityCompletedEvent>> processRuntimeEventListeners;
private ToActivityCompletedConverter converter;
public ActivityCompletedListenerDelegate(
List<BPMNElementEventListene... | converter
.from((ActivitiActivityEvent) event)
.ifPresent(convertedEvent -> {
for (BPMNElementEventListener<BPMNActivityCompletedEvent> listener : processRuntimeEventListeners) {
listener.onEvent(convertedEvent);
}
... | repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-process-runtime-impl\src\main\java\org\activiti\runtime\api\event\internal\ActivityCompletedListenerDelegate.java | 1 |
请完成以下Java代码 | public int getCM_NewsItem_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_CM_NewsItem_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Content HTML.
@param ContentHTML
Contains the content itself
*/
public void setContentHTML (String ContentHTML)
{
set_Value (COLUMNNAME_Conte... | }
/** Set Publication Date.
@param PubDate
Date on which this article will / should get published
*/
public void setPubDate (Timestamp PubDate)
{
set_Value (COLUMNNAME_PubDate, PubDate);
}
/** Get Publication Date.
@return Date on which this article will / should get published
*/
public Timestamp... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_NewsItem.java | 1 |
请完成以下Java代码 | public WFActivityType getHandledActivityType()
{
return HANDLED_ACTIVITY_TYPE;
}
@Override
public UIComponent getUIComponent(
final @NonNull WFProcess wfProcess,
final @NonNull WFActivity wfActivity,
final @NonNull JsonOpts jsonOpts)
{
return UserConfirmationSupportUtil.createUIComponent(
UserCon... | {
final DistributionJob job = DistributionMobileApplication.getDistributionJob(wfProcess);
return computeActivityState(job);
}
public static WFActivityStatus computeActivityState(final DistributionJob job)
{
return job.isClosed() ? WFActivityStatus.COMPLETED : WFActivityStatus.NOT_STARTED;
}
@Override
pub... | repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\workflows_api\activity_handlers\CompleteDistributionWFActivityHandler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JsonExternalSystemInfo
{
@NonNull
@JsonProperty("externalSystemConfigId")
JsonMetasfreshId externalSystemConfigId;
@NonNull
@JsonProperty("orgCode")
String orgCode;
@NonNull
@JsonProperty("externalSystemChildConfigValue")
String externalSystemChildConfigValue;
@NonNull
@JsonProperty("external... | @NonNull
@JsonProperty("parameters")
Map<String, String> parameters;
@Builder
public JsonExternalSystemInfo(
@JsonProperty("externalSystemConfigId") final @NonNull JsonMetasfreshId externalSystemConfigId,
@JsonProperty("externalSystemName") final @NonNull JsonExternalSystemName externalSystemName,
@JsonPr... | repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-externalsystem\src\main\java\de\metas\common\externalsystem\JsonExternalSystemInfo.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public List<EntityLinkEntity> findEntityLinksByQuery(InternalEntityLinkQuery<EntityLinkEntity> query) {
return getList("selectEntityLinksByQuery", query, (CachedEntityMatcher<EntityLinkEntity>) query, true);
}
@Override
@SuppressWarnings("unchecked")
public EntityLinkEntity findEntityLinkByQuer... | @Override
public void deleteEntityLinksByRootScopeIdAndType(String scopeId, String scopeType) {
Map<String, String> parameters = new HashMap<>();
parameters.put("rootScopeId", scopeId);
parameters.put("rootScopeType", scopeType);
bulkDelete("deleteEntityLinksByRootScopeIdAndRootScope... | repos\flowable-engine-main\modules\flowable-entitylink-service\src\main\java\org\flowable\entitylink\service\impl\persistence\entity\data\impl\MybatisEntityLinkDataManager.java | 2 |
请完成以下Java代码 | public final class CurrentAttributeValueContextProvider
{
private static final ThreadLocal<IAttributeValueContext> currentAttributesContextRef = new ThreadLocal<IAttributeValueContext>();
private CurrentAttributeValueContextProvider()
{
super();
}
/**
* @return {@link IAttributeValueContext} available or <co... | public static IAttributeValueContext setCurrentAttributesContext(final IAttributeValueContext attributesContext)
{
final IAttributeValueContext attributesContextOld = currentAttributesContextRef.get();
currentAttributesContextRef.set(attributesContext);
return attributesContextOld;
}
/**
* Makes sure curre... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\adempiere\mm\attributes\api\CurrentAttributeValueContextProvider.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String prefix() {
return "management.newrelic.metrics.export";
}
@Override
public boolean meterNameEventTypeEnabled() {
return obtain(NewRelicProperties::isMeterNameEventTypeEnabled, NewRelicConfig.super::meterNameEventTypeEnabled);
}
@Override
public String eventType() {
return obtain(NewRelicProp... | }
@Override
public @Nullable String apiKey() {
return get(NewRelicProperties::getApiKey, NewRelicConfig.super::apiKey);
}
@Override
public @Nullable String accountId() {
return get(NewRelicProperties::getAccountId, NewRelicConfig.super::accountId);
}
@Override
public String uri() {
return obtain(NewRel... | repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\newrelic\NewRelicPropertiesConfigAdapter.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public JAXBElement<String> createVATIdentificationNumber(String value) {
return new JAXBElement<String>(_VATIdentificationNumber_QNAME, String.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link UnitType }{@code >}
*
* @param value
* Java inst... | public JAXBElement<UnitType> createWidth(UnitType value) {
return new JAXBElement<UnitType>(_Width_QNAME, UnitType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element'... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ObjectFactory.java | 2 |
请完成以下Java代码 | private JsonReportError extractJsonReportError(final RestClientResponseException ex)
{
final ObjectMapper jsonObjectMapper = JsonObjectMapperHolder.sharedJsonObjectMapper();
try
{
return jsonObjectMapper.readValue(ex.getResponseBodyAsString(), JsonReportError.class);
}
catch (final Exception ex2)
{
l... | Loggables.withLogger(logger, Level.ERROR)
.addLog("Caught {} trying to invoke URL {}; message: {}",
ex.getClass(), url, ex.getMessage(), ex);
}
@Override
public void cacheReset()
{
final String mgtUrl = mgtRootUrl + "?" + ReportConstants.MGTSERVLET_PARAM_Action + "=" + ReportConstants.MGTSERVLET_ACTION... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\de.metas.report.jasper.client\src\main\java\de\metas\report\jasper\client\RemoteServletInvoker.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
nameSet = true;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
... | public void setFormKey(String formKey) {
this.formKey = formKey;
formKeySet = true;
}
public boolean isOwnerSet() {
return ownerSet;
}
public boolean isAssigneeSet() {
return assigneeSet;
}
public boolean isDelegationStateSet() {
return delegationStateS... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\task\TaskRequest.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class DefaultJwtSettingsValidator implements JwtSettingsValidator {
@Override
public void validate(JwtSettings jwtSettings) {
if (StringUtils.isEmpty(jwtSettings.getTokenIssuer())) {
throw new DataValidationException("JWT token issuer should be specified!");
}
if (Opt... | byte[] decodedKey;
try {
decodedKey = Base64.getDecoder().decode(jwtSettings.getTokenSigningKey());
} catch (Exception e) {
throw new DataValidationException("JWT token signing key should be a valid Base64 encoded string! " + e.getMessage());
}
if (Arrays.isNullO... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\security\auth\jwt\settings\DefaultJwtSettingsValidator.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class DerKurierShipperConfigRepository
{
private static final CCache<Integer, Optional<DerKurierShipperConfig>> cache = CCache.newCache(
I_DerKurier_Shipper_Config.Table_Name + "#by#" + I_DerKurier_Shipper_Config.COLUMNNAME_M_Shipper_ID,
10,
CCache.EXPIREMINUTES_Never);
public DerKurierShipperConfig ... | .create()
.firstOnly(I_DerKurier_Shipper_Config.class);
if (shipperConfigRecord == null)
{
return Optional.empty();
}
final DerKurierShipperConfig shipperConfig = DerKurierShipperConfig.builder()
.restApiBaseUrl(shipperConfigRecord.getAPIServerBaseURL())
.customerNumber(shipperConfigRecord.getDK... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.derkurier\src\main\java\de\metas\shipper\gateway\derkurier\misc\DerKurierShipperConfigRepository.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public List<ExternalSystemServiceModel> getAllByType(@NonNull @CacheAllowMutable final ExternalSystemType systemType)
{
return queryBL.createQueryBuilder(I_ExternalSystem_Service.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_ExternalSystem_Service.COLUMN_ExternalSystem_ID, externalSystemRepository... | }
@NonNull
private ExternalSystemServiceModel ofServiceRecord(@NonNull final I_ExternalSystem_Service record)
{
return ExternalSystemServiceModel.builder()
.id(ExternalSystemServiceId.ofRepoId(record.getExternalSystem_Service_ID()))
.name(record.getName())
.description(record.getDescription())
.se... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\externalservice\model\ExternalSystemServiceRepository.java | 2 |
请完成以下Java代码 | public InputStream getInputStream() throws IOException
{
if (_data == null)
{
throw new IOException("no data");
}
// a new stream must be returned each time.
return new ByteArrayInputStream(_data);
}
/**
* Throws exception
*/
@Override
public OutputStream getOutputStream() throws IOException | {
throw new IOException("cannot do this");
}
/**
* Get Content Type
*
* @return MIME type e.g. text/html
*/
@Override
public String getContentType()
{
return _mimeType;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\email\ByteArrayBackedDataSource.java | 1 |
请完成以下Java代码 | public boolean isDefaultForPicking()
{
return get_ValueAsBoolean(COLUMNNAME_IsDefaultForPicking);
}
@Override
public void setIsDefaultLU (final boolean IsDefaultLU)
{
set_Value (COLUMNNAME_IsDefaultLU, IsDefaultLU);
}
@Override
public boolean isDefaultLU()
{
return get_ValueAsBoolean(COLUMNNAME_IsDef... | public int getM_HU_PI_ID()
{
return get_ValueAsInt(COLUMNNAME_M_HU_PI_ID);
}
@Override
public void setName (final java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
@Override
public java.lang.String getName()
{
return get_ValueAsString(COLUMNNAME_Name);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_PI.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Optional<Todo> getTodoById(long id) {
return todoRepository.findById(id);
}
@Override
public void updateTodo(Todo todo) {
todoRepository.save(todo);
}
@Override
public void addTodo(String name, String desc, Date targetDate, boolean isDone) {
todoRepository.save(n... | if(todo.isPresent()) {
todoRepository.delete(todo.get());
}
}
@Override
public void saveTodo(Todo todo) {
todoRepository.save(todo);
}
@Override
public Object getTodosByUser(ModelMap name) {
return null;
}
} | repos\SpringBoot-Projects-FullStack-master\Part-8 Spring Boot Real Projects\0.ProjectToDoinDBNoSec\src\main\java\spring\hibernate\service\TodoService.java | 2 |
请完成以下Java代码 | public Integer getPort() {
return port;
}
public ClusterAppAssignMap setPort(Integer port) {
this.port = port;
return this;
}
public Set<String> getClientSet() {
return clientSet;
}
public ClusterAppAssignMap setClientSet(Set<String> clientSet) {
this.c... | }
public ClusterAppAssignMap setBelongToApp(Boolean belongToApp) {
this.belongToApp = belongToApp;
return this;
}
public Double getMaxAllowedQps() {
return maxAllowedQps;
}
public ClusterAppAssignMap setMaxAllowedQps(Double maxAllowedQps) {
this.maxAllowedQps = max... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\domain\cluster\request\ClusterAppAssignMap.java | 1 |
请完成以下Java代码 | public de.metas.contracts.model.I_C_Flatrate_RefundConfig getC_Flatrate_RefundConfig() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_C_Flatrate_RefundConfig_ID, de.metas.contracts.model.I_C_Flatrate_RefundConfig.class);
}
@Override
public void setC_Flatrate_RefundConfig(de.metas.contracts.model.I_C_F... | }
/** Set Vertrag-Rechnungskandidat.
@param C_Invoice_Candidate_Term_ID Vertrag-Rechnungskandidat */
@Override
public void setC_Invoice_Candidate_Term_ID (int C_Invoice_Candidate_Term_ID)
{
if (C_Invoice_Candidate_Term_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_Invoice_Candidate_Term_ID, null);
else
se... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\model\X_C_Invoice_Candidate_Assignment_Aggregate_V.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BusinessController {
private final BusinessService businessService;
/**
* 购买下单,模拟全局事务提交
*
* @return
*/
@RequestMapping("/purchase/commit")
public Boolean purchaseCommit(HttpServletRequest request) {
businessService.purchase("1001", "2001", 1);
return tr... | * 购买下单,模拟全局事务回滚
*
* @return
*/
@RequestMapping("/purchase/rollback")
public Boolean purchaseRollback() {
try {
businessService.purchase("1002", "2001", 1);
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true... | repos\SpringBootLearning-master (1)\springboot-seata\sbm-business-service\src\main\java\com\gf\controller\BusinessController.java | 2 |
请完成以下Java代码 | public ContextVariables newChildContext(@NonNull final DocumentEntityDescriptor entityDescriptor)
{
return ContextVariables.builder()
.name("Entity: " + ContextPath.extractName(entityDescriptor))
.parent(this)
.contextVariables(extractFieldNames(entityDescriptor))
.build();
}
public ContextVariabl... | private static boolean isSimilar(@NonNull String contextVariable1, @NonNull String contextVariable2)
{
return contextVariable1.equalsIgnoreCase(contextVariable2);
}
public boolean contains(@NonNull final String contextVariable)
{
if (contextVariables.contains(contextVariable))
{
return true;
}
if (kn... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\health\ContextVariables.java | 1 |
请完成以下Java代码 | public String getClassName() {
return variableContainer.getClass().getName();
}
@Override
public Object get(String s, Scriptable scriptable) {
if (KEYWORD_EXECUTION.equals(s) && variableContainer instanceof DelegateExecution) {
return variableContainer;
} else if (KEYWOR... | return null;
}
@Override
public void setPrototype(Scriptable scriptable) {
}
@Override
public Scriptable getParentScope() {
return null;
}
@Override
public void setParentScope(Scriptable scriptable) {
}
@Override
public Object[] getIds() {
return null;... | repos\flowable-engine-main\modules\flowable-secure-javascript\src\main\java\org\flowable\scripting\secure\impl\SecureScriptScope.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String chat(){
return "chat";
}
//http://localhost:8080/ws
@MessageMapping("/welcome")//浏览器发送请求通过@messageMapping 映射/welcome 这个地址。
@SendTo("/topic/getResponse")//服务器端有消息时,会订阅@SendTo 中的路径的浏览器发送消息。
public Response say(Message message) throws Exception {
Thread.sleep(1000);
... | // 第一个参数是接收消息的用户,第二个参数是浏览器订阅的地址,第三个参数是消息本身
messagingTemplate.convertAndSendToUser("abel",
"/queue/notifications", principal.getName() + "-send:"
+ message.getName());
/**
* 72 行操作相等于
* messagingTemplate.convertAndSend("/... | repos\springBoot-master\springWebSocket\src\main\java\com\us\example\controller\WebSocketController.java | 2 |
请完成以下Java代码 | public class AD_ImpFormat_Row_Create_Based_OnTable extends JavaProcess
{
private static transient IADTableDAO tableDAO = Services.get(IADTableDAO.class);
@Override
protected String doIt()
{
final I_AD_ImpFormat impFormat = getRecord(I_AD_ImpFormat.class);
final I_AD_Table table = tableDAO.retrieveTable(AdTabl... | private String extractDisplayType(final int adRefId)
{
if (DisplayType.isText(adRefId))
{
return X_AD_ImpFormat_Row.DATATYPE_String;
}
else if (DisplayType.isNumeric(adRefId))
{
return X_AD_ImpFormat_Row.DATATYPE_Number;
}
else if (DisplayType.isDate(adRefId))
{
return X_AD_ImpFormat_Row.DATAT... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\table\process\AD_ImpFormat_Row_Create_Based_OnTable.java | 1 |
请完成以下Java代码 | public OptimizeRestService getOptimizeRestService(String engineName) {
String rootResourcePath = getRelativeEngineUri(engineName).toASCIIString();
OptimizeRestService subResource = new OptimizeRestService(engineName, getObjectMapper());
subResource.setRelativeRootResourceUri(rootResourcePath);
return su... | public TelemetryRestService getTelemetryRestService(String engineName) {
String rootResourcePath = getRelativeEngineUri(engineName).toASCIIString();
TelemetryRestServiceImpl subResource = new TelemetryRestServiceImpl(engineName, getObjectMapper());
subResource.setRelativeRootResourceUri(rootResourcePath);
... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\AbstractProcessEngineRestServiceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Routing
{
LocalDate sendDate;
LocalDate deliveryDate;
Participant sender;
Participant consignee;
List<String> viaHubs;
String labelContent;
String message;
@Builder
@JsonCreator
public Routing(
@JsonProperty("sendDate") @JsonFormat(shape = Shape.STRING, pattern = DATE_FORMAT) final LocalDate ... | @JsonProperty("consignee") final Participant consignee,
@JsonProperty("viaHubs") final List<String> viaHubs,
@JsonProperty("labelContent") final String labelContent,
@JsonProperty("message") final String message)
{
this.sendDate = Check.assumeNotNull(sendDate, "Parameter sendDate may not be null");
this.d... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.derkurier\src\main\java\de\metas\shipper\gateway\derkurier\restapi\models\Routing.java | 2 |
请完成以下Java代码 | public HUAttributeChange mergeWithNextChange(final HUAttributeChange nextChange)
{
Check.assumeEquals(huId, nextChange.huId, "Invalid huId for {}. Expected: {}", nextChange, huId);
Check.assumeEquals(attributeId, nextChange.attributeId, "Invalid attributeId for {}. Expected: {}", nextChange, attributeId);
Check.... | {
final BigDecimal valueBD = NumberUtils.asBigDecimal(value);
return BigDecimal.ZERO.equals(valueBD)
? null
: AttributesKeyPart.ofNumberAttribute(attributeId, valueBD);
}
else if (AttributeValueType.DATE.equals(attributeValueType))
{
final LocalDate valueDate = TimeUtil.asLocalDate(value);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\material\interceptor\HUAttributeChange.java | 1 |
请完成以下Java代码 | public Boolean validateToken(String token, UserDetails userDetails) {
User user = (User) userDetails;
String username = getUsernameFromToken( token );
return (username.equals( user.getUsername() ) && !isTokenExpired( token ));
}
/**
* 获取token是否过期
*/
public Boolean isToken... | Date expiration = getClaimsFromToken( token ).getExpiration();
return expiration;
}
/**
* 解析JWT
*/
private Claims getClaimsFromToken(String token) {
Claims claims = Jwts.parser()
.setSigningKey( SECRET )
.parseClaimsJws( token )
.get... | repos\SpringBootLearning-master (1)\springboot-jwt\src\main\java\com\gf\utils\JwtTokenUtil.java | 1 |
请完成以下Java代码 | private static void startThread() {
LOG.info("startThread");
cacheThreadPool.execute(new Runnable() {
public void run() {
try {
while (true) {
Thread.sleep(50);//50毫秒执行一次
// 如果当前活动线程等于最大线程,那么不执行
... | int numPerPage = 500;
PageParam pageParam = new PageParam(pageNum, numPerPage);
// 查询状态和通知次数符合以下条件的数据进行通知
String[] status = new String[]{"101", "102", "200", "201"};
Integer[] notifyTime = new Integer[]{0, 1, 2, 3, 4};
// 组装查询条件
Map<String, Object> paramMap = new HashMap... | repos\roncoo-pay-master\roncoo-pay-app-notify\src\main\java\com\roncoo\pay\AppNotifyApplication.java | 1 |
请完成以下Java代码 | public SpinXmlElement replace(SpinXmlElement newElement) {
ensureNotNull("newElement", newElement);
DomXmlElement element = ensureParamInstanceOf("newElement", newElement, DomXmlElement.class);
adoptElement(element);
Node parentNode = domElement.getParentNode();
if (parentNode == null) {
thro... | }
public String toString() {
StringWriter writer = new StringWriter();
writeToWriter(writer);
return writer.toString();
}
public void writeToWriter(Writer writer) {
dataFormat.getWriter().writeToWriter(writer, this.domElement);
}
/**
* Returns a XPath Factory
*
* @return the XPath ... | repos\camunda-bpm-platform-master\spin\dataformat-xml-dom\src\main\java\org\camunda\spin\impl\xml\dom\DomXmlElement.java | 1 |
请完成以下Java代码 | public boolean enableLookupAutocomplete()
{
if (lookupAutoCompleter != null)
{
return true; // auto-complete already initialized
}
final Lookup lookup = getLookup();
if (lookup instanceof MLookup && lookup.getDisplayType() == DisplayType.Search)
{
final MLookup mlookup = (MLookup)lookup;
final ML... | if (gridField == null)
{
return IValidationContext.DISABLED;
}
final IValidationContext evalCtx = Services.get(IValidationRuleFactory.class).createValidationContext(gridField);
// In case grid field validation context could not be created, disable validation
// NOTE: in most of the cases when we reach th... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VLookup.java | 1 |
请完成以下Java代码 | public void insert(DeadLetterJobEntity jobEntity) {
insert(jobEntity, true);
}
@Override
public void delete(DeadLetterJobEntity jobEntity) {
super.delete(jobEntity);
deleteExceptionByteArrayRef(jobEntity);
if (jobEntity.getExecutionId() != null && isExecutionRelatedEntityC... | exceptionByteArrayRef.delete();
}
}
protected DeadLetterJobEntity createDeadLetterJob(AbstractJobEntity job) {
DeadLetterJobEntity newJobEntity = create();
newJobEntity.setJobHandlerConfiguration(job.getJobHandlerConfiguration());
newJobEntity.setJobHandlerType(job.getJobHandler... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\DeadLetterJobEntityManagerImpl.java | 1 |
请完成以下Java代码 | public void addCaseDefinitionCacheEntry(String caseDefinitionId, CaseDefinitionCacheEntry caseDefinitionCacheEntry) {
caseDefinitionCache.put(caseDefinitionId, caseDefinitionCacheEntry);
}
@Override
public CaseDefinitionCacheEntry getCaseDefinitionCacheEntry(String caseDefinitionId) {
retur... | public void setParentDeploymentId(String parentDeploymentId) {
this.parentDeploymentId = parentDeploymentId;
}
@Override
public void setResources(Map<String, EngineResource> resources) {
this.resources = resources;
}
@Override
public Date getDeploymentTime() {
return de... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\persistence\entity\CmmnDeploymentEntityImpl.java | 1 |
请完成以下Java代码 | Supplier<Integer> incrementer() {
return () -> start++;
}
public void localVariableMultithreading() {
boolean run = true;
executor.execute(() -> {
while (run) {
// do operation
}
});
// commented because it doesn't compile, it's ju... | System.out.println(sums.sum());
}
/**
* WARNING: always avoid this workaround!!
*/
public void workaroundMultithreading() {
int[] holder = new int[] { 2 };
Runnable runnable = () -> System.out.println(IntStream
.of(1, 2, 3)
.map(val -> val + holder[0])
... | repos\tutorials-master\core-java-modules\core-java-lambdas-2\src\main\java\com\baeldung\lambdas\LambdaVariables.java | 1 |
请完成以下Java代码 | public Builder scope(String scope) {
try {
this.scope = AttributeScope.valueOf(scope);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Invalid attribute scope '" + scope + "'");
}
return this;
}
p... | return this;
}
public Builder future(SettableFuture<Void> future) {
return callback(new FutureCallback<>() {
@Override
public void onSuccess(Void result) {
future.set(result);
}
@Override
pu... | repos\thingsboard-master\rule-engine\rule-engine-api\src\main\java\org\thingsboard\rule\engine\api\AttributesDeleteRequest.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DocumentReportRequest
{
@Nullable
AdProcessId reportProcessId;
@Nullable
PrintFormatId printFormatIdToUse;
@NonNull
@Builder.Default
DocumentReportFlavor flavor = DocumentReportFlavor.PRINT;
@NonNull TableRecordReference documentRef;
@NonNull ClientId clientId;
@NonNull OrgId orgId;
@NonNull U... | public DocumentReportRequest withPrintOptionsFallback(@NonNull final DocumentPrintOptions printOptionsFallback)
{
final DocumentPrintOptions newPrintOptions = this.printOptions.mergeWithFallback(printOptionsFallback);
return !Objects.equals(this.printOptions, newPrintOptions)
? toBuilder().printOptions(newPrin... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\report\DocumentReportRequest.java | 2 |
请完成以下Java代码 | private IQueryBuilder<I_AD_Private_Access> queryPrivateAccess(
@NonNull final Principal principal,
@NonNull final TableRecordReference recordRef)
{
return queryBL
.createQueryBuilder(I_AD_Private_Access.class)
.addEqualsFilter(I_AD_Private_Access.COLUMNNAME_AD_User_ID, principal.getUserId())
.addEq... | queryBL.createQueryBuilder(I_C_OrgAssignment.class)
.addEqualsFilter(I_C_OrgAssignment.COLUMNNAME_AD_User_ID, userId)
.create()
.delete();
}
@Value(staticConstructor = "of")
private static class RoleOrgPermissionsCacheKey
{
RoleId roleId;
AdTreeId adTreeOrgId;
}
@Value(staticConstructor = "of")
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\impl\UserRolePermissionsDAO.java | 1 |
请完成以下Java代码 | public String getElementText() {
return elementText;
}
public void setElementText(String elementText) {
this.elementText = elementText;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getN... | }
public void setChildElements(Map<String, List<ExtensionElement>> childElements) {
this.childElements = childElements;
}
public ExtensionElement clone() {
ExtensionElement clone = new ExtensionElement();
clone.setValues(this);
return clone;
}
public void setValues... | repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\ExtensionElement.java | 1 |
请完成以下Java代码 | protected Properties getParentCtx()
{
return getParentPO().getCtx();
}
@Override
protected String getParentTrxName()
{
return getParentPO().get_TrxName();
}
@Override
protected int getId()
{
final PO parentPO = getParentPO();
final String parentColumnName = getParentColumnName();
return parentPO.ge... | final String parentColumnName = getParentColumnName();
final boolean ok = parentPO.set_ValueOfColumn(parentColumnName, value);
if (!ok)
{
logger.warn("Cannot set " + parentColumnName + "=" + id + " to " + parentPO);
}
return ok;
}
public POCacheLocal copy(@NonNull final PO parentPO)
{
final POCacheLo... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\model\POCacheLocal.java | 1 |
请完成以下Java代码 | public static Password cast(final Object value)
{
return (Password)value;
}
public static final String OBFUSCATE_STRING = "********";
private final String password;
private Password(@NonNull final String password)
{
this.password = password;
}
@Override
public String toString()
{
return MoreObjects.... | .add("password", "********")
.toString();
}
@JsonValue
public String toJson()
{
return OBFUSCATE_STRING;
}
public String getAsString()
{
return password;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\datatypes\Password.java | 1 |
请完成以下Java代码 | public class TreeModel implements Serializable {
private static final long serialVersionUID = 4013193970046502756L;
private String key;
private String title;
private String slotTitle;
private Boolean isLeaf;
private String icon;
private Integer ruleFlag;
private Map<String,String> scopedSlots;
... | this.parentId = parentId;
this.ruleFlag=ruleFlag;
this.slotTitle = slotTitle;
Map<String,String> map = new HashMap(5);
map.put("title", "hasDatarule");
this.scopedSlots = map;
this.isLeaf = isLeaf;
this.value = key;
if(!isLeaf) {
this.children = new ArrayList<TreeModel>();... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\TreeModel.java | 1 |
请完成以下Java代码 | protected MigratingProcessElementInstance createMigratingEventScopeInstance(MigratingInstanceParseContext parseContext,
EventSubscriptionEntity element) {
ActivityImpl compensatingActivity = parseContext.getSourceProcessDefinition().findActivity(element.getActivityId());
MigrationInstruction migrationIn... | ActivityImpl eventTrigger = compensationHandlerProperties.get(BpmnProperties.COMPENSATION_BOUNDARY_EVENT);
if (eventTrigger == null) {
eventTrigger = compensationHandlerProperties.get(BpmnProperties.INITIAL_ACTIVITY);
}
return parseContext.findSingleMigrationInstruction(eventTrigger.getActivi... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\migration\instance\parser\CompensationInstanceHandler.java | 1 |
请完成以下Java代码 | public java.lang.String getProductValue ()
{
return (java.lang.String)get_Value(COLUMNNAME_ProductValue);
}
/** Set Reihenfolge.
@param SeqNo
Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst
*/
@Override
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Integ... | {
return (java.sql.Timestamp)get_Value(COLUMNNAME_ValidFrom);
}
/** Set Gültig bis.
@param ValidTo
Gültig bis inklusiv (letzter Tag)
*/
@Override
public void setValidTo (java.sql.Timestamp ValidTo)
{
set_Value (COLUMNNAME_ValidTo, ValidTo);
}
/** Get Gültig bis.
@return Gültig bis inklusiv (letzt... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java-gen\de\metas\procurement\base\model\X_PMM_Product.java | 1 |
请完成以下Java代码 | public int getEmployeeUsingBeanPropertySqlParameterSource() {
final Employee employee = new Employee();
employee.setFirstName("James");
final String SELECT_BY_ID = "SELECT COUNT(*) FROM EMPLOYEE WHERE FIRST_NAME = :firstName";
final SqlParameterSource namedParameters = new BeanProperty... | public int[] batchUpdateUsingNamedParameterJDBCTemplate(final List<Employee> employees) {
final SqlParameterSource[] batch = SqlParameterSourceUtils.createBatch(employees.toArray());
final int[] updateCounts = namedParameterJdbcTemplate.batchUpdate("INSERT INTO EMPLOYEE VALUES (:id, :firstName, :lastNam... | repos\tutorials-master\persistence-modules\spring-persistence-simple\src\main\java\com\baeldung\spring\jdbc\template\guide\EmployeeDAO.java | 1 |
请完成以下Java代码 | public boolean isSkipIoMappings() {
return skipIoMappings;
}
public boolean isExternallyTerminated() {
return externallyTerminated;
}
public void setSkipCustomListeners(boolean skipCustomListeners) {
this.skipCustomListeners = skipCustomListeners;
}
public void setSkipIoMappings(boolean skipI... | return modificationReason;
}
public void setModificationReason(String modificationReason) {
this.modificationReason = modificationReason;
}
public String getAnnotation() {
return annotation;
}
public void setAnnotationInternal(String annotation) {
this.annotation = annotation;
}
} | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\ProcessInstanceModificationBuilderImpl.java | 1 |
请完成以下Java代码 | private void assertVariableDoesNotExist(CreateTaskVariablePayload createTaskVariablePayload) {
Map<String, VariableInstance> variables = taskService.getVariableInstancesLocal(
createTaskVariablePayload.getTaskId()
);
if (variables != null && variables.containsKey(createTaskVariableP... | throw new IllegalStateException("Variable does not exist");
}
if (!variables.containsKey(updateTaskVariablePayload.getName())) {
throw new IllegalStateException("Variable does not exist");
}
}
public void handleCompleteTaskPayload(CompleteTaskPayload completeTaskPayload) {
... | repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-task-runtime-impl\src\main\java\org\activiti\runtime\api\impl\TaskRuntimeHelper.java | 1 |
请完成以下Java代码 | public void close()
{
}
public float[] weightVector()
{
return null;
}
public boolean add(String str)
{
return true;
}
public int size()
{
return 0;
}
public int xsize()
{
return 0;
}
public int dsize()
{
return... | {
return true;
}
public boolean empty()
{
return true;
}
public boolean clear()
{
return true;
}
public boolean next()
{
return true;
}
public String parse(String str)
{
return "";
}
public String toString()
{
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\crf\crfpp\Tagger.java | 1 |
请完成以下Java代码 | public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
sendMessageToServer();
}
}
private void sendMessageToServer() {
warningLabel.setText("");
String textToServer = name... | serverResponseLabel.addStyleName("serverResponseLabelError");
serverResponseLabel.setHTML("server error occurred");
closeButton.setFocus(true);
}
public void onSuccess(String result) {
serverResponseLabel.re... | repos\tutorials-master\web-modules\google-web-toolkit\src\main\java\com\baeldung\client\Google_web_toolkit.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Instant getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Instant createdDate) {
this.createdDate = createdDat... | return lastModifiedBy;
}
public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
public Instant getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(Instant lastModifiedDate) {
this.lastModifiedDate =... | repos\tutorials-master\jhipster-8-modules\jhipster-8-microservice\gateway-app\src\main\java\com\gateway\domain\AbstractAuditingEntity.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private final void destroyExecutor(final ScheduledThreadPoolExecutor threadPoolExecutor)
{
threadPoolExecutor.shutdown();
logger.debug("Shutdown {}", threadPoolExecutor);
}
@Override
public void destroy()
{
_threadNamePrefix2ThreadPoolExecutor.invalidateAll();
_threadNamePrefix2ThreadPoolExecutor.cleanUp(... | final int time,
final TimeUnit timeUnit,
final String theadNamePrefix)
{
final ScheduledThreadPoolExecutor threadPoolExecutor = getCreateExecutor(theadNamePrefix);
return threadPoolExecutor.schedule(task, time, timeUnit);
}
@Override
public Future<?> submit(final Runnable task, final String theadNamePref... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\service\impl\TaskExecutorService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class LookupTemplate<KT extends Object> implements ILookupTemplate<KT>
{
private final Class<KT> keyType;
private final String methodName;
/**
* Create an {@link ILookupTemplate} instance.<br>
* <br>
* Call {@link #createMandatoryValueLookup(Object)} or {@link #createNonMandatoryValueLookup(Object)} in... | @Override
public String getMethodName()
{
return methodName;
}
@Override
public ILookupValue<KT> createMandatoryValueLookup(final KT value)
{
return new LookupValue<KT>(this, value, true); // mandatoryLookup=true
}
@Override
public ILookupValue<KT> createNonMandatoryValueLookup(final KT value)
{
retur... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\commons\api\impl\LookupTemplate.java | 2 |
请完成以下Java代码 | public Sentence mergeCompoundWords()
{
ListIterator<IWord> listIterator = wordList.listIterator();
while (listIterator.hasNext())
{
IWord word = listIterator.next();
if (word instanceof CompoundWord)
{
listIterator.set(new Word(word.getValu... | public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Sentence sentence = (Sentence) o;
return toString().equals(sentence.toString());
}
@Override
public int hashCode()
{
return toString().ha... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\document\sentence\Sentence.java | 1 |
请完成以下Java代码 | private static LocalDate fromObjectToLocalDate(final Object valueObj, final ZoneId zoneId)
{
return fromObjectTo(valueObj,
LocalDate.class,
DateTimeConverters::fromJsonToLocalDate,
(object) -> TimeUtil.asLocalDate(object, zoneId));
}
@Nullable
private static LocalTime fromObjectToLocalTime(f... | @NonNull final Object valueObj,
@NonNull final Class<T> type,
@NonNull final Function<String, T> fromJsonConverter,
@NonNull final Function<Object, T> fromObjectConverter)
{
if (type.isInstance(valueObj))
{
return type.cast(valueObj);
}
else if (valueObj instanceof CharSequence)
{
final String... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\util\converter\DateTimeConverters.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_M_Nutrition_Fact getM_Nutrition_Fact() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_M_Nutrition_Fact_ID, org.compiere.model.I_M_Nutrition_Fact.class);
}
@Override
public void setM_Nutrition_Fact(org.compiere.model.I_M_Nutrition_Fact M_Nutrition_Fact)
{
set_ValueFromPO(... | return 0;
return ii.intValue();
}
/** Set Product Nutrition.
@param M_Product_Nutrition_ID Product Nutrition */
@Override
public void setM_Product_Nutrition_ID (int M_Product_Nutrition_ID)
{
if (M_Product_Nutrition_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_Product_Nutrition_ID, null);
else
set_Valu... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Product_Nutrition.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Map<String, String> getSecrets() {
return secrets;
}
public void setSecrets(Map<String, String> secrets) {
Assert.notNull(secrets);
Assert.hasText(secrets.get(SignatureAlgorithm.HS256.getJcaName()));
Assert.hasText(secrets.get(SignatureAlgorithm.HS384.getJcaName()));
... | return TextCodec.BASE64.decode(secrets.get(SignatureAlgorithm.HS512.getJcaName()));
}
public Map<String, String> refreshSecrets() throws NoSuchAlgorithmException {
SecretKey key = KeyGenerator.getInstance(SignatureAlgorithm.HS256.getJcaName()).generateKey();
secrets.put(SignatureAlgorithm.HS256... | repos\tutorials-master\security-modules\jjwt\src\main\java\io\jsonwebtoken\jjwtfun\service\SecretService.java | 2 |
请完成以下Java代码 | public void setRecord_ID (final int Record_ID)
{
if (Record_ID < 0)
set_Value (COLUMNNAME_Record_ID, null);
else
set_Value (COLUMNNAME_Record_ID, Record_ID);
}
@Override
public int getRecord_ID()
{
return get_ValueAsInt(COLUMNNAME_Record_ID);
}
@Override
public de.metas.handlingunits.model.I_M_... | public void setVHU(final de.metas.handlingunits.model.I_M_HU VHU)
{
set_ValueFromPO(COLUMNNAME_VHU_ID, de.metas.handlingunits.model.I_M_HU.class, VHU);
}
@Override
public void setVHU_ID (final int VHU_ID)
{
if (VHU_ID < 1)
set_Value (COLUMNNAME_VHU_ID, null);
else
set_Value (COLUMNNAME_VHU_ID, VHU_I... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Assignment.java | 1 |
请完成以下Java代码 | private static Color extractPrimaryAWTColor(@NonNull final I_AD_Color colorRecord)
{
return new Color(colorRecord.getRed(), colorRecord.getGreen(), colorRecord.getBlue());
}
private static Color extractSecondaryAWTColor(@NonNull final I_AD_Color colorRecord)
{
return new Color(colorRecord.getRed(), colorRecord... | return ColorId.ofRepoId(newColorRecord.getAD_Color_ID());
}
@Override
public ColorId getColorIdByName(final String colorName)
{
return colorIdByName.getOrLoad(colorName, () -> retrieveColorIdByName(colorName));
}
private ColorId retrieveColorIdByName(final String colorName)
{
final int colorRepoId = Serv... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\util\impl\ColorRepository.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private int resolvePartitionIndexForEntity(UUID entityId) {
return partitionService.resolvePartitionIndex(entityId, snmpTransportsCount);
}
private void recalculatePartitions(List<ServiceInfo> otherServices, ServiceInfo currentService) {
log.info("Recalculating partitions for SNMP transports");... | currentTransportPartitionIndex = i;
break;
}
}
snmpTransportsCount = snmpTransports.size();
}
if (snmpTransportsCount != previousSnmpTransportsCount || currentTransportPartitionIndex != previousCurrentTransportPartitionIndex) {
log... | repos\thingsboard-master\common\transport\snmp\src\main\java\org\thingsboard\server\transport\snmp\service\SnmpTransportBalancingService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private static Map<String, String> uriVariables(HttpServletRequest request) {
String baseUrl = getApplicationUri(request);
Map<String, String> uriVariables = new HashMap<>();
UriComponents uriComponents = UriComponentsBuilder.fromUriString(baseUrl)
.replaceQuery(null)
.fragment(null)
.build();
String s... | .replaceQuery(null)
.fragment(null)
.build();
return uriComponents.toUriString();
}
/**
* A class for resolving {@link RelyingPartyRegistration} URIs
*/
public static final class UriResolver {
private final Map<String, String> uriVariables;
private UriResolver(Map<String, String> uriVariables) {
... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\provider\service\web\RelyingPartyRegistrationPlaceholderResolvers.java | 2 |
请完成以下Java代码 | public String getCallbackType() {
return callbackType;
}
@Override
public void setCallbackType(String callbackType) {
this.callbackType = callbackType;
}
@Override
public String getReferenceId() {
return referenceId;
}
@Override
public void setReferenceId(S... | }
return variables;
}
@Override
public List<HistoricVariableInstanceEntity> getQueryVariables() {
if (queryVariables == null && Context.getCommandContext() != null) {
queryVariables = new HistoricVariableInitializingList();
}
return queryVariables;
}
@Ov... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\persistence\entity\HistoricProcessInstanceEntityImpl.java | 1 |
请完成以下Java代码 | private void setHyperlinkListener()
{
if (hyperlinkListenerClass == null)
{
return;
}
try
{
final HyperlinkListener listener = (HyperlinkListener)hyperlinkListenerClass.newInstance();
m_textPane.addHyperlinkListener(listener);
}
catch (Exception e)
{
log.warn("Cannot instantiate hyperlink ... | final String hyperlinkListenerClassname = "de.metas.adempiere.gui.ADHyperlinkHandler";
try
{
hyperlinkListenerClass = Thread.currentThread().getContextClassLoader().loadClass(hyperlinkListenerClassname);
}
catch (Exception e)
{
log.warn("Cannot instantiate hyperlink listener - " + hyperlinkListenerClass... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\swing\CTextPane.java | 1 |
请完成以下Java代码 | public int getM_Inventory_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Inventory_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Move Confirm.
@param M_MovementConfirm_ID
Inventory Move Confirmation
*/
public void setM_MovementConfirm_ID (int M_MovementConfirm_ID)
{
if ... | /** Set Processed.
@param Processed
The document has been processed
*/
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Processed.
@return The document has been processed
*/
public boolean isProcessed ()
{
Object oo = get_Val... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_MovementConfirm.java | 1 |
请完成以下Java代码 | public void setPassword(char[] password) {
this.password = password;
}
@Override
public Object getPrincipal() {
return this.getUsername();
}
@Override
public Object getCredentials() {
return this.getPassword();
}
@Override
public String getHost() {
... | }
@Override
public void setRememberMe(boolean rememberMe) {
this.rememberMe = rememberMe;
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
@Override
public void clea... | repos\springBoot-master\springboot-shiro2\src\main\java\cn\abel\rest\shiro\credentials\ThirdPartySupportedToken.java | 1 |
请完成以下Java代码 | public class ProgrammerAnnotated {
private String name;
private String favouriteLanguage;
@JsonMerge
private Keyboard keyboard;
public ProgrammerAnnotated(String name, String favouriteLanguage, Keyboard keyboard) {
this.name = name;
this.favouriteLanguage = favouriteLanguage;
... | this.name = name;
}
public String getFavouriteLanguage() {
return favouriteLanguage;
}
public Keyboard getKeyboard() {
return keyboard;
}
@Override
public String toString() {
return "Programmer{" + "name='" + name + '\'' + ", favouriteLanguage='" + favouriteLanguag... | repos\tutorials-master\jackson-modules\jackson-annotations\src\main\java\com\baeldung\jackson\jsonmerge\ProgrammerAnnotated.java | 1 |
请完成以下Java代码 | public <T> T readValue(String value, String typeIdentifier) {
try {
Class<?> cls = Class.forName(typeIdentifier);
return (T) readValue(value, cls);
}
catch (ClassNotFoundException e) {
JavaType javaType = constructJavaTypeFromCanonicalString(typeIdentifier);
return readValue(value, j... | throw LOG.unableToReadValue(value, e);
}
}
public JavaType constructJavaTypeFromCanonicalString(String canonicalString) {
try {
return TypeFactory.defaultInstance().constructFromCanonical(canonicalString);
}
catch (IllegalArgumentException e) {
throw LOG.unableToConstructJavaType(canoni... | repos\camunda-bpm-platform-master\clients\java\client\src\main\java\org\camunda\bpm\client\variable\impl\format\json\JacksonJsonDataFormat.java | 1 |
请完成以下Java代码 | public Store setSessionStoreProperties(String userName, String password, Properties properties) throws MessagingException {
Session session = Session.getDefaultInstance(properties);
Store store = session.getStore("pop3");
store.connect(userName, password);
return store;
}
publi... | DownloadEmailAttachments receiver = new DownloadEmailAttachments();
receiver.setSaveDirectory(saveDirectory);
try {
receiver.downloadEmailAttachments(host, port, userName, password);
} catch (NoSuchProviderException ex) {
System.out.println("No provider for pop3.");
... | repos\tutorials-master\core-java-modules\core-java-networking-3\src\main\java\com\baeldung\downloadattachments\DownloadEmailAttachments.java | 1 |
请完成以下Java代码 | public final class NullAllocationResult implements IAllocationResult
{
public static final NullAllocationResult instance = new NullAllocationResult();
private NullAllocationResult()
{
super();
}
@Override
public BigDecimal getQtyToAllocate()
{
return BigDecimal.ZERO;
}
@Override
public BigDecimal getQt... | public boolean isCompleted()
{
return true;
}
@Override
public List<IHUTransactionCandidate> getTransactions()
{
return Collections.emptyList();
}
@Override
public List<IHUTransactionAttribute> getAttributeTransactions()
{
return Collections.emptyList();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\NullAllocationResult.java | 1 |
请完成以下Java代码 | public class CalendarNonBusinessDays implements IBusinessDayMatcher
{
private final ImmutableList<NonBusinessDay> nonBusinessDays;
@Builder
private CalendarNonBusinessDays(
@NonNull @Singular final ImmutableList<NonBusinessDay> nonBusinessDays)
{
this.nonBusinessDays = nonBusinessDays;
}
@Override
public ... | }
@Override
public boolean isBusinessDay(@NonNull final LocalDate date)
{
return !isNonBusinessDay(date);
}
public boolean isNonBusinessDay(@NonNull final LocalDate date)
{
return nonBusinessDays
.stream()
.anyMatch(nonBusinessDay -> nonBusinessDay.isMatching(date));
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\calendar\CalendarNonBusinessDays.java | 1 |
请完成以下Java代码 | public void setConnection_timeout (final int Connection_timeout)
{
set_Value (COLUMNNAME_Connection_timeout, Connection_timeout);
}
@Override
public int getConnection_timeout()
{
return get_ValueAsInt(COLUMNNAME_Connection_timeout);
}
@Override
public void setPostgREST_ResultDirectory (final String Postg... | @Override
public int getRead_timeout()
{
return get_ValueAsInt(COLUMNNAME_Read_timeout);
}
@Override
public void setS_PostgREST_Config_ID (final int S_PostgREST_Config_ID)
{
if (S_PostgREST_Config_ID < 1)
set_ValueNoCheck (COLUMNNAME_S_PostgREST_Config_ID, null);
else
set_ValueNoCheck (COLUMNNAME_... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_S_PostgREST_Config.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static void logResult(String sWord) {
FileWriter writer = null;
try {
writer = new FileWriter(LOG_PATH + "alipay_log_" + System.currentTimeMillis()+".txt");
writer.write(sWord);
} catch (Exception e) {
e.printStackTrace();
} finally {
... | * @return 文件摘要结果
*/
public static String getAbstract(String strFilePath, String file_digest_type) throws IOException {
PartSource file = new FilePartSource(new File(strFilePath));
if(file_digest_type.equals("MD5")){
return DigestUtils.md5Hex(file.createInputStream());
}
else if(fil... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\utils\alipay\AlipayCore.java | 2 |
请完成以下Java代码 | public Iterator<I_C_Flatrate_Term> retrieveTermsWithMissingCandidates(@Nullable final QueryLimit limit_IGNORED)
{
return ImmutableList
.<I_C_Flatrate_Term> of()
.iterator();
}
@NonNull
@Override
public CandidatesAutoCreateMode isMissingInvoiceCandidate(@Nullable final I_C_Flatrate_Term flatrateTerm)
{
... | }
/**
* @return {@link PriceAndTax#NONE} because the tax remains unchanged and the price is updated in {@link CandidateAssignmentService}.
*/
@Override
public PriceAndTax calculatePriceAndTax(@NonNull final I_C_Invoice_Candidate invoiceCandidateRecord)
{
return PriceAndTax.NONE; // no changes to be made
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\refund\invoicecandidatehandler\FlatrateTermRefund_Handler.java | 1 |
请完成以下Java代码 | public void multiplyMatrices() throws Exception {
Matrix m1 = new DenseMatrix(new double[][]{
{1, 2, 3},
{4, 5, 6}
});
Matrix m2 = new DenseMatrix(new double[][]{
{1, 4},
{2, 5},
{3, 6}
});
Matrix m3 = m1.multiply(m2);... | {3, 4}
});
Inverse m2 = new Inverse(m1);
log.info("Inverting a matrix: {}", m2);
log.info("Verifying a matrix inverse: {}", m1.multiply(m2));
}
public Polynomial createPolynomial() {
return new Polynomial(new double[]{3, -5, 1});
}
public void evaluatePolynomia... | repos\tutorials-master\libraries-data-2\src\main\java\com\baeldung\suanshu\SuanShuMath.java | 1 |
请完成以下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 Comment/Help.
@param Help
Co... | {
return new KeyNamePair(get_ID(), getName());
}
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
}
/** Get Process Now.
@return Process Now */
public boolean isProcessing ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_DistributionList.java | 1 |
请完成以下Java代码 | protected JsonNode toJson(Object value) {
if (value != null) {
return JacksonUtil.valueToTree(value);
} else {
return null;
}
}
protected <T> T fromJson(JsonNode json, Class<T> type) {
return JacksonUtil.convertValue(json, type);
}
protected Stri... | } else {
return "";
}
}
protected <E> List<E> listFromString(String string, Function<String, E> mappingFunction) {
if (string != null) {
return Arrays.stream(StringUtils.split(string, ','))
.filter(StringUtils::isNotBlank)
.map(map... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\model\BaseSqlEntity.java | 1 |
请完成以下Java代码 | public class InstantMessage {
private String to;
private String from;
private String message;
private Calendar created = Calendar.getInstance();
public String getTo() {
return this.to;
}
public void setTo(String to) {
this.to = to;
}
public String getFrom() {
return this.from;
} | public void setFrom(String from) {
this.from = from;
}
public String getMessage() {
return this.message;
}
public void setMessage(String message) {
this.message = message;
}
public Calendar getCreated() {
return this.created;
}
public void setCreated(Calendar created) {
this.created = created;
}
... | repos\spring-session-main\spring-session-samples\spring-session-sample-boot-websocket\src\main\java\sample\data\InstantMessage.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SessionProperties {
/**
* Session timeout. If a duration suffix is not specified, seconds will be used.
*/
@DurationUnit(ChronoUnit.SECONDS)
private @Nullable Duration timeout;
private Servlet servlet = new Servlet();
public @Nullable Duration getTimeout() {
return this.timeout;
}
public v... | }
/**
* Servlet-related properties.
*/
public static class Servlet {
/**
* Session repository filter order.
*/
private int filterOrder = SessionRepositoryFilter.DEFAULT_ORDER;
/**
* Session repository filter dispatcher types.
*/
private Set<DispatcherType> filterDispatcherTypes = new HashSe... | repos\spring-boot-4.0.1\module\spring-boot-session\src\main\java\org\springframework\boot\session\autoconfigure\SessionProperties.java | 2 |
请完成以下Java代码 | static FileLock getReadLockFromInputStream(long from, long size) throws IOException {
Path path = Files.createTempFile("foo", "txt");
try (FileInputStream fis = new FileInputStream(path.toFile());
FileLock lock = fis.getChannel()
.lock(from, size, true)) {
if (loc... | */
static FileLock getReadLockFromRandomAccessFile(long from, long size) throws IOException {
Path path = Files.createTempFile("foo", "txt");
try (RandomAccessFile file = new RandomAccessFile(path.toFile(), "r"); // could also be "rw", but "r" is sufficient for reading
FileLock lock = fi... | repos\tutorials-master\core-java-modules\core-java-nio\src\main\java\com\baeldung\lock\FileLocks.java | 1 |
请完成以下Java代码 | public void setContextAttributesMapper(
Function<OAuth2AuthorizeRequest, Mono<Map<String, Object>>> contextAttributesMapper) {
Assert.notNull(contextAttributesMapper, "contextAttributesMapper cannot be null");
this.contextAttributesMapper = contextAttributesMapper;
}
/**
* Sets the handler that handles succ... | * </p>
* @param authorizationFailureHandler the handler that handles authorization failures.
* @since 5.3
* @see RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
*/
public void setAuthorizationFailureHandler(ReactiveOAuth2AuthorizationFailureHandler authorizationFailureHandler) {
Assert.notNul... | repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.