instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | protected boolean doValidate(Object submittedValue, FormFieldValidatorContext validatorContext) {
FormFieldValidator validator;
if(clazz != null) {
// resolve validator using Fully Qualified Classname
Object validatorObject = ReflectUtil.instantiate(clazz);
if(validatorObject instanceof FormF... | FormFieldValidatorInvocation invocation = new FormFieldValidatorInvocation(validator, submittedValue, validatorContext);
try {
Context
.getProcessEngineConfiguration()
.getDelegateInterceptor()
.handleInvocation(invocation);
} catch (RuntimeException e) {
throw e;
} catch... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\form\validator\DelegateFormFieldValidator.java | 1 |
请完成以下Java代码 | public CharsetEncoder newEncoder() {
CharsetEncoder cd = new CharsetEncoder(this, 1.0f, 1.0f) {
@Override
protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out) {
while (in.hasRemaining()) {
if (!out.hasRemaining()) {
... | }
};
return cd;
}
};
public String createModifiableString(String s) {
return new String(s.getBytes(), myCharset);
}
public void modifyString() {
CharBuffer cb = cbRef.get();
cb.position(0);
cb.put("xyz");
}
} | repos\tutorials-master\core-java-modules\core-java-string-operations-7\src\main\java\com\baeldung\mutablestrings\MutableStringUsingCharset.java | 1 |
请完成以下Java代码 | public PartyIdentificationSEPA1 getUltmtDbtr() {
return ultmtDbtr;
}
/**
* Sets the value of the ultmtDbtr property.
*
* @param value
* allowed object is
* {@link PartyIdentificationSEPA1 }
*
*/
public void setUltmtDbtr(PartyIdentificationSEPA1 value... | this.purp = value;
}
/**
* Gets the value of the rmtInf property.
*
* @return
* possible object is
* {@link RemittanceInformationSEPA1Choice }
*
*/
public RemittanceInformationSEPA1Choice getRmtInf() {
return rmtInf;
}
/**
* Sets the va... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_008_003_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_008_003_02\DirectDebitTransactionInformationSDD.java | 1 |
请完成以下Java代码 | private static List<String> parseSQLScript(String scriptFilePath) throws IOException {
List<String> sqlStatements = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new FileReader(scriptFilePath))) {
StringBuilder currentStatement = new StringBuilder();
String ... | return sqlStatements;
}
private static void executeSQLBatches(Connection connection, List<String> sqlStatements, int batchSize)
throws SQLException {
int count = 0;
Statement statement = connection.createStatement();
for (String sql : sqlStatements) {
statement.... | repos\tutorials-master\persistence-modules\core-java-persistence-2\src\main\java\com\baeldung\script\SqlScriptBatchExecutor.java | 1 |
请完成以下Java代码 | public static String normalizeDateValue(@Nullable final LocalDate valueDate)
{
return valueDate != null ? valueDate.toString() : "";
}
public static AttributesKeyPart ofAttributeIdAndValue(@NonNull final AttributeId attributeId, @NonNull final String value)
{
final String stringRepresentation = attributeId.get... | }
return stringRepresentation.compareTo(other.stringRepresentation);
}
private Integer getAttributeValueIdOrSpecialCodeOrNull()
{
if (type == AttributeKeyPartType.AttributeValueId)
{
return attributeValueId.getRepoId();
}
else if (type == AttributeKeyPartType.All
|| type == AttributeKeyPartType.Ot... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\commons\AttributesKeyPart.java | 1 |
请完成以下Java代码 | private String convert (long number)
{
/* special case */
if (number == 0)
{
return "zero";
}
String prefix = "";
if (number < 0)
{
number = -number;
prefix = "minus ";
}
String soFar = "";
int place = 0;
do
{
long n = number % 1000;
if (n != 0)
{
String s = convertLessTha... | break;
}
}
return sb.toString();
} // getAmtInWords
/**
* Test Print
*
* @param amt
* amount
*/
private void print(String amt) {
try {
System.out.println(amt + " = " + getAmtInWords(amt));
} catch (Exception e) {
e.printStackTrace();
}
} // print
/**
* Test
*
* @pa... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\util\AmtInWords_PL.java | 1 |
请完成以下Java代码 | class ClickHouseJdbcDockerComposeConnectionDetailsFactory
extends DockerComposeConnectionDetailsFactory<JdbcConnectionDetails> {
protected ClickHouseJdbcDockerComposeConnectionDetailsFactory() {
super("clickhouse/clickhouse-server");
}
@Override
protected JdbcConnectionDetails getDockerComposeConnectionDetail... | public String getUsername() {
return this.environment.getUsername();
}
@Override
public String getPassword() {
return this.environment.getPassword();
}
@Override
public String getJdbcUrl() {
return this.jdbcUrl;
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-jdbc\src\main\java\org\springframework\boot\jdbc\docker\compose\ClickHouseJdbcDockerComposeConnectionDetailsFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ResourceTypeId implements RepoIdAware
{
@JsonCreator
public static ResourceTypeId ofRepoId(final int repoId)
{
return new ResourceTypeId(repoId);
}
@Nullable
public static ResourceTypeId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? new ResourceTypeId(repoId) : null;
}
public static... | }
int repoId;
private ResourceTypeId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "S_ResourceType_ID");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\resource\ResourceTypeId.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public ReturnT<Map<String, Object>> chartInfo(Date startDate, Date endDate) {
// process
List<String> triggerDayList = new ArrayList<String>();
List<Integer> triggerDayCountRunningList = new ArrayList<Integer>();
List<Integer> triggerDayCountSucList = new ArrayList<Integer>();
List<Integer> triggerDayCountFa... | } else {
for (int i = -6; i <= 0; i++) {
triggerDayList.add(DateUtil.formatDate(DateUtil.addDays(new Date(), i)));
triggerDayCountRunningList.add(0);
triggerDayCountSucList.add(0);
triggerDayCountFailList.add(0);
}
}
Map<String, Object> result = new HashMap<String, Object>();
result.put("tr... | repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-xxljob\src\main\java\com\xxl\job\admin\service\impl\XxlJobServiceImpl.java | 2 |
请完成以下Java代码 | private static final class TemporaryFileSystemResource extends FileSystemResource {
private final Log logger = LogFactory.getLog(getClass());
private TemporaryFileSystemResource(File file) {
super(file);
}
@Override
public ReadableByteChannel readableChannel() throws IOException {
ReadableByteChannel... | }
finally {
deleteFile();
}
}
private void deleteFile() {
try {
Files.delete(getFile().toPath());
}
catch (IOException ex) {
TemporaryFileSystemResource.this.logger
.warn("Failed to delete temporary heap dump file '" + getFile() + "'", ex);
}
}
@Override
public boolean isF... | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\management\HeapDumpWebEndpoint.java | 1 |
请完成以下Java代码 | public void setValues(PreparedStatement ps, int i) throws SQLException {
CalculatedFieldDebugEvent event = (CalculatedFieldDebugEvent) events.get(i);
setCommonEventFields(ps, event);
safePutUUID(ps, 6, event.getCalculatedFieldId().getId());
safePutUUID(ps,... | private void setCommonEventFields(PreparedStatement ps, Event event) throws SQLException {
ps.setObject(1, event.getId().getId());
ps.setObject(2, event.getTenantId().getId());
ps.setLong(3, event.getCreatedTime());
ps.setObject(4, event.getEntityId());
ps.setString(5, event.getS... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\event\EventInsertRepository.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DummyJobProcessor implements JobProcessor {
@Override
public int process(Job job, Consumer<Task<?>> taskConsumer) throws Exception {
DummyJobConfiguration configuration = job.getConfiguration();
if (configuration.getGeneralError() != null) {
for (int number = 1; number ... | return DummyTask.builder()
.tenantId(job.getTenantId())
.jobId(job.getId())
.key(configuration.getTasksKey())
.retries(configuration.getRetries())
.number(number)
.processingTimeMs(configuration.getTaskProcessingTimeMs())
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\job\DummyJobProcessor.java | 2 |
请完成以下Java代码 | public java.lang.String getUserElementString5()
{
return get_ValueAsString(COLUMNNAME_UserElementString5);
}
@Override
public void setUserElementString6 (final @Nullable java.lang.String UserElementString6)
{
set_Value (COLUMNNAME_UserElementString6, UserElementString6);
}
@Override
public java.lang.Stri... | @Override
public void setC_Flatrate_Term_ID (final int C_Flatrate_Term_ID)
{
if (C_Flatrate_Term_ID < 1)
set_Value (COLUMNNAME_C_Flatrate_Term_ID, null);
else
set_Value (COLUMNNAME_C_Flatrate_Term_ID, C_Flatrate_Term_ID);
}
@Override
public int getC_Flatrate_Term_ID()
{
return get_ValueAsInt(COLUMNNA... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_InvoiceLine.java | 1 |
请完成以下Java代码 | final class LookupDataSourceAdapter implements LookupDataSource
{
public static LookupDataSourceAdapter of(final LookupDataSourceFetcher fetcher)
{
return new LookupDataSourceAdapter(fetcher);
}
private final LookupDataSourceFetcher fetcher;
private LookupDataSourceAdapter(@NonNull final LookupDataSourceFetche... | .putFilterById(IdsToFilter.ofSingleValue(idNormalized))
.putShowInactive(true)
.build();
//
// Get the lookup value
final LookupValue lookupValue = fetcher.retrieveLookupValueById(evalCtx);
if (lookupValue == LookupDataSourceFetcher.LOOKUPVALUE_NULL)
{
return null;
}
return lookupValue;
}
@... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\lookup\LookupDataSourceAdapter.java | 1 |
请完成以下Java代码 | public void execute(DelegateExecution execution) {
ActivityExecution activityExecution = (ActivityExecution) execution;
InterpretableExecution interpretableExecution = (InterpretableExecution) execution;
ActivityImpl activity = interpretableExecution.getProcessDefinition().findActivity(activityI... | ((InterpretableExecution) outgoingExecution).setActivity(activity);
// continue execution
outgoingExecution.takeAll(activity.getOutgoingTransitions(), Collections.EMPTY_LIST);
}
public void setInterrupting(boolean b) {
isInterrupting = b;
}
public boolean isInterrupting() {
... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\bpmn\behavior\EventSubProcessStartEventActivityBehavior.java | 1 |
请完成以下Java代码 | public String getSeqNb() {
return seqNb;
}
/**
* Sets the value of the seqNb property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSeqNb(String value) {
this.seqNb = value;
}
/**
* Gets the value o... | * {@link Product2 }
*
*/
public void setPdct(Product2 value) {
this.pdct = value;
}
/**
* Gets the value of the vldtnDt property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\CardIndividualTransaction1.java | 1 |
请完成以下Java代码 | public String amounts (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{
// Needs to be Invoice
if (isCalloutActive() || !"I".equals(mTab.getValue("CashType")))
return "";
// Check, if InvTotalAmt exists
String total = Env.getContext(ctx, WindowNo, "InvTotalAmt");
if (total =... | // Amount - calculate write off
if (colName.equals("Amount"))
{
WriteOffAmt = InvTotalAmt.subtract(PayAmt).subtract(DiscountAmt);
mTab.setValue("WriteOffAmt", WriteOffAmt);
}
else // calculate PayAmt
{
PayAmt = InvTotalAmt.subtract(DiscountAmt).subtract(WriteOffAmt);
mTab.setValue("Amount", P... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\CalloutCashJournal.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private RestTemplate restTemplate()
{
return new RestTemplateBuilder()
.errorHandler(new ShopwareApiErrorHandler())
.setConnectTimeout(Duration.of(CONNECTION_TIMEOUT_SECONDS, SECONDS))
.setReadTimeout(Duration.of(READ_TIMEOUT_SECONDS, SECONDS))
.build();
}
@NonNull
private static Optional<JsonNod... | .clientId(clientId)
.clientSecret(clientSecret)
.build();
}
public void updateBearer(@NonNull final String bearer, @NonNull final Instant validUntil)
{
this.bearer = bearer;
this.validUntil = validUntil;
}
public boolean isExpired()
{
return bearer == null || Instant.now().isAfter(valid... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-shopware6\src\main\java\de\metas\camel\externalsystems\shopware6\api\ShopwareClient.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Optional<ExternalStatus> getStatusByCommandOptional(@NonNull final String command)
{
if (Check.isNotBlank(enableCommand) && enableCommand.equals(command))
{
return Optional.of(ExternalStatus.ACTIVE);
}
if (Check.isNotBlank(disableCommand) && disableCommand.equals(command))
{
return Optional.of(... | public ExternalStatus getStatusByCommand(@NonNull final String command)
{
return getStatusByCommandOptional(command)
.orElseThrow(() -> new AdempiereException("Unknown command!")
.appendParametersToMessage()
.setParameter("EnableCommand", getEnableCommand())
.setParameter("DisableCommand", getD... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\externalservice\model\ExternalSystemServiceModel.java | 2 |
请完成以下Java代码 | public static Object parseValueObjectByColumnDisplayType(@Nullable final Object valueObj, final int displayType, @NonNull final String columnName)
{
if (valueObj == null)
{
return null;
}
try
{
// Return Integer
if (displayType == DisplayType.Integer || DisplayType.isID(displayType) && columnName.en... | return new Timestamp(time);
}
// Return Y/N for Boolean
else if (valueObj instanceof Boolean)
{
return DisplayType.toBooleanString((Boolean)valueObj);
}
}
catch (final Exception ex)
{
String error = ex.getLocalizedMessage();
if (error == null || error.isEmpty())
{
error = ex.toStri... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\apps\search\UserQueryFieldHelper.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DataImportConfigRepository
{
private final CCache<Integer, DataImportConfigsCollection> cache = CCache.<Integer, DataImportConfigRepository.DataImportConfigsCollection> builder()
.tableName(I_C_DataImport.Table_Name)
.build();
public DataImportConfig getById(@NonNull final DataImportConfigId id)
... | .id(DataImportConfigId.ofRepoId(record.getC_DataImport_ID()))
.internalName(StringUtils.trimBlankToNull(record.getInternalName()))
.impFormatId(ImpFormatId.ofRepoId(record.getAD_ImpFormat_ID()))
.build();
}
private static class DataImportConfigsCollection
{
private final ImmutableMap<DataImportConfigI... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\config\DataImportConfigRepository.java | 2 |
请完成以下Java代码 | public String getMndtId() {
return mndtId;
}
/**
* Sets the value of the mndtId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMndtId(String value) {
this.mndtId = value;
}
/**
* Gets the va... | * Gets the value of the amdmntInfDtls property.
*
* @return
* possible object is
* {@link AmendmentInformationDetailsSDD }
*
*/
public AmendmentInformationDetailsSDD getAmdmntInfDtls() {
return amdmntInfDtls;
}
/**
* Sets the value of the amdmntInfDt... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_008_003_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_008_003_02\MandateRelatedInformationSDD.java | 1 |
请完成以下Java代码 | public Builder setWarningsConsumer(final IProcessor<Exception> warningsConsumer)
{
this.warningsConsumer = warningsConsumer;
return this;
}
public Builder setDocumentIdsToIncludeWhenQuering(final Multimap<AllocableDocType, Integer> documentIds)
{
this.documentIds = documentIds;
return this;
}
... | return this;
}
public Builder setFilter_POReference(String filterPOReference)
{
this.filterPOReference = filterPOReference;
return this;
}
public Builder allowPurchaseSalesInvoiceCompensation(final boolean allowPurchaseSalesInvoiceCompensation)
{
this.allowPurchaseSalesInvoiceCompensation = allow... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.swingui\src\main\java\de\metas\banking\payment\paymentallocation\model\PaymentAllocationContext.java | 1 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
public Date getGmtModified() {
return gmtM... | this.exceptionQps = exceptionQps;
}
public double getRt() {
return rt;
}
public void setRt(double rt) {
this.rt = rt;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int getResourceCode(... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\datasource\entity\MetricEntity.java | 1 |
请完成以下Java代码 | /* package */public boolean isRunPrepareOutOfTransaction()
{
return runPrepareOutOfTransaction;
}
/**
* @return <code>true</code> if we shall run {@link JavaProcess#doIt()} method out of transaction
*/
/* package */boolean isRunDoItOutOfTransaction()
{
return runDoItOutOfTransaction;
}
/**
* @return ... | * @see Process annotation
*/
public boolean isExistingCurrentRecordRequiredWhenCalledFromGear()
{
return existingCurrentRecordRequiredWhenCalledFromGear;
}
public boolean isAllowedForCurrentProfiles()
{
// No profiles restriction => allowed
if (onlyForProfiles == null || onlyForProfiles.length == 0)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\process\ProcessClassInfo.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Quote implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotNull
@Column(name = "symbol", nullable = false)
private String symbol;
@NotNull
@Column(name = "price", preci... | @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Quote quote = (Quote) o;
if (quote.getId() == null || getId() == null) {
return false;
... | repos\tutorials-master\jhipster-modules\jhipster-uaa\quotes\src\main\java\com\baeldung\jhipster\quotes\domain\Quote.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Optional<OrderLineId> getOrderLineId(final MatchInv matchInv)
{
final I_C_InvoiceLine invoiceLine = invoiceBL.getLineById(matchInv.getInvoiceAndLineId());
OrderLineId orderLineId = OrderLineId.ofRepoIdOrNull(invoiceLine.getC_OrderLine_ID());
if (orderLineId == null)
{
final InOutLineId inoutLineId = ... | .reduce(Money::add);
}
public Optional<Money> getCostAmountMatched(final InvoiceAndLineId invoiceAndLineId)
{
final List<MatchInv> matchInvs = matchInvoiceRepository.list(MatchInvQuery.builder()
.type(MatchInvType.Cost)
.invoiceAndLineId(invoiceAndLineId)
.build());
return matchInvs.stream()
.m... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\matchinv\service\MatchInvoiceService.java | 2 |
请完成以下Java代码 | protected boolean createEntityIfNotExists() {
return false;
}
@Override
public void onMsg(TbContext ctx, TbMsg msg) {
ListenableFuture<Boolean> deleteResultFuture = config.isDeleteForSingleEntity() ?
Futures.transformAsync(getTargetEntityId(ctx, msg), targetEntityId ->
... | toId = msg.getOriginator();
fromId = targetEntityId;
}
var relationType = processPattern(msg, config.getRelationType());
var tenantId = ctx.getTenantId();
var relationService = ctx.getRelationService();
return Futures.transformAsync(relationService.checkRelationAsync(... | repos\thingsboard-master\rule-engine\rule-engine-components\src\main\java\org\thingsboard\rule\engine\action\TbDeleteRelationNode.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isGlobalAcquireLockEnabled() {
return configuration.isGlobalAcquireLockEnabled();
}
@Override
public String getGlobalAcquireLockPrefix() {
return configuration.getGlobalAcquireLockPrefix();
}
@Override
public Duration getLockWaitTi... | return configuration.getGlobalAcquireLockPrefix();
}
@Override
public Duration getLockWaitTime() {
return configuration.getAsyncJobsGlobalLockWaitTime();
}
@Override
public Duration getLockPollRate() {
return configuration.getAsyncJobsGlobalLockP... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\asyncexecutor\AbstractAsyncExecutor.java | 2 |
请完成以下Java代码 | public void setM_Product_ID (final int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
else
set_Value (COLUMNNAME_M_Product_ID, M_Product_ID);
}
@Override
public int getM_Product_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Product_ID);
}
@Override
public void setN... | {
return get_ValueAsString(COLUMNNAME_Name);
}
@Override
public void setValue (final String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
@Override
public String getValue()
{
return get_ValueAsString(COLUMNNAME_Value);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Cost_Type.java | 1 |
请完成以下Java代码 | public void process(IT item) throws Exception
{
processor.accept(item);
}
});
return this;
}
/**
* Sets exception handler to be used if processing fails.
*
* @see ITrxItemProcessorExecutor#setExceptionHandler(ITrxItemExceptionHandler)
* @see ITrxItemProcessorExecutor#DEFAULT_ExceptionHandler
... | /**
* Sets if the executor shall use transaction savepoints on individual chunks internally.
* This setting is only relevant, if the executor's parent-trx is null (see {@link #setContext(Properties, String)}).
* <p>
* If <code>true</code> and the executor has an external not-null transaction,
* then the execu... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\processor\api\ITrxItemExecutorBuilder.java | 1 |
请完成以下Java代码 | public void init(FilterConfig filterConfig) {
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
String baseUrl;
String configBaseUrl = ConfigConstants.getBaseUrl();
final HttpServletR... | if (!baseUrl.endsWith("/")) {
baseUrl = baseUrl.concat("/");
}
BASE_URL = baseUrl;
request.setAttribute("baseUrl", baseUrl);
filterChain.doFilter(request, response);
}
@Override
public void destroy() {
}
} | repos\kkFileView-master\server\src\main\java\cn\keking\web\filter\BaseUrlFilter.java | 1 |
请完成以下Java代码 | public void sendRedirect(String location) throws IOException {
appendSameSiteIfMissing();
super.sendRedirect(location);
}
@Override
public PrintWriter getWriter() throws IOException {
appendSameSiteIfMissing();
return super.getWriter();
}
@Override
public ServletOutputS... | boolean firstHeader = true;
String cookieHeaderStart = cookieConfigurator.getCookieName("JSESSIONID") + "=";
for (String cookieHeader : cookieHeaders) {
if (cookieHeader.startsWith(cookieHeaderStart)) {
cookieHeader = cookieConfigurator.getConfig(cookieHeader);
}
if (first... | repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\webapp\impl\security\filter\SessionCookieFilter.java | 1 |
请完成以下Java代码 | public boolean isIndexRedirectEnabled() {
return indexRedirectEnabled;
}
public void setIndexRedirectEnabled(boolean indexRedirectEnabled) {
this.indexRedirectEnabled = indexRedirectEnabled;
}
public String getWebjarClasspath() {
return webjarClasspath;
}
public void setWebjarClasspath(String... | return headerSecurity;
}
public void setHeaderSecurity(HeaderSecurityProperties headerSecurity) {
this.headerSecurity = headerSecurity;
}
public AuthenticationProperties getAuth() {
return auth;
}
public void setAuth(AuthenticationProperties authentication) {
this.auth = authentication;
}
... | repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\property\WebappProperty.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected S2JJAXBModel compileModel(Types types, SchemaCompiler compiler, Element rootTypes) {
Schema schema = (Schema) types.getExtensibilityElements().get(0);
compiler.parseSchema(schema.getDocumentBaseURI() + "#types1", rootTypes);
S2JJAXBModel intermediateModel = compiler.bind();
ret... | @Override
public Map<String, StructureDefinition> getStructures() {
return this.structures;
}
@Override
public Map<String, WSService> getServices() {
return this.wsServices;
}
@Override
public Map<String, WSOperation> getOperations() {
return this.wsOperations;
... | repos\flowable-engine-main\modules\flowable-cxf\src\main\java\org\flowable\engine\impl\webservice\WSDLImporter.java | 2 |
请完成以下Java代码 | public void negateAllLineAmounts()
{
for (final IInvoiceCandAggregate lineAgg : getLines())
{
lineAgg.negateLineAmounts();
}
}
/**
* Calculates total net amount by summing up all {@link IInvoiceLineRW#getNetLineAmt()}s.
*
* @return total net amount
*/
public Money calculateTotalNetAmtFromLines()
... | {
this.C_Async_Batch_ID = C_Async_Batch_ID;
}
public String setExternalId(String externalId)
{
return this.externalId = externalId;
}
@Override
public int getC_Incoterms_ID()
{
return C_Incoterms_ID;
}
public void setC_Incoterms_ID(final int C_Incoterms_ID)
{
this.C_Incoterms_ID = C_Incoterms_ID;
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\InvoiceHeaderImpl.java | 1 |
请完成以下Java代码 | protected void addBatchOperationsWithoutTTL(Map<String, Integer> batchOperations) {
Map<String, BatchJobHandler<?>> batchJobHandlers = Context.getProcessEngineConfiguration().getBatchHandlers();
Set<String> batchOperationKeys = null;
if (batchJobHandlers != null) {
batchOperationKeys = batchJobHandle... | }
private void checkPermissions(CommandContext commandContext) {
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadHistoricBatch();
}
}
protected void provideHistoryCleanupStrategy(CommandContext commandContext) {
String histo... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\CleanableHistoricBatchReportImpl.java | 1 |
请完成以下Java代码 | public static List<String> to863(List<Term> termList)
{
List<String> posTagList = new ArrayList<String>(termList.size());
for (Term term : termList)
{
String posTag = posConverter.get(term.nature.toString());
if (posTag == null)
posTag = term.nature.to... | {
int correct = 0, total = 0;
IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(corpus);
for (String line : lineIterator)
{
Sentence sentence = Sentence.create(line);
if (sentence == null) continue;
String[][] wordTagArray = sentence.toWordTag... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dependency\nnparser\util\PosTagUtil.java | 1 |
请完成以下Java代码 | public void add(String param)
{
Item item = Item.create(param);
if (item != null) add(item);
}
public static interface Filter
{
/**
* 是否保存这个条目
* @param item
* @return true表示保存
*/
boolean onSave(Item item);
}
/**
* 允许保存之前对... | return true;
}
/**
* 调整频次,按排序后的次序给定频次
*
* @param itemList
* @return 处理后的列表
*/
public static List<Item> normalizeFrequency(List<Item> itemList)
{
for (Item item : itemList)
{
ArrayList<Map.Entry<String, Integer>> entryArray = new ArrayList<Map.Entry<S... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\dictionary\DictionaryMaker.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserCredentialsDataValidator extends DataValidator<UserCredentials> {
@Autowired
private UserCredentialsDao userCredentialsDao;
@Autowired
@Lazy
private UserService userService;
@Override
protected void validateCreate(TenantId tenantId, UserCredentials userCredentials) {
... | }
if (StringUtils.isNotEmpty(userCredentials.getActivateToken())) {
throw new DataValidationException("Enabled user credentials can't have activate token!");
}
}
UserCredentials existingUserCredentialsEntity = userCredentialsDao.findById(tenantId, userCredentials.... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\service\validator\UserCredentialsDataValidator.java | 2 |
请完成以下Java代码 | public int hashCode()
{
return id.hashCode();
}
@Override
public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
final PaymentBatch other = EqualsBuilder.getOther(this, obj);
if (other == null)
{
return false;
}
return new EqualsBuilder()
.append(id, other.id)
... | private String getName()
{
if (name != null)
{
return name;
}
if (record != null)
{
return Services.get(IMsgBL.class).translate(Env.getCtx(), record.getTableName()) + " #" + record.getRecord_ID();
}
return "";
}
public Builder setDate(final Date date)
{
this.date = date;
re... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\bankstatement\match\spi\PaymentBatch.java | 1 |
请完成以下Java代码 | public class InterruptExample extends Thread {
public static void propagateException() throws InterruptedException {
Thread.sleep(1000);
Thread.currentThread().interrupt();
if (Thread.interrupted()) {
throw new InterruptedException();
}
}
public static Boole... | Thread.sleep(1000);
Thread.currentThread().interrupt();
if (Thread.interrupted()) {
throw new CustomInterruptedException("This thread was interrupted");
}
}
public static Boolean handleWithCustomException() throws CustomInterruptedException{
try {
Thr... | repos\tutorials-master\core-java-modules\core-java-concurrency-basic\src\main\java\com\baeldung\concurrent\interrupt\InterruptExample.java | 1 |
请完成以下Java代码 | public abstract class AbstractTsKvEntity implements ToData<TsKvEntry> {
protected static final String SUM = "SUM";
protected static final String AVG = "AVG";
protected static final String MIN = "MIN";
protected static final String MAX = "MAX";
@Id
@Column(name = ENTITY_ID_COLUMN, columnDefinit... | }
public abstract boolean isNotEmpty();
protected static boolean isAllNull(Object... args) {
for (Object arg : args) {
if (arg != null) {
return false;
}
}
return true;
}
@Override
public TsKvEntry toData() {
KvEntry kvEntry ... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\model\sql\AbstractTsKvEntity.java | 1 |
请完成以下Java代码 | public InventoryLineHU updatingFrom(@NonNull final InventoryLineCountRequest request)
{
return toBuilder().updatingFrom(request).build();
}
public static InventoryLineHU of(@NonNull final InventoryLineCountRequest request)
{
return builder().updatingFrom(request).build();
}
//
//
//
// -----------------... | {
InventoryLineHUBuilder updatingFrom(@NonNull final InventoryLineCountRequest request)
{
return huId(request.getHuId())
.huQRCode(HuId.equals(this.huId, request.getHuId()) ? this.huQRCode : null)
.qtyInternalUse(null)
.qtyBook(request.getQtyBook())
.qtyCount(request.getQtyCount())
.isCo... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inventory\InventoryLineHU.java | 1 |
请完成以下Java代码 | public String getIncidentMessage() {
return incidentMessage;
}
public String getTenantId() {
return tenantId;
}
public String getJobDefinitionId() {
return jobDefinitionId;
}
public Boolean isOpen() {
return open;
}
public Boolean isDeleted() {
return deleted;
}
public Boole... | dto.processDefinitionKey = historicIncident.getProcessDefinitionKey();
dto.processDefinitionId = historicIncident.getProcessDefinitionId();
dto.processInstanceId = historicIncident.getProcessInstanceId();
dto.executionId = historicIncident.getExecutionId();
dto.createTime = historicIncident.getCreateTim... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\HistoricIncidentDto.java | 1 |
请完成以下Java代码 | private boolean matches(final PgPassEntry entry, final PgPassEntry entryLookup)
{
return matchesToken(entry.getHost(), entryLookup.getHost())
&& matchesToken(entry.getPort(), entryLookup.getPort())
&& matchesToken(entry.getDbName(), entryLookup.getDbName())
&& matchesToken(entry.getUser(), entryLookup.ge... | if (token == tokenLookup)
{
return true;
}
if (ANY.equals(token))
{
return true;
}
if (token.equals(tokenLookup))
{
return true;
}
return false;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.base\src\main\java\de\metas\migration\sql\postgresql\PgPassFile.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setBaseAmount(BigDecimal value) {
this.baseAmount = value;
}
/**
* The percentage of the reduction/surcharge.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getPercentage() {
return percentage;
}... | *
* @param value
* allowed object is
* {@link String }
*
*/
public void setComment(String value) {
this.comment = value;
}
/**
* The type of surcharge or reduction. May be used to aggregate surcharges and reductions into different categories.Gets the valu... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ReductionAndSurchargeBaseType.java | 2 |
请完成以下Java代码 | public void addReceiptScheduleListener(final IReceiptScheduleListener listener)
{
Check.assumeNotNull(listener, "listener not null");
listeners.addIfAbsent(listener);
}
@Override
public void onReceiptScheduleAllocReversed(final I_M_ReceiptSchedule_Alloc rsa, final I_M_ReceiptSchedule_Alloc rsaReversal)
{
fo... | @Override
public void onBeforeReopen(I_M_ReceiptSchedule receiptSchedule)
{
for (final IReceiptScheduleListener listener : listeners)
{
listener.onBeforeReopen(receiptSchedule);
}
}
@Override
public void onAfterReopen(I_M_ReceiptSchedule receiptSchedule)
{
for (final IReceiptScheduleListener listener ... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\spi\impl\CompositeReceiptScheduleListener.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public UnitType getGrossVolume() {
return grossVolume;
}
/**
* Sets the value of the grossVolume property.
*
* @param value
* allowed object is
* {@link UnitType }
*
*/
public void setGrossVolume(UnitType value) {
this.grossVolume = value;
... | return grossWeight;
}
/**
* Sets the value of the grossWeight property.
*
* @param value
* allowed object is
* {@link UnitType }
*
*/
public void setGrossWeight(UnitType value) {
this.grossWeight = value;
}
} | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\extensions\edifact\PackagingInformationType.java | 2 |
请完成以下Java代码 | private void appendMissingParam(
final StringBuilder sql,
final int missingParamIndexZeroBased)
{
final int missingParamIndexOneBased = missingParamIndexZeroBased + 1;
if (failOnError)
{
throw new AdempiereException("Missing SQL parameter with index=" + missingParamIndexOneBased);
}
sql.append("?m... | sql.append(" -- Exceeding params: ");
boolean firstExceedingParam = true;
for (int i = firstExceedingParamIndex; i < paramsCount; i++)
{
if (firstExceedingParam)
{
firstExceedingParam = false;
}
else
{
sql.append(", ");
}
sql.append(DB.TO_SQL(allParams.get(i)));
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\dao\sql\SqlParamsInliner.java | 1 |
请完成以下Java代码 | public boolean isExistingLU()
{
return luId != null;
}
public boolean isNewLU()
{
return luId == null && luPIId != null;
}
public HuPackingInstructionsId getLuPIIdNotNull()
{
return Check.assumeNotNull(luPIId, "LU PI shall be set for {}", this);
}
public HuId getLuIdNotNull()
{
return Check.assumeN... | {
if (isNewLU())
{
consumer.newLU(getLuPIIdNotNull());
}
else if (isExistingLU())
{
consumer.existingLU(getLuIdNotNull(), getLuQRCode());
}
else
{
throw new AdempiereException("Unsupported target type: " + this);
}
}
public boolean isPrintable() {return isExistingLU();}
public void asser... | repos\metasfresh-new_dawn_uat\backend\de.metas.hu_consolidation.mobile\src\main\java\de\metas\hu_consolidation\mobile\job\HUConsolidationTarget.java | 1 |
请完成以下Java代码 | static Builder<?> builder(WebClient webClient) {
return builder(webClient.mutate());
}
/**
* Variant of {@link #builder()} with a pre-configured {@code WebClient}
* to mutate and customize further through the returned builder.
* @param webClientBuilder the {@code WebClient.Builder} to use for building the HT... | /**
* Customize the {@code WebClient} to use.
* <p>Note that some properties of {@code WebClient.Builder} like the
* base URL, headers, and codecs can be customized through this builder.
* @param webClient the function for customizing the {@code WebClient.Builder} that's used to build the HTTP client
* @... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\client\HttpGraphQlClient.java | 1 |
请完成以下Java代码 | default Mono<ClientGraphQlResponse> intercept(ClientGraphQlRequest request, Chain chain) {
return chain.next(request);
}
/**
* Intercept a subscription request and delegate to the rest of the chain
* including other interceptors followed by the {@link GraphQlTransport}.
* @param request the request to perfor... | * Contract to delegate to the rest of a non-blocking execution chain.
*/
interface Chain {
/**
* Delegate to the rest of the chain to perform the request.
* @param request the request to perform
* @return {@code Mono} with the response
* @see GraphQlClient.RequestSpec#execute()
*/
Mono<ClientGrap... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\client\GraphQlClientInterceptor.java | 1 |
请完成以下Java代码 | public String getReferenceType() {
return referenceType;
}
public boolean isEnded() {
return ended;
}
public boolean isNotEnded() {
return notEnded;
}
public String getEntryCriterionId() {
return entryCriterionId;
}
public String getExitCriterionId() {
... | return safeInvolvedGroups;
}
public void setSafeInvolvedGroups(List<List<String>> safeInvolvedGroups) {
this.safeInvolvedGroups = safeInvolvedGroups;
}
public List<List<String>> getSafeCaseInstanceIds() {
return safeCaseInstanceIds;
}
public void setSafeCaseInstanceIds(List<Li... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\history\HistoricPlanItemInstanceQueryImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PrintingClientExternalSystemService
{
private final IOrgDAO orgDAO = Services.get(IOrgDAO.class);
private final ExternalSystemMessageSender externalSystemMessageSender;
private final ExternalSystemConfigService externalSystemConfigService;
private final IQueryBL queryBL;
private final static String ... | private JsonExternalSystemRequest toPrintingClientExternalSystemRequest(@NonNull final PrintingClientRequest request)
{
final I_ExternalSystem_Config_PrintingClient childConfigRecord = queryBL.createQueryBuilder(I_ExternalSystem_Config_PrintingClient.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(X_Ex... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\printingclient\PrintingClientExternalSystemService.java | 2 |
请完成以下Java代码 | public class Error {
protected String id;
protected String errorCode;
private ParameterValueProvider errorMessageExpression;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getErrorCode() { | return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public ParameterValueProvider getErrorMessageExpression() {
return errorMessageExpression;
}
public void setErrorMessageExpression(ParameterValueProvider errorMessageExpression) {
this.errorMessag... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\parser\Error.java | 1 |
请完成以下Java代码 | public static int failFast2() {
ArrayList<Integer> numbers = new ArrayList<>();
numbers.add(10);
numbers.add(20);
numbers.add(30);
numbers.add(40);
Iterator<Integer> iterator = numbers.iterator();
while (iterator.hasNext()) {
if (iterator.next() == 30... | map.put("First", 10);
map.put("Second", 20);
map.put("Third", 30);
map.put("Fourth", 40);
Iterator<String> iterator = map.keySet()
.iterator();
while (iterator.hasNext()) {
String key = iterator.next();
map.put("Fifth", 50);
}
... | repos\tutorials-master\core-java-modules\core-java-collections-6\src\main\java\com\baeldung\collections\iterators\Iterators.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JwtRequestFilter extends OncePerRequestFilter {
@Autowired
private JwtUserDetailsService jwtUserDetailsService;
@Autowired
private JwtTokenUtil jwtTokenUtil;
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws ServletExce... | }
//Once we get the token validate it.
if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
UserDetails userDetails = this.jwtUserDetailsService.loadUserByUsername(username);
// if token is valid configure Spring Security to manually set authentication
if (jwtTokenUt... | repos\SpringBoot-Projects-FullStack-master\Advanced-SpringSecure\spring-boot-jwt-without-JPA\spring-boot-jwt\src\main\java\com\javainuse\config\JwtRequestFilter.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class HUMovementGeneratorResult
{
public static final HUMovementGeneratorResult EMPTY = builder().build();
ImmutableList<org.compiere.model.I_M_Movement> movements;
ImmutableList<MovementAndLineId> movementLineIds;
ImmutableList<I_M_HU> husMoved;
@Builder
private HUMovementGeneratorResult(
@Nullable f... | }
else if (this.isEmpty())
{
return other;
}
else
{
final ImmutableList<I_M_Movement> newMovements = ImmutableList.<I_M_Movement>builder().addAll(this.movements).addAll(other.movements).build();
final ImmutableList<MovementAndLineId> newMovementAndLineIds = ImmutableList.<MovementAndLineId>builder().... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\movement\generate\HUMovementGeneratorResult.java | 2 |
请完成以下Java代码 | private static String getStringFromInputStream(InputStream inputStream, boolean trim) throws IOException {
BufferedReader bufferedReader = null;
StringBuilder stringBuilder = new StringBuilder();
try {
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line;
wh... | * Writes a {@link DomDocument} to an {@link OutputStream} by transforming the DOM to XML.
*
* @param document the DOM document to write
* @param outputStream the {@link OutputStream} to write to
*/
public static void writeDocumentToOutputStream(DomDocument document, OutputStream outputStream) {
Stre... | repos\camunda-bpm-platform-master\model-api\xml-model\src\main\java\org\camunda\bpm\model\xml\impl\util\IoUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Object execute(CommandContext commandContext) {
HistoryJobEntity jobToDelete = getJobToDelete(commandContext);
sendCancelEvent(jobToDelete);
jobServiceConfiguration.getHistoryJobEntityManager().delete(jobToDelete);
return null;
}
protected void sendCancelEvent(HistoryJo... | if (historyJobId == null) {
throw new FlowableIllegalArgumentException("jobId is null");
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Deleting job {}", historyJobId);
}
HistoryJobEntity job = jobServiceConfiguration.getHistoryJobEntityManager().findById(history... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\cmd\DeleteHistoryJobCmd.java | 2 |
请完成以下Java代码 | public class ThumbnailatorUtil {
public static void main(String[] args) throws IOException {
String originalPic = "/Users/liuhaihua/IdeaProjects/springboot-demo/thumbnailator/src/main/resources/origin-image/pexels-mike-b-130851.jpg";
String picturePath = "/Users/liuhaihua/IdeaProjects/springboot-dem... | // The width and height are both enlarged to 1.1 times the original
Thumbnails.of(originalPic)
.scale(1.1f)
.toFile(picturePath + "climb-up.scale.4435X3326.jpeg");
// rotate
Thumbnails.of(originalPic)
.size(400,300)
.rotate(45)
... | repos\springboot-demo-master\thumbnailator\src\main\java\com\et\thumbnailtor\util\ThumbnailatorUtil.java | 1 |
请完成以下Java代码 | public void setConditionSQL (final @Nullable java.lang.String ConditionSQL)
{
set_Value (COLUMNNAME_ConditionSQL, ConditionSQL);
}
@Override
public java.lang.String getConditionSQL()
{
return get_ValueAsString(COLUMNNAME_ConditionSQL);
}
@Override
public void setOnDelete (final boolean OnDelete)
{
set... | {
return get_ValueAsBoolean(COLUMNNAME_OnUpdate);
}
@Override
public void setSource_Table_ID (final int Source_Table_ID)
{
if (Source_Table_ID < 1)
set_Value (COLUMNNAME_Source_Table_ID, null);
else
set_Value (COLUMNNAME_Source_Table_ID, Source_Table_ID);
}
@Override
public int getSource_Table_ID... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_BusinessRule_Trigger.java | 1 |
请完成以下Java代码 | public DefaultPrintFormats getByClientId(@NonNull final ClientId clientId)
{
return cache.getOrLoad(clientId, this::retrieveByClientId);
}
private DefaultPrintFormats retrieveByClientId(@NonNull final ClientId clientId)
{
final I_AD_PrintForm record = queryBL.createQueryBuilderOutOfTrx(I_AD_PrintForm.class)
... | return toDefaultPrintFormats(record);
}
private static DefaultPrintFormats toDefaultPrintFormats(final I_AD_PrintForm record)
{
return DefaultPrintFormats.builder()
.orderPrintFormatId(PrintFormatId.ofRepoIdOrNull(record.getOrder_PrintFormat_ID()))
.invoicePrintFormatId(PrintFormatId.ofRepoIdOrNull(record... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\report\DefaultPrintFormatsRepository.java | 1 |
请完成以下Java代码 | public static final class Builder
{
private int AD_Org_ID;
private int C_BPartner_ID;
private int C_Currency_ID;
private Boolean multiCurrency;
private Date date;
//
// NOTE: order is important because some BL wants to apply the types in the same order they were enabled!
private final LinkedHashSet<Inv... | {
Check.assumeNotNull(allowedWriteOffType, "allowedWriteOffType not null");
allowedWriteOffTypes.add(allowedWriteOffType);
return this;
}
public Builder setWarningsConsumer(final IProcessor<Exception> warningsConsumer)
{
this.warningsConsumer = warningsConsumer;
return this;
}
public Builder ... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.swingui\src\main\java\de\metas\banking\payment\paymentallocation\model\PaymentAllocationContext.java | 1 |
请完成以下Java代码 | public static void main(String[] args) throws InterruptedException {
defaultBehaviour();
// subscribeBeforeConnect();
}
private static void defaultBehaviour() {
Observable obs = getObservable();
LOGGER.info("Subscribing");
Subscription s1 = obs.subscribe(i -> LOGGER.in... | }
private static Observable getObservable() {
return Observable.create(subscriber -> {
subscriber.onNext(gettingValue(1));
subscriber.onNext(gettingValue(2));
subscriber.add(Subscriptions.create(() -> {
LOGGER.info("Clear resources");
}));
... | repos\tutorials-master\rxjava-modules\rxjava-observables\src\main\java\com\baeldung\rxjava\MultipleSubscribersColdObs.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
this.categoryChanged = true;
}
@ApiModelProperty(example = "2")
public Integer getVersion() {
return version;
}
public void setVersion(Inte... | public boolean isKeyChanged() {
return keyChanged;
}
@JsonIgnore
public boolean isMetaInfoChanged() {
return metaInfoChanged;
}
@JsonIgnore
public boolean isNameChanged() {
return nameChanged;
}
@JsonIgnore
public boolean isVersionChanged() {
return... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\repository\ModelRequest.java | 2 |
请完成以下Java代码 | private static void handleFutureControlFlow() {
ExecutorService executorService = Executors.newSingleThreadExecutor();
Future<Integer> futureTask = executorService.submit(() -> {
LOG.debug("Future Task: Executing...");
return 1;
});
try {
int result =... | promiseWithError.exceptionally(throwable -> {
LOG.error("Error occurred with CompletableFuture: " + throwable.getMessage());
return "Fallback value";
});
}
private static void handleFutureError() {
ExecutorService executorService = Executors.newSingleThreadExecutor();
... | repos\tutorials-master\core-java-modules\core-java-concurrency-basic-2\src\main\java\com\baeldung\concurrent\futurevspromise\FutureVsPromise.java | 1 |
请完成以下Java代码 | public static ClientAndOrgId ofClientAndOrg(
@JsonProperty("clientId") @NonNull final ClientId adClientId,
@JsonProperty("orgId") @NonNull final OrgId adOrgId)
{
final ClientAndOrgId instance = new ClientAndOrgId(adClientId, adOrgId);
// intern:
if (SYSTEM.equals(instance))
{
return SYSTEM;
}
els... | @NonNull final ClientId clientId,
@NonNull final OrgId orgId)
{
this.clientId = clientId;
this.orgId = orgId;
}
public ClientAndOrgId withSystemClientId()
{
return ClientId.equals(this.clientId, ClientId.SYSTEM)
? this
: ofClientAndOrg(ClientId.SYSTEM, orgId);
}
public ClientAndOrgId withAnyOrg... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\organization\ClientAndOrgId.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserController {
Logger logger= LoggerFactory.getLogger(UserController.class);
@Autowired
private UserService userService;
@GetMapping("/users")
public Object list() {
List<User> list= userService.list();
//Collections.sort(list);
return list;
}
@GetM... | for(int i=1;i<101;i++) {
User user = new User();
user.setId(i);
user.setUsername("forezp"+(i));
user.setPassword("1233edwd");
long resutl= userService.addUser(user);
logger.info("insert:"+user.toString()+" result:"+resutl);
}
retur... | repos\SpringBootLearning-master\sharding-jdbc-example\sharding-jdbc-db-ms-tbl\src\main\java\com\forezp\shardingjdbcdbmstbl\web\UserController.java | 2 |
请完成以下Java代码 | public class BooleanValueSerializer extends PrimitiveValueSerializer<BooleanValue> {
// boolean is modeled as long values
private static final Long TRUE = 1L;
private static final Long FALSE = 0L;
public BooleanValueSerializer() {
super(ValueType.BOOLEAN);
}
public BooleanValue convertToTypedValue(Un... | return Variables.booleanValue(boolValue, asTransientValue);
}
public void writeValue(BooleanValue variableValue, ValueFields valueFields) {
Long longValue = null;
Boolean boolValue = variableValue.getValue();
if(boolValue != null) {
longValue = boolValue ? TRUE : FALSE;
}
valueFields.se... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\variable\serializer\BooleanValueSerializer.java | 1 |
请完成以下Java代码 | public void setRating(int rating) {
this.rating = rating;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj)... | return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CourseRating other = (CourseRating) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
... | repos\tutorials-master\persistence-modules\spring-jpa\src\main\java\com\baeldung\manytomany\model\CourseRating.java | 1 |
请完成以下Java代码 | public class CapturingStreamListener implements StreamListener<String, MapRecord<String, String, String>> {
private AtomicInteger counter = new AtomicInteger(0);
private BlockingDeque<MapRecord<String, String, String>> deque = new LinkedBlockingDeque<>();
private CapturingStreamListener() {
}
@Override
public ... | /**
* @return the total number or records captured so far.
*/
public int recordsReceived() {
return counter.get();
}
/**
* Retrieves and removes the head of the queue waiting if
* necessary until an element becomes available.
*
* @return
* @throws InterruptedException if interrupted while waiting
... | repos\spring-data-examples-main\redis\streams\src\main\java\example\springdata\redis\sync\CapturingStreamListener.java | 1 |
请完成以下Java代码 | public void setMessage (String Message)
{
set_Value (COLUMNNAME_Message, Message);
}
/** Get Message.
@return EMail Message
*/
public String getMessage ()
{
return (String)get_Value(COLUMNNAME_Message);
}
/** Set Message 2.
@param Message2
Optional second part of the EMail Message
*/
public ... | Web Store Mail Message Template
*/
public void setW_MailMsg_ID (int W_MailMsg_ID)
{
if (W_MailMsg_ID < 1)
set_ValueNoCheck (COLUMNNAME_W_MailMsg_ID, null);
else
set_ValueNoCheck (COLUMNNAME_W_MailMsg_ID, Integer.valueOf(W_MailMsg_ID));
}
/** Get Mail Message.
@return Web Store Mail Message Templat... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_MailMsg.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BookServiceImpl implements BookService {
private final Logger log = LoggerFactory.getLogger(BookServiceImpl.class);
private final BookRepository bookRepository;
private final BookMapper bookMapper;
public BookServiceImpl(BookRepository bookRepository, BookMapper bookMapper) {
th... | @Override
@Transactional(readOnly = true)
public Optional<BookDTO> findOne(Long id) {
log.debug("Request to get Book : {}", id);
return bookRepository.findById(id)
.map(bookMapper::toDto);
}
/**
* Delete the book by id.
*
* @param id the id of the entity
... | repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\service\impl\BookServiceImpl.java | 2 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
@Override
public void setAD_User_ID (final int AD_User_ID)
{
if (AD_User_ID < 0)
set_ValueNoCheck (COLUMNNAME_AD_User_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_User_ID, ... | * IsScanResourceRequired AD_Reference_ID=319
* Reference name: _YesNo
*/
public static final int ISSCANRESOURCEREQUIRED_AD_Reference_ID=319;
/** Yes = Y */
public static final String ISSCANRESOURCEREQUIRED_Yes = "Y";
/** No = N */
public static final String ISSCANRESOURCEREQUIRED_No = "N";
@Override
public v... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_MobileUI_UserProfile_MFG.java | 1 |
请完成以下Java代码 | public Quantity getQtyOrdered() {return orderLineInfo.getQtyOrdered();}
public ProductId getProductId() {return orderLineInfo.getProductId();}
public CurrencyId getCurrencyId()
{
return orderLineInfo.getCurrencyId();
}
public UomId getUomId()
{
return orderLineInfo.getUomId();
}
public void setOrderLine... | costAmountNew.assertCurrencyId(orderLineInfo.getCurrencyId());
this.costAmount = costAmountNew;
}
void addInOutCost(@NonNull Money amt, @NonNull Quantity qty)
{
this.inoutCostAmount = this.inoutCostAmount.add(amt);
this.inoutQty = this.inoutQty.add(qty);
}
public OrderCostDetail copy(@NonNull final OrderCo... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\costs\OrderCostDetail.java | 1 |
请完成以下Java代码 | public List<DepartIdModel> getChildren() {
return children;
}
public void setChildren(List<DepartIdModel> children) {
this.children = children;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getKey() {
return key;
}
... | public void setValue(String value) {
this.value = value;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.co... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\DepartIdModel.java | 1 |
请完成以下Java代码 | public int getAD_Org_ID() {
return po.getAD_Org_ID(); // getAD_Org_ID
}
/**
* Set Active
* @param active active
*/
public void setIsActive(boolean active) {
po.setIsActive(active); // setActive
}
/**
* Is Active
* @return is active
*/
public boolean isActive() {
return po.isActive(); // ... | }
/**
* Create Single/Multi Key Where Clause
* @param withValues if true uses actual values otherwise ?
* @return where clause
*/
public String get_WhereClause(boolean withValues) {
return po.get_WhereClause(withValues); // getWhereClause
}
/**********************************************************... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\model\wrapper\AbstractPOWrapper.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class GatewayProperties {
/**
* Properties prefix.
*/
public static final String PREFIX = "spring.cloud.gateway.server.webflux";
private final Log logger = LogFactory.getLog(getClass());
/**
* List of Routes.
*/
@NotNull
@Valid
private List<RouteDefinition> routes = new ArrayList<>();
/**
*... | public void setStreamingMediaTypes(List<MediaType> streamingMediaTypes) {
this.streamingMediaTypes = streamingMediaTypes;
}
public boolean isFailOnRouteDefinitionError() {
return failOnRouteDefinitionError;
}
public void setFailOnRouteDefinitionError(boolean failOnRouteDefinitionError) {
this.failOnRouteDef... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\config\GatewayProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private Map<String, TsValue> toTsValue(List<TsKvEntry> data) {
return data.stream().collect(Collectors.toMap(TsKvEntry::getKey, value -> new TsValue(value.getTs(), value.getValueAsString())));
}
@Override
public void cancelSubscription(String sessionId, UnsubscribeCmd cmd) {
cleanupAndCance... | @Override
public void cancelAllSessionSubscriptions(String sessionId) {
Map<Integer, TbAbstractSubCtx> sessionSubs = subscriptionsBySessionId.remove(sessionId);
if (sessionSubs != null) {
sessionSubs.values().forEach(sub -> {
try {
clea... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\subscription\DefaultTbEntityDataSubscriptionService.java | 2 |
请完成以下Java代码 | public class Edge {
private int weight;
private boolean isIncluded = false;
private boolean isPrinted = false;
public Edge(int weight) {
this.weight = weight;
}
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;... | public boolean isIncluded() {
return isIncluded;
}
public void setIncluded(boolean included) {
isIncluded = included;
}
public boolean isPrinted() {
return isPrinted;
}
public void setPrinted(boolean printed) {
isPrinted = printed;
}
} | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-5\src\main\java\com\baeldung\algorithms\prim\Edge.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ShiroProperty {
@Value("${shiro.retryExpireTimeRedis}")
private int shiroRetryExpireTimeRedis;
@Value("${shiro.authorizationExpireTimeRedis}")
private int shiroAuthorizationExpireTimeRedis;
@Value("${shiro.retryMax}")
private int shiroRetryMax;
@Value("${shiro.sessionExpireT... | return shiroAuthorizationExpireTimeRedis;
}
public void setShiroAuthorizationExpireTimeRedis(int shiroAuthorizationExpireTimeRedis) {
this.shiroAuthorizationExpireTimeRedis = shiroAuthorizationExpireTimeRedis;
}
public int getShiroRetryMax() {
return shiroRetryMax;
}
public vo... | repos\springBoot-master\springboot-shiro2\src\main\java\cn\abel\rest\shiro\ShiroProperty.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public DataResponse<List<Map<String, Object>>> getTableData(@ApiParam(name = "tableName") @PathVariable String tableName, @ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams) {
if (restApiInterceptor != null) {
restApiInterceptor.accessTableInfo();
}
... | DataResponse response = new DataResponse();
TablePageQuery tablePageQuery = managementService.createTablePageQuery().tableName(tableName);
if (orderAsc != null) {
tablePageQuery.orderAsc(orderAsc);
response.setOrder("asc");
response.setSort(orderAsc);
}
... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\management\TableDataResource.java | 2 |
请完成以下Java代码 | public LUTUAssignBuilder setC_BPartner(final I_C_BPartner bpartner)
{
assertConfigurable();
this._bpartnerId = bpartner != null ? BPartnerId.ofRepoId(bpartner.getC_BPartner_ID()) : null;
return this;
}
private final BPartnerId getBPartnerId()
{
return _bpartnerId;
}
public LUTUAssignBuilder setC_BPartne... | return this;
}
private LocatorId getLocatorId()
{
Check.assumeNotNull(_locatorId, "_locatorId not null");
return _locatorId;
}
public LUTUAssignBuilder setHUStatus(final String huStatus)
{
assertConfigurable();
_huStatus = huStatus;
return this;
}
private String getHUStatus()
{
Check.assumeNotEm... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\transfer\impl\LUTUAssignBuilder.java | 1 |
请完成以下Java代码 | /*package*/final class UserQuery implements IUserQuery
{
public static UserQuery of(final int id, final String caption, final int adUserId, final List<IUserQueryRestriction> segments)
{
return new UserQuery(id, caption, adUserId, segments);
}
private final int id;
private final int adUserId;
private final ITra... | @Override
public int getId()
{
return id;
}
@Override
public ITranslatableString getCaption()
{
return caption;
}
@Override
public int getAD_User_ID()
{
return adUserId;
}
@Override
public List<IUserQueryRestriction> getRestrictions()
{
return restrictions;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\apps\search\UserQuery.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class GraphQLProvider {
@Autowired
GraphQLDataFetchers graphQLDataFetchers;
private GraphQL graphQL;
@PostConstruct
public void init() throws IOException {
URL url = Resources.getResource("schema.graphqls");
String sdl = Resources.toString(url, Charsets.UTF_8);
Gra... | }
private RuntimeWiring buildWiring() {
return RuntimeWiring.newRuntimeWiring()
.type(newTypeWiring("Query")
.dataFetcher("bookById", graphQLDataFetchers.getBookByIdDataFetcher()))
.type(newTypeWiring("Book")
.dataFetcher("auth... | repos\spring-boot-quick-master\quick-graphQL\src\main\java\com\quick\graphql\config\GraphQLProvider.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Page<Author> fetchAuthors(@PathVariable int page, @PathVariable int size) {
return bookstoreService.fetchNextPage(page, size);
}
@GetMapping("/authorsByGenre/{page}/{size}")
public Page<Author> fetchAuthorsByGenre(@PathVariable int page, @PathVariable int size) {
return booksto... | public Page<Author> fetchAuthorsByGenreNative(@PathVariable int page, @PathVariable int size) {
return bookstoreService.fetchNextPageByGenreNative(page, size);
}
@GetMapping("/authorsByGenreNativeExplicitCount/{page}/{size}")
public Page<Author> fetchAuthorsByGenreNativeExplicitCount(@PathVari... | repos\Hibernate-SpringBoot-master\HibernateSpringBootOffsetPagination\src\main\java\com\bookstore\controller\BookstoreController.java | 2 |
请完成以下Java代码 | public int getC_Customer_Trade_Margin_Line_ID()
{
return get_ValueAsInt(COLUMNNAME_C_Customer_Trade_Margin_Line_ID);
}
@Override
public void setMargin (final int Margin)
{
set_Value (COLUMNNAME_Margin, Margin);
}
@Override
public int getMargin()
{
return get_ValueAsInt(COLUMNNAME_Margin);
}
@Overr... | }
@Override
public void setM_Product_ID (final int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
else
set_Value (COLUMNNAME_M_Product_ID, M_Product_ID);
}
@Override
public int getM_Product_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Product_ID);
}
@Override
p... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\commission\model\X_C_Customer_Trade_Margin_Line.java | 1 |
请完成以下Java代码 | private ImmutableList<I_M_HU> retainOnlyHUsWithCapturedInfo(final List<I_M_HU> hus)
{
return hus.stream()
.filter(hu -> getCapturedHUInfoOrNull(hu) != null)
.collect(ImmutableList.toImmutableList());
}
private CapturedHUInfo getCapturedHUInfo(@NonNull final I_M_HU hu)
{
return Check.assumeNotNull(getCa... | setWeightNet(hus.get(index), actualWeightToDistribute);
}
}
}
private void setWeightNet(@NonNull final I_M_HU hu, @NonNull final Quantity weightNet)
{
final IAttributeStorage huAttributes = huContext.getHUAttributeStorageFactory().getAttributeStorage(hu);
huAttributes.setSaveOnChange(true);
final IWeigh... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\candidate\commands\PackedHUWeightNetUpdater.java | 1 |
请完成以下Java代码 | private byte[] generateBuild(ProjectGenerationContext context) throws IOException {
ProjectDescription description = context.getBean(ProjectDescription.class);
StringWriter out = new StringWriter();
BuildWriter buildWriter = context.getBeanProvider(BuildWriter.class).getIfAvailable();
if (buildWriter != null) {... | context.registerBean(MetadataProjectDescriptionCustomizer.class,
() -> new MetadataProjectDescriptionCustomizer(metadata));
}
private void publishProjectGeneratedEvent(R request, ProjectGenerationContext context) {
InitializrMetadata metadata = context.getBean(InitializrMetadata.class);
ProjectGeneratedEvent... | repos\initializr-main\initializr-web\src\main\java\io\spring\initializr\web\project\ProjectGenerationInvoker.java | 1 |
请完成以下Java代码 | public Timestamp getDateAcct ()
{
return (Timestamp)get_Value(COLUMNNAME_DateAcct);
}
/** Set Document Date.
@param DateDoc
Date of the Document
*/
public void setDateDoc (Timestamp DateDoc)
{
set_Value (COLUMNNAME_DateDoc, DateDoc);
}
/** Get Document Date.
@return Date of the Document
*/
p... | return "Y".equals(oo);
}
return false;
}
/** 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 ()
{
Object... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Disposed.java | 1 |
请完成以下Java代码 | class CMediaSizeName extends MediaSizeName
{
/**
*
*/
private static final long serialVersionUID = 8561532175435930293L;
/**
* CMediaSizeName
* @param code
*/
public CMediaSizeName(int code)
{
super (code);
} // CMediaSizeName
/**
* Get String Table
* @return str... | */
public static void main(String[] args)
{
org.compiere.Adempiere.startupEnvironment(true);
// create ("Standard Landscape", true);
// create ("Standard Portrait", false);
// Read All Papers
int[] IDs = PO.getAllIDs ("AD_PrintPaper", null, null);
for (int i = 0; i < IDs.length; i++)
{
System.out.pri... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\MPrintPaper.java | 1 |
请完成以下Java代码 | public void checkCorrectCalendar(final I_C_Calendar calendar)
{
Check.errorUnless(isCalendarNoOverlaps(calendar), "{} has overlaps", calendar);
Check.errorUnless(isCalendarNoGaps(calendar), "{} has gaps", calendar);
final List<I_C_Year> years = Services.get(ICalendarDAO.class).retrieveYearsOfCalendar(calendar);... | } // isStandardPeriod
@Override
public IBusinessDayMatcher createBusinessDayMatcherExcluding(final Set<DayOfWeek> excludeWeekendDays)
{
// TODO: consider I_C_NonBusinessDay and compose the matchers using CompositeBusinessDayMatcher
return ExcludeWeekendBusinessDayMatcher.builder()
.excludeWeekendDays(exc... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\calendar\impl\CalendarBL.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class InventoryController {
protected static final String INVENTORY_ATTR = "inventory";
private static final String BINDING_RESULT = "org.springframework.validation.BindingResult." + INVENTORY_ATTR;
private final InventoryService inventoryService;
public InventoryController(InventoryService in... | }
}
if (bindingResult.hasErrors()) {
redirectAttributes.addFlashAttribute(BINDING_RESULT, bindingResult);
return "redirect:load/" + inventory.getId();
}
sessionStatus.setComplete();
return "redirect:success";
}
@GetMapping(value = "/success")
... | repos\Hibernate-SpringBoot-master\HibernateSpringBootHTTPLongConversationDetachedEntity\src\main\java\com\bookstore\controller\InventoryController.java | 2 |
请完成以下Java代码 | public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getStatus() {
retu... | }
public String getLastLoginIp() {
return lastLoginIp;
}
public void setLastLoginIp(String lastLoginIp) {
this.lastLoginIp = lastLoginIp;
}
@Override
public String toString() {
return "UserDetail{" +
"id=" + id +
", userId=" + userId +
... | repos\spring-boot-leaning-master\2.x_42_courses\第 3-4 课: Spring Data JPA 的基本使用\spring-boot-jpa\src\main\java\com\neo\model\UserDetail.java | 1 |
请完成以下Java代码 | private void updatePassword(String password, User user) {
var encodedPassword = passwordService.encodePassword(password);
user.setEncodedPassword(encodedPassword);
}
private Mono<?> updateUsername(UpdateUserRequest request, User user) {
if (request.getUsername() == null) {
r... | private void updateEmail(UpdateUserRequest request, User user, boolean existsByEmail) {
if (existsByEmail) {
throw emailAlreadyInUseException();
}
user.setEmail(request.getEmail());
}
private InvalidRequestException usernameAlreadyInUseException() {
return new Invali... | repos\realworld-spring-webflux-master\src\main\java\com\realworld\springmongo\user\UserUpdater.java | 1 |
请完成以下Java代码 | protected final void done()
{
// Unlock
unlock();
//
// Display errors if any
try
{
get();
}
catch (final InterruptedException e)
{
logger.info("Interrupted", e);
}
catch (final ExecutionException e)
{
final Throwable cause = e.getCause() == null ? e : e.getCause();
Services.get(IC... | // Get Command
MTask task = null;
if (AD_Task_ID > 0)
{
task = new MTask(Env.getCtx(), AD_Task_ID, ITrx.TRXNAME_None);
}
if (task.getAD_Task_ID() != AD_Task_ID)
{
task = null;
}
if (task == null)
{
return;
}
m_menu.getWindowManager().add(new ATask(m_name, task));
// ATask.start(m_nam... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\AMenuStartItem.java | 1 |
请完成以下Java代码 | protected PlanItemVariableAggregator getPlanItemVariableAggregator() {
Object delegateInstance = instantiate(className);
applyFieldExtensions(fieldExtensions, delegateInstance, false);
if (delegateInstance instanceof PlanItemVariableAggregator) {
return (PlanItemVariableAggregator) d... | public String getSourceState() {
return sourceState;
}
public void setSourceState(String sourceState) {
this.sourceState = sourceState;
}
@Override
public String getTargetState() {
return targetState;
}
public void setTargetState(String targetState) {
this.tar... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\delegate\CmmnClassDelegate.java | 1 |
请完成以下Java代码 | public void setSelectedIndex (final int index)
{
final Component newComp = getComponentAt(index);
final GridController newGC;
final Integer newTabLevel;
if (newComp instanceof GridController)
{
newGC = (GridController)newComp;
newTabLevel = ((GridController)newComp).getTabLevel();
}
else if (newCom... | ADialog.warn(0, this, "TabSwitchJump");
return;
}
}
oldGC.setMnemonics(false);
}
}
// Switch
super.setSelectedIndex (index);
if (newGC != null)
{
newGC.setMnemonics(true);
}
} // setSelectedIndex
/**
* Evaluate Tab Logic
* @param e event
*/
public void evaluate (final Dat... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\VTabbedPane.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.