instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | protected Properties childValue(final Properties ctx)
{
final Properties childCtx = new Properties(ctx);
listener.onChildContextCreated(ctx, childCtx);
return childCtx;
}
@Override
public Properties get()
{
final Properties ctx = super.get();
listener.onContextCheckOut(ctx);
return ctx;
}... | {
private boolean closed = false;
@Override
public void close()
{
// Do nothing if already closed
if (closed)
{
return;
}
// Assert we are restoring the ctx in same thread.
// Because else, we would set the context "back" in another thread which would lead to huge inconsistenc... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\context\ThreadLocalServerContext.java | 1 |
请完成以下Java代码 | public Mono<Authentication> authenticate(Authentication authentication) {
// @formatter:off
return Mono.justOrEmpty(authentication)
.filter(BearerTokenAuthenticationToken.class::isInstance)
.cast(BearerTokenAuthenticationToken.class)
.map(BearerTokenAuthenticationToken::getToken)
.flatMap(this::auth... | * @param authenticatedPrincipal the successful introspection output
* @return an async wrapper of default {@link OpaqueTokenAuthenticationConverter}
* result
*/
static Mono<Authentication> convert(String introspectedToken, OAuth2AuthenticatedPrincipal authenticatedPrincipal) {
return Mono.just(OpaqueTokenAuthe... | repos\spring-security-main\oauth2\oauth2-resource-server\src\main\java\org\springframework\security\oauth2\server\resource\authentication\OpaqueTokenReactiveAuthenticationManager.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) {
this.objectPostProcessor = objectPostProcessor;
}
@Autowired(required = false)
public void setMethodSecurityExpressionHandler(List<MethodSecurityExpressionHandler> handlers) {
if (handlers.size() != 1) {
logger.debug("Not a... | private boolean securedEnabled() {
return enableMethodSecurity().getBoolean("securedEnabled");
}
private boolean jsr250Enabled() {
return enableMethodSecurity().getBoolean("jsr250Enabled");
}
private boolean isAspectJ() {
return enableMethodSecurity().getEnum("mode") == AdviceMode.ASPECTJ;
}
private Anno... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\method\configuration\GlobalMethodSecurityConfiguration.java | 2 |
请完成以下Java代码 | public boolean isPrinted()
{
return printed;
}
@Override
public void setPrinted(final boolean printed)
{
this.printed = printed;
}
@Override
public int getLineNo()
{
return lineNo;
}
@Override
public void setLineNo(final int lineNo)
{
this.lineNo = lineNo;
}
@Override
public void setInvoiceL... | @Override
public List<IInvoiceLineAttribute> getInvoiceLineAttributes()
{
return invoiceLineAttributes;
}
@Override
public List<InvoiceCandidateInOutLineToUpdate> getInvoiceCandidateInOutLinesToUpdate()
{
return iciolsToUpdate;
}
@Override
public int getC_PaymentTerm_ID()
{
return C_PaymentTerm_ID;
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\InvoiceLineImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public TypeAProcessor typeAProcessor() {
return new TypeAProcessor();
}
@Bean
public TypeBProcessor typeBProcessor() {
return new TypeBProcessor();
}
@Bean
public CustomerProcessorRouter processorRouter(TypeAProcessor typeAProcessor, TypeBProcessor typeBProcessor) {
ret... | .build();
}
@Bean
public CompositeItemWriter<Customer> compositeWriter(JpaItemWriter<Customer> jpaDBWriter, FlatFileItemWriter<Customer> fileWriter) {
return new CompositeItemWriterBuilder<Customer>().delegates(List.of(jpaDBWriter, fileWriter))
.build();
}
@Bean
public Step... | repos\tutorials-master\spring-batch-2\src\main\java\com\baeldung\multiprocessorandwriter\config\BatchConfig.java | 2 |
请完成以下Java代码 | protected ITranslatableString buildMessage()
{
String msg = super.getMessage();
StringBuffer sb = new StringBuffer(msg);
//
if (this.order != null)
{
final String info;
if (order instanceof IDocument)
{
info = ((IDocument)order).getSummary();
}
else
{
info = "" + order.getDocumentNo... | sb.append(" @PP_Order_ID@:").append(info);
}
if (this.orderActivity != null)
{
sb.append(" @PP_Order_Node_ID@:").append(orderActivity);
}
if (this.resource != null)
{
sb.append(" @S_Resource_ID@:").append(resource.getValue()).append("_").append(resource.getName());
}
//
return TranslatableString... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\exceptions\CRPException.java | 1 |
请完成以下Java代码 | public static BPartnerCompositeLookupKey ofExternalId(@NonNull final ExternalId externalId)
{
return ofJsonExternalId(JsonExternalIds.of(externalId));
}
public static BPartnerCompositeLookupKey ofCode(@NonNull final String code)
{
assumeNotEmpty(code, "Given parameter 'code' may not be empty");
return new BP... | String code;
GLN gln;
GlnWithLabel glnWithLabel;
private BPartnerCompositeLookupKey(
@Nullable final MetasfreshId metasfreshId,
@Nullable final JsonExternalId jsonExternalId,
@Nullable final String code,
@Nullable final GLN gln,
@Nullable final GlnWithLabel glnWithLabel)
{
this.metasfreshId = meta... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\utils\BPartnerCompositeLookupKey.java | 1 |
请完成以下Java代码 | public CalculatedFieldId getId() {
return super.getId();
}
@Schema(description = "Timestamp of the calculated field creation, in milliseconds", example = "1609459200000", accessMode = Schema.AccessMode.READ_ONLY)
@Override
public long getCreatedTime() {
return super.getCreatedTime();
... | @Override
public String toString() {
return new StringBuilder()
.append("CalculatedField[")
.append("tenantId=").append(tenantId)
.append(", entityId=").append(entityId)
.append(", type='").append(type)
.append(", name='").appen... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\cf\CalculatedField.java | 1 |
请完成以下Java代码 | public static AttributeId ofRepoId(final int repoId)
{
return new AttributeId(repoId);
}
public static AttributeId ofRepoIdObj(@NonNull final Object repoIdObj)
{
if (repoIdObj instanceof AttributeId)
{
return (AttributeId)repoIdObj;
}
else if (repoIdObj instanceof Integer)
{
return ofRepoId((int)... | public static int toRepoId(final AttributeId attributeId)
{
return attributeId != null ? attributeId.getRepoId() : -1;
}
private AttributeId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "repoId");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public static... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\mm\attributes\AttributeId.java | 1 |
请完成以下Java代码 | public Result afterHU(final I_M_HU hu)
{
final int huId = hu.getM_HU_ID();
final List<IHUDocumentLine> documentLines = huId2documentLines.remove(huId);
// allow empty documents because it's more obvious for user
// if (documentLines.isEmpty())
// {
// return Result.CONTINUE;
// }
fi... | }
return Result.SKIP_DOWNSTREAM;
}
});
iterator.iterate(hu);
}
protected IHUDocument createHUDocument(final I_M_HU hu, final List<IHUDocumentLine> documentLines)
{
final I_M_HU innerHU = getInnerHU(hu);
return new HandlingUnitHUDocument(hu, innerHU, documentLines);
}
protected I_M_HU getInnerHU(... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\document\impl\HandlingUnitHUDocumentFactory.java | 1 |
请完成以下Java代码 | public void exceptionWhileUnregisteringDeploymentsWithJobExecutor(Exception e) {
logError(
"020",
"Exceptions while unregistering deployments with job executor", e);
}
public void registrationSummary(String string) {
logInfo(
"021",
string);
}
public void exceptionWhil... | public void debugNoTargetProcessApplicationFound(ExecutionEntity execution, ProcessApplicationManager processApplicationManager) {
logDebug("023",
"No target process application found for Execution[{}], ProcessDefinition[{}], Deployment[{}] Registrations[{}]",
execution.getId(),
exec... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\application\impl\ProcessApplicationLogger.java | 1 |
请完成以下Java代码 | public void setCountry(String country) {
this.country = country;
}
public String getCounty() {
return country;
}
@Override
public String toString() {
return "Student{" +
"name='" + name + '\'' +
", cls='" + cls + '\'' +
", co... | }
public Student (String name, String cls, String country){
super();
this.name = name;
this.cls = cls;
this.country = country;
}
public String getName() {
return name;
}
} | repos\SpringBoot-Projects-FullStack-master\Part-4 Spring Boot REST API\SpringSwagger2Project\src\main\java\spring\swagger2\Student.java | 1 |
请完成以下Java代码 | public void setPostgREST_ResultDirectory (final String PostgREST_ResultDirectory)
{
set_Value (COLUMNNAME_PostgREST_ResultDirectory, PostgREST_ResultDirectory);
}
@Override
public String getPostgREST_ResultDirectory()
{
return get_ValueAsString(COLUMNNAME_PostgREST_ResultDirectory);
}
@Override
public vo... | @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_S_PostgREST_Config_ID, S_PostgREST_Config_ID);
}
@Override
public int getS_PostgREST_Config_ID(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_S_PostgREST_Config.java | 1 |
请完成以下Java代码 | public void read(LineHandler handler, int size) throws Exception
{
File rootFile = new File(root);
File[] files;
if (rootFile.isDirectory())
{
files = rootFile.listFiles(new FileFilter()
{
@Override
public boolean accept(File pa... | {
++totalAddress;
String line = lineIterator.next();
if (line.length() == 0) continue;
handler.handle(line);
}
}
handler.done();
if (verbose) System.out.printf("处理了 %.2f 万行,花费了 %.2f min\n", totalAddress / 10000.0, (Syste... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\io\EasyReader.java | 1 |
请完成以下Java代码 | protected void compute() {
if (Objects.isNull(file)) {
return;
}
File[] files = file.listFiles();
List<EncryptionClassFileTask> fileTasks = new ArrayList<>();
if (Objects.nonNull(files)) {
for (File f : files) {
// 拆分任务
if ... | invokeAll(fileTasks);
for (EncryptionClassFileTask fileTask : fileTasks) {
// 等待任务执行完成
fileTask.join();
}
}
}
private void encryptFile(File file) {
try {
logger.info("加密[{}] 文件 开始", file.getPath());
byte[] bytes = R... | repos\spring-boot-student-master\spring-boot-student-jvm\src\main\java\com\xiaolyuh\utils\EncryptionClassFileTask.java | 1 |
请完成以下Java代码 | public List<IPricingAttribute> extractPricingAttributes(@NonNull final I_M_ProductPrice productPrice)
{
final I_M_AttributeSetInstance productPriceASI = productPrice.getM_AttributeSetInstance();
if (productPriceASI == null || productPriceASI.getM_AttributeSetInstance_ID() <= 0)
{
return ImmutableList.of();
... | }
@Override
public void setDynAttrProductPriceAttributeAware(final IAttributeSetInstanceAware asiAware, final IProductPriceAware productPriceAware)
{
if (asiAware == null)
{
return; // nothing to do
}
DYN_ATTR_IProductPriceAware.setValue(asiAware, productPriceAware);
}
@Override
public Optional<IProd... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\attributebased\impl\AttributePricingBL.java | 1 |
请完成以下Java代码 | public class ErrorEventDefinition extends EventDefinition {
protected String errorCode;
protected String errorVariableName;
protected Boolean errorVariableTransient;
protected Boolean errorVariableLocalScope;
public String getErrorCode() {
return errorCode;
}
public void setErrorC... | public void setErrorVariableLocalScope(Boolean errorVariableLocalScope) {
this.errorVariableLocalScope = errorVariableLocalScope;
}
@Override
public ErrorEventDefinition clone() {
ErrorEventDefinition clone = new ErrorEventDefinition();
clone.setValues(this);
return clone;
... | repos\flowable-engine-main\modules\flowable-bpmn-model\src\main\java\org\flowable\bpmn\model\ErrorEventDefinition.java | 1 |
请完成以下Java代码 | void configureCopyWithDetailsSupport()
{
CopyRecordFactory.enableForTableName(I_C_RfQ.Table_Name);
}
@ModelChange(timings = { ModelValidator.TYPE_BEFORE_NEW, ModelValidator.TYPE_BEFORE_CHANGE })
public void beforeSave(final I_C_RfQ rfq)
{
final IRfQWorkDatesAware workDatesAware = InterfaceWrapperHelper.create... | public void onDeliveryDays(final I_C_RfQ rfq)
{
if (InterfaceWrapperHelper.isNull(rfq, I_C_RfQ.COLUMNNAME_DeliveryDays))
{
return;
}
final IRfQWorkDatesAware workDatesAware = InterfaceWrapperHelper.create(rfq, IRfQWorkDatesAware.class);
RfQWorkDatesUtil.updateFromDeliveryDays(workDatesAware);
}
@Callou... | repos\metasfresh-new_dawn_uat\backend\de.metas.rfq\src\main\java\de\metas\rfq\model\interceptor\C_RfQ.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void saveRouting(final PPOrderRouting routing)
{
supportingServices.saveOrderRouting(routing);
}
public void saveHeader(@NonNull final ManufacturingJob job)
{
final I_PP_Order ppOrder = getPPOrderRecordById(job.getPpOrderId());
ppOrder.setCurrentScaleDeviceId(job.getCurrentScaleDeviceId() != null ? jo... | .map(sourceLocatorInfo -> prepareJobActivity(from).sourceLocatorValidate(sourceLocatorInfo).build());
}
@NonNull
private Optional<ManufacturingJobActivity> toIssueOnlyWhatWasReceivedActivity(final @NonNull PPOrderRoutingActivity from)
{
if (!hasAnyIssueOnlyForReceivedLines(from.getOrderId()))
{
return Optio... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\job\service\ManufacturingJobLoaderAndSaver.java | 2 |
请完成以下Java代码 | public class TsKvQueryCursor extends QueryCursor {
@Getter
private final List<TsKvEntry> data;
@Getter
private final String orderBy;
private int partitionIndex;
private int currentLimit;
public TsKvQueryCursor(String entityType, UUID entityId, ReadTsKvQuery baseQuery, List<Long> partition... | @Override
public long getNextPartition() {
long partition = partitions.get(partitionIndex);
if (isDesc()) {
partitionIndex--;
} else {
partitionIndex++;
}
return partition;
}
public int getCurrentLimit() {
return currentLimit;
}
... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\timeseries\TsKvQueryCursor.java | 1 |
请完成以下Java代码 | public ServletInputStream getInputStream() throws IOException {
return new ServletInputStream() {
final InputStream inputStream = getRequestBody(isBodyEmpty, requestBody);
@Override
public int read() throws IOException {
return inputStream.read();
}
... | @Override
public boolean markSupported() {
return inputStream.markSupported();
}
};
}
@Override
public BufferedReader getReader() throws IOException {
return EmptyBodyFilter.this.getReader(this.getInputStream());
}
};
}
} | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\filter\EmptyBodyFilter.java | 1 |
请完成以下Java代码 | private DocumentFilterDescriptor createFacetFilter(@NonNull final DocumentFieldDescriptor field, final int sortNo)
{
final FacetsFilterLookupDescriptor facetsLookupDescriptor = createFacetsFilterLookupDescriptor(field);
return DocumentFilterDescriptor.builder()
.setFilterId(facetsLookupDescriptor.getFilterId(... | else
{
numericKey = fieldWidgetType.isNumeric();
}
return FacetsFilterLookupDescriptor.builder()
.viewsRepository(viewsRepository)
.filterId(filterId)
.fieldName(columnName)
.fieldWidgetType(fieldWidgetType)
.numericKey(numericKey)
.maxFacetsToFetch(fieldFilteringInfo.getMaxFacetsToFet... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\provider\standard\StandardDocumentFilterDescriptorsProviderFactory.java | 1 |
请完成以下Java代码 | public static String nullToEmpty(@Nullable final String in)
{
return in != null ? in : "";
}
/**
* Example:
* <pre>
* - string = `87whdhA7008S` (length 14)
* - groupSeparator = "--"
* - groupSize = 4
*
* Results into `87wh--dhA7--008S` of length 18.
* </pre>
*
* @param string the input... | final HashMap<String, String> params = new HashMap<>();
for (final String param : queryNorm.split("&"))
{
final String key;
final String value;
final int idx = param.indexOf("=");
if (idx < 0)
{
key = param;
value = null;
}
else
{
key = param.substring(0, idx);
value = param.... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\StringUtils.java | 1 |
请完成以下Java代码 | public void createNewDocument() {
Tutorials tutorials = new Tutorials();
tutorials.setTutorial(new ArrayList<Tutorial>());
Tutorial tut = new Tutorial();
tut.setTutId("01");
tut.setType("XML");
tut.setTitle("XML with Jaxb");
tut.setDescription("XML Binding with Ja... | } catch (JAXBException e) {
e.printStackTrace();
}
}
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
} | repos\tutorials-master\xml-modules\xml\src\main\java\com\baeldung\xml\JaxbParser.java | 1 |
请完成以下Java代码 | public Iterator<I_M_InOut> retrieveAllModelsWithMissingCandidates(final QueryLimit limit_IGNORED)
{
return Collections.emptyIterator();
}
@Override
public InvoiceCandidateGenerateResult createCandidatesFor(final InvoiceCandidateGenerateRequest request)
{
throw new IllegalStateException("Not supported");
}
... | }
@Override
public boolean isUserInChargeUserEditable()
{
return false;
}
@Override
public void setOrderedData(final I_C_Invoice_Candidate ic)
{
throw new IllegalStateException("Not supported");
}
@Override
public void setDeliveredData(final I_C_Invoice_Candidate ic)
{
throw new IllegalStateExceptio... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inout\invoicecandidate\M_InOut_Handler.java | 1 |
请完成以下Java代码 | public static class StringTypeImpl extends PrimitiveValueTypeImpl {
private static final long serialVersionUID = 1L;
public StringTypeImpl() {
super(String.class);
}
public StringValue createValue(Object value, Map<String, Object> valueInfo) {
return Variables.stringValue((String) value, ... | public NumberTypeImpl() {
super(Number.class);
}
public NumberValue createValue(Object value, Map<String, Object> valueInfo) {
return Variables.numberValue((Number) value, isTransient(valueInfo));
}
@Override
public boolean isAbstract() {
return true;
}
}
} | repos\camunda-bpm-platform-master\commons\typed-values\src\main\java\org\camunda\bpm\engine\variable\impl\type\PrimitiveValueTypeImpl.java | 1 |
请完成以下Java代码 | private void startWorkflow(
@NonNull final Workflow workflow,
@NonNull final PO document)
{
final ProcessInfo pi = ProcessInfo.builder()
.setCtx(document.getCtx())
.setAD_Process_ID(305) // FIXME HARDCODED
.setAD_Client_ID(document.getAD_Client_ID())
.setTitle(workflow.getName().getDefaultValue... | .append(" AND NOT EXISTS (SELECT 1 FROM AD_WF_Process wfp ")
.append("WHERE wfp.AD_Table_ID=? AND wfp.Record_ID=") // #3
.append(tableName).append(".").append(keyColumn)
.append(" AND wfp.AD_Workflow_ID=?") // #4
.append(" AND SUBSTR(wfp.WFState,1,1)='O')");
final Object[] sqlParams = new Object... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\workflow\execution\DocWorkflowManager.java | 1 |
请完成以下Java代码 | public List<HistoricCaseInstance> findHistoricCaseInstancesByNativeQuery(Map<String, Object> parameterMap, int firstResult, int maxResults) {
return getDbEntityManager().selectListWithRawParameter("selectHistoricCaseInstanceByNativeQuery", parameterMap, firstResult, maxResults);
}
public long findHistoricCaseI... | @SuppressWarnings("unchecked")
public List<CleanableHistoricCaseInstanceReportResult> findCleanableHistoricCaseInstancesReportByCriteria(CleanableHistoricCaseInstanceReportImpl query, Page page) {
query.setCurrentTimestamp(ClockUtil.getCurrentTime());
getTenantManager().configureQuery(query);
return getDb... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\HistoricCaseInstanceManager.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getCategory() {
return category;
}
... | }
public void setDeploymentId(String deploymentId) {
this.deploymentId = deploymentId;
}
public String getEditorSourceValueId() {
return editorSourceValueId;
}
public void setEditorSourceValueId(String editorSourceValueId) {
this.editorSourceValueId = editorSourceValueId;
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\ModelEntityImpl.java | 1 |
请完成以下Java代码 | private void createFactsForInventoryLine(final Fact fact, final DocLine_Inventory line)
{
final AcctSchema as = fact.getAcctSchema();
final CostAmount costs = line.getCreateCosts(as);
//
// Inventory DR/CR
fact.createLine()
.setDocLine(line)
.setAccount(line.getAccount(ProductAcctType.P_Asset_Acct,... | //
// Charge/InventoryDiff CR/DR
final Account invDiff = line.getInvDifferencesAccount(as, costs.toBigDecimal().negate());
final FactLine cr = fact.createLine()
.setDocLine(line)
.setAccount(invDiff)
.setAmtSourceDrOrCr(costs.toMoney().negate())
.setQty(line.getQty().negate())
.locatorId(line.... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\Doc_Inventory.java | 1 |
请完成以下Java代码 | public void setBaseURL (final String BaseURL)
{
set_Value (COLUMNNAME_BaseURL, BaseURL);
}
@Override
public String getBaseURL()
{
return get_ValueAsString(COLUMNNAME_BaseURL);
}
@Override
public void setC_Root_BPartner_ID (final int C_Root_BPartner_ID)
{
if (C_Root_BPartner_ID < 1)
set_Value (COLUM... | }
@Override
public void setExternalSystemValue (final String ExternalSystemValue)
{
set_Value (COLUMNNAME_ExternalSystemValue, ExternalSystemValue);
}
@Override
public String getExternalSystemValue()
{
return get_ValueAsString(COLUMNNAME_ExternalSystemValue);
}
@Override
public void setPharmacy_PriceLi... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Config_Alberta.java | 1 |
请完成以下Java代码 | public <NT> OldAndNewValues<NT> mapNonNulls(@NonNull final Function<T, NT> mapper)
{
final OldAndNewValues<NT> result = ofOldAndNewValues(
oldValue != null ? mapper.apply(oldValue) : null,
newValue != null ? mapper.apply(newValue) : null
);
if (this.equals(result))
{
//noinspection unchecked
ret... | final OldAndNewValues<NT> result = ofOldAndNewValues(
mapper.apply(oldValue),
mapper.apply(newValue)
);
if (this.equals(result))
{
//noinspection unchecked
return (OldAndNewValues<NT>)this;
}
return result;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\lang\OldAndNewValues.java | 1 |
请完成以下Java代码 | private static Dictionary<String, String> props(String... args) {
Dictionary<String, String> props = new Hashtable<>();
for (int i = 0; i < args.length / 2; i++) {
props.put(args[2 * i], args[2 * i + 1]);
}
return props;
}
@SuppressWarnings({"rawtypes"})
private ... | private static class Tracker implements Runnable {
private final Extender extender;
private Tracker(Extender extender) {
this.extender = extender;
this.extender.open();
}
@Override
public void run() {
extender.close();
}
}
} | repos\flowable-engine-main\modules\flowable-osgi\src\main\java\org\flowable\osgi\Activator.java | 1 |
请完成以下Java代码 | public Object stringToObject(final I_AD_Column column, final String valueStr)
{
if (valueStr == null)
{
if (column.isMandatory())
{
return VALUE_Unknown;
}
else
{
return null;
}
}
final int displayType = column.getAD_Reference_ID();
if (DisplayType.isText(displayType))
{
retu... | && column.getColumnName().startsWith("Is"))
{
final boolean valueBoolean = "true".equalsIgnoreCase(valueStr) || "Y".equalsIgnoreCase(valueStr);
return valueBoolean ? "Y" : "N"; // column value expected to be string
}
//
// Binary, Radio, RowID, Image not supported
else
{
return null;
}
}
@Over... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\migration\util\DefaultDataConverter.java | 1 |
请完成以下Java代码 | private int checkColumnConstraint(boolean[][] coverBoard, int hBase) {
for (int column = COVER_START_INDEX; column <= BOARD_SIZE; column++) {
for (int n = COVER_START_INDEX; n <= BOARD_SIZE; n++, hBase++) {
for (int row = COVER_START_INDEX; row <= BOARD_SIZE; row++) {
... | }
return hBase;
}
private boolean[][] initializeExactCoverBoard(int[][] board) {
boolean[][] coverBoard = createExactCoverBoard();
for (int row = COVER_START_INDEX; row <= BOARD_SIZE; row++) {
for (int column = COVER_START_INDEX; column <= BOARD_SIZE; column++) {
... | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-2\src\main\java\com\baeldung\algorithms\sudoku\DancingLinksAlgorithm.java | 1 |
请完成以下Java代码 | public void setLocode (java.lang.String Locode)
{
set_Value (COLUMNNAME_Locode, Locode);
}
/** Get Locode.
@return Location code - UN/LOCODE
*/
@Override
public java.lang.String getLocode ()
{
return (java.lang.String)get_Value(COLUMNNAME_Locode);
}
/** Set Name.
@param Name
Alphanumeric ident... | public java.lang.String getName ()
{
return (java.lang.String)get_Value(COLUMNNAME_Name);
}
/** Set PLZ.
@param Postal
Postal code
*/
@Override
public void setPostal (java.lang.String Postal)
{
set_Value (COLUMNNAME_Postal, Postal);
}
/** Get PLZ.
@return Postal code
*/
@Override
public ja... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_City.java | 1 |
请完成以下Java代码 | protected void onInit(final IModelValidationEngine engine, final I_AD_Client client)
{
engine.addModelChange(modelTableName, this);
}
@Override
public void onModelChange(final Object model, final ModelChangeType changeType) throws Exception
{
if (!changeType.isAfter())
{
return;
}
//
// Model was ... | final IContextAware context = InterfaceWrapperHelper.getContextAware(model);
final IDeliveryDayAllocable deliveryDayAllocable = handler.asDeliveryDayAllocable(model);
final I_M_DeliveryDay_Alloc deliveryDayAlloc = deliveryDayBL.getCreateDeliveryDayAlloc(context, deliveryDayAllocable);
if (deliveryDayAlloc == nul... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\tourplanning\model\validator\DeliveryDayAllocableInterceptor.java | 1 |
请完成以下Java代码 | public List<DimensionSpec> retrieveForColumn(final I_AD_Column column)
{
final IQuery<I_DIM_Dimension_Spec_Assignment> assignmentQuery = createDimAssignmentQueryBuilderFor(column)
.addOnlyActiveRecordsFilter()
.create();
return Services.get(IQueryBL.class).createQueryBuilder(I_DIM_Dimension_Spec.class, co... | }
return DimensionSpec.ofRecord(record);
}
@Override
public List<String> retrieveAttributeValueForGroup(final String dimensionSpectInternalName,
final String groupName,
final IContextAware ctxAware)
{
final KeyNamePair[] keyNamePairs = DB.getKeyNamePairs("SELECT M_AttributeValue_ID, ValueName "
+ "FR... | repos\metasfresh-new_dawn_uat\backend\de.metas.dimension\src\main\java\de\metas\dimension\impl\DimensionspecDAO.java | 1 |
请完成以下Java代码 | public Builder addAllowedWriteOffType(final InvoiceWriteOffAmountType allowedWriteOffType)
{
Check.assumeNotNull(allowedWriteOffType, "allowedWriteOffType not null");
allowedWriteOffTypes.add(allowedWriteOffType);
return this;
}
public Builder setWarningsConsumer(final IProcessor<Exception> warningsCons... | {
this.filterPaymentId = filter_Payment_ID;
return this;
}
public Builder setFilter_POReference(String filterPOReference)
{
this.filterPOReference = filterPOReference;
return this;
}
public Builder allowPurchaseSalesInvoiceCompensation(final boolean allowPurchaseSalesInvoiceCompensation)
{
... | 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 MFColor setTextureTaintColor(final Color color)
{
if (!isTexture() || color == null)
{
return this;
}
return toBuilder().textureTaintColor(color).build();
}
public MFColor setTextureCompositeAlpha(final float alpha)
{
if (!isTexture())
{
return this;
}
return toBuilder().textureCompos... | public MFColor toFlatColor()
{
switch (getType())
{
case FLAT:
return this;
case GRADIENT:
return ofFlatColor(getGradientUpperColor());
case LINES:
return ofFlatColor(getLineBackColor());
case TEXTURE:
return ofFlatColor(getTextureTaintColor());
default:
throw new IllegalStateExc... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\util\MFColor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class FlowableIdmProperties {
/**
* Whether the idm engine needs to be started.
*/
private boolean enabled = true;
/**
* The type of the password encoder that needs to be used.
*/
private String passwordEncoder;
/**
* The servlet configuration for the IDM Rest API.... | return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getPasswordEncoder() {
return passwordEncoder;
}
public void setPasswordEncoder(String passwordEncoder) {
this.passwordEncoder = passwordEncoder;
}
public Flowa... | repos\flowable-engine-main\modules\flowable-spring-boot\flowable-spring-boot-starters\flowable-spring-boot-autoconfigure\src\main\java\org\flowable\spring\boot\idm\FlowableIdmProperties.java | 2 |
请完成以下Java代码 | public void init(TbActorCtx ctx) throws TbActorException {
super.init(ctx);
log.debug("[{}] Starting CF manager actor.", processor.tenantId);
try {
processor.init(ctx);
log.debug("[{}] CF manager actor started.", processor.tenantId);
} catch (Exception e) {
... | processor.onStatePartitionRestoreMsg((CalculatedFieldStatePartitionRestoreMsg) msg);
break;
case CF_ENTITY_LIFECYCLE_MSG:
processor.onEntityLifecycleMsg((CalculatedFieldEntityLifecycleMsg) msg);
break;
case CF_ENTITY_ACTION_EVENT_MSG:
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\actors\calculatedField\CalculatedFieldManagerActor.java | 1 |
请完成以下Java代码 | public class JpaUserSettingsDao implements UserSettingsDao, TenantEntityDao<UserSettings> {
@Autowired
private UserSettingsRepository userSettingsRepository;
@Override
public UserSettings save(TenantId tenantId, UserSettings userSettings) {
log.trace("save [{}][{}]", tenantId, userSettings);
... | }
@Override
public void removeByUserId(TenantId tenantId, UserId userId) {
userSettingsRepository.deleteByUserId(userId.getId());
}
@Override
public List<UserSettings> findByTypeAndPath(TenantId tenantId, UserSettingsType type, String... path) {
log.trace("findByTypeAndPath [{}][{}... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\user\JpaUserSettingsDao.java | 1 |
请完成以下Java代码 | private void onPharmaProductImported(@NonNull final I_I_Product iproduct, @NonNull final I_M_Product product )
{
product.setIsPrescription(iproduct.isPrescription());
product.setIsNarcotic(iproduct.isNarcotic());
product.setIsColdChain(iproduct.isColdChain());
product.setIsTFG(iproduct.isTFG());
if (!Check.... | final TaxCategoryQuery query = TaxCategoryQuery.builder()
.type(VATType.RegularVAT)
.countryId(Services.get(ICountryDAO.class).getDefaultCountryId())
.build();
final ProductPriceCreateRequest request = ProductPriceCreateRequest.builder()
.price(importRecord.getA01APU())
.priceListId(importRecord... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma\src\main\java\de\metas\impexp\product\PharmaImportProductInterceptor.java | 1 |
请完成以下Java代码 | public int getShipment_MailText_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Shipment_MailText_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_AD_PrintFormat getShipment_PrintFormat() throws RuntimeException
{
return (I_AD_PrintFormat)MTable.get(getCtx(), I_AD_PrintFormat.Tabl... | set_Value (COLUMNNAME_Shipment_PrintFormat_ID, null);
else
set_Value (COLUMNNAME_Shipment_PrintFormat_ID, Integer.valueOf(Shipment_PrintFormat_ID));
}
/** Get Shipment Print Format.
@return Print Format for Shipments, Receipts, Pick Lists
*/
public int getShipment_PrintFormat_ID ()
{
Integer ii = (In... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_PrintForm.java | 1 |
请完成以下Java代码 | private Optional<PriceListVersion> getPriceListVersion(
@NonNull final ExternalIdentifier priceListVersionIdentifier,
@NonNull final String orgCode)
{
return getPriceListVersionId(priceListVersionIdentifier, orgCode)
.map(priceListVersionRepository::getPriceListVersionById);
}
@NonNull
public PriceList... | @NonNull final PriceListVersionId priceListVersionId)
{
Check.assume(externalPriceListVersionIdentifier.getType().equals(ExternalIdentifier.Type.EXTERNAL_REFERENCE), "ExternalIdentifier must be of type external reference.");
final ExternalReferenceValueAndSystem externalReferenceValueAndSystem = externalPriceList... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\pricing\PriceListRestService.java | 1 |
请完成以下Java代码 | public class UndeployProcessArchiveStep extends DeploymentOperationStep {
protected String processArchvieName;
protected JmxManagedProcessApplication deployedProcessApplication;
protected ProcessArchiveXml processArchive;
protected String processEngineName;
public UndeployProcessArchiveStep(JmxManagedProces... | final Map<String, DeployedProcessArchive> processArchiveDeploymentMap = deployedProcessApplication.getProcessArchiveDeploymentMap();
final DeployedProcessArchive deployedProcessArchive = processArchiveDeploymentMap.get(processArchive.getName());
final ProcessEngine processEngine = serviceContainer.getServiceVal... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\container\impl\deployment\UndeployProcessArchiveStep.java | 1 |
请完成以下Java代码 | public void add(@NonNull final PickFromHU pickFromHU) {list.add(pickFromHU);}
public List<I_M_HU> toHUsList() {return list.stream().map(PickFromHU::toM_HU).collect(ImmutableList.toImmutableList());}
public PickFromHU getSingleHU() {return CollectionUtils.singleElement(list);}
public boolean isSingleHUAlreadyPa... | private static class HuPackingInstructionsIdAndCaptionAndCapacity
{
@NonNull HuPackingInstructionsId huPackingInstructionsId;
@NonNull String caption;
@Nullable Capacity capacity;
@Nullable
public Capacity getCapacityOrNull() {return capacity;}
@SuppressWarnings("unused")
@NonNull
public Optional<Cap... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\candidate\commands\PackToHUsProducer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PInstanceId implements RepoIdAware
{
int repoId;
@JsonCreator
public static PInstanceId ofRepoId(final int repoId)
{
return new PInstanceId(repoId);
}
public static PInstanceId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? new PInstanceId(repoId) : null;
}
public static Optional<PI... | private PInstanceId(final int adPInstanceId)
{
repoId = Check.assumeGreaterThanZero(adPInstanceId, "adPInstanceId");
}
@JsonValue
public int toJson()
{
return getRepoId();
}
public static boolean equals(final PInstanceId o1, final PInstanceId o2)
{
return Objects.equals(o1, o2);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\process\PInstanceId.java | 2 |
请完成以下Java代码 | public void getFile(String remoteFile, String localTargetDirectory) {
Connection conn = new Connection(ip, port);
try {
conn.connect();
boolean isAuthenticated = conn.authenticateWithPassword(username, password);
if (!isAuthenticated) {
System.err.println("authentication failed");
}
SCPClient cli... | conn.connect();
boolean isAuthenticated = conn.authenticateWithPassword(username, password);
if (!isAuthenticated) {
System.err.println("authentication failed");
}
SCPClient client = new SCPClient(conn);
if (StringUtils.isBlank(mode)) {
mode = "0600";
}
if (remoteFileName == null) {
cli... | repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\maint\util\ScpClientUtil.java | 1 |
请完成以下Java代码 | private String getClientId(TbContext ctx) throws TbNodeException {
String clientId = mqttNodeConfiguration.isAppendClientIdSuffix() ?
mqttNodeConfiguration.getClientId() + "_" + ctx.getServiceId() :
mqttNodeConfiguration.getClientId();
int maxLength = mqttNodeConfiguratio... | @Override
public TbPair<Boolean, JsonNode> upgrade(int fromVersion, JsonNode oldConfiguration) throws TbNodeException {
boolean hasChanges = false;
switch (fromVersion) {
case 0:
String parseToPlainText = "parseToPlainText";
if (!oldConfiguration.has(parse... | repos\thingsboard-master\rule-engine\rule-engine-components\src\main\java\org\thingsboard\rule\engine\mqtt\TbMqttNode.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected static class IntegrationRSocketConfiguration {
/**
* Check if either an {@link IntegrationRSocketEndpoint} or
* {@link RSocketOutboundGateway} bean is available.
*/
static class AnyRSocketChannelAdapterAvailable extends AnyNestedCondition {
AnyRSocketChannelAdapterAvailable() {
super(Con... | }
else {
throw new IllegalStateException("Neither uri nor host and port is set");
}
clientRSocketConnector.setRSocketStrategies(rSocketStrategies);
return clientRSocketConnector;
}
/**
* Check if a remote address is configured for the RSocket Integration client.
*/
static class Re... | repos\spring-boot-4.0.1\module\spring-boot-integration\src\main\java\org\springframework\boot\integration\autoconfigure\IntegrationAutoConfiguration.java | 2 |
请完成以下Java代码 | public void setC_DocType_ID (int C_DocType_ID)
{
if (C_DocType_ID < 0)
set_Value (COLUMNNAME_C_DocType_ID, null);
else
set_Value (COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID));
}
/** Get Document Type.
@return Document type or rules
*/
public int getC_DocType_ID ()
{
Integer ii = (In... | /** Broadcast = B */
public static final String REPLICATIONTYPE_Broadcast = "B";
/** Set Replication Type.
@param ReplicationType
Type of Data Replication
*/
public void setReplicationType (String ReplicationType)
{
set_Value (COLUMNNAME_ReplicationType, ReplicationType);
}
/** Get Replication Type.
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_ReplicationDocument.java | 1 |
请完成以下Java代码 | private static Optional<DocumentLayoutElementDescriptor> getClearanceNoteLayoutElement(@NonNull final I_M_HU hu)
{
if (Check.isBlank(hu.getClearanceNote()))
{
return Optional.empty();
}
final boolean isDisplayedClearanceStatus = Services.get(ISysConfigBL.class).getBooleanValue(SYS_CONFIG_CLEARANCE, true);
... | @NonNull
private static DocumentLayoutElementDescriptor createClearanceNoteLayoutElement()
{
final ITranslatableString caption = Services.get(IMsgBL.class).translatable(I_M_HU.COLUMNNAME_ClearanceNote);
return DocumentLayoutElementDescriptor.builder()
.setCaption(caption)
.setWidgetType(DocumentFieldWidg... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\HUEditorRowAttributesHelper.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public R<List<Kv>> authRoutes(BladeUser user) {
if (Func.isEmpty(user) || user.getUserId() == 0L) {
return null;
}
return R.data(menuService.authRoutes(user));
}
/**
* 顶部菜单数据
*/
@GetMapping("/top-menu")
@ApiOperationSupport(order = 13)
@Operation(summary = "顶部菜单数据", description = "顶部菜单数据")
public R<... | @GetMapping("/grant-top-tree")
@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
@ApiOperationSupport(order = 14)
@Operation(summary = "顶部菜单树形结构", description = "顶部菜单树形结构")
public R<GrantTreeVO> grantTopTree(BladeUser user) {
GrantTreeVO vo = new GrantTreeVO();
vo.setMenu(menuService.grantTopTree(user));
return R.data(vo... | repos\SpringBlade-master\blade-service\blade-system\src\main\java\org\springblade\system\controller\MenuController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void setDetails(Object details) {
this.delegate.setDetails(details);
}
@Override
public Object getDetails() {
return this.delegate.getDetails();
}
@Override
public void setAuthenticated(boolean authenticated) {
this.delegate.setAuthenticated(authenticated);
}... | *
* @return the token value as a String
*/
public String tokenValue() {
return delegate.getToken().getTokenValue();
}
/**
* Extract Subject from JWT. Here, Subject is the user ID in UUID format.
*
* @return the user ID as a UUID
*/
public UUID userId() {
re... | repos\realworld-java21-springboot3-main\server\api\src\main\java\io\zhc1\realworld\config\AuthToken.java | 2 |
请完成以下Java代码 | public void clearCookies(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
String domain = getCookieDomain(httpServletRequest);
for (String cookieName : COOKIE_NAMES) {
clearCookie(httpServletRequest, httpServletResponse, domain, cookieName);
}
}
... | // if not explicitly defined, use top-level domain
domain = request.getServerName().toLowerCase();
// strip off leading www.
if (domain.startsWith("www.")) {
domain = domain.substring(4);
}
// if it isn't an IP address
if (!isIPv4Address(domain) && !isIPv6Addr... | repos\tutorials-master\jhipster-modules\jhipster-uaa\gateway\src\main\java\com\baeldung\jhipster\gateway\security\oauth2\OAuth2CookieHelper.java | 1 |
请完成以下Java代码 | public String getPreferenceType()
{
return preferenceType;
}
/**
* Show (Value) Preference Menu
*
* @return true if preference type is not {@link #NONE}.
*/
public boolean isShowPreference()
{
return !isNone();
}
public boolean isNone()
{
return this == NONE;
}
public boolean isClient()
{
... | public boolean isOrganization()
{
return this == ORGANIZATION;
}
public boolean isUser()
{
return this == USER;
}
/**
*
* @return true if this level allows user to view table record change log (i.e. this level is {@link #CLIENT})
*/
public boolean canViewRecordChangeLog()
{
return isClient();
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\permissions\UserPreferenceLevelConstraint.java | 1 |
请完成以下Java代码 | public boolean isAutoStartup() {
return this.autoStartup;
}
/**
* Specify the phase in which this component should be started
* and stopped. The startup order proceeds from lowest to highest, and
* the shutdown order is the reverse of that. By default this value is
* Integer.MAX_VAL... | synchronized (this.lifeCycleMonitor) {
if (this.running) {
logger.info("Stopping...");
doStop();
this.running = false;
logger.info("Stopped.");
}
}
}
@Override
public void stop(Runnable callback) {
sync... | repos\Activiti-develop\activiti-core\activiti-spring-boot-starter\src\main\java\org\activiti\spring\AbstractActivitiSmartLifeCycle.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DemoServiceImpl implements DemoService {
@Override
public String getOneResult(String methodName) {
return String.format("%s invoker success", methodName);
}
@Override
public List<String> getMultiResult(String methodName) {
List<String> list = new ArrayList<>(3);
... | List<User> list = new ArrayList<>();
for (int i = 0; i < 3; i++) {
int no = i + 1;
list.add(new User((long) no, "USER_" + no, "PWD_" + no, 18 + no));
}
return list;
}
@Override
public User findUserById(Long id) {
return new User(id, "USER_" + id, "PW... | repos\springboot-demo-master\webflux\src\main\java\com\et\webflux\DemoServiceImpl.java | 2 |
请完成以下Java代码 | private static Geometry buildPolygonFromCoordinates(List<Coordinate> coordinates) {
if (coordinates.size() == 2) {
Coordinate a = coordinates.get(0);
Coordinate c = coordinates.get(1);
coordinates.clear();
Coordinate b = new Coordinate(a.x, c.y);
Coor... | for (JsonElement element : array) {
return element.isJsonPrimitive();
}
return false;
}
private static boolean containsArrayWithPrimitives(JsonArray array) {
for (JsonElement element : array) {
if (!containsPrimitives(element.getAsJsonArray())) {
... | repos\thingsboard-master\common\util\src\main\java\org\thingsboard\common\util\geo\GeoUtil.java | 1 |
请完成以下Java代码 | public class CamundaScriptImpl extends BpmnModelElementInstanceImpl implements CamundaScript {
protected static Attribute<String> camundaScriptFormatAttribute;
protected static Attribute<String> camundaResourceAttribute;
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder ty... | super(instanceContext);
}
public String getCamundaScriptFormat() {
return camundaScriptFormatAttribute.getValue(this);
}
public void setCamundaScriptFormat(String camundaScriptFormat) {
camundaScriptFormatAttribute.setValue(this, camundaScriptFormat);
}
public String getCamundaResource() {
re... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\camunda\CamundaScriptImpl.java | 1 |
请完成以下Java代码 | public void setAD_Reference_ID (final int AD_Reference_ID)
{
if (AD_Reference_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_Reference_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_Reference_ID, AD_Reference_ID);
}
@Override
public int getAD_Reference_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_Reference... | {
return get_ValueAsString(COLUMNNAME_Name);
}
@Override
public void setValidFrom (final @Nullable java.sql.Timestamp ValidFrom)
{
set_Value (COLUMNNAME_ValidFrom, ValidFrom);
}
@Override
public java.sql.Timestamp getValidFrom()
{
return get_ValueAsTimestamp(COLUMNNAME_ValidFrom);
}
@Override
publi... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Ref_List.java | 1 |
请完成以下Java代码 | public class ConsumerPartitionPausedEvent extends KafkaEvent {
private static final long serialVersionUID = 1L;
private final TopicPartition partition;
/**
* Construct an instance with the provided source and partition.
* @param source the container instance that generated the event.
* @param container the ... | /**
* Return the paused partition.
* @return the partition.
* @since 3.3
*/
public TopicPartition getPartition() {
return this.partition;
}
@Override
public String toString() {
return "ConsumerPartitionPausedEvent [partition=" + this.partition + "]";
}
} | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\event\ConsumerPartitionPausedEvent.java | 1 |
请完成以下Java代码 | public JwkSourceReactiveJwtDecoderBuilder jwtProcessorCustomizer(
Consumer<ConfigurableJWTProcessor<JWKSecurityContext>> jwtProcessorCustomizer) {
Assert.notNull(jwtProcessorCustomizer, "jwtProcessorCustomizer cannot be null");
this.jwtProcessorCustomizer = jwtProcessorCustomizer;
return this;
}
/**
... | this.jwtProcessorCustomizer.accept(jwtProcessor);
return (jwt) -> {
if (jwt instanceof SignedJWT) {
return this.jwkSource.apply((SignedJWT) jwt)
.onErrorMap((e) -> new IllegalStateException("Could not obtain the keys", e))
.collectList()
.map((jwks) -> createClaimsSet(jwtProcessor, jwt, ne... | repos\spring-security-main\oauth2\oauth2-jose\src\main\java\org\springframework\security\oauth2\jwt\NimbusReactiveJwtDecoder.java | 1 |
请在Spring Boot框架中完成以下Java代码 | final class MethodSecuritySelector implements ImportSelector {
private static final boolean isDataPresent = ClassUtils
.isPresent("org.springframework.security.data.aot.hint.AuthorizeReturnObjectDataHintsRegistrar", null);
private static final boolean isWebPresent = ClassUtils
.isPresent("org.springframework.we... | }
return imports.toArray(new String[0]);
}
private static final class AutoProxyRegistrarSelector extends AdviceModeImportSelector<EnableMethodSecurity> {
private static final String[] IMPORTS = new String[] { AutoProxyRegistrar.class.getName(),
MethodSecurityAdvisorRegistrar.class.getName() };
private st... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\method\configuration\MethodSecuritySelector.java | 2 |
请完成以下Java代码 | public int getAD_User_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Node_ID.
@param Node_ID Node_ID */
@Override
public void setNode_ID (int Node_ID)
{
if (Node_ID < 0)
set_Value (COLUMNNAME_Node_ID, null); | else
set_Value (COLUMNNAME_Node_ID, Integer.valueOf(Node_ID));
}
/** Get Node_ID.
@return Node_ID */
@Override
public int getNode_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Node_ID);
if (ii == null)
return 0;
return ii.intValue();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_TreeBar.java | 1 |
请完成以下Java代码 | public void updateFromDocType(final I_C_RemittanceAdvice remittanceAdviceRecord, final ICalloutField field)
{
final DocTypeId docTypeId = DocTypeId.ofRepoIdOrNull(remittanceAdviceRecord.getC_DocType_ID());
if (docTypeId == null)
{
return;
}
final I_C_DocType docType = docTypeDAO.getById(docTypeId);
fin... | final RemittanceAdviceId remittanceAdviceId = RemittanceAdviceId.ofRepoId(record.getC_RemittanceAdvice_ID());
final RemittanceAdvice remittanceAdvice = remittanceAdviceRepository.getRemittanceAdvice(remittanceAdviceId);
remittanceAdvice.setProcessedFlag(record.isProcessed());
remittanceAdviceRepository.updateRe... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\remittanceadvice\interceptor\C_RemittanceAdvice.java | 1 |
请完成以下Java代码 | private JsonCreateReceiptsResponse createReceipts_0(@NonNull final JsonCreateReceiptsRequest jsonCreateReceiptsRequest)
{
final List<InOutId> createdReceiptIds = jsonCreateReceiptsRequest.getJsonCreateReceiptInfoList().isEmpty()
? ImmutableList.of()
: receiptService.updateReceiptCandidatesAndGenerateReceipts... | .map(InOutId::getRepoId)
.map(JsonMetasfreshId::of)
.collect(ImmutableList.toImmutableList());
final List<JsonMetasfreshId> jsonReturnIds = returnIds
.stream()
.map(InOutId::getRepoId)
.map(JsonMetasfreshId::of)
.collect(ImmutableList.toImmutableList());
return JsonCreateReceiptsResponse.b... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\receipt\ReceiptRestController.java | 1 |
请完成以下Java代码 | public String getPermsType() {
return permsType;
}
public void setPermsType(String permsType) {
this.permsType = permsType;
}
public java.lang.String getStatus() {
return status;
}
public void setStatus(java.lang.String status) {
this.status = status;
}
/*update_begin author:wuxianquan date:20190908... | }
public void setInternalOrExternal(boolean internalOrExternal) {
this.internalOrExternal = internalOrExternal;
}
/*update_end author:wuxianquan date:20190908 for:get set 方法 */
public boolean isHideTab() {
return hideTab;
}
public void setHideTab(boolean hideTab) {
this.hideTab = hideTab;
}
} | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\SysPermissionTree.java | 1 |
请完成以下Java代码 | public void inefficientUsage() throws SQLException {
for (int i = 0; i < 10000; i++) {
PreparedStatement preparedStatement = connection.prepareStatement(SQL);
preparedStatement.setInt(1, i);
preparedStatement.setString(2, "firstname" + i);
preparedStatement.setStr... | }
preparedStatement.executeBatch();
try {
connection.commit();
} catch (SQLException e) {
connection.rollback();
throw e;
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
p... | repos\tutorials-master\persistence-modules\core-java-persistence-4\src\main\java\com\baeldung\resusepreparedstatement\ReusePreparedStatement.java | 1 |
请完成以下Java代码 | public class TraditionalToHongKongChineseDictionary extends BaseChineseDictionary
{
static AhoCorasickDoubleArrayTrie<String> trie = new AhoCorasickDoubleArrayTrie<String>();
static
{
long start = System.currentTimeMillis();
String datPath = HanLP.Config.tcDictionaryRoot + "t2hk";
if... | saveDat(datPath, trie, t2hk.entrySet());
}
logger.info("繁体转香港繁体加载成功,耗时" + (System.currentTimeMillis() - start) + "ms");
}
public static String convertToHongKongTraditionalChinese(String traditionalChineseString)
{
return segLongest(traditionalChineseString.toCharArray(), trie);
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dictionary\ts\TraditionalToHongKongChineseDictionary.java | 1 |
请完成以下Java代码 | public int getM_InventoryLine_ID()
{
return get_ValueAsInt(COLUMNNAME_M_InventoryLine_ID);
}
@Override
public de.metas.material.dispo.model.I_MD_Candidate getMD_Candidate()
{
return get_ValueAsPO(COLUMNNAME_MD_Candidate_ID, de.metas.material.dispo.model.I_MD_Candidate.class);
}
@Override
public void setMD... | @Override
public void setMD_Candidate_StockChange_Detail_ID (final int MD_Candidate_StockChange_Detail_ID)
{
if (MD_Candidate_StockChange_Detail_ID < 1)
set_ValueNoCheck (COLUMNNAME_MD_Candidate_StockChange_Detail_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MD_Candidate_StockChange_Detail_ID, MD_Candidate_... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java-gen\de\metas\material\dispo\model\X_MD_Candidate_StockChange_Detail.java | 1 |
请完成以下Java代码 | public final class PreAuthorizeReactiveAuthorizationManager
implements ReactiveAuthorizationManager<MethodInvocation>, MethodAuthorizationDeniedHandler {
private final PreAuthorizeExpressionAttributeRegistry registry = new PreAuthorizeExpressionAttributeRegistry();
public PreAuthorizeReactiveAuthorizationManager(... | * by evaluating an expression from the {@link PreAuthorize} annotation.
* @param authentication the {@link Mono} of the {@link Authentication} to check
* @param mi the {@link MethodInvocation} to check
* @return a {@link Mono} of the {@link AuthorizationResult} or an empty {@link Mono}
* if the {@link PreAuthor... | repos\spring-security-main\core\src\main\java\org\springframework\security\authorization\method\PreAuthorizeReactiveAuthorizationManager.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class LogAspect {
@Autowired
private SysLogDao sysLogDao;
@Pointcut("@annotation(com.springboot.annotation.Log)")
public void pointcut() {
}
@Around("pointcut()")
public void around(ProceedingJoinPoint point) {
long beginTime = System.currentTimeMillis();
try {
// 执行方法
point.proceed();
} ca... | LocalVariableTableParameterNameDiscoverer u = new LocalVariableTableParameterNameDiscoverer();
String[] paramNames = u.getParameterNames(method);
if (args != null && paramNames != null) {
String params = "";
for (int i = 0; i < args.length; i++) {
params += " " + paramNames[i] + ": " + args[i];
}
s... | repos\SpringAll-master\07.Spring-Boot-AOP-Log\src\main\java\com\springboot\aspect\LogAspect.java | 2 |
请完成以下Java代码 | public static void doEvent(String path, Document obj) throws Exception {
String[] pathArray = path.split("/");
if (pathArray.length != 4) {
logger.info("path 格式不正确: {}", path);
return;
}
Method method = handlerMap.get(path);
Object schema = instanceMap.get... | public static Object getBean(String name) {
return getApplicationContext().getBean(name);
}
//通过class获取Bean.
public static <T> T getBean(Class<T> clazz) {
return getApplicationContext().getBean(clazz);
}
//通过name,以及Clazz返回指定的Bean
public static <T> T getBean(String name, Class<T... | repos\spring-boot-leaning-master\2.x_data\3-4 解决后期业务变动导致的数据结构不一致的问题\spring-boot-canal-mongodb-cascade\src\main\java\com\neo\util\SpringUtil.java | 1 |
请完成以下Java代码 | public class GetRenderedStartFormCmd implements Command<Object>, Serializable {
private static final long serialVersionUID = 1L;
protected String processDefinitionId;
protected String formEngineName;
public GetRenderedStartFormCmd(String processDefinitionId, String formEngineName) {
this.proce... | FormEngine formEngine = commandContext
.getProcessEngineConfiguration()
.getFormEngines()
.get(formEngineName);
if (formEngine == null) {
throw new ActivitiException("No formEngine '" + formEngineName + "' defined process engine configuration");
... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\cmd\GetRenderedStartFormCmd.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DataStoreConfig {
//Configuration for embededded data store through H2
@Bean
public DataSource dataSource() {
return new EmbeddedDatabaseBuilder()
.setType(EmbeddedDatabaseType.H2)
.setName("socketDB")
.addScript("classpath:schema.sql")
... | @Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
final LocalContainerEntityManagerFactoryBean bean = new LocalContainerEntityManagerFactoryBean();
bean.setDataSource(dataSource);
bean.setJpaVendorAdapter(jpaVendorAdapter());
bean.setPa... | repos\tutorials-master\spring-security-modules\spring-security-web-sockets\src\main\java\com\baeldung\springsecuredsockets\config\DataStoreConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void execute(QuartzJob quartzJob) throws Exception {
String jobName = quartzJob.getJobClassName().trim();
Date startDate = new Date();
String ymd = DateUtils.date2Str(startDate,DateUtils.yyyymmddhhmmss.get());
String identity = jobName + ymd;
//3秒后执行 只执行一次
// 代码逻辑说明: 定时任务立即执行,延迟3秒改成0.1秒-------
sta... | // 按新的cronExpression表达式构建一个新的trigger
CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(id).withSchedule(scheduleBuilder).build();
scheduler.scheduleJob(jobDetail, trigger);
} catch (SchedulerException e) {
throw new JeecgBootException("创建定时任务失败", e);
} catch (RuntimeException e) {
throw ne... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\quartz\service\impl\QuartzJobServiceImpl.java | 2 |
请完成以下Java代码 | public OrderLineId getOrderLineId() {return orderLineInfo.getOrderLineId();}
public Money getOrderLineNetAmt() {return orderLineInfo.getOrderLineNetAmt();}
public Quantity getQtyOrdered() {return orderLineInfo.getQtyOrdered();}
public ProductId getProductId() {return orderLineInfo.getProductId();}
public Curren... | 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 OrderCostCloneMapper mapper)
{
return toBuilder()
.id(null)
.... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\costs\OrderCostDetail.java | 1 |
请完成以下Java代码 | public class C_BPartner
{
/**
* If <code>C_InvoiceSchedule_ID</code> changes, then this MV calls {@link IInvoiceCandDAO#invalidateCandsForBPartnerInvoiceRule(org.compiere.model.I_C_BPartner)} to invalidate those ICs that
* might be concerned by the change.
*/
@ModelChange(timings = ModelValidator.TYPE_BEFORE_C... | /**
* Invalidate all invoice candidates of given partner, in case the header/line aggregation definitions were changed.
*/
@ModelChange(timings = ModelValidator.TYPE_AFTER_CHANGE,//
ifColumnsChanged = { I_C_BPartner.COLUMNNAME_PO_Invoice_Aggregation_ID, I_C_BPartner.COLUMNNAME_PO_InvoiceLine_Aggregation_ID, I_C... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\modelvalidator\C_BPartner.java | 1 |
请完成以下Java代码 | public static List<Integer> findPeaks(int[] arr) {
List<Integer> peaks = new ArrayList<>();
if (arr == null || arr.length == 0) {
return peaks;
}
findPeakElements(arr, 0, arr.length - 1, peaks, arr.length);
return peaks;
}
private static void findPeakElemen... | boolean isPeak = (mid == 0 || arr[mid] > arr[mid - 1]) && (mid == length - 1 || arr[mid] > arr[mid + 1]);
boolean isFirstInSequence = mid > 0 && arr[mid] == arr[mid - 1] && arr[mid] > arr[mid + 1];
if (isPeak || isFirstInSequence) {
if (!peaks.contains(arr[mid])) {
peaks.ad... | repos\tutorials-master\core-java-modules\core-java-collections-array-list-2\src\main\java\com\baeldung\peakelements\MultiplePeakFinder.java | 1 |
请完成以下Java代码 | public static void ensureChildElement(DomXmlElement parentElement, DomXmlElement childElement) {
Node parent = childElement.unwrap().getParentNode();
if (parent == null || !parentElement.unwrap().isEqualNode(parent)) {
throw LOG.elementIsNotChildOfThisElement(childElement, parentElement);
}
}
/**... | }
}
/**
* Ensure that the nodeList is either null or empty.
*
* @param nodeList the nodeList to ensure to be either null or empty
* @param expression the expression was used to fine the nodeList
* @throws SpinXPathException if the nodeList is either null or empty
*/
public static void ensureXPa... | repos\camunda-bpm-platform-master\spin\dataformat-xml-dom\src\main\java\org\camunda\spin\impl\xml\dom\util\DomXmlEnsure.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void addAuthorWithBooks() {
Author author = new Author();
author.setId(new AuthorId("Alicia Tom", 38));
author.setGenre("Anthology");
Book book1 = new Book();
book1.setIsbn("001-AT");
book1.setTitle("The book of swords");
Book book2 = new Book();
... | }
@Transactional(readOnly = true)
public void fetchAuthorByName() {
Author author = authorRepository.fetchByName("Alicia Tom");
System.out.println(author);
}
@Transactional
public void removeBookOfAuthor() {
Author author = authorRepository.fetchWithBooks(new ... | repos\Hibernate-SpringBoot-master\HibernateSpringBootCompositeKeyEmbeddable\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | protected final T _this() {
return (T) this;
}
/**
* Sets the {@code RelayState} parameter that will accompany this AuthNRequest
* @param relayState the relay state value, unencoded. if null or empty, the
* parameter will be removed from the map.
* @return this object
*/
public T relayState(Str... | */
public T authenticationRequestUri(String authenticationRequestUri) {
this.authenticationRequestUri = authenticationRequestUri;
return _this();
}
/**
* This is the unique id used in the {@link #samlRequest}
* @param id the SAML2 request id
* @return the {@link AbstractSaml2AuthenticationRequest.... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\provider\service\authentication\AbstractSaml2AuthenticationRequest.java | 2 |
请完成以下Java代码 | public Collection<Process> getProcesses() {
return processCollection.get(this);
}
public Collection<Decision> getDecisions() {
return decisionCollection.get(this);
}
public ExtensionElements getExtensionElements() {
return extensionElementsChild.getChild(this);
}
public void setExtensionEleme... | authorAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_AUTHOR)
.build();
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
importCollection = sequenceBuilder.elementCollection(Import.class)
.build();
caseFileItemDefinitionCollection = sequenceBuilder.elementCollection(CaseFi... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\DefinitionsImpl.java | 1 |
请完成以下Java代码 | private static Method getMainMethod(Class<?> application) throws Exception {
try {
return application.getDeclaredMethod("main", String[].class);
}
catch (NoSuchMethodException ex) {
return application.getDeclaredMethod("main");
}
}
public static void main(String[] args) throws Exception {
int require... | @Override
public void contextLoaded(ConfigurableApplicationContext context) {
throw new AbandonedRunException(context);
}
};
}
private <T> GenericApplicationContext run(ThrowingSupplier<T> action) {
try {
SpringApplication.withHook(this, action);
}
catch (AbandonedRunException ex) {
... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\SpringApplicationAotProcessor.java | 1 |
请完成以下Java代码 | public class HULoadException extends HUException
{
/**
*
*/
private static final long serialVersionUID = 6554990044648764732L;
private final IAllocationRequest request;
private final IAllocationResult result;
/**
*
* @param message
* @param request initial request
* @param result last load result, wh... | Check.assumeNotNull(request, "request not null");
this.request = request;
Check.assumeNotNull(result, "result not null");
this.result = result;
}
public IAllocationRequest getAllocationRequest()
{
return request;
}
public IAllocationResult getAllocationResult()
{
return result;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\exceptions\HULoadException.java | 1 |
请完成以下Java代码 | public void setMSV3_VerfuegbarkeitsanfrageEinzelneAntwort_ID (int MSV3_VerfuegbarkeitsanfrageEinzelneAntwort_ID)
{
if (MSV3_VerfuegbarkeitsanfrageEinzelneAntwort_ID < 1)
set_ValueNoCheck (COLUMNNAME_MSV3_VerfuegbarkeitsanfrageEinzelneAntwort_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MSV3_Verfuegbarkeits... | public static final int MSV3_VERFUEGBARKEITTYP_AD_Reference_ID=540817;
/** Spezifisch = Spezifisch */
public static final String MSV3_VERFUEGBARKEITTYP_Spezifisch = "Spezifisch";
/** Unspezifisch = Unspezifisch */
public static final String MSV3_VERFUEGBARKEITTYP_Unspezifisch = "Unspezifisch";
/** Set Verfuegbarke... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.vendor.gateway.msv3\src\main\java-gen\de\metas\vertical\pharma\vendor\gateway\msv3\model\X_MSV3_VerfuegbarkeitsanfrageEinzelneAntwort.java | 1 |
请完成以下Java代码 | protected void ensureProcessDefinitionAndTenantIdNotSet() {
if (processDefinitionId != null && isTenantIdSet) {
throw LOG.exceptionCorrelateMessageWithProcessDefinitionAndTenantId();
}
}
protected <T> T execute(Command<T> command) {
if(commandExecutor != null) {
return commandExecutor.execu... | }
public Map<String, Object> getCorrelationLocalVariables() {
return correlationLocalVariables;
}
public Map<String, Object> getPayloadProcessInstanceVariables() {
return payloadProcessInstanceVariables;
}
public VariableMap getPayloadProcessInstanceVariablesLocal() {
return payloadProcessInsta... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\MessageCorrelationBuilderImpl.java | 1 |
请完成以下Java代码 | public T get() throws InterruptedException, ExecutionException
{
latch.await();
return get0();
}
@Override
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
{
latch.await(timeout, unit);
return get0();
}
private T get0() throws ExecutionExceptio... | {
final CancellationException cancelException = new CancellationException(exception.getLocalizedMessage());
cancelException.initCause(exception);
throw cancelException;
}
//
// We got an error
if (exception != null)
{
throw new ExecutionException(exception);
}
return value;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\concurrent\FutureValue.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static class RetryConfig {
private int retries = 3;
private Set<HttpStatus.Series> series = new HashSet<>(List.of(HttpStatus.Series.SERVER_ERROR));
private Set<Class<? extends Throwable>> exceptions = new HashSet<>(
List.of(IOException.class, TimeoutException.class, RetryException.class));
privat... | public RetryConfig setCacheBody(boolean cacheBody) {
this.cacheBody = cacheBody;
return this;
}
}
public static class RetryException extends NestedRuntimeException {
private final ServerRequest request;
private final ServerResponse response;
RetryException(ServerRequest request, ServerResponse resp... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\filter\RetryFilterFunctions.java | 2 |
请完成以下Java代码 | public static void main(String[] args) {
final UserService userService = new UserServiceMapImpl();
post("/users", (request, response) -> {
response.type("application/json");
User user = new Gson().fromJson(request.body(), User.class);
userService.addUser(user);
... | User toEdit = new Gson().fromJson(request.body(), User.class);
User editedUser = userService.editUser(toEdit);
if (editedUser != null) {
return new Gson().toJson(new StandardResponse(StatusResponse.SUCCESS, new Gson().toJsonTree(editedUser)));
} else {
... | repos\tutorials-master\web-modules\spark-java\src\main\java\com\baeldung\sparkjava\SparkRestExample.java | 1 |
请完成以下Java代码 | public boolean isCreateAsActive ()
{
Object oo = get_Value(COLUMNNAME_IsCreateAsActive);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Depreciate.
@param IsDepreciated
The asset will be depreciated
... | @return The asset is owned by the organization
*/
public boolean isOwned ()
{
Object oo = get_Value(COLUMNNAME_IsOwned);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Track Issues.
@param IsTrackIssu... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Group.java | 1 |
请完成以下Java代码 | public BigDecimal getValueAsBigDecimal()
{
return getValue(COL::toBigDecimal);
}
private static BigDecimal toBigDecimal(final String valueStr)
{
if (valueStr == null || valueStr.trim().isEmpty())
{
return null;
}
try
{
return new BigDecimal(valueStr);
}
catch (final Exception e)
{
retur... | if (valueStr == null || valueStr.trim().isEmpty())
{
return null;
}
try
{
return Integer.parseInt(valueStr);
}
catch (final Exception e)
{
return null;
}
}
} | repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-filemaker\src\main\java\de\metas\common\filemaker\COL.java | 1 |
请完成以下Java代码 | public Set<DocumentId> retrieveRowIdsMatchingFilters(
@NonNull final ViewId viewId,
@NonNull final DocumentFilterList filters,
@NonNull final Set<DocumentId> rowIds)
{
if (rowIds.isEmpty())
{
return ImmutableSet.of();
}
final SqlViewRowsWhereClause sqlWhereClause = getSqlWhereClause(viewId, filter... | final HashSet<DocumentId> rowIds = new HashSet<>();
while (rs.next())
{
final DocumentId rowId = keyColumnNamesMap.retrieveRowId(rs);
if (rowId != null)
{
rowIds.add(rowId);
}
}
return rowIds;
}
catch (final Exception ex)
{
throw new DBException(ex, sql.getSql(), sql.getSqlPar... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\SqlViewDataRepository.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class StockEstimateDeletedHandler implements MaterialEventHandler<AbstractStockEstimateEvent>
{
private static final transient Logger logger = LogManager.getLogger(StockEstimateDeletedHandler.class);
private final StockEstimateEventService stockEstimateEventService;
private final CandidateChangeService candi... | }
final StockChangeDetail existingStockChangeDetail = StockChangeDetail.cast(businessCaseDetail)
.toBuilder()
.isReverted(true)
.build();
final CandidatesQuery query = CandidatesQuery.fromCandidate(candidateToDelete, false);
final I_MD_Candidate candidateRecord = RepositoryCommons
.mkQueryBuild... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-service\src\main\java\de\metas\material\dispo\service\event\handler\stockchange\StockEstimateDeletedHandler.java | 2 |
请完成以下Java代码 | public String getAuditmsg() {
return auditmsg;
}
public void setAuditmsg(String auditmsg) {
this.auditmsg = auditmsg;
}
public String getTrialstatus() {
return trialstatus;
}
public void setTrialstatus(String trialstatus) {
this.trialstatus = trialstatus;
}... | }
public void setEdittime(String edittime) {
this.edittime = edittime;
}
public String getStartdate() {
return startdate;
}
public void setStartdate(String startdate) {
this.startdate = startdate;
}
public String getEnddate() {
return enddate;
}
p... | repos\SpringBootBucket-master\springboot-batch\src\main\java\com\xncoding\trans\modules\vtoll\BudgetVtoll.java | 1 |
请完成以下Java代码 | public String getTenantId() {
return tenantId;
}
public boolean hasCorrelationParameterValues() {
return correlationParameterValues.size() > 0;
}
public Map<String, Object> getCorrelationParameterValues() {
return correlationParameterValues;
}
@Override
public void... | }
@Override
public void migrateToCaseDefinition(String caseDefinitionId) {
this.newCaseDefinitionId = caseDefinitionId;
checkValidInformation();
cmmnRuntimeService.migrateCaseInstanceStartEventSubscriptionsToCaseDefinitionVersion(this);
}
protected void checkValidInformation() ... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\runtime\CaseInstanceStartEventSubscriptionModificationBuilderImpl.java | 1 |
请完成以下Java代码 | public class Hash implements java.io.Serializable
{
/**
*
*/
private static final long serialVersionUID = 7635193444611108511L;
private Array keys = new Array();
private Array elements = new Array();
public Hash()
{
}
public void setSize(int newSize)
{
keys.setSize(newSize);... | {
try
{
elements.location(element);
return(true);
}
catch(org.apache.ecs.storage.NoSuchObjectException noSuchObject)
{
return false;
}
}
public Enumeration keys()
{
return keys;
}
public boolean containsKey... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\storage\Hash.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.