instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public C_AllocationLine_Builder paymentWriteOffAmt(final BigDecimal paymentWriteOffAmt)
{
allocLine.setPaymentWriteOffAmt(paymentWriteOffAmt);
return this;
}
public final C_AllocationLine_Builder skipIfAllAmountsAreZero()
{
this.skipIfAllAmountsAreZero = true;
return this;
}
private boolean isSkipBecaus... | {
if (isSkipBecauseAllAmountsAreZero())
{
return null;
}
//
// Get the allocation header, created & saved.
final I_C_AllocationHdr allocHdr = allocHdrSupplier.get();
Check.assumeNotNull(allocHdr, "Param 'allocHdr' not null");
Check.assume(allocHdr.getC_AllocationHdr_ID() > 0, "Param 'allocHdr' has C... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\allocation\api\C_AllocationLine_Builder.java | 1 |
请完成以下Java代码 | public class AutoPoiDictConfig implements AutoPoiDictServiceI {
final static String EXCEL_SPLIT_TAG = "_";
final static String TEMP_EXCEL_SPLIT_TAG = "---";
@Lazy
@Resource
private CommonAPI commonApi;
/**
* 通过字典查询easypoi,所需字典文本
*
* @Author:scott
* @since:2019-04-09
* @return
*/
@Override
public... | }
}
for (DictModel t : dictList) {
// 代码逻辑说明: [issues/4917]excel 导出异常---
if(t!=null && t.getText()!=null && t.getValue()!=null){
// 代码逻辑说明: [issues/I4MBB3]@Excel dicText字段的值有下划线时,导入功能不能正确解析---
if(t.getValue().contains(EXCEL_SPLIT_TAG)){
String val = t.getValue().replace(EXCEL_SPLIT_TAG,TEMP_EXC... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\config\AutoPoiDictConfig.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CachingAnnotationsAspect {
private static final Logger logger = LoggerFactory.getLogger(CachingAnnotationsAspect.class);
@Autowired
private CacheSupport cacheSupport;
private <T extends Annotation> List<T> getMethodAnnotations(AnnotatedElement ae, Class<T> annotationType) {
List<... | @Around("pointcut()")
public Object registerInvocation(ProceedingJoinPoint joinPoint) throws Throwable {
Method method = this.getSpecificmethod(joinPoint);
List<Cacheable> annotations = this.getMethodAnnotations(method, Cacheable.class);
Set<String> cacheSet = new HashSet<String>();
... | repos\spring-boot-student-master\spring-boot-student-cache-redis\src\main\java\com\xiaolyuh\redis\cache\CachingAnnotationsAspect.java | 2 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO (Properties ctx)
{
org.compiere.model.POInfo poi = org.compiere.model.POInfo.getPOInfo (ctx, Table_Name, get_TrxName());
return poi;
}
/** Set Beschreibung.
@param Description Beschreibung */
@Override
public void setDescription (java.lang.String De... | Integer ii = (Integer)get_Value(COLUMNNAME_M_PharmaProductCategory_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
@Override
public void setName (java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Nam... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma\src\main\java-gen\de\metas\vertical\pharma\model\X_M_PharmaProductCategory.java | 1 |
请完成以下Java代码 | public Optional<OrderId> getOrderId(@NonNull final JsonOrderRevertRequest request, @NonNull final MasterdataProvider masterdataProvider)
{
final OrgId orgId = masterdataProvider.getOrgId(request.getOrgCode());
final ExternalSystemId externalSystemId = masterdataProvider.getExternalSystemId(ExternalSystemType.ofVal... | final OrderQuery getOrderByExternalId = queryBuilder
.externalId(orderIdentifier.asExternalId())
.build();
return orderDAO.retrieveByOrderCriteria(getOrderByExternalId)
.map(I_C_Order::getC_Order_ID)
.map(OrderId::ofRepoId);
default:
throw new InvalidIdentifierException("Given Identi... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\order\sales\OrderService.java | 1 |
请完成以下Java代码 | public class EmployeeAlreadyExists_Exception
extends Exception
{
/**
* Java type that goes as soapenv:Fault detail element.
*
*/
private EmployeeAlreadyExists faultInfo;
/**
*
* @param faultInfo
* @param message
*/
public EmployeeAlreadyExists_Exception(String ... | * @param faultInfo
* @param cause
* @param message
*/
public EmployeeAlreadyExists_Exception(String message, EmployeeAlreadyExists faultInfo, Throwable cause) {
super(message, cause);
this.faultInfo = faultInfo;
}
/**
*
* @return
* returns fault bean: com.... | repos\tutorials-master\web-modules\jee-7\src\main\java\com\baeldung\jaxws\client\EmployeeAlreadyExists_Exception.java | 1 |
请完成以下Spring Boot application配置 | ##########################################################
################## 所有profile共有的配置 #################
##########################################################
################### spring配置 ###################
spring:
profiles:
active: dev
datasource:
url: jdbc:mysql://127.0.0.1:3306/test?serv... | #################################
######################## 开发环境profile ##########################
#####################################################################
spring:
profiles: dev
redis:
host: 127.0.0.1
port: 6379
database: 0
lettuce:
shutdown-timeout: 200ms
pool:
max... | repos\SpringBootBucket-master\springboot-redis\src\main\resources\application.yml | 2 |
请完成以下Java代码 | private I_MKTG_Consent getConsentRecord(@NonNull final ContactPersonId contactPersonId)
{
return queryBL.createQueryBuilder(I_MKTG_Consent.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_MKTG_Consent.COLUMNNAME_ConsentRevokedOn, null)
.addEqualsFilter(I_MKTG_Consent.COLUMNNAME_MKTG_ContactPerson_... | .addEqualsFilter(I_MKTG_ContactPerson.COLUMN_C_BPartner_Location_ID, bpLocationId.getRepoId())
.create()
.stream()
.map(ContactPersonRepository::toContactPerson)
.collect(ImmutableSet.toImmutableSet());
}
public Set<ContactPerson> getByUserId(@NonNull final UserId userId)
{
return queryBL
.cre... | repos\metasfresh-new_dawn_uat\backend\de.metas.marketing\base\src\main\java\de\metas\marketing\base\model\ContactPersonRepository.java | 1 |
请完成以下Java代码 | public static EmbeddedStorageManager initializeStorageWithCustomTypeAsRoot(Path directory, String root, List<Book> booksToStore) {
EmbeddedStorageManager storageManager = EmbeddedStorage.start(directory);
RootInstance rootInstance = new RootInstance(root);
storageManager.setRoot(rootInstance);
... | }
return storageManager;
}
public static EmbeddedStorageManager lazyLoadOrCreateStorageWithCustomTypeAsRoot(Path directory, String root, List<Book> booksToStore) {
EmbeddedStorageManager storageManager = EmbeddedStorage.start(directory);
if (storageManager.root() == null) {
... | repos\tutorials-master\persistence-modules\core-java-persistence-2\src\main\java\com\baeldung\microstream\StorageManager.java | 1 |
请完成以下Java代码 | public void setCharset(@Nullable Charset charset) {
this.charset = charset;
}
/**
* Set the name of the charset to use.
* @param charset the charset
* @deprecated since 4.1.0 for removal in 4.3.0 in favor of
* {@link #setCharset(Charset)}
*/
@Deprecated(since = "4.1.0", forRemoval = true)
public void s... | }
@Override
protected AbstractUrlBasedView createView(String viewName) {
MustacheView view = (MustacheView) super.createView(viewName);
view.setCompiler(this.compiler);
view.setCharset(this.charset);
return view;
}
@Override
protected AbstractUrlBasedView instantiateView() {
return (getViewClass() == M... | repos\spring-boot-main\module\spring-boot-mustache\src\main\java\org\springframework\boot\mustache\reactive\view\MustacheViewResolver.java | 1 |
请完成以下Java代码 | public void setSecureRandom(SecureRandom secureRandom) {
Assert.notNull(secureRandom, "secureRandom cannot be null");
this.secureRandom = secureRandom;
}
@Override
public void handle(ServerWebExchange exchange, Mono<CsrfToken> csrfToken) {
Assert.notNull(exchange, "exchange cannot be null");
Assert.notNull(... | // extract token and random bytes
byte[] xoredCsrf = new byte[tokenSize];
byte[] randomBytes = new byte[tokenSize];
System.arraycopy(actualBytes, 0, randomBytes, 0, tokenSize);
System.arraycopy(actualBytes, tokenSize, xoredCsrf, 0, tokenSize);
byte[] csrfBytes = xorCsrf(randomBytes, xoredCsrf);
return (cs... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\csrf\XorServerCsrfTokenRequestAttributeHandler.java | 1 |
请完成以下Java代码 | private void syncInvoiceRuleOverrideToCandidate(
@NonNull final NewManualInvoiceCandidateBuilder candidate,
@Nullable final JsonInvoiceRule invoiceRuleOverride)
{
candidate.invoiceRuleOverride(BPartnerCompositeRestUtils.getInvoiceRule(invoiceRuleOverride));
}
private void syncPriceEnteredOverrideToCandidate... | final UomId priceUomId;
try
{
priceUomId = uomDAO.getUomIdByX12DE355(uomCode);
}
catch (final AdempiereException e)
{
throw MissingResourceException.builder().resourceName("uom").resourceIdentifier("priceUomCode").parentResource(item).cause(e).build();
}
return priceUomId;
}
private InvoiceCandid... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v1\invoicecandidates\impl\CreateInvoiceCandidatesService.java | 1 |
请完成以下Java代码 | /* package */ IAutoCloseable lockForReading()
{
final ReadLock readLock = readwriteLock.readLock();
logger.debug("Acquiring read lock for {}: {}", this, readLock);
readLock.lock();
logger.debug("Acquired read lock for {}: {}", this, readLock);
return () -> {
readLock.unlock();
logger.debug("Released r... | *
* @see OutputType#getDefault()
*/
private OutputType getTargetOutputType()
{
final IDocumentFieldView formatField = parameters.getFieldViewOrNull(REPORT_PARAM_REPORT_FORMAT);
if (formatField != null)
{
final LookupValue outputTypeParamValue = formatField.getValueAs(LookupValue.class);
if (outputTy... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\process\adprocess\ADProcessInstanceController.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class AddCommentHandler implements CommandHandler<AddCommentResult, AddComment> {
private final AuthenticationService authenticationService;
private final ArticleRepository articleRepository;
private final CommentRepository commentRepository;
private final ConversionService conversionService;
... | var comment = Comment.builder()
.articleId(articleId)
.authorId(currentUserId)
.body(command.getBody())
.build();
var savedComment = commentRepository.save(comment);
var commentAssembly = commentRepository.findAssemblyById(currentUserId, ... | repos\realworld-backend-spring-master\service\src\main\java\com\github\al\realworld\application\command\AddCommentHandler.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void renameTableSequence(final Properties ctx, final String tableNameOld, final String tableNameNew)
{
//
// Rename the AD_Sequence
final I_AD_Sequence adSequence = retrieveTableSequenceOrNull(ctx, tableNameOld, ITrx.TRXNAME_ThreadInherited);
if (adSequence != null)
{
adSequence.setName(tableNameNe... | .addEqualsFilter(I_AD_Sequence.COLUMNNAME_IsTableID, false)
.addOnlyActiveRecordsFilter()
.create()
.firstOptional(I_AD_Sequence.class);
}
@Override
public DocSequenceId cloneToOrg(@NonNull final DocSequenceId fromDocSequenceId, @NonNull final OrgId toOrgId)
{
final I_AD_Sequence fromSequence = Inter... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\service\impl\SequenceDAO.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class RelatedDocuments
{
@NonNull RelatedDocumentsId id;
@NonNull String internalName;
@NonNull ITranslatableString caption;
@Nullable
ITranslatableString filterByFieldCaption;
@NonNull MQuery query;
@NonNull RelatedDocumentsTargetWindow targetWindow;
@NonNull Priority priority;
@Builder
private Relat... | public String toString()
{
return MoreObjects.toStringHelper(this)
.omitNullValues()
.add("id", id)
.add("internalName", internalName)
.add("caption", caption.getDefaultValue())
.add("filterByFieldCaption", filterByFieldCaption != null ? filterByFieldCaption.getDefaultValue() : null)
.add("ta... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\document\references\related_documents\RelatedDocuments.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public ResponseEntity<Student> create(@RequestBody Student student) throws URISyntaxException {
Student createdStudent = service.create(student);
URI uri = ServletUriComponentsBuilder.fromCurrentRequest()
.path("/{id}")
.buildAndExpand(createdStudent.getId())
.toUri(... | Student updatedStudent = service.update(id, student);
if (updatedStudent == null) {
return ResponseEntity.notFound().build();
} else {
return ResponseEntity.ok(updatedStudent);
}
}
@DeleteMapping("/{id}")
public ResponseEntity<Object> deleteStudent(@PathVaria... | repos\tutorials-master\spring-web-modules\spring-boot-rest\src\main\java\com\baeldung\web\controller\students\StudentController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public static ESFieldName ofString(@NonNull final String name)
{
final String nameNorm = normalizeName(name);
if (nameNorm == null)
{
throw new AdempiereException("Invalid name `" + name + "`");
}
else if (ID.name.equals(name))
{
return ID;
}
else
{
return new ESFieldName(nameNorm);
}
}
... | return StringUtils.trimBlankToNull(name);
}
@Override
@Deprecated
public String toString()
{
return getAsString();
}
public String getAsString()
{
return name;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.elasticsearch\src\main\java\de\metas\fulltextsearch\config\ESFieldName.java | 2 |
请完成以下Java代码 | public HostInfo getCurrentKafkaStreamsApplicationHostInfo() {
Properties streamsConfiguration = this.streamsBuilderFactoryBean
.getStreamsConfiguration();
if (streamsConfiguration != null && streamsConfiguration.containsKey("application.server")) {
String applicationServer = (String) streamsConfiguration.get... | }
catch (RetryException ex) {
throw new IllegalStateException("Error when retrieving state store.", ex.getCause());
}
}
private <K> HostInfo getActiveHost(String store, K key, Serializer<K> serializer) throws RetryException {
return Objects.requireNonNull(this.retryTemplate.execute(() -> {
KeyQueryMetada... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\streams\KafkaStreamsInteractiveQueryService.java | 1 |
请完成以下Java代码 | public void warn(Marker marker, String msg) {
logger.warn(marker, mdcValue(msg));
}
@Override
public void warn(Marker marker, String format, Object arg) {
logger.warn(marker, mdcValue(format), arg);
}
@Override
public void warn(Marker marker, String format, Object arg1, Object ... | logger.error(marker, mdcValue(format), arg);
}
@Override
public void error(Marker marker, String format, Object arg1, Object arg2) {
logger.error(marker, mdcValue(format), arg1, arg2);
}
@Override
public void error(Marker marker, String format, Object... arguments) {
logger.err... | repos\spring-boot-student-master\spring-boot-student-log\src\main\java\com\xiaolyuh\core\TrackLogger.java | 1 |
请完成以下Java代码 | public class ThreadDumpEndpoint {
private final PlainTextThreadDumpFormatter plainTextFormatter = new PlainTextThreadDumpFormatter();
@ReadOperation
public ThreadDumpDescriptor threadDump() {
return getFormattedThreadDump(ThreadDumpDescriptor::new);
}
@ReadOperation(produces = "text/plain;charset=UTF-8")
pub... | */
public static final class ThreadDumpDescriptor implements OperationResponseBody {
private final List<ThreadInfo> threads;
private ThreadDumpDescriptor(ThreadInfo[] threads) {
this.threads = Arrays.asList(threads);
}
public List<ThreadInfo> getThreads() {
return this.threads;
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\management\ThreadDumpEndpoint.java | 1 |
请完成以下Java代码 | public ImmutableSet<LocatorId> getLocatorIdsByRepoId(@NonNull final Collection<Integer> locatorIds)
{
return warehouseDAO.getLocatorIdsByRepoId(locatorIds);
}
@Override
public LocatorQRCode getLocatorQRCode(@NonNull final LocatorId locatorId)
{
final I_M_Locator locator = warehouseDAO.getLocatorById(locatorId... | }
else
{
final I_M_Locator locator = locators.get(0);
return ExplainedOptional.of(LocatorQRCode.ofLocator(locator));
}
}
@Override
public List<I_M_Locator> getActiveLocatorsByValue(final @NotNull String locatorValue)
{
return warehouseDAO.retrieveActiveLocatorsByValue(locatorValue);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\warehouse\api\impl\WarehouseBL.java | 1 |
请完成以下Java代码 | public void toStop(){
toStop = true;
// stop registryOrRemoveThreadPool
registryOrRemoveThreadPool.shutdownNow();
// stop monitir (interrupt and wait)
registryMonitorThread.interrupt();
try {
registryMonitorThread.join();
} catch (InterruptedException e) {
logger.error(e.getMessage(), e);
}
}
... | public ReturnT<String> registryRemove(RegistryParam registryParam) {
// valid
if (!StringUtils.hasText(registryParam.getRegistryGroup())
|| !StringUtils.hasText(registryParam.getRegistryKey())
|| !StringUtils.hasText(registryParam.getRegistryValue())) {
return new ReturnT<String>(ReturnT.FAIL_CODE, "Ill... | repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-xxljob\src\main\java\com\xxl\job\admin\core\thread\JobRegistryHelper.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ApiResponse<NursingService> getNursingServiceWithHttpInfo(String albertaApiKey, String _id) throws ApiException {
com.squareup.okhttp.Call call = getNursingServiceValidateBeforeCall(albertaApiKey, _id, null, null);
Type localVarReturnType = new TypeToken<NursingService>(){}.getType();
ret... | progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequest... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-patient-api\src\main\java\io\swagger\client\api\NursingServiceApi.java | 2 |
请完成以下Java代码 | public String getIBAN() {
return iban;
}
/**
* Sets the value of the iban property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setIBAN(String value) {
this.iban = value;
}
/**
* Gets the value of the... | * possible object is
* {@link GenericAccountIdentification1 }
*
*/
public GenericAccountIdentification1 getOthr() {
return othr;
}
/**
* Sets the value of the othr property.
*
* @param value
* allowed object is
* {@link GenericAccountIde... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\AccountIdentification4Choice.java | 1 |
请完成以下Java代码 | public XmlTransport withMod(@Nullable final TransportMod transportMod)
{
if (transportMod == null)
{
return this;
}
final XmlTransportBuilder builder = toBuilder();
if (transportMod.getFrom() != null)
{
builder.from(transportMod.getFrom());
}
final List<String> replacementViaEANs = transportMod... | .max(Comparator.naturalOrder())
.orElse(0);
for (final String additionalViaEAN : additionalViaEANs)
{
currentMaxSeqNo += 1;
final XmlVia xmlVia = XmlVia.builder()
.via(additionalViaEAN)
.sequenceId(currentMaxSeqNo)
.build();
builder.via(xmlVia);
}
}
return builder
.... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_xversion\src\main\java\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_xversion\request\model\processing\XmlTransport.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getKanbanCardNumberRange1Start() {
return kanbanCardNumberRange1Start;
}
/**
* Sets the value of the kanbanCardNumberRange1Start property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setKanbanCardNumberRange1... | * {@link String }
*
*/
public String getKanbanCardNumberRange1End() {
return kanbanCardNumberRange1End;
}
/**
* Sets the value of the kanbanCardNumberRange1End property.
*
* @param value
* allowed object is
* {@link String }
*
*/
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\PackagingIdentificationType.java | 2 |
请完成以下Java代码 | public DataLoader<?, ?> getDataLoader() {
return this.dataLoader;
}
/**
* Return the keys for loading by the {@link org.dataloader.DataLoader}.
*/
public List<?> getKeys() {
return this.keys;
}
/**
* Return the list of values resolved by the {@link org.dataloader.DataLoader},
* or an empty list if no... | /**
* Set the list of resolved values by the {@link org.dataloader.DataLoader}.
* @param result the values resolved by the data loader
*/
public void setResult(List<?> result) {
this.result = result;
}
/**
* Return the {@link BatchLoaderEnvironment environment} given to the batch loading function.
*/
p... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\observation\DataLoaderObservationContext.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static class Config {
@NotEmpty
private List<String> sources = new ArrayList<>();
@NotNull
private RemoteAddressResolver remoteAddressResolver = new RemoteAddressResolver() {
};
public List<String> getSources() {
return sources;
}
public Config setSources(List<String> sources) {
this.so... | return this;
}
public Config setSources(String... sources) {
this.sources = Arrays.asList(sources);
return this;
}
public Config setRemoteAddressResolver(RemoteAddressResolver remoteAddressResolver) {
this.remoteAddressResolver = remoteAddressResolver;
return this;
}
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\handler\predicate\RemoteAddrRoutePredicateFactory.java | 2 |
请完成以下Java代码 | public class SunJaasKerberosClient implements KerberosClient {
private boolean debug = false;
private boolean multiTier = false;
private static final Log LOG = LogFactory.getLog(SunJaasKerberosClient.class);
@Override
public JaasSubjectHolder login(String username, String password) {
LOG.debug("Trying to aut... | static final class KerberosClientCallbackHandler implements CallbackHandler {
private String username;
private String password;
private KerberosClientCallbackHandler(String username, String password) {
this.username = username;
this.password = password;
}
@Override
public void handle(Callback[] ca... | repos\spring-security-main\kerberos\kerberos-core\src\main\java\org\springframework\security\kerberos\authentication\sun\SunJaasKerberosClient.java | 1 |
请完成以下Java代码 | public String toString()
{
return String.valueOf(value);
}
@Override
public int hashCode()
{
return value;
}
@Override
public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj instanceof MutableInt)
{
final MutableInt other = (MutableInt)obj;
return value ==... | return value;
}
public int decrementAndGet()
{
value--;
return value;
}
public int incrementIf(final boolean condition)
{
if (condition)
{
value++;
}
return value;
}
public boolean isZero()
{
return value == 0;
}
public boolean isGreaterThanZero()
{
return value > 0;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\lang\MutableInt.java | 1 |
请完成以下Java代码 | List<ArticleWithAuthor> articleRightJoinAuthor() {
String query = String.format(QUERY_TEMPLATE, "RIGHT JOIN");
return executeQuery(query);
}
List<ArticleWithAuthor> articleFullJoinAuthor() {
String query = String.format(QUERY_TEMPLATE, "FULL JOIN");
... | }
return null;
}
private List<ArticleWithAuthor> mapToList(ResultSet resultSet) throws SQLException {
List<ArticleWithAuthor> list = new ArrayList<>();
while (resultSet.next()) {
ArticleWithAuthor articleWithAuthor = new ArticleWit... | repos\tutorials-master\persistence-modules\core-java-persistence-4\src\main\java\com\baeldung\joins\ArticleWithAuthorDAO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ShipmentCosts
{
//
// P_Asset -> P_COGS
@NonNull CostAmountAndQty shippedButNotNotified;
@Builder
private ShipmentCosts(
@NonNull final CostAmountAndQty shippedButNotNotified)
{
this.shippedButNotNotified = Check.assumeNotNull(shippedButNotNotified, "shippedButNotNotified");
}
public static ... | }
public interface CostAmountAndQtyAndTypeMapper
{
CostDetailCreateResult shippedButNotNotified(CostAmountAndQty amtAndQty, CostAmountType type);
}
public CostDetailCreateResultsList toCostDetailCreateResultsList(@NonNull final CostAmountAndQtyAndTypeMapper mapper)
{
final ArrayList<CostDetailCreateResult> r... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\ShipmentCosts.java | 2 |
请完成以下Java代码 | public class EntityTypes {
public static final String APPLICATION = "Application";
public static final String ATTACHMENT = "Attachment";
public static final String AUTHORIZATION = "Authorization";
public static final String FILTER = "Filter";
public static final String GROUP = "Group";
public static final ... | public static final String TENANT_MEMBERSHIP = "TenantMembership";
public static final String BATCH = "Batch";
public static final String DECISION_REQUIREMENTS_DEFINITION = "DecisionRequirementsDefinition";
public static final String DECISION_INSTANCE = "DecisionInstance";
public static final String REPORT = "R... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\EntityTypes.java | 1 |
请完成以下Java代码 | private String toSummaryString(final DataImportResult importResult)
{
final StringBuilder result = new StringBuilder();
result.append("@IsImportScheduled@");
final InsertIntoImportTableResult insertIntoImportTable = importResult.getInsertIntoImportTable();
if (insertIntoImportTable != null)
{
result.appe... | {
return p_AD_AttachmentEntry_ID;
}
private DataImportConfigId getDataImportConfigId()
{
return DataImportConfigId.ofRepoId(getRecord_ID());
}
private void deleteAttachmentEntry()
{
final AttachmentEntry attachmentEntry = attachmentEntryService.getById(getAttachmentEntryId());
attachmentEntryService.una... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\process\C_DataImport_ImportAttachment.java | 1 |
请完成以下Java代码 | public String getTenantIdLike() {
return tenantIdLike;
}
public boolean isWithoutTenantId() {
return withoutTenantId;
}
public String getNameLikeIgnoreCase() {
return nameLikeIgnoreCase;
}
public List<HistoricProcessInstanceQueryImpl> getOrQueryObjects() {
retu... | return involvedGroups;
}
public HistoricProcessInstanceQuery involvedGroupsIn(List<String> involvedGroups) {
if (involvedGroups == null || involvedGroups.isEmpty()) {
throw new ActivitiIllegalArgumentException("Involved groups list is null or empty.");
}
if (inOrStatement) ... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\HistoricProcessInstanceQueryImpl.java | 1 |
请完成以下Java代码 | public final IQualityInspectionLineBuilder setNegateQty(final boolean negateQty)
{
_negateQty = negateQty;
return this;
}
protected final boolean isNegateQty()
{
return _negateQty;
}
@Override
public final IQualityInspectionLineBuilder setQtyProjected(final BigDecimal qtyProjected)
{
_qtyProjected = q... | {
return _name;
}
private IHandlingUnitsInfo getHandlingUnitsInfoToSet()
{
if (_handlingUnitsInfoSet)
{
return _handlingUnitsInfo;
}
return null;
}
@Override
public IQualityInspectionLineBuilder setHandlingUnitsInfo(final IHandlingUnitsInfo handlingUnitsInfo)
{
_handlingUnitsInfo = handlingUnit... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\qualityBasedInvoicing\impl\QualityInspectionLineBuilder.java | 1 |
请完成以下Java代码 | public Optional<Article> findBySlug(String slug) {
return articleJpaRepository.findBySlug(slug);
}
@Override
public List<Article> findByAuthors(Collection<User> authors, ArticleFacets facets) {
return articleJpaRepository
.findByAuthorInOrderByCreatedAtDesc(authors, PageRequ... | return new ArticleDetails(article, totalFavorites, favorited);
}
@Override
@Transactional
public void delete(Article article) {
articleCommentJpaRepository.deleteByArticle(article);
articleJpaRepository.delete(article);
}
@Override
public boolean existsBy(String title) {
... | repos\realworld-java21-springboot3-main\module\persistence\src\main\java\io\zhc1\realworld\persistence\ArticleRepositoryAdapter.java | 1 |
请完成以下Java代码 | protected String doIt()
{
final Plan plan = creatPlan().orElseThrow();
final PaymentAmtMultiplier amtMultiplier = plan.getAmtMultiplier();
final Amount amountToWriteOff = amtMultiplier.convertToRealValue(plan.getAmountToWriteOff());
paymentBL.paymentWriteOff(
plan.getPaymentId(),
amountToWriteOff.toM... | }
return ExplainedOptional.of(
Plan.builder()
.paymentId(paymentRow.getPaymentId())
.amtMultiplier(paymentRow.getPaymentAmtMultiplier())
.amountToWriteOff(openAmt)
.build());
}
@Value
@Builder
private static class Plan
{
@NonNull PaymentId paymentId;
@NonNull PaymentAmtMultiplie... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\payment_allocation\process\PaymentsView_PaymentWriteOff.java | 1 |
请完成以下Java代码 | public static void jdkFlatMapping() {
System.out.println("Java flatMapping");
System.out.println("====================================");
java.util.stream.Stream.of(42).flatMap(i -> java.util.stream.Stream.generate(() -> {
System.out.println("nested call");
return 42;
... | vavredStream2.forEach(item -> System.out.println("Vavr Stream item after stream addition: " + item));
stringList.forEach(item -> System.out.println("List item after stream addition: " + item));
Stream<String> deletionStream = vavredStream.remove("bar");
deletionStream.forEach(item -> System.out.... | repos\tutorials-master\vavr-modules\vavr\src\main\java\com\baeldung\samples\java\vavr\VavrSampler.java | 1 |
请完成以下Java代码 | public String toString()
{
return "HUStorage [hu=" + hu + ", virtualHU=" + virtualHU + "]";
}
@Override
public I_C_UOM getC_UOMOrNull()
{
return dao.getC_UOMOrNull(hu);
}
@Override
public boolean isSingleProductWithQtyEqualsTo(@NonNull final ProductId productId, @NonNull final Quantity qty)
{
final Lis... | @Override
public boolean isSingleProductStorageMatching(@NonNull final ProductId productId)
{
final List<IHUProductStorage> productStorages = getProductStorages();
return isSingleProductStorageMatching(productStorages, productId);
}
private static boolean isSingleProductStorageMatching(@NonNull final List<IHUP... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\storage\impl\HUStorage.java | 1 |
请完成以下Java代码 | private static String encode(byte[] bytes) {
ByteArrayOutputStream result = new ByteArrayOutputStream(bytes.length);
for (byte b : bytes) {
if (isAllowed(b)) {
result.write(b);
}
else {
result.write('%');
result.write(Character.toUpperCase(Character.forDigit((b >> 4) & 0xF, 16)));
result.wr... | for (char allowed : ALLOWED) {
if (ch == allowed) {
return true;
}
}
return isAlpha(ch) || isDigit(ch);
}
private static boolean isAlpha(int ch) {
return (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z');
}
private static boolean isDigit(int ch) {
return (ch >= '0' && ch <= '9');
}
} | repos\spring-boot-4.0.1\loader\spring-boot-loader\src\main\java\org\springframework\boot\loader\nio\file\UriPathEncoder.java | 1 |
请完成以下Java代码 | protected String doIt() throws Exception
{
final UomId uomId = productBL.getStockUOMId(productId);
final StockQtyAndUOMQty levelMin = StockQtyAndUOMQtys.createConvert(this.levelMin, productId, uomId);
final StockQtyAndUOMQty levelMax = this.levelMax == null ? levelMin : StockQtyAndUOMQtys.createConvert(this.leve... | {
return materialNeedsPlannerRow.getWarehouseId();
}
else if (PARAM_Level_Min.equals(parameter.getColumnName()))
{
return materialNeedsPlannerRow.getLevelMin();
}
else if (PARAM_Level_Max.equals(parameter.getColumnName()))
{
return materialNeedsPlannerRow.getLevelMax();
}
else
{
return DEF... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\replenish\process\WEBUI_M_Replenish_Add_Update_Demand.java | 1 |
请完成以下Java代码 | private BPartnerLocationAndCaptureId getHandOverLocationEffectiveId(@NonNull final I_C_OLCand olCand)
{
return coalesceSuppliers(
() -> BPartnerLocationAndCaptureId.ofRepoIdOrNull(olCand.getHandOver_Partner_Override_ID(), olCand.getHandOver_Location_Override_ID(), olCand.getHandOver_Location_Override_Value_ID())... | {
final Quantity catchWeight = Quantity.of(olCand.getQtyShipped_CatchWeight(), uomDAO.getById(catchWeightUomId));
builder.uomQty(catchWeight);
}
return Optional.of(builder.build());
}
@Override
public Optional<BigDecimal> getManualQtyInPriceUOM(final @NonNull I_C_OLCand record)
{
return !InterfaceWrap... | repos\metasfresh-new_dawn_uat\backend\de.metas.salescandidate.base\src\main\java\de\metas\ordercandidate\api\impl\OLCandEffectiveValuesBL.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PmsProductAttributeCategoryController {
@Autowired
private PmsProductAttributeCategoryService productAttributeCategoryService;
@ApiOperation("添加商品属性分类")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestParam String nam... | @ApiOperation("获取单个商品属性分类信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<PmsProductAttributeCategory> getItem(@PathVariable Long id) {
PmsProductAttributeCategory productAttributeCategory = productAttributeCategoryService.getItem(id);
retur... | repos\mall-master\mall-admin\src\main\java\com\macro\mall\controller\PmsProductAttributeCategoryController.java | 2 |
请完成以下Java代码 | public I_C_UOM getC_UOM()
{
return storage.getC_UOM();
}
@Override
public BigDecimal getQtyAllocated()
{
return storage.getQtyFree();
}
@Override
public BigDecimal getQtyToAllocate()
{
return storage.getQty().toBigDecimal();
}
@Override
public Object getTrxReferencedModel()
{
return referenceMod... | @Override
public boolean isReadOnly()
{
return readonly;
}
@Override
public void setReadOnly(final boolean readonly)
{
this.readonly = readonly;
}
@Override
public I_M_HU_Item getInnerHUItem()
{
return null;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\document\impl\AbstractHUDocumentLine.java | 1 |
请完成以下Java代码 | public void setKeyInfo(KeyInfoType value) {
this.keyInfo = value;
}
/**
* Gets the value of the cipherData property.
*
* @return
* possible object is
* {@link CipherDataType }
*
*/
public CipherDataType getCipherData() {
return cipherData;
... | * Gets the value of the mimeType property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMimeType() {
return mimeType;
}
/**
* Sets the value of the mimeType property.
*
* @param value
* allowed object i... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\EncryptedType.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setIdentificationOfUse(String value) {
this.identificationOfUse = value;
}
/**
* Gets the value of the specialConditions property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSpecialConditions() {
retu... | * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the kanbanID property.
*
* <p>
* For example, to add a... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\AdditionalLineItemInformationType.java | 2 |
请完成以下Java代码 | public boolean checkPassword(String userId, String password) {
return getIdmIdentityService().checkPassword(userId, password);
}
@Override
public void deleteUser(String userId) {
getIdmIdentityService().deleteUser(userId);
}
@Override
public void setUserPicture(String userId, P... | }
@Override
public List<String> getUserInfoKeys(String userId) {
return getIdmIdentityService().getUserInfoKeys(userId);
}
@Override
public void setUserInfo(String userId, String key, String value) {
getIdmIdentityService().setUserInfo(userId, key, value);
}
@Override
... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\IdentityServiceImpl.java | 1 |
请完成以下Java代码 | class UnixDomainSocketClient {
public static void main(String[] args) throws Exception {
new UnixDomainSocketClient().runClient();
}
void runClient() throws IOException {
Path socketPath = Path.of(System.getProperty("user.home"))
.resolve("baeldung.socket");
UnixDomainSoc... | SocketChannel openSocketChannel(UnixDomainSocketAddress socketAddress) throws IOException {
SocketChannel channel = SocketChannel
.open(StandardProtocolFamily.UNIX);
channel.connect(socketAddress);
return channel;
}
void writeMessage(SocketChannel socketChannel, String message... | repos\tutorials-master\core-java-modules\core-java-networking-3\src\main\java\com\baeldung\socket\UnixDomainSocketClient.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JsonReaderCheckoutRequest
{
@Nullable String description;
@JsonProperty("return_url")
@Nullable String return_url;
@JsonProperty("total_amount")
@NonNull JsonAmount total_amount;
//
//
//
@Value
@Builder
@Jacksonized
public static class JsonAmount
{
/**
* Currency ISO 4217 code
*/ | @NonNull String currency;
int minor_unit;
int value;
public static JsonAmount ofAmount(@NonNull final Amount amount, @NonNull CurrencyPrecision precision)
{
final BigDecimal amountBD = precision.round(amount.toBigDecimal());
if (amountBD.compareTo(amount.toBigDecimal()) != 0)
{
throw new Adempier... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sumup\src\main\java\de\metas\payment\sumup\client\json\JsonReaderCheckoutRequest.java | 2 |
请完成以下Java代码 | public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
publ... | return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getDescription() {
... | repos\tutorials-master\spring-boot-modules\spring-boot-properties\src\main\java\com\baeldung\yaml\YAMLConfig.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public BigDecimal getBookedSeconds()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_BookedSeconds);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setComments (final @Nullable java.lang.String Comments)
{
set_Value (COLUMNNAME_Comments, Comments);
}
@Override
public java.la... | @Override
public void setS_Issue_ID (final int S_Issue_ID)
{
if (S_Issue_ID < 1)
set_Value (COLUMNNAME_S_Issue_ID, null);
else
set_Value (COLUMNNAME_S_Issue_ID, S_Issue_ID);
}
@Override
public int getS_Issue_ID()
{
return get_ValueAsInt(COLUMNNAME_S_Issue_ID);
}
@Override
public void setS_Time... | repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java-gen\de\metas\serviceprovider\model\X_S_TimeBooking.java | 2 |
请完成以下Java代码 | public void setAD_WF_Responsible(org.compiere.model.I_AD_WF_Responsible AD_WF_Responsible)
{
set_ValueFromPO(COLUMNNAME_AD_WF_Responsible_ID, org.compiere.model.I_AD_WF_Responsible.class, AD_WF_Responsible);
}
/** Set Workflow - Verantwortlicher.
@param AD_WF_Responsible_ID
Verantwortlicher für die Ausführun... | set_ValueNoCheck (COLUMNNAME_C_Doc_Responsible_ID, Integer.valueOf(C_Doc_Responsible_ID));
}
/** Get Document Responsible.
@return Document Responsible */
@Override
public int getC_Doc_Responsible_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Doc_Responsible_ID);
if (ii == null)
return 0;
re... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\workflow\model\X_C_Doc_Responsible.java | 1 |
请完成以下Java代码 | public ITrxItemExecutorBuilder<IT, RT> setProcessor(final ITrxItemProcessor<IT, RT> processor)
{
this._processor = processor;
return this;
}
private final ITrxItemProcessor<IT, RT> getProcessor()
{
Check.assumeNotNull(_processor, "processor is set");
return _processor;
}
@Override
public TrxItemExecuto... | {
this._onItemErrorPolicy = onItemErrorPolicy;
return this;
}
@Override
public ITrxItemExecutorBuilder<IT, RT> setItemsPerBatch(final int itemsPerBatch)
{
if (itemsPerBatch == Integer.MAX_VALUE)
{
this.itemsPerBatch = null;
}
else
{
this.itemsPerBatch = itemsPerBatch;
}
return this;
}
@O... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\processor\api\impl\TrxItemExecutorBuilder.java | 1 |
请完成以下Java代码 | public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getRole() {
return role;
}
public void setRole(Integer role) {
this.role = role;
} | public String getIdCard() {
return idCard;
}
public void setIdCard(String idCard) {
this.idCard = idCard;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
} | repos\springBoot-master\springboot-elasticsearch\src\main\java\cn\abel\bean\User.java | 1 |
请完成以下Java代码 | private IAutoCloseable updateLoggerContextFrom(final BusinessRuleTrigger trigger)
{
return logger.temporaryChangeContext(contextBuilder -> contextBuilder.triggerId(trigger.getId()));
}
private ImmutableList<BusinessRuleAndTriggers> getRuleAndTriggers()
{
return rules.getByTriggerTableId(sourceModelRef.getAdTab... | }
return matching;
}
private BooleanWithReason checkConditionMatching(@Nullable final Validation condition)
{
return condition == null || recordMatcher.isRecordMatching(sourceModelRef, condition)
? BooleanWithReason.TRUE
: BooleanWithReason.FALSE;
}
private void enqueueToRecompute(@NonNull final Bus... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\business_rule\trigger\BusinessRuleFireTriggersCommand.java | 1 |
请完成以下Java代码 | static I_C_UOM extractUOM(@NonNull final I_M_HU_PI_Item_Product itemProduct)
{
final I_C_UOM uom = extractUOMOrNull(itemProduct);
if (uom == null)
{
throw new AdempiereException("Cannot determine UOM of " + itemProduct.getName());
}
return uom;
}
I_M_HU_PI_Item_Product extractHUPIItemProduct(final I_C_... | if (orderLineRecord.getQtyItemCapacity().signum() > 0)
{
// we use the capacity which the goods were ordered in
qtyCUsPerTUInStockUOM = Quantitys.of(orderLineRecord.getQtyItemCapacity(), stockQty.getUomId());
}
else if (!lutuConfigurationInStockUOM.isInfiniteQtyCU())
{
// we make an educated guess, bas... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\IHUPIItemProductBL.java | 1 |
请完成以下Java代码 | public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getContinent() {
return continent;
}
public void setContinent(String continent) {
this.continent = continent == null ? null : continent.trim();
}
public String getRegion()... | }
public void setGnpold(Float gnpold) {
this.gnpold = gnpold;
}
public String getLocalname() {
return localname;
}
public void setLocalname(String localname) {
this.localname = localname == null ? null : localname.trim();
}
public String getGovernmentform() {
... | repos\spring-boot-quick-master\quick-modules\dao\src\main\java\com\modules\entity\Country.java | 1 |
请完成以下Java代码 | public List<Task> findTasksByQueryCriteria(TaskQueryImpl taskQuery) {
return taskDataManager.findTasksByQueryCriteria(taskQuery);
}
@Override
public List<Task> findTasksAndVariablesByQueryCriteria(TaskQueryImpl taskQuery) {
return taskDataManager.findTasksAndVariablesByQueryCriteria(taskQue... | TaskEntity task = findById(taskId);
if (task != null) {
if (task.getExecutionId() != null) {
throw new ActivitiException("The task cannot be deleted because is part of a running process");
}
deleteTask(task, deleteReason, cascade, cancel);
} else if ... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\TaskEntityManagerImpl.java | 1 |
请完成以下Java代码 | public Object run() {
RequestContext context = RequestContext.getCurrentContext();
context.getResponse().setCharacterEncoding("UTF-8");
String rewrittenResponse = rewriteBasePath(context);
if (context.getResponseGZipped()) {
try {
context.setResponseDataStre... | String basePath = requestUri.replace(Swagger2Controller.DEFAULT_URL, "");
map.put("basePath", basePath);
log.debug("Swagger-docs: rewritten Base URL with correct micro-service route: {}", basePath);
return mapper.writeValueAsString(map);
}
} catch (IOE... | repos\tutorials-master\jhipster-modules\jhipster-uaa\gateway\src\main\java\com\baeldung\jhipster\gateway\gateway\responserewriting\SwaggerBasePathRewritingFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class FormModelResponse {
protected String id;
protected String name;
protected String description;
protected String key;
protected int version;
protected List<FormField> fields;
protected List<FormOutcome> outcomes;
protected String outcomeVariableName;
public FormModelResp... | public void setKey(String key) {
this.key = key;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public List<FormField> getFields() {
return fields;
}
public void setFields(List<FormField> f... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\FormModelResponse.java | 2 |
请完成以下Java代码 | public class IpUtil {
private final static String UNKNOWN = "unknown";
private final static int MAX_LENGTH = 15;
/**
* 获取IP地址
* 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
* 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
*/
public s... | if (StrUtil.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (StrUtil.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (StrUtil.isEmpty(ip) || U... | repos\spring-boot-demo-master\demo-ratelimit-redis\src\main\java\com\xkcoding\ratelimit\redis\util\IpUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JsonQuery
{
@Nullable
@JsonProperty("field")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
String field;
@NonNull
@JsonProperty("type")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
QueryType queryType;
@ApiModelProperty("Depending on the query-type, you can have either a `value` or `parameters`.")
... | OperatorType operatorType;
@Nullable
@JsonProperty("queries")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
List<JsonQuery> jsonQueryList;
@Builder
public JsonQuery(
@JsonProperty("field") @Nullable final String field,
@JsonProperty("type") @NonNull final QueryType queryType,
@JsonProperty("parameters") ... | 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\model\JsonQuery.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public long getDateTimeIntervalStartTs(ZonedDateTime dateTime) {
long offset = getOffsetSafe();
ZonedDateTime shiftedNow = dateTime.minusSeconds(offset);
ZonedDateTime alignedStart = getAlignedBoundary(shiftedNow, false);
ZonedDateTime actualStart = alignedStart.plusSeconds(offset);
... | ZonedDateTime base = alignToIntervalStart(reference);
return next ? getNextIntervalStart(base) : base;
}
@Override
public void validate() {
try {
getZoneId();
} catch (Exception ex) {
throw new IllegalArgumentException("Invalid timezone in interval: " + ex.ge... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\cf\configuration\aggregation\single\interval\BaseAggInterval.java | 2 |
请在Spring Boot框架中完成以下Java代码 | static class ImmutablesJdbcConfiguration extends AbstractJdbcConfiguration {
private final ResourceLoader resourceLoader;
public ImmutablesJdbcConfiguration(ResourceLoader resourceLoader) {
this.resourceLoader = resourceLoader;
}
/**
* {@link JdbcConverter} that redirects entities to be instantiated to... | };
}
/**
* Returns if the entity passed as an argument is an interface the implementation provided by Immutable is provided
* instead. In all other cases the entity passed as an argument is returned.
*/
@SuppressWarnings("unchecked")
private <T> RelationalPersistentEntity<T> getImplementationEntity(Jd... | repos\spring-data-examples-main\jdbc\immutables\src\main\java\example\springdata\jdbc\immutables\Application.java | 2 |
请完成以下Java代码 | public boolean hasResponseToken() {
return this.ticketValidation != null && this.ticketValidation.responseToken() != null;
}
/**
* Gets the (Base64) encoded response token assuming one is available.
* @return encoded response token
*/
public String getEncodedResponseToken() {
if (!hasResponseToken()) {
... | /**
* Wraps an message using the gss context
* @param data the data
* @param offset data offset
* @param length data length
* @return the encrypted message
* @throws PrivilegedActionException if jaas throws and error
*/
public byte[] encrypt(final byte[] data, final int offset, final int length) throws P... | repos\spring-security-main\kerberos\kerberos-core\src\main\java\org\springframework\security\kerberos\authentication\KerberosServiceRequestToken.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static class ExecutorOneConfiguration {
@Bean(name = EXECUTOR_ONE_BEAN_NAME + "-properties")
@Primary
@ConfigurationProperties(prefix = "spring.task.execution-one") // 读取 spring.task.execution-one 配置到 TaskExecutionProperties 对象
public TaskExecutionProperties taskExecutionProperti... | }
private static TaskExecutorBuilder createTskExecutorBuilder(TaskExecutionProperties properties) {
// Pool 属性
TaskExecutionProperties.Pool pool = properties.getPool();
TaskExecutorBuilder builder = new TaskExecutorBuilder();
builder = builder.queueCapacity(pool.getQueueCapacity());... | repos\SpringBoot-Labs-master\lab-29\lab-29-async-two\src\main\java\cn\iocoder\springboot\lab29\asynctask\config\AsyncConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | ServerHttpMessageConvertersCustomizer serverConvertersCustomizer(
ObjectProvider<HttpMessageConverters> legacyConverters,
ObjectProvider<HttpMessageConverter<?>> converters) {
return new DefaultServerHttpMessageConvertersCustomizer(legacyConverters.getIfAvailable(),
converters.orderedStream().toList());
}
... | builder.withStringConverter(this.converter);
}
}
static class NotReactiveWebApplicationCondition extends NoneNestedConditions {
NotReactiveWebApplicationCondition() {
super(ConfigurationPhase.PARSE_CONFIGURATION);
}
@ConditionalOnWebApplication(type = Type.REACTIVE)
private static final class Reactiv... | repos\spring-boot-4.0.1\module\spring-boot-http-converter\src\main\java\org\springframework\boot\http\converter\autoconfigure\HttpMessageConvertersAutoConfiguration.java | 2 |
请完成以下Java代码 | public Pointcut getPointcut() {
return this.pointcut;
}
@Override
public Advice getAdvice() {
return this;
}
@Override
public boolean isPerInstance() {
return true;
}
/**
* Sets the {@link SecurityContextHolderStrategy} to use. The default action is to use
* the {@link SecurityContextHolderStrategy... | return returnedObject;
}
MethodSecurityExpressionHandler expressionHandler = this.registry.getExpressionHandler();
EvaluationContext ctx = expressionHandler.createEvaluationContext(this::getAuthentication, mi);
return expressionHandler.filter(returnedObject, attribute.getExpression(), ctx);
}
private Authent... | repos\spring-security-main\core\src\main\java\org\springframework\security\authorization\method\PostFilterAuthorizationMethodInterceptor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isReloadOnUpdate() {
return this.reloadOnUpdate;
}
public void setReloadOnUpdate(boolean reloadOnUpdate) {
this.reloadOnUpdate = reloadOnUpdate;
}
public static class Options {
/**
* Supported SSL ciphers.
*/
private @Nullable Set<String> ciphers;
/**
* Enabled SSL protocols.
... | /**
* The alias that identifies the key in the key store.
*/
private @Nullable String alias;
public @Nullable String getPassword() {
return this.password;
}
public void setPassword(@Nullable String password) {
this.password = password;
}
public @Nullable String getAlias() {
return this.ali... | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\ssl\SslBundleProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getLogLevel() {
return this.logLevel;
}
public void setLogLevel(String logLevel) {
this.logLevel = logLevel;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public OffHeapProperties getOffHeap() {
return this.offHeap;
}
public... | public String[] getRegionNames() {
return this.regionNames;
}
public void setRegionNames(String[] regionNames) {
this.regionNames = regionNames;
}
}
public static class OffHeapProperties {
private String memorySize;
private String[] regionNames = {};
public String getMemorySize() {
return th... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\configuration\support\CacheProperties.java | 2 |
请完成以下Java代码 | private AccountDimension newMinimalAccountDimension(final I_I_GLJournal importRecord, final int accountId)
{
return AccountDimension.builder()
.setAcctSchemaId(AcctSchemaId.ofRepoIdOrNull(importRecord.getC_AcctSchema_ID()))
.setAD_Client_ID(importRecord.getAD_Client_ID())
.setAD_Org_ID(importRecord.getAD... | @Override
protected String getTargetTableName()
{
return I_GL_Journal.Table_Name;
}
@Override
protected String getImportOrderBySql()
{
return "COALESCE(BatchDocumentNo, I_GLJournal_ID ||' '), COALESCE(JournalDocumentNo, " +
"I_GLJournal_ID ||' '), C_AcctSchema_ID, PostingType, C_DocType_ID, GL_Category_I... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\impexp\GLJournalImportProcess.java | 1 |
请完成以下Java代码 | public class LifecycleEventEntity extends EventEntity<LifecycleEvent> implements BaseEntity<LifecycleEvent> {
@Column(name = EVENT_TYPE_COLUMN_NAME)
private String eventType;
@Column(name = EVENT_SUCCESS_COLUMN_NAME)
private boolean success;
@Column(name = EVENT_ERROR_COLUMN_NAME)
private Strin... | @Override
public LifecycleEvent toData() {
return LifecycleEvent.builder()
.tenantId(TenantId.fromUUID(tenantId))
.entityId(entityId)
.serviceId(serviceId)
.id(id)
.ts(ts)
.lcEventType(eventType)
... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\model\sql\LifecycleEventEntity.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class EventSubscriptionResource {
@Autowired
protected CmmnRestResponseFactory restResponseFactory;
@Autowired
protected CmmnRuntimeService runtimeService;
@Autowired(required=false)
protected CmmnRestApiInterceptor restApiInterceptor;
@ApiOperation(value = "Get a single event... | })
@GetMapping(value = "/cmmn-runtime/event-subscriptions/{eventSubscriptionId}", produces = "application/json")
public EventSubscriptionResponse getEventSubscription(@ApiParam(name = "eventSubscriptionId") @PathVariable String eventSubscriptionId) {
EventSubscription eventSubscription = runtimeService.... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\caze\EventSubscriptionResource.java | 2 |
请完成以下Java代码 | public OAuth2AccessTokenResponse build() {
Instant issuedAt = getIssuedAt();
Instant expiresAt = getExpiresAt();
OAuth2AccessTokenResponse accessTokenResponse = new OAuth2AccessTokenResponse();
accessTokenResponse.accessToken = new OAuth2AccessToken(this.tokenType, this.tokenValue, issuedAt,
expiresAt,... | * value of 0. For these instances, default the expiresAt to +1 second from
* issuedAt time.
* @return
*/
private Instant getExpiresAt() {
if (this.expiresAt == null) {
Instant issuedAt = getIssuedAt();
this.expiresAt = (this.expiresIn > 0) ? issuedAt.plusSeconds(this.expiresIn) : issuedAt.plusSeco... | repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\endpoint\OAuth2AccessTokenResponse.java | 1 |
请完成以下Java代码 | private I_AD_Column getAD_Column()
{
I_AD_Column column = data.getAD_Column();
if (column != null && column.getAD_Table_ID() != adTableId)
{
logger.warn("Column '" + column.getColumnName()
+ "' (ID=" + column.getAD_Column_ID() + ") does not match AD_Table_ID from parent. Attempting to retrieve column by... | if (column == null)
{
final Properties ctx = InterfaceWrapperHelper.getCtx(data);
final String trxName = InterfaceWrapperHelper.getTrxName(data);
final String whereClause = I_AD_Column.COLUMNNAME_AD_Table_ID + "=?"
+ " AND " + I_AD_Column.COLUMNNAME_ColumnName + "=?";
column = new TypedSqlQuery<I_AD_... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\migration\executor\impl\MigrationDataExecutor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public JXlsExporter setLoader(final ClassLoader loader)
{
this._loader = loader;
return this;
}
public ClassLoader getLoader()
{
return _loader == null ? getClass().getClassLoader() : _loader;
}
public JXlsExporter setAD_Language(final String adLanguage)
{
this._adLanguage = adLanguage;
return this;
... | public JXlsExporter setDataSource(final IXlsDataSource dataSource)
{
this._dataSource = dataSource;
return this;
}
public JXlsExporter setResourceBundle(final ResourceBundle resourceBundle)
{
this._resourceBundle = resourceBundle;
return this;
}
private ResourceBundle getResourceBundle()
{
if (_resou... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\metasfresh-report-service\src\main\java\de\metas\report\xls\engine\JXlsExporter.java | 2 |
请完成以下Java代码 | public void setJSONPathShopwareID (final @Nullable java.lang.String JSONPathShopwareID)
{
set_Value (COLUMNNAME_JSONPathShopwareID, JSONPathShopwareID);
}
@Override
public java.lang.String getJSONPathShopwareID()
{
return get_ValueAsString(COLUMNNAME_JSONPathShopwareID);
}
@Override
public void setM_Frei... | {
return get_ValueAsInt(COLUMNNAME_M_PriceList_ID);
}
/**
* ProductLookup AD_Reference_ID=541499
* Reference name: _ProductLookup
*/
public static final int PRODUCTLOOKUP_AD_Reference_ID=541499;
/** Product Id = ProductId */
public static final String PRODUCTLOOKUP_ProductId = "ProductId";
/** Product N... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Config_Shopware6.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class FacebookService {
@Autowired
private FacebookClient facebookClient;
@Value("${facebook.app.secret}")
private String appSecret;
private static final Logger logger = Logger.getLogger(FacebookService.class.getName());
public User getUserProfile() {
try {
return... | } catch (Exception e) {
logger.log(Level.SEVERE,"Failed to post status: " + e.getMessage());
return null;
}
}
public void uploadPhotoToFeed() {
try (InputStream imageStream = getClass().getResourceAsStream("/static/image.jpg")) {
FacebookType response = faceb... | repos\tutorials-master\libraries-http-3\src\main\java\com\baeldung\facebook\FacebookService.java | 2 |
请完成以下Java代码 | public int getId() {
return id;
}
/**
* Sets the value of the id property.
*
*/
public void setId(int value) {
this.id = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
* ... | * Sets the value of the gender property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGender(String value) {
this.gender = value;
}
/**
* Gets the value of the created property.
*
* @return
* possible... | repos\tutorials-master\xml-modules\jaxb\src\main\java\com\baeldung\jaxb\gen\UserResponse.java | 1 |
请完成以下Java代码 | public abstract class AbstractValidatingPasswordEncoder implements PasswordEncoder {
@Override
public final @Nullable String encode(@Nullable CharSequence rawPassword) {
if (rawPassword == null) {
return null;
}
return encodeNonNullPassword(rawPassword.toString());
}
protected abstract String encodeNonNu... | return matchesNonNull(rawPassword.toString(), encodedPassword);
}
protected abstract boolean matchesNonNull(String rawPassword, String encodedPassword);
@Override
public final boolean upgradeEncoding(@Nullable String encodedPassword) {
if (encodedPassword == null || encodedPassword.length() == 0) {
return fa... | repos\spring-security-main\crypto\src\main\java\org\springframework\security\crypto\password\AbstractValidatingPasswordEncoder.java | 1 |
请完成以下Java代码 | public class X_AD_Ref_List_Trl extends org.compiere.model.PO implements I_AD_Ref_List_Trl, org.compiere.model.I_Persistent
{
private static final long serialVersionUID = -1050923734L;
/** Standard Constructor */
public X_AD_Ref_List_Trl (final Properties ctx, final int AD_Ref_List_Trl_ID, @Nullable final St... | {
set_Value (COLUMNNAME_Description, Description);
}
@Override
public java.lang.String getDescription()
{
return get_ValueAsString(COLUMNNAME_Description);
}
@Override
public void setIsTranslated (final boolean IsTranslated)
{
set_Value (COLUMNNAME_IsTranslated, IsTranslated);
}
@Override
public bo... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Ref_List_Trl.java | 1 |
请完成以下Java代码 | public boolean matches(HttpServletRequest request) {
for (RequestMatcher matcher : this.requestMatchers) {
if (matcher.matches(request)) {
return true;
}
}
return false;
}
/**
* Returns a {@link MatchResult} for this {@link HttpServletRequest}. In the case of a
* match, request variables are any ... | return false;
}
OrRequestMatcher that = (OrRequestMatcher) o;
return Objects.equals(this.requestMatchers, that.requestMatchers);
}
@Override
public int hashCode() {
return Objects.hash(this.requestMatchers);
}
@Override
public String toString() {
return "Or " + this.requestMatchers;
}
} | repos\spring-security-main\web\src\main\java\org\springframework\security\web\util\matcher\OrRequestMatcher.java | 1 |
请完成以下Java代码 | public class IntermediateThrowEventParseHandler extends AbstractActivityBpmnParseHandler<ThrowEvent> {
private static final Logger LOGGER = LoggerFactory.getLogger(IntermediateThrowEventParseHandler.class);
@Override
public Class<? extends BaseElement> getHandledType() {
return ThrowEvent.class;
... | //
// Seems not to be used anymore?
//
// protected CompensateEventDefinition createCompensateEventDefinition(BpmnParse bpmnParse, org.activiti.bpmn.model.CompensateEventDefinition eventDefinition, ScopeImpl scopeElement) {
// if (StringUtils.isNotEmpty(eventDefinition.getActivityRef())) {
// if (sc... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\bpmn\parser\handler\IntermediateThrowEventParseHandler.java | 1 |
请完成以下Java代码 | public List<Object> provideLineGroupingValues(final OLCand cand)
{
return ImmutableList.of();
}
}
@ToString
private static final class CompositeOLCandGroupingProvider implements IOLCandGroupingProvider
{
private final ImmutableList<IOLCandGroupingProvider> providers;
private CompositeOLCandGroupingProv... | this.validators = ImmutableList.copyOf(validators);
this.errorManager = errorManager;
}
/** @return {@code 0}. Actually, it doesn't matte for this validator. */
@Override
public int getSeqNo()
{
return 0;
}
/**
* Change {@link I_C_OLCand#COLUMN_IsError IsError}, {@link I_C_OLCand#COLUMN_ErrorMs... | repos\metasfresh-new_dawn_uat\backend\de.metas.salescandidate.base\src\main\java\de\metas\ordercandidate\api\OLCandSPIRegistry.java | 1 |
请完成以下Java代码 | private String getDescriptionPrefix(final I_C_Invoice_Candidate candidate)
{
final IBPartnerDAO bpartnerDAO = Services.get(IBPartnerDAO.class);
final int bpartnerId = candidate.getBill_BPartner_ID();
String descriptionPrefix = bpartnerId2descriptionPrefix.get(bpartnerId);
// Build descriptionPrefix if not a... | return descriptionPrefix;
}
private void setNetLineAmt(final IInvoiceLineRW invoiceLine)
{
final Quantity stockQty = invoiceLine.getQtysToInvoice().getStockQty();
final Quantity uomQty = invoiceLine.getQtysToInvoice().getUOMQtyOpt().orElse(stockQty);
final ProductPrice priceActual = invoiceLine.getPriceActua... | repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\de\metas\fresh\invoicecandidate\spi\impl\FreshQuantityDiscountAggregator.java | 1 |
请完成以下Java代码 | public class Reservation {
private LocalDate begin;
private LocalDate end;
@Valid
private Customer customer;
@Positive
private int room;
@ConsistentDateParameters
@ValidReservation
public Reservation(LocalDate begin, LocalDate end, Customer customer, int room) {
this.beg... | public LocalDate getEnd() {
return end;
}
public void setEnd(LocalDate end) {
this.end = end;
}
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public int getRoom() {
r... | repos\tutorials-master\javaxval\src\main\java\com\baeldung\javaxval\methodvalidation\model\Reservation.java | 1 |
请完成以下Java代码 | public int getAD_User_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_User_ID);
}
@Override
public void setAD_User_Occupation_Job_ID (final int AD_User_Occupation_Job_ID)
{
if (AD_User_Occupation_Job_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_User_Occupation_Job_ID, null);
else
set_ValueNoCheck (COLUMNNAME... | }
@Override
public void setCRM_Occupation(final org.compiere.model.I_CRM_Occupation CRM_Occupation)
{
set_ValueFromPO(COLUMNNAME_CRM_Occupation_ID, org.compiere.model.I_CRM_Occupation.class, CRM_Occupation);
}
@Override
public void setCRM_Occupation_ID (final int CRM_Occupation_ID)
{
if (CRM_Occupation_ID ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_User_Occupation_Job.java | 1 |
请完成以下Java代码 | public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException {
return new JcaExecutorServiceConnectionFactoryImpl(this, cxManager);
}
public Object createConnectionFactory() throws ResourceException {
throw new ResourceException("This resource adapter doesn't support non-mana... | }
public ResourceAdapter getResourceAdapter() {
return ra;
}
public void setResourceAdapter(ResourceAdapter ra) {
this.ra = ra;
}
@Override
public int hashCode() {
return 31;
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other == t... | repos\camunda-bpm-platform-master\javaee\jobexecutor-ra\src\main\java\org\camunda\bpm\container\impl\threading\ra\outbound\JcaExecutorServiceManagedConnectionFactory.java | 1 |
请完成以下Java代码 | public void setJSONPathSalesRepID (final @Nullable java.lang.String JSONPathSalesRepID)
{
set_Value (COLUMNNAME_JSONPathSalesRepID, JSONPathSalesRepID);
}
@Override
public java.lang.String getJSONPathSalesRepID()
{
return get_ValueAsString(COLUMNNAME_JSONPathSalesRepID);
}
@Override
public void setJSONPa... | if (M_PriceList_ID < 1)
set_Value (COLUMNNAME_M_PriceList_ID, null);
else
set_Value (COLUMNNAME_M_PriceList_ID, M_PriceList_ID);
}
@Override
public int getM_PriceList_ID()
{
return get_ValueAsInt(COLUMNNAME_M_PriceList_ID);
}
/**
* ProductLookup AD_Reference_ID=541499
* Reference name: _Produc... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Config_Shopware6.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean lockEventSubscription(String eventSubscriptionId) {
return getEventSubscriptionEntityManager().lockEventSubscription(eventSubscriptionId);
}
@Override
public void unlockEventSubscription(String eventSubscriptionId) {
getEventSubscriptionEntityManager().unlockEventSubscription... | public void deleteEventSubscriptionsForScopeDefinitionIdAndType(String scopeDefinitionId, String scopeType) {
getEventSubscriptionEntityManager().deleteEventSubscriptionsForScopeDefinitionIdAndType(scopeDefinitionId, scopeType);
}
@Override
public void deleteEventSubscriptionsForScopeDefinitionIdAn... | repos\flowable-engine-main\modules\flowable-eventsubscription-service\src\main\java\org\flowable\eventsubscription\service\impl\EventSubscriptionServiceImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private void updateDashboardAssignments(TenantId tenantId, CustomerId edgeCustomerId, Dashboard dashboardById, Dashboard savedDashboard, Set<ShortCustomerInfo> newAssignedCustomers) {
Set<ShortCustomerInfo> currentAssignedCustomers = new HashSet<>();
if (dashboardById != null) {
if (dashboar... | }
protected void deleteDashboard(TenantId tenantId, DashboardId dashboardId) {
deleteDashboard(tenantId, null, dashboardId);
}
protected void deleteDashboard(TenantId tenantId, Edge edge, DashboardId dashboardId) {
Dashboard dashboardById = edgeCtx.getDashboardService().findDashboardById(t... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\edge\rpc\processor\dashboard\BaseDashboardProcessor.java | 2 |
请完成以下Java代码 | public boolean isRequired() {
return required;
}
public void setRequired(boolean required) {
this.required = required;
}
public List<FormValue> getFormValues() {
return formValues;
}
public void setFormValues(List<FormValue> formValues) {
this.formValues = form... | public void setValues(FormProperty otherProperty) {
super.setValues(otherProperty);
setName(otherProperty.getName());
setExpression(otherProperty.getExpression());
setVariable(otherProperty.getVariable());
setType(otherProperty.getType());
setDefaultExpression(otherProper... | repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\FormProperty.java | 1 |
请完成以下Java代码 | public ProjectTypeId getFirstIdByProjectCategoryAndOrgOrNull(
@NonNull final ProjectCategory projectCategory,
@NonNull final OrgId orgId,
final boolean onlyCurrentOrg)
{
final IQueryBuilder<I_C_ProjectType> builder = queryBL.createQueryBuilderOutOfTrx(I_C_ProjectType.class)
.addOnlyActiveRecordsFilter()... | {
builder.addInArrayFilter(I_C_ProjectType.COLUMNNAME_AD_Org_ID, OrgId.ANY, orgId);
}
return builder
.create()
.firstId(ProjectTypeId::ofRepoIdOrNull);
}
public I_C_ProjectType getByName(final @NonNull String projectTypeValue)
{
return queryBL.createQueryBuilderOutOfTrx(I_C_ProjectType.class)
.... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\project\ProjectTypeRepository.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
/*@Bean
public ServletWebServerFactory servletContainer() {
TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
tomcat.addAdditionalTomcatConnectors(createSta... | SecurityConstraint securityConstraint = new SecurityConstraint();
securityConstraint.setUserConstraint("CONFIDENTIAL");
SecurityCollection collection = new SecurityCollection();
collection.addPattern("/*");
securityConstraint.addCollection(collection);
context.addConstraint(securityConstraint);
}... | repos\springboot-demo-master\https\src\main\java\com\et\https\DemoApplication.java | 2 |
请完成以下Java代码 | public boolean contains(String m) {
String text = this.value;
if (text.length() < m.length()) {
return false;
}
return text.toLowerCase().contains(m.toLowerCase());
}
/**
* 任意一个包含返回true
* <pre>
* containsAny("abcdef", "a", "b)
* 等价
* "abcdef"... | return !this.value.isEmpty();
}
@Override
public int length() {
return this.value.length();
}
@Override
public char charAt(int index) {
return this.value.charAt(index);
}
@Override
public CharSequence subSequence(int start, int end) {
return this.value.sub... | repos\SpringBootCodeGenerator-master\src\main\java\com\softdev\system\generator\entity\NonCaseString.java | 1 |
请完成以下Java代码 | public class TbFetchDeviceCredentialsNode extends TbAbstractNodeWithFetchTo<TbFetchDeviceCredentialsNodeConfiguration> {
private static final String CREDENTIALS = "credentials";
private static final String CREDENTIALS_TYPE = "credentialsType";
@Override
protected TbFetchDeviceCredentialsNodeConfigurat... | } else if (TbMsgSource.DATA.equals(fetchTo)) {
msgDataAsObjectNode.put(CREDENTIALS_TYPE, credentialsType.name());
msgDataAsObjectNode.set(CREDENTIALS, credentialsInfo);
}
TbMsg transformedMsg = transformMessage(msg, msgDataAsObjectNode, metaData);
ctx.tellSuccess(transfor... | repos\thingsboard-master\rule-engine\rule-engine-components\src\main\java\org\thingsboard\rule\engine\metadata\TbFetchDeviceCredentialsNode.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getScopeDefinitionId() {
return scopeDefinitionId;
}
public void setScopeDefinitionId(String scopeDefinitionId) {
this.scopeDefinitionId = scopeDefinitionId;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
thi... | public String getConfiguration() {
return configuration;
}
public void setConfiguration(String configuration) {
this.configuration = configuration;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public String getTenantId() {
return ten... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\process\EventSubscriptionResponse.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private static class ProxyDataSourceInterceptor implements MethodInterceptor {
private final DataSource dataSource;
public ProxyDataSourceInterceptor(final DataSource dataSource) {
super();
SLF4JQueryLoggingListener listener = new SLF4JQueryLoggingListener() {
... | .multiline()
.listener(listener)
.build();
}
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
final Method proxyMethod = ReflectionUtils.
findMethod(this.dataSource.getClass(),
... | repos\Hibernate-SpringBoot-master\HibernateSpringBootLogSlowQueries\src\main\java\com\bookstore\config\DatasourceProxyBeanPostProcessor.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.