instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请在Spring Boot框架中完成以下Java代码 | public class AuthorizationServerConfig {
@Bean
@Order(1)
public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception {
OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http);
http.getConfigurer(OAuth2AuthorizationServerConfigurer.class)
... | // Custom MCP scopes
.scope("mcp.read")
.scope("mcp.write")
.clientSettings(ClientSettings.builder()
.requireAuthorizationConsent(false)
.requireProofKey(false)
.build())
.tokenSettings(TokenSettings.builder()
... | repos\tutorials-master\spring-ai-modules\spring-ai-mcp-oauth\oauth2-authorization-server\src\main\java\com\baeldung\mcp\oauth2authorizationserver\config\AuthorizationServerConfig.java | 2 |
请完成以下Java代码 | protected ReferenceTypeSerializer<ArgumentValue<?>> withResolved(final BeanProperty prop, final TypeSerializer vts,
final JsonSerializer<?> valueSer, final NameTransformer unwrapper) {
return new ArgumentValueSerializer(this, prop, vts, valueSer, unwrapper, _suppressableValue, _suppressNulls);
}... | }
@Override
protected @Nullable Object _getReferenced(final ArgumentValue<?> value) {
return value.value();
}
@Override
protected @Nullable Object _getReferencedIfPresent(final ArgumentValue<?> value) {
return value.value();
}
}
} | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\client\json\GraphQlJackson2Module.java | 1 |
请完成以下Java代码 | public boolean containsKey(Object key) {
for (Resolver scriptResolver: scriptResolvers) {
if (scriptResolver.containsKey(key)) {
return true;
}
}
return wrappedBindings.containsKey(key);
}
public Object get(Object key) {
Object result = null;
if(wrappedBindings.containsKey(... | public Object remove(Object key) {
if (UNSTORED_KEYS.contains(key)) {
return null;
}
return wrappedBindings.remove(key);
}
public void clear() {
wrappedBindings.clear();
}
public boolean containsValue(Object value) {
return calculateBindingMap().containsValue(value);
}
public bo... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\scripting\engine\ScriptBindings.java | 1 |
请完成以下Java代码 | private static Set<String> getDeviceRequestClassnames(final String deviceName, final AttributeCode attributeCode)
{
return DummyDevice.getDeviceRequestClassnames();
}
public static DummyDeviceResponse generateRandomResponse()
{
final BigDecimal value = NumberUtils.randomBigDecimal(responseMinValue, responseMax... | }
public synchronized @Nullable DeviceConfig removeDeviceByName(@NonNull final String deviceName)
{
final DeviceConfig existingDevice = devicesByName.remove(deviceName);
if (existingDevice != null)
{
existingDevice.getAssignedAttributeCodes()
.forEach(attributeCode -> devicesByAttributeCode.remo... | repos\metasfresh-new_dawn_uat\backend\de.metas.device.adempiere\src\main\java\de\metas\device\dummy\DummyDeviceConfigPool.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CopyListService {
public List<Flower> copyListByConstructor(List<Flower> source) {
return new ArrayList<Flower>(source);
}
public List<Flower> copyListByConstructorAndEditOneFlowerInTheNewList(List<Flower> source) {
List<Flower> flowers = new ArrayList<>(source);
if(fl... | public List<Flower> copyListByStream(List<Flower> source) {
return source.stream().collect(Collectors.toList());
}
public List<Flower> copyListByStreamAndSkipFirstElement(List<Flower> source) {
return source.stream().skip(1).collect(Collectors.toList());
}
public List<Flower> copyListB... | repos\tutorials-master\core-java-modules\core-java-collections-list-3\src\main\java\com\baeldung\java\list\CopyListService.java | 2 |
请完成以下Java代码 | public static final boolean isOrgCode(String orgCode) {
String[] codeNo = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
String[] staVal = { "0", "1", "2", "3", "4", "5", "6", "7", "8"... | * @param minLength
* @param maxLength
* @return
*/
public static String lengthValidate(String propertyName, String property, boolean isRequire, int minLength, int maxLength) {
int propertyLenght = property.length();
if (isRequire && propertyLenght == 0) {
return propertyName + "不能为空,"; // 校验不能为空
} else ... | repos\roncoo-pay-master\roncoo-pay-web-boss\src\main\java\com\roncoo\pay\permission\utils\ValidateUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Long updateCity(City city) {
Long ret = cityDao.updateCity(city);
// 缓存存在,删除缓存
String key = "city_" + city.getId();
boolean hasKey = redisTemplate.hasKey(key);
if (hasKey) {
redisTemplate.delete(key);
LOGGER.info("CityServiceImpl.updateCity() : 从缓... | Long ret = cityDao.deleteCity(id);
// 缓存存在,删除缓存
String key = "city_" + id;
boolean hasKey = redisTemplate.hasKey(key);
if (hasKey) {
redisTemplate.delete(key);
LOGGER.info("CityServiceImpl.deleteCity() : 从缓存中删除城市 ID >> " + id);
}
return ret;
... | repos\springboot-learning-example-master\springboot-mybatis-redis\src\main\java\org\spring\springboot\service\impl\CityServiceImpl.java | 2 |
请完成以下Java代码 | public class Product {
@Id
private long id;
@NotBlank
@Size(max=100)
@Indexed(unique=true)
private String name;
private String description;
public long getId() {
return id;
}
public void setId(long id) { | this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
} | repos\Spring-Boot-Advanced-Projects-main\springboot-mongodb-crud\src\main\java\net\springboot\alanbinu\model\Product.java | 1 |
请在Spring Boot框架中完成以下Java代码 | class DynamicReferencesCache
{
private final ITableRecordIdDAO tableRecordIdDAO = Services.get(ITableRecordIdDAO.class);
private static final ImmutableSet<String> TABLENAMES_TO_AVOID_CACHING = ImmutableSet.<String>builder()
.add(I_AD_Issue.Table_Name) // because it's often written => often cache reset
.build(... | return TableInfo.builder()
.tableName(tableName)
.referencedTableNames(referencedTableNames)
.build();
}
@Value
@Builder
private static class TableInfo
{
@NonNull String tableName;
@NonNull ImmutableSet<String> referencedTableNames;
public boolean containsReferencedTableName(@NonNull final Stri... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\document\references\related_documents\generic\DynamicReferencesCache.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getCvn2() {
return cvn2;
}
public void setCvn2(String cvn2) {
this.cvn2 = cvn2;
}
public String getExpDate() {
return expDate;
}
public void setExpDate(String expDate) {
this.expDate = expDate;
}
public String getIsDefault() {
return isDefault;
}
public void setIsDefault(String is... | }
public String getIsAuth() {
return isAuth;
}
public void setIsAuth(String isAuth) {
this.isAuth = isAuth;
}
public String getStatusDesc() {
if (StringUtil.isEmpty(this.getStatus())) {
return "";
} else {
return PublicStatusEnum.getEnum(this.getStatus()).getDesc();
}
}
} | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\user\entity\RpUserQuickPayBankAccount.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public R<List<RoleVO>> treeById(Long roleId, BladeUser bladeUser) {
Role role = roleService.getById(roleId);
List<RoleVO> tree = roleService.tree(Func.notNull(role) ? role.getTenantId() : bladeUser.getTenantId());
return R.data(tree);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = ... | @Operation(summary = "删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(SYS_CACHE);
return R.status(roleService.removeByIds(Func.toLongList(ids)));
}
/**
* 设置菜单权限
*/
@PostMapping("/grant")
@ApiOperationSupport(order = ... | repos\SpringBlade-master\blade-service\blade-system\src\main\java\org\springblade\system\controller\RoleController.java | 2 |
请完成以下Java代码 | public class Person {
@JacksonInject
private UUID id;
private String firstName;
private String lastName;
public Person() {
}
public Person(String firstName, String lastName) {
this.id = UUID.randomUUID();
this.firstName = firstName;
this.lastName = lastName;
}... | public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public UUID getId() {
return id;
}
} | repos\tutorials-master\jackson-modules\jackson-core\src\main\java\com\baeldung\jackson\deserialization\jacksoninject\Person.java | 1 |
请完成以下Java代码 | public final class LoggerGroups implements Iterable<LoggerGroup> {
private final Map<String, LoggerGroup> groups = new ConcurrentHashMap<>();
public LoggerGroups() {
}
public LoggerGroups(Map<String, List<String>> namesAndMembers) {
putAll(namesAndMembers);
}
public void putAll(Map<String, List<String>> nam... | }
private void put(LoggerGroup loggerGroup) {
this.groups.put(loggerGroup.getName(), loggerGroup);
}
public @Nullable LoggerGroup get(String name) {
return this.groups.get(name);
}
@Override
public Iterator<LoggerGroup> iterator() {
return this.groups.values().iterator();
}
} | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\logging\LoggerGroups.java | 1 |
请完成以下Java代码 | public Configuration parsePartial() throws Exception
{
Configuration initialConfiguration = new Configuration(sentence, rootFirst);
boolean isNonProjective = false;
if (instance.isNonprojective())
{
isNonProjective = true;
}
ArrayList<Configuration> beam ... | }
else if (action == 4)
{
ArcEager.unShift(newConfig.state);
newConfig.addAction(2);
}
newConfig.setScore(score);
repBeam.add(newConfig);
}
beam = repBeam;
}
C... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dependency\perceptron\transition\parser\ParseThread.java | 1 |
请完成以下Java代码 | public Todo asyncJackson() throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://jsonplaceholder.typicode.com/todos"))
.build();
TodoAppClient todoAppClient = new TodoAppClient();
List<Todo> todo = HttpClient.newHttpClient()
... | return todo.get(1);
}
List<Todo> readValueJackson(String content) {
try {
return objectMapper.readValue(content, new TypeReference<List<Todo>>() {
});
} catch (IOException ioe) {
throw new CompletionException(ioe);
}
}
List<Todo> readVa... | repos\tutorials-master\core-java-modules\core-java-11-3\src\main\java\com\baeldung\httppojo\TodoAppClient.java | 1 |
请完成以下Java代码 | public Void execute(CommandContext commandContext) {
/*
* If execution related entity counting is on in config | Current property in database : Result
*
* A) true | not there : write new property with value 'true'
* B) true | true : all good
* C) true | false : th... | if (!configProperty && propertyValue) {
if (logger.isInfoEnabled()) {
logger.info(
"Configuration change: execution related entity counting feature was enabled before, but now disabled. " +
"Updating all execution entities."
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cmd\ValidateExecutionRelatedEntityCountCfgCmd.java | 1 |
请完成以下Java代码 | public CorrelationPropertyRetrievalExpression newInstance(ModelTypeInstanceContext instanceContext) {
return new CorrelationPropertyRetrievalExpressionImpl(instanceContext);
}
});
messageRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_MESSAGE_REF)
.required()
.qNameAtt... | public Message getMessage() {
return messageRefAttribute.getReferenceTargetElement(this);
}
public void setMessage(Message message) {
messageRefAttribute.setReferenceTargetElement(this, message);
}
public MessagePath getMessagePath() {
return messagePathChild.getChild(this);
}
public void set... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\CorrelationPropertyRetrievalExpressionImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private <C> C getSharedOrBean(B http, Class<C> clazz) {
C shared = http.getSharedObject(clazz);
if (shared != null) {
return shared;
}
return getBeanOrNull(http, clazz);
}
private <C> C getBeanOrNull(B http, Class<C> clazz) {
ApplicationContext context = http.getSharedObject(ApplicationContext.class);
... | matchers.add(new ParameterRequestMatcher(parts[0], parts[1]));
}
}
this.matcher = new AndRequestMatcher(matchers);
}
@Override
public boolean matches(HttpServletRequest request) {
return matcher(request).isMatch();
}
@Override
public MatchResult matcher(HttpServletRequest request) {
return... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\saml2\Saml2LoginConfigurer.java | 2 |
请完成以下Java代码 | void start() throws IOException {
server = HttpServer.create(new InetSocketAddress("localhost", port), 0);
server.createContext("/persons", exchange -> {
switch (exchange.getRequestMethod()) {
case "POST":
final Person person = (Person) xstream.fromXML(exchange.ge... | server.start();
}
void stop() {
if (server != null) {
server.stop(0);
}
}
int port() {
if (server == null)
throw new IllegalStateException("Server not started");
return server.getAddress()
.getPort();
}
} | repos\tutorials-master\xml-modules\xstream\src\main\java\com\baeldung\rce\App.java | 1 |
请完成以下Java代码 | private boolean supplierApprovalExpired(final LocalDate supplierApprovalDate, final LocalDate datePromised, final int numberOfYears)
{
return datePromised.minusYears(numberOfYears).isAfter(supplierApprovalDate);
}
public void notifyUserGroupAboutSupplierApprovalExpiration()
{
final ImmutableList<I_C_BP_Supplie... | final LocalDate expirationDate = TimeUtil.asLocalDate(supplierApprovalRecord.getSupplierApproval_Date(), timeZone)
.plusYears(getNumberOfYearsForApproval(supplierApprovalRecord));
userGroupRepository
.getByUserGroupId(userGroupId)
.streamAssignmentsFor(userGroupId, Instant.now())
.map(UserGroupUserAs... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\bpartner\BPartnerSupplierApprovalService.java | 1 |
请完成以下Java代码 | protected void doHealthCheck(Health.Builder builder) throws Exception {
try (Connection connection = this.connectionFactory.createConnection()) {
new MonitoredConnection(connection).start();
builder.up().withDetail("provider", connection.getMetaData().getJMSProviderName());
}
}
private final class Monitore... | catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}, "jms-health-indicator").start();
this.connection.start();
this.latch.countDown();
}
private void closeConnection() {
try {
this.connection.close();
}
catch (Exception ex) {
// Continue
}
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-jms\src\main\java\org\springframework\boot\jms\health\JmsHealthIndicator.java | 1 |
请完成以下Java代码 | public void setByteArrayValue(byte[] bytes) {
setByteArrayValue(bytes, false);
}
public void setByteArrayValue(byte[] bytes, boolean isTransient) {
if (bytes != null) {
// note: there can be cases where byteArrayId is not null
// but the corresponding byte array entity has been removed in par... | // the next apparently useless line is probably to ensure consistency in the DbSqlSession cache,
// but should be checked and docked here (or removed if it turns out to be unnecessary)
getByteArrayEntity();
if (byteArrayValue != null) {
Context.getCommandContext()
.getDbEntityM... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\util\ByteArrayField.java | 1 |
请完成以下Java代码 | private ColorId getColorId(final HasPricingConditions hasPricingConditions)
{
if (hasPricingConditions == HasPricingConditions.YES)
{
return null;
}
else if (hasPricingConditions == HasPricingConditions.TEMPORARY)
{
return getTemporaryPriceConditionsColorId();
}
else if (hasPricingConditions == Has... | return noPriceConditionsColorId != null;
}
private boolean isPricingConditionsMissingButRequired(final I_C_OrderLine orderLine)
{
// Pricing conditions are not required for packing material line (task 3925)
if (orderLine.isPackagingMaterial())
{
return false;
}
return hasPricingConditions(orderLine) =... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\impl\OrderLinePricingConditions.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void forwardToEventService(Event event, TbCallback callback) {
DonAsynchron.withCallback(actorContext.getEventService().saveAsync(event),
result -> callback.onSuccess(),
callback::onFailure,
actorContext.getDbCallbackExecutor());
}
void forwardToR... | private TenantId toTenantId(long tenantIdMSB, long tenantIdLSB) {
return TenantId.fromUUID(new UUID(tenantIdMSB, tenantIdLSB));
}
@Override
protected void stopConsumers() {
super.stopConsumers();
mainConsumer.stop();
mainConsumer.awaitStop();
usageStatsConsumer.stop(... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\queue\DefaultTbCoreConsumerService.java | 2 |
请完成以下Java代码 | public String getBody() {
Body body = bodyChild.getChild(this);
if (body != null) {
return body.getTextContent();
}
return null;
}
public void setBody(String body) {
bodyChild.getChild(this).setTextContent(body);
}
public String getLanguage() {
return languageAttribute.getValue(t... | }
});
languageAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_LANGUAGE)
.defaultValue("http://www.w3.org/1999/XPath")
.build();
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
bodyChild = sequenceBuilder.element(Body.class)
.build();
typeBuilder.build... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\ExpressionImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setArea(Area area) {
this.area = area;
}
public Object getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Object createdAt) {
this.createdAt = createdAt;
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
t... | public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
} | repos\tutorials-master\json-modules\json-2\src\main\java\com\baeldung\jsonschemageneration\configuration\AdvancedArticle.java | 2 |
请完成以下Java代码 | public <V> V get(Object key) {
return hasKey(key) ? (V) this.context.get(key) : null;
}
@Override
public boolean hasKey(Object key) {
Assert.notNull(key, "key cannot be null");
return this.context.containsKey(key);
}
/**
* Returns the {@link OAuth2AccessToken OAuth 2.0 Access Token}.
* @return the {@li... | return put(OAuth2AccessToken.class, accessToken);
}
/**
* Sets the {@link OAuth2Authorization authorization}.
* @param authorization the {@link OAuth2Authorization}
* @return the {@link Builder} for further configuration
*/
public Builder authorization(OAuth2Authorization authorization) {
return p... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\oidc\authentication\OidcUserInfoAuthenticationContext.java | 1 |
请完成以下Java代码 | public String extractFieldValueToString(final Document document)
{
final Object fieldValue = document.getFieldView(fieldName).getValue();
if (fieldValue == null)
{
return null;
}
else if (fieldValue instanceof LookupValue)
{
return ((LookupValue)fieldValue).getDisplayName();
}
else
... | // shall not happen
displayType = DisplayType.Number;
}
}
@Override
public String getFieldName()
{
return fieldName;
}
@Override
public String extractFieldValueToString(final Document document)
{
final Object fieldValue = document.getFieldView(fieldName).getValue();
if (fieldValue == n... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\factory\standard\GenericDocumentSummaryValueProvider.java | 1 |
请完成以下Java代码 | public SecureRandom getObject() throws Exception {
SecureRandom random = SecureRandom.getInstance(this.algorithm);
// Request the next bytes, thus eagerly incurring the expense of default
// seeding and to prevent the see from replacing the entire state
random.nextBytes(new byte[1]);
if (this.seed != null) {
... | */
public void setAlgorithm(String algorithm) {
Assert.hasText(algorithm, "Algorithm required");
this.algorithm = algorithm;
}
/**
* Allows the user to specify a resource which will act as a seed for the
* {@link SecureRandom} instance. Specifically, the resource will be read into an
* {@link InputStream}... | repos\spring-security-main\core\src\main\java\org\springframework\security\core\token\SecureRandomFactoryBean.java | 1 |
请完成以下Spring Boot application配置 | spring.kafka.bootstrap-servers=${KAFKA_BOOTSTRAP_SERVERS}
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer
spring.kafka.consumer.group-id=synchronous-kafka-group
spring.... | er
spring.kafka.properties.allow.auto.create.topics=true
com.baeldung.kafka.synchronous.request-topic=notification-dispatch-request
com.baeldung.kafka.synchronous.reply-topic=notification-dispatch-response
com.baeldung.kafka.synchronous.reply-timeout=30s | repos\tutorials-master\spring-kafka-4\src\main\resources\application-synchronous-kafka.properties | 2 |
请完成以下Java代码 | public String getHandledTableName()
{
return I_M_InOutLine.Table_Name;
}
@NonNull
@Override
public Dimension getFromRecord(@NonNull final I_M_InOutLine record)
{
return Dimension.builder()
.projectId(ProjectId.ofRepoIdOrNull(record.getC_Project_ID()))
.campaignId(record.getC_Campaign_ID())
.activ... | .build();
}
@Override
public void updateRecord(final I_M_InOutLine record, final Dimension from)
{
record.setC_Project_ID(ProjectId.toRepoId(from.getProjectId()));
record.setC_Campaign_ID(from.getCampaignId());
record.setC_Activity_ID(ActivityId.toRepoId(from.getActivityId()));
record.setC_OrderSO_ID(Order... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\document\dimension\InOutLineDimensionFactory.java | 1 |
请完成以下Java代码 | public void close(final ResultSet rs, final PreparedStatement pstmt, final Connection conn)
{
close(rs);
close(pstmt);
close(conn);
}
public Set<String> getDBFunctionsMatchingPattern(final String functionNamePattern)
{
ResultSet rs = null;
try
{
final ImmutableSet.Builder<String> result = ImmutableS... | .getProcedures(database.getDbName(), null, functionNamePattern);
while (rs.next())
{
final String functionName = rs.getString("PROCEDURE_NAME");
final String schemaName = rs.getString("PROCEDURE_SCHEM");
final String functionNameFQ = schemaName != null ? schemaName + "." + functionName : functionName... | repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.base\src\main\java\de\metas\migration\impl\SQLHelper.java | 1 |
请完成以下Java代码 | public static Boolean isBearer(String auth) {
if ((auth != null) && (auth.length() > AUTH_LENGTH)) {
String headStr = auth.substring(0, 6).toLowerCase();
return headStr.compareTo(BEARER) == 0;
}
return false;
}
/**
* 判断token类型为crypto
*
* @param auth token
* @return String
*/
public static Bool... | * 解析jsonWebToken
*
* @param jsonWebToken token串
* @return Claims
*/
public static Claims parseJWT(String jsonWebToken) {
try {
return Jwts.parser()
.verifyWith(Keys.hmacShaKeyFor(Base64.getDecoder().decode(getBase64Security()))).build()
.parseSignedClaims(jsonWebToken)
.getPayload();
} catch... | repos\SpringBlade-master\blade-gateway\src\main\java\org\springblade\gateway\utils\JwtUtil.java | 1 |
请完成以下Java代码 | public void setM_MatchInv_ID (final int M_MatchInv_ID)
{
if (M_MatchInv_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_MatchInv_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_MatchInv_ID, M_MatchInv_ID);
}
@Override
public int getM_MatchInv_ID()
{
return get_ValueAsInt(COLUMNNAME_M_MatchInv_ID);
}
@Over... | set_Value (COLUMNNAME_Processing, Processing);
}
@Override
public boolean isProcessing()
{
return get_ValueAsBoolean(COLUMNNAME_Processing);
}
@Override
public void setQty (final BigDecimal Qty)
{
set_ValueNoCheck (COLUMNNAME_Qty, Qty);
}
@Override
public BigDecimal getQty()
{
final BigDecimal bd... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_MatchInv.java | 1 |
请完成以下Java代码 | private Mono<?> filterSingleValue(Publisher<?> filterTarget, Expression filterExpression, EvaluationContext ctx) {
MethodSecurityExpressionOperations rootObject = (MethodSecurityExpressionOperations) ctx.getRootObject()
.getValue();
return Mono.from(filterTarget).filterWhen((filterObject) -> {
if (rootObject ... | }
@Override
public int getOrder() {
return this.order;
}
public void setOrder(int order) {
this.order = order;
}
private static final class FilterTarget {
private final Publisher<?> value;
private final int index;
private FilterTarget(Publisher<?> value, int index) {
this.value = value;
this... | repos\spring-security-main\core\src\main\java\org\springframework\security\authorization\method\PreFilterAuthorizationReactiveMethodInterceptor.java | 1 |
请完成以下Java代码 | public BillOfMaterials createSpringBootBom(String bootVersion, String versionProperty) {
BillOfMaterials bom = BillOfMaterials.create("org.springframework.boot", "spring-boot-dependencies",
bootVersion);
bom.setVersionProperty(VersionProperty.of(versionProperty));
bom.setOrder(100);
return bom;
}
/**
*... | private final TextCapability groupId;
private final TextCapability artifactId;
PackageCapability(TextCapability groupId, TextCapability artifactId) {
super("packageName", "Package Name", "root package");
this.groupId = groupId;
this.artifactId = artifactId;
}
@Override
public String getContent() {... | repos\initializr-main\initializr-metadata\src\main\java\io\spring\initializr\metadata\InitializrMetadata.java | 1 |
请完成以下Java代码 | public Mono<Void> saveToken(ServerWebExchange exchange, @Nullable CsrfToken token) {
return Mono.fromRunnable(() -> {
String tokenValue = (token != null) ? token.getToken() : "";
// @formatter:off
ResponseCookie.ResponseCookieBuilder cookieBuilder = ResponseCookie
.from(this.cookieName, tokenValue)
... | }
/**
* Sets the cookie path
* @param cookiePath The cookie path
*/
public void setCookiePath(String cookiePath) {
this.cookiePath = cookiePath;
}
private CsrfToken createCsrfToken() {
return createCsrfToken(createNewToken());
}
private CsrfToken createCsrfToken(String tokenValue) {
return new Defa... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\csrf\CookieServerCsrfTokenRepository.java | 1 |
请完成以下Java代码 | public void setUPC_CU (final @Nullable java.lang.String UPC_CU)
{
set_ValueNoCheck (COLUMNNAME_UPC_CU, UPC_CU);
}
@Override
public java.lang.String getUPC_CU()
{
return get_ValueAsString(COLUMNNAME_UPC_CU);
}
@Override
public void setUPC_TU (final @Nullable java.lang.String UPC_TU)
{
set_ValueNoCheck ... | @Override
public java.lang.String getUPC_TU()
{
return get_ValueAsString(COLUMNNAME_UPC_TU);
}
@Override
public void setValue (final @Nullable java.lang.String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
@Override
public java.lang.String getValue()
{
return get_ValueAsString(COLUMNNAME_Value);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_cctop_invoic_500_v.java | 1 |
请完成以下Java代码 | public abstract class ServiceListenerFuture<S, V> extends AbstractServiceListener<S> implements ServiceListener<S>, Future<V> {
protected final S serviceInstance;
public ServiceListenerFuture(S serviceInstance) {
this.serviceInstance = serviceInstance;
}
protected V value;
boolean cancelled;
bo... | public boolean isDone() {
return value != null;
}
public V get() throws InterruptedException, ExecutionException {
if (!failed && !cancelled && value == null) {
synchronized (this) {
if (!failed && !cancelled && value == null) {
this.wait();
}
}
}
ret... | repos\camunda-bpm-platform-master\distro\wildfly26\subsystem\src\main\java\org\camunda\bpm\container\impl\jboss\util\ServiceListenerFuture.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Object findByRegex() {
// 设置查询条件参数
String regex = "^zh*";
// 创建条件对象
Criteria criteria = Criteria.where("name").regex(regex);
// 创建查询对象,然后将条件对象添加到其中
Query query = new Query(criteria);
// 查询并返回结果
List<User> documentList = mongoTemplate.find(query, Use... | *
* @return 符合条件的文档列表
*/
public Object countNumber() {
// 设置查询条件参数
int age = 22;
// 创建条件对象
Criteria criteria = Criteria.where("age").is(age);
// 创建查询对象,然后将条件对象添加到其中
Query query = new Query(criteria);
// 查询并返回结果
long count = mongoTemplate.coun... | repos\springboot-demo-master\mongodb\src\main\java\demo\et\mongodb\service\QueryService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public final class ValidationHelper
{
private ValidationHelper()
{
}
/**
* Validate any type, and throw {@link RuntimeCamelException} if the field is null.
*/
public static <T extends Object> T validateObject(final T field, final String errorMsg)
{
if (field == null)
{
throw new RuntimeCamelException(... | return field;
}
/**
* Validate {@link Number}, and throw {@link RuntimeCamelException} if the field is null or 0.
*
* @param field
* @param errorMsg
*/
public static Number validateNumber(final Number field, final String errorMsg)
{
if (field == null || field.intValue() == 0)
{
throw new RuntimeCa... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\commons\ValidationHelper.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void setElementName(String elementName) {
this.elementName = elementName;
}
public boolean isWithException() {
return withException;
}
@ApiParam("Only return jobs with an exception")
public void setWithException(boolean withException) {
this.withException = withExcep... | @ApiParam("Only return jobs that are locked")
public void setLocked(boolean locked) {
this.locked = locked;
}
public boolean isUnlocked() {
return unlocked;
}
@ApiParam("Only return jobs that are unlocked")
public void setUnlocked(boolean unlocked) {
this.unlocked = unl... | repos\flowable-engine-main\modules\flowable-external-job-rest\src\main\java\org\flowable\external\job\rest\service\api\query\ExternalWorkerJobQueryRequest.java | 2 |
请完成以下Java代码 | public Integer getDisplayOrder() {
return displayOrder;
}
public void setDisplayOrder(Integer displayOrder) {
this.displayOrder = displayOrder;
}
public String getIncludeInStageOverview() {
return includeInStageOverview;
}
public void setIncludeInStageOverview(String i... | public List<Criterion> getExitCriteria() {
return exitCriteria;
}
@Override
public void setExitCriteria(List<Criterion> exitCriteria) {
this.exitCriteria = exitCriteria;
}
public String getBusinessStatus() {
return businessStatus;
}
public void setBusinessStatus(St... | repos\flowable-engine-main\modules\flowable-cmmn-model\src\main\java\org\flowable\cmmn\model\Stage.java | 1 |
请完成以下Java代码 | public class TaxAmountAndType1 {
@XmlElement(name = "Tp")
protected TaxAmountType1Choice tp;
@XmlElement(name = "Amt", required = true)
protected ActiveOrHistoricCurrencyAndAmount amt;
/**
* Gets the value of the tp property.
*
* @return
* possible object is
* {@l... | * {@link ActiveOrHistoricCurrencyAndAmount }
*
*/
public ActiveOrHistoricCurrencyAndAmount getAmt() {
return amt;
}
/**
* Sets the value of the amt property.
*
* @param value
* allowed object is
* {@link ActiveOrHistoricCurrencyAndAmount }
*... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\TaxAmountAndType1.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class TransactionProperties implements TransactionManagerCustomizer<AbstractPlatformTransactionManager> {
/**
* Default transaction timeout. If a duration suffix is not specified, seconds will be
* used.
*/
@DurationUnit(ChronoUnit.SECONDS)
private @Nullable Duration defaultTimeout;
/**
* Whether t... | return this.rollbackOnCommitFailure;
}
public void setRollbackOnCommitFailure(@Nullable Boolean rollbackOnCommitFailure) {
this.rollbackOnCommitFailure = rollbackOnCommitFailure;
}
@Override
public void customize(AbstractPlatformTransactionManager transactionManager) {
if (this.defaultTimeout != null) {
t... | repos\spring-boot-4.0.1\module\spring-boot-transaction\src\main\java\org\springframework\boot\transaction\autoconfigure\TransactionProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void process(String nodeId, ToTransportMsg msg) {
process(nodeId, msg, null, null);
}
@Override
public void process(String nodeId, ToTransportMsg msg, Runnable onSuccess, Consumer<Throwable> onFailure) {
if (nodeId == null || nodeId.isEmpty()) {
log.trace("process: skippi... | }
@Override
public void onSuccess(TbQueueMsgMetadata metadata) {
if (onSuccess != null) {
onSuccess.run();
}
}
@Override
public void onFailure(Throwable t) {
if (onFailure != null) {
onFailure.accept(t);
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\transport\DefaultTbCoreToTransportService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public DeferredResult<ResponseEntity<?>> handleReqWithTimeouts(Model model) {
LOG.info("Received async request with a configured timeout");
DeferredResult<ResponseEntity<?>> deferredResult = new DeferredResult<>(500l);
deferredResult.onTimeout(new Runnable() {
@Override
public void run() {
deferredResul... | public DeferredResult<ResponseEntity<?>> handleAsyncFailedRequest(Model model) {
DeferredResult<ResponseEntity<?>> deferredResult = new DeferredResult<>();
ForkJoinPool.commonPool().submit(() -> {
try {
// Exception occurred in processing
throw new Exception();
} catch (Exception e) {
LOG.info("Re... | repos\tutorials-master\spring-web-modules\spring-rest-http-2\src\main\java\com\baeldung\deffered\controllers\DeferredResultController.java | 2 |
请完成以下Java代码 | public int copyLandedCostFrom(MInvoiceLine otherInvoiceLine)
{
if (otherInvoiceLine == null)
{
return 0;
}
MLandedCost[] fromLandedCosts = otherInvoiceLine.getLandedCost(null);
int count = 0;
for (MLandedCost fromLandedCost : fromLandedCosts)
{
MLandedCost landedCost = new MLandedCost(getCtx(), 0, ... | BigDecimal qty = rmaLine.getQty();
if (rmaLine.getQtyInvoiced() != null)
{
qty = qty.subtract(rmaLine.getQtyInvoiced());
}
setQty(qty);
setLineNetAmt();
setTaxAmt();
setLineTotalAmt(rmaLine.getLineNetAmt());
setC_Project_ID(rmaLine.getC_Project_ID());
// 07442
// Do not change the activity if it ... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MInvoiceLine.java | 1 |
请完成以下Java代码 | protected AstNode literal() throws Scanner.ScanException, ParseException {
AstNode v = null;
switch (token.getSymbol()) {
case TRUE:
v = new AstBoolean(true);
consumeToken();
break;
case FALSE:
v = new AstBoolean(fal... | return v;
}
protected final AstFunction function(String name, AstParameters params) {
if (functions.isEmpty()) {
functions = new ArrayList<FunctionNode>(4);
}
AstFunction function = createAstFunction(name, functions.size(), params);
functions.add(function);
r... | repos\Activiti-develop\activiti-core-common\activiti-juel-jakarta\src\main\java\org\activiti\core\el\juel\tree\impl\Parser.java | 1 |
请完成以下Java代码 | public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(th... | sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
... | repos\tutorials-master\spring-swagger-codegen-modules\spring-openapi-generator-api-client\src\main\java\com\baeldung\petstore\client\model\Order.java | 1 |
请完成以下Java代码 | public String getArtifactId() {
return this.artifactId;
}
public void setArtifactId(String artifactId) {
this.artifactId = artifactId;
}
public String getVersion() {
return this.version;
}
public void setVersion(String version) {
this.version = version;
}
public Boolean getStarter() {
... | }
public void setRepository(String repository) {
this.repository = repository;
}
public VersionRange getRange() {
return this.range;
}
public String getCompatibilityRange() {
return this.compatibilityRange;
}
public void setCompatibilityRange(String compatibilityRange) {
this.compatibility... | repos\initializr-main\initializr-metadata\src\main\java\io\spring\initializr\metadata\Dependency.java | 1 |
请完成以下Java代码 | public class SequenceCheck extends JavaProcess
{
/** Static Logger */
private static Logger s_log = LogManager.getLogger(SequenceCheck.class);
/**
* Prepare - e.g., get Parameters.
*/
@Override
protected void prepare()
{
} // prepare
/**
* Perform process.
* (see also MSequenve.validate)
*
* @retu... | * Validate Sequences
*
* @param ctx context
*/
public static void validate(final Properties ctx)
{
try
{
checkSequences(ctx);
}
catch (final Exception e)
{
s_log.error("validate", e);
}
} // validate
/**
* Check/Initialize DocumentNo/Value Sequences for all Clients
*
* @param ctx cont... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\process\SequenceCheck.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SmsHomeNewProductServiceImpl implements SmsHomeNewProductService {
@Autowired
private SmsHomeNewProductMapper homeNewProductMapper;
@Override
public int create(List<SmsHomeNewProduct> homeNewProductList) {
for (SmsHomeNewProduct SmsHomeNewProduct : homeNewProductList) {
... | return homeNewProductMapper.updateByExampleSelective(record,example);
}
@Override
public List<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum) {
PageHelper.startPage(pageNum,pageSize);
SmsHomeNewProductExample example = new SmsHomeNewPr... | repos\mall-master\mall-admin\src\main\java\com\macro\mall\service\impl\SmsHomeNewProductServiceImpl.java | 2 |
请完成以下Java代码 | public void huParentChanged(
@NonNull final I_M_HU hu,
@Nullable final I_M_HU_Item parentHUItemOld)
{
final HUTraceEventsService huTraceEventService = HUTraceModuleInterceptor.INSTANCE.getHUTraceEventsService();
huTraceEventService.createAndAddForHuParentChanged(hu, parentHUItemOld);
}
@Override
public v... | setTrxName(trxHdr, localTrxName);
trxLines.forEach(l -> setTrxName(l, localTrxName));
afterTrxProcessed0(trxLines, trxHdr);
});
});
logger.debug("Enqueued M_HU_Trx_Hdr and _M_HU_Trx_Lines for HU-tracing after the next commit; trxHdr={}; trxLines={}", trxHdr, trxLines);
}
private void afterTrx... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\trace\interceptor\TraceHUTrxListener.java | 1 |
请完成以下Spring Boot application配置 | #application
spring.application.name=abel-user-provider
application.main=cn.abel.user.UserProviderApplication
server.port=9658
server.tomcat.uri-encoding=UTF-8
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
spring.messages.encoding=UTF-8
server.tomcat.max-threads=20... | 00
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.validation-timeout=3000
spring.datasource.hikari.connection-test-query=SELECT 1
#mybatis
logging.level.cn.abel.user.dao=info
mybatis.type-aliases-package=cn.abel.user.model
mybatis.mapper-locations=classpath*:mapper/*Mapper.xml
#PageHelper... | repos\springBoot-master\springboot-dubbo\abel-user-provider\src\main\resources\dev\application.properties | 2 |
请完成以下Java代码 | public <C> C mapTo(Class<C> type) {
DataFormatMapper mapper = dataFormat.getMapper();
return mapper.mapInternalToJava(jsonNode, type);
}
/**
* Maps the json represented by this object to a java object of the given type.
* Argument is to be supplied in Jackson's canonical type string format
* (see ... | DataFormatMapper mapper = dataFormat.getMapper();
return mapper.mapInternalToJava(jsonNode, type);
}
/**
* Maps the json represented by this object to a java object of the given type.<br>
* Note: the desired target type is not validated and needs to be trusted.
*
* @throws SpinJsonException if the ... | repos\camunda-bpm-platform-master\spin\dataformat-json-jackson\src\main\java\org\camunda\spin\impl\json\jackson\JacksonJsonNode.java | 1 |
请完成以下Java代码 | default void setInvoiceScheduleAndDateToInvoice(@NonNull final I_C_Invoice_Candidate ic)
{
final IBPartnerDAO bpartnerDAO = Services.get(IBPartnerDAO.class);
final IInvoiceCandBL invoiceCandBL = Services.get(IInvoiceCandBL.class);
ic.setC_InvoiceSchedule_ID(bpartnerDAO.getById(ic.getBill_BPartner_ID()).getC_Inv... | PriceListVersionId priceListVersionId;
CurrencyId currencyId;
BigDecimal priceEntered;
BigDecimal priceActual;
UomId priceUOMId;
Percent discount;
InvoicableQtyBasedOn invoicableQtyBasedOn;
Boolean taxIncluded;
TaxId taxId;
TaxCategoryId taxCategoryId;
BigDecimal compensationGroupBaseAmt;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\spi\IInvoiceCandidateHandler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class HUsToReturn_SelectHU extends HUsToReturnViewBasedProcess implements IProcessPrecondition
{
private final RepairCustomerReturnsService repairCustomerReturnsService = SpringContextHolder.instance.getBean(RepairCustomerReturnsService.class);
@Override
protected ProcessPreconditionsResolution checkPrecondi... | {
final HUEditorRow row = getSingleSelectedRow();
final HUsToReturnViewContext viewContext = getHUsToReturnViewContext();
final HuId huId = row.getHuId();
final InOutId customerReturnsId = viewContext.getCustomerReturnsId();
if (isValidHuForInOut(customerReturnsId, huId))
{
repairCustomerReturnsService.... | repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.webui\src\main\java\de\metas\servicerepair\customerreturns\process\HUsToReturn_SelectHU.java | 2 |
请完成以下Java代码 | public String makeSound() {
return "Meow";
}
/**
* Warning: Inconsistent with the equals method.
*/
@Override
public int compareTo(Cat cat) {
return this.getName().length() - cat.getName().length();
}
@Override
public String toString() {
return "Cat{" + "t... | }
@Override
public int hashCode() {
return Objects.hash(type, name);
}
@Override
public boolean equals(Object o) {
if(o == this) return true;
if(!(o instanceof Cat)) return false;
Cat cat = (Cat) o;
return type.equals(cat.type) && name.equals(cat.name);
... | repos\tutorials-master\core-java-modules\core-java-lang-2\src\main\java\com\baeldung\generics\Cat.java | 1 |
请完成以下Java代码 | public JsonReaderCheckoutResponse cardReaderCheckout(@NonNull final SumUpCardReaderExternalId id, @NonNull final JsonReaderCheckoutRequest request)
{
final String uri = UriComponentsBuilder.fromHttpUrl(BASE_URL)
.pathSegment("merchants", merchantCode.getAsString(), "readers", id.getAsString(), "checkout")
.t... | .toUriString();
final String json = httpCall(uri, HttpMethod.GET, null, String.class);
try
{
return jsonObjectMapper.readValue(json, JsonGetTransactionResponse.class)
.withJson(json);
}
catch (JsonProcessingException ex)
{
throw AdempiereException.wrapIfNeeded(ex);
}
}
public void refundTr... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sumup\src\main\java\de\metas\payment\sumup\client\SumUpClient.java | 1 |
请完成以下Java代码 | public Double getCount() {
return count;
}
public void setCount(Double count) {
this.count = count;
}
public Long getInterval() {
return interval;
}
public void setInterval(Long interval) {
this.interval = interval;
}
public Integer getIntervalUnit() {... | }
public void setBurst(Integer burst) {
this.burst = burst;
}
public Integer getMaxQueueingTimeoutMs() {
return maxQueueingTimeoutMs;
}
public void setMaxQueueingTimeoutMs(Integer maxQueueingTimeoutMs) {
this.maxQueueingTimeoutMs = maxQueueingTimeoutMs;
}
public G... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\domain\vo\gateway\rule\UpdateFlowRuleReqVo.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public byte[] getContent() {
return content;
}
public void setContent(byte[] content) {
this.content = content;
}
public String getExt() {
return ext;
}
public void setExt(String ext) {
this.ext = ... | return md5;
}
public void setMd5(String md5) {
this.md5 = md5;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
} | repos\spring-boot-leaning-master\2.x_42_courses\第 2-7 课:使用 Spring Boot 上传文件到 FastDFS\spring-boot-fastDFS\src\main\java\com\neo\fastdfs\FastDFSFile.java | 1 |
请完成以下Java代码 | public String completeIt(final DocumentTableFields docFields)
{
final I_C_RemittanceAdvice remittanceAdviceRecord = extractRemittanceAdvice(docFields);
final RemittanceAdviceId remittanceAdviceId = RemittanceAdviceId.ofRepoId(remittanceAdviceRecord.getC_RemittanceAdvice_ID());
final RemittanceAdvice remittanceA... | if (remittanceAdvice.getC_Payment_ID() > 0)
{
throw new AdempiereException("A payment was already created!");
}
remittanceAdvice.setProcessed(false);
remittanceAdvice.setDocAction(X_C_RemittanceAdvice.DOCACTION_Complete);
}
private static I_C_RemittanceAdvice extractRemittanceAdvice(final DocumentTableFi... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\remittanceadvice\document\C_RemittanceAdvice_DocHandler.java | 1 |
请完成以下Java代码 | public List<HistoricDecisionInputInstance> getInputs() {
if(inputs != null) {
return inputs;
} else {
throw LOG.historicDecisionInputInstancesNotFetchedException();
}
}
@Override
public List<HistoricDecisionOutputInstance> getOutputs() {
if(outputs != null) {
return outputs;
... | public void addOutput(HistoricDecisionOutputInstance decisionOutputInstance) {
if(outputs == null) {
outputs = new ArrayList<HistoricDecisionOutputInstance>();
}
outputs.add(decisionOutputInstance);
}
public Double getCollectResultValue() {
return collectResultValue;
}
public void setCol... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\HistoricDecisionInstanceEntity.java | 1 |
请完成以下Java代码 | public void setFunction(String prefix, String localName, Method method) {
if (functions == null) {
functions = new Functions();
}
functions.setFunction(prefix, localName, method);
}
/**
* Define a variable.
*/
public ValueExpression setVariable(String name, Val... | return variables;
}
/**
* Get our resolver. Lazy initialize to a {@link SimpleResolver} if necessary.
*/
@Override
public ELResolver getELResolver() {
if (resolver == null) {
resolver = new SimpleResolver();
}
return resolver;
}
/**
* Set our ... | repos\Activiti-develop\activiti-core-common\activiti-juel-jakarta\src\main\java\org\activiti\core\el\juel\util\SimpleContext.java | 1 |
请完成以下Java代码 | private void findSalesRep ()
{
int changed = 0;
int notFound = 0;
final Properties ctx = Env.newTemporaryCtx();
//
String sql = "SELECT * FROM R_Request "
+ "WHERE AD_Client_ID=?"
+ " AND SalesRep_ID=0 AND Processed='N'";
if (m_model.getR_RequestType_ID() != 0)
{
sql += " AND R_RequestType_ID=?"... | * @return SalesRep_ID user
*/
private int findSalesRep (MRequest request)
{
String QText = request.getSummary();
if (QText == null)
{
QText = "";
}
else
{
QText = QText.toUpperCase();
}
//
MRequestProcessorRoute[] routes = m_model.getRoutes(false);
for (MRequestProcessorRoute route : rout... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\serverRoot\de.metas.adempiere.adempiere.serverRoot.base\src\main\java-legacy\org\compiere\server\RequestProcessor.java | 1 |
请完成以下Java代码 | public static int nthPadovanTermRecursiveMethod(int n) {
if (n == 0 || n == 1 || n == 2) {
return 1;
}
return nthPadovanTermRecursiveMethod(n - 2) + nthPadovanTermRecursiveMethod(n - 3);
}
public static int nthPadovanTermRecursiveMethodWithMemoization(int n) {
if (n ... | memo[i] = memo[i - 2] + memo[i - 3];
}
return memo[n];
}
public static int nthPadovanTermIterativeMethodWithVariables(int n) {
if (n == 0 || n == 1 || n == 2) {
return 1;
}
int p0 = 1, p1 = 1, p2 = 1;
int tempNthTerm;
for (int i = 3; i <= n; i... | repos\tutorials-master\core-java-modules\core-java-numbers-3\src\main\java\com\baeldung\padovan\PadovanSeriesUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
FilterInvocation fi = new FilterInvocation(servletRequest, servletResponse, filterChain);
invoke(fi);
}
public void invoke(FilterInvocation fi) t... | }
@Override
public Class<?> getSecureObjectClass() {
return FilterInvocation.class;
}
@Override
public SecurityMetadataSource obtainSecurityMetadataSource() {
return this.securityMetadataSource;
}
} | repos\SpringBootLearning-master (1)\springboot-jwt\src\main\java\com\gf\config\MyFilterSecurityInterceptor.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private boolean isCoProduct()
{
return getCOProductLine() != null;
}
private void setQRCodeAttribute(@NonNull final I_M_HU hu)
{
if (barcode == null) {return;}
final IAttributeStorage huAttributes = handlingUnitsBL.getAttributeStorage(hu);
if (!huAttributes.hasAttribute(HUAttributeConstants.ATTR_QRCode)) ... | private void save()
{
newSaver().saveActivityStatuses(job);
}
@NonNull
private ManufacturingJobLoaderAndSaver newSaver() {return new ManufacturingJobLoaderAndSaver(loadingAndSavingSupportServices);}
private void autoIssueForWhatWasReceived()
{
job = jobService.autoIssueWhatWasReceived(job, RawMaterialsIssue... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\job\service\commands\receive\ReceiveGoodsCommand.java | 2 |
请完成以下Java代码 | private static class DefaultSelectionHolder
{
private final HUEditorViewRepository huEditorViewRepository;
private final ViewEvaluationCtx viewEvaluationCtx;
private final ViewId viewId;
private final DocumentFilterList filters;
private final DocumentQueryOrderByList orderBys;
private final SqlDocumentFilt... | public ViewRowIdsOrderedSelection get()
{
return defaultSelectionRef.computeIfNull(this::create);
}
/**
* @return true if selection was really changed
*/
public boolean change(@NonNull final UnaryOperator<ViewRowIdsOrderedSelection> mapper)
{
final ViewRowIdsOrderedSelection defaultSelectionOld =... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\HUEditorViewBuffer_HighVolume.java | 1 |
请完成以下Java代码 | public static EntityCache getEntityCache() {
return getEntityCache(getCommandContext());
}
public static EntityCache getEntityCache(CommandContext commandContext) {
return commandContext.getSession(EntityCache.class);
}
@SuppressWarnings("unchecked")
public static void addInvolvedC... | public static CaseInstanceHelper getCaseInstanceHelper() {
return getCaseInstanceHelper(getCommandContext());
}
public static CaseInstanceHelper getCaseInstanceHelper(CommandContext commandContext) {
return getCmmnEngineConfiguration(commandContext).getCaseInstanceHelper();
}
public st... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\util\CommandContextUtil.java | 1 |
请完成以下Java代码 | public static VariableOrderProperty forProcessInstanceVariable(String variableName, ValueType valueType) {
VariableOrderProperty orderingProperty = new VariableOrderProperty(variableName, valueType);
orderingProperty.relationConditions.add(
new QueryEntityRelationCondition(VariableInstanceQueryProperty.... | new QueryEntityRelationCondition(VariableInstanceQueryProperty.CASE_EXECUTION_ID, TaskQueryProperty.CASE_EXECUTION_ID));
return orderingProperty;
}
public static QueryProperty typeToQueryProperty(ValueType type) {
if (ValueType.STRING.equals(type)) {
return VariableInstanceQueryProperty.TEXT_AS_LOWE... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\VariableOrderProperty.java | 1 |
请完成以下Java代码 | CodeSigner[] getCodeSigners(ZipContent.Entry contentEntry) {
return (this.codeSignerLookups != null) ? clone(this.codeSignerLookups[contentEntry.getLookupIndex()]) : null;
}
private <T> T[] clone(T[] array) {
return (array != null) ? array.clone() : null;
}
/**
* Get the {@link SecurityInfo} for the given {... | private static SecurityInfo load(ZipContent content) throws IOException {
int size = content.size();
boolean hasSecurityInfo = false;
Certificate[][] entryCertificates = new Certificate[size][];
CodeSigner[][] entryCodeSigners = new CodeSigner[size][];
try (JarEntriesStream entries = new JarEntriesStream(cont... | repos\spring-boot-4.0.1\loader\spring-boot-loader\src\main\java\org\springframework\boot\loader\jar\SecurityInfo.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public int hashCode()
{
return Objects.hash(shippingCarrierCode, shippingServiceCode, shipTo, shipToReferenceId);
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("class ShippingStep {\n");
sb.append(" shippingCarrierCode: ").append(toIndentedString(shippingCarri... | /**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o)
{
if (o == null)
{
return "null";
}
return o.toString().replace("\n", "\n ");
}
} | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-ebay\ebay-api-client\src\main\java\de\metas\camel\externalsystems\ebay\api\model\ShippingStep.java | 2 |
请完成以下Java代码 | public class SequenceFlow extends FlowElement {
protected String conditionExpression;
protected String sourceRef;
protected String targetRef;
protected String skipExpression;
// Actual flow elements that match the source and target ref
// Set during process definition parsing
@JsonIgnore
... | this.skipExpression = skipExpression;
}
public FlowElement getSourceFlowElement() {
return sourceFlowElement;
}
public void setSourceFlowElement(FlowElement sourceFlowElement) {
this.sourceFlowElement = sourceFlowElement;
}
public FlowElement getTargetFlowElement() {
r... | repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\SequenceFlow.java | 1 |
请完成以下Java代码 | private void updateInvoiceRecord(@NonNull final ImportedInvoiceResponse response,
@NonNull final I_C_Invoice invoiceRecord)
{
invoiceRecord.setIsInDispute(ImportedInvoiceResponse.Status.REJECTED.equals(response.getStatus()));
saveRecord(invoiceRecord);
}
private void attachFileToInvoiceRecord(
@Non... | @SuppressWarnings("WeakerAccess")
public static final class InvoiceResponseRepoException extends AdempiereException
{
private static final long serialVersionUID = -4024895067979792864L;
public InvoiceResponseRepoException(@NonNull final ITranslatableString message)
{
super(message);
}
public InvoiceRes... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_base\src\main\java\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\base\imp\InvoiceResponseRepo.java | 1 |
请完成以下Java代码 | default Integer provideCode(ProcessEngineException processEngineException) {
if (processEngineException instanceof OptimisticLockingException) {
return OPTIMISTIC_LOCKING.getCode();
}
return null;
}
/**
* <p>Called when a {@link SQLException} occurs.
*
* <p>Provides the exception code ... | boolean deadlockDetected = ExceptionUtil.checkDeadlockException(sqlException);
if (deadlockDetected) {
return DEADLOCK.getCode();
}
boolean foreignKeyConstraintViolated = ExceptionUtil.checkForeignKeyConstraintViolation(sqlException);
if (foreignKeyConstraintViolated) {
return FOREIGN_KEY_C... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\errorcode\ExceptionCodeProvider.java | 1 |
请完成以下Java代码 | public Text getText() {
return textChild.getChild(this);
}
public void setText(Text text) {
textChild.setChild(this, text);
}
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(UnaryTests.class, DMN_ELEMENT_UNARY_TESTS)
... | }
});
expressionLanguageAttribute = typeBuilder.stringAttribute(DMN_ATTRIBUTE_EXPRESSION_LANGUAGE)
.build();
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
textChild = sequenceBuilder.element(Text.class)
.build();
typeBuilder.build();
}
} | repos\camunda-bpm-platform-master\model-api\dmn-model\src\main\java\org\camunda\bpm\model\dmn\impl\instance\UnaryTestsImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static void addPath(final Map<String, Object> errorAttributes, final RequestAttributes requestAttributes)
{
final String path = getAttribute(requestAttributes, RequestDispatcher.ERROR_REQUEST_URI);
if (path != null)
{
errorAttributes.put(ATTR_Path, path);
}
}
@Override
public java.lang.Throwable... | public Throwable unboxRootError(@NonNull final java.lang.Throwable error)
{
Throwable rootError = error;
while (rootError instanceof ServletException)
{
final Throwable cause = AdempiereException.extractCause(rootError);
if (cause == rootError)
{
return rootError;
}
else
{
rootError = c... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\config\WebuiExceptionHandler.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public IncludeAttribute getIncludeMessage() {
return this.includeMessage;
}
public void setIncludeMessage(IncludeAttribute includeMessage) {
this.includeMessage = includeMessage;
}
public IncludeAttribute getIncludeBindingErrors() {
return this.includeBindingErrors;
}
public void setIncludeBindingErrors(... | * Always add error attribute.
*/
ALWAYS,
/**
* Add error attribute when the appropriate request parameter is not "false".
*/
ON_PARAM
}
public static class Whitelabel {
/**
* Whether to enable the default error page displayed in browsers in case of a
* server error.
*/
private boolean ... | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\web\ErrorProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private PickingJob getJob()
{
if (_job == null)
{
_job = pickingJobService.getById(request.getPickingJobId());
}
return _job;
}
private IHUQRCode getHUQRCode()
{
if (_huQRCode == null)
{
_huQRCode = huService.parsePickFromScannedCode(request.getHuScannedCode());
log("Parsed QR code: " + _huQRC... | final ShipmentScheduleId shipmentScheduleId = line.getScheduleId().getShipmentScheduleId();
return shipmentSchedules.getById(shipmentScheduleId).getWarehouseId();
}
private void log(@NonNull String message)
{
log(null, message);
}
private void log(@Nullable final PickingJobLine line, @NonNull String message)... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\commands\get_next_eligible_line\GetNextEligibleLineToPackCommand.java | 2 |
请完成以下Java代码 | protected void visit(RuleChain entity, TbActorRef actorRef) {
if (entity != null && entity.isRoot() && entity.getType().equals(RuleChainType.CORE)) {
rootChain = entity;
rootChainActor = actorRef;
}
}
protected TbActorRef getOrCreateActor(RuleChainId ruleChainId) {
... | () -> true);
}
protected TbActorRef getEntityActorRef(EntityId entityId) {
TbActorRef target = null;
if (entityId.getEntityType() == EntityType.RULE_CHAIN) {
target = getOrCreateActor((RuleChainId) entityId);
}
return target;
}
protected void broadcast(TbAct... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\actors\ruleChain\RuleChainManagerActor.java | 1 |
请完成以下Java代码 | public class PaymentsTableModel extends AbstractAllocableDocTableModel<IPaymentRow>
{
private static final long serialVersionUID = 1L;
// NOTE: using cast() is discouraged
// public static final PaymentsTableModel cast(final TableModel model)
// {
// Check.assumeNotNull(model, "model not null");
// return (Payme... | *
* @param type
* @param allowed
*/
public final void setAllowWriteOffAmountOfType(final InvoiceWriteOffAmountType type, final boolean allowed)
{
if (type == InvoiceWriteOffAmountType.Discount)
{
// Update column's editable status
final String columnName = IPaymentRow.PROPERTY_DiscountAmt;
getTabl... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.swingui\src\main\java\de\metas\banking\payment\paymentallocation\model\PaymentsTableModel.java | 1 |
请完成以下Java代码 | private static String executeCommand(String command) {
String output = null;
try {
output = collectOutput(runProcess(command));
} catch (Exception ex) {
System.out.println(ex);
}
return output;
}
private static String collectOutput(Process process... | output.append(line + "\n");
}
return output.toString();
}
private static Process runProcess(String command) throws IOException, InterruptedException {
ProcessBuilder builder = new ProcessBuilder(command.split(DELIMITER));
builder.directory(new File(WORK_PATH).getAbsoluteFile());... | repos\tutorials-master\core-java-modules\core-java-jar\src\main\java\com\baeldung\manifest\ExecuteJarFile.java | 1 |
请完成以下Java代码 | public final class SecurityAnnotationScanners {
private static final Map<Class<? extends Annotation>, SecurityAnnotationScanner<? extends Annotation>> uniqueTemplateScanners = new ConcurrentHashMap<>();
private static final Map<List<Class<? extends Annotation>>, SecurityAnnotationScanner<? extends Annotation>> uniq... | */
public static <A extends Annotation> SecurityAnnotationScanner<A> requireUnique(Class<A> type,
AnnotationTemplateExpressionDefaults templateDefaults) {
return (SecurityAnnotationScanner<A>) uniqueTemplateScanners.computeIfAbsent(type,
(t) -> new ExpressionTemplateSecurityAnnotationScanner<>(t, templateDefa... | repos\spring-security-main\core\src\main\java\org\springframework\security\core\annotation\SecurityAnnotationScanners.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Builder singleLogoutServiceResponseLocation(String singleLogoutServiceResponseLocation) {
this.singleLogoutServiceResponseLocation = singleLogoutServiceResponseLocation;
return this;
}
/**
* Set the NameID format
* @param nameIdFormat the given NameID format
* @return the {@link Builder} for ... | public Builder assertingPartyMetadata(Consumer<AssertingPartyMetadata.Builder<?>> assertingPartyMetadata) {
assertingPartyMetadata.accept(this.assertingPartyMetadataBuilder);
return this;
}
/**
* Constructs a RelyingPartyRegistration object based on the builder
* configurations
* @return a RelyingPa... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\provider\service\registration\RelyingPartyRegistration.java | 2 |
请完成以下Java代码 | public final class CookieHttpSessionIdResolver implements HttpSessionIdResolver {
private static final String WRITTEN_SESSION_ID_ATTR = CookieHttpSessionIdResolver.class.getName()
.concat(".WRITTEN_SESSION_ID_ATTR");
private CookieSerializer cookieSerializer = new DefaultCookieSerializer();
@Override
public Li... | public void expireSession(HttpServletRequest request, HttpServletResponse response) {
this.cookieSerializer.writeCookieValue(new CookieValue(request, response, ""));
}
/**
* Sets the {@link CookieSerializer} to be used.
* @param cookieSerializer the cookieSerializer to set. Cannot be null.
*/
public void se... | repos\spring-session-main\spring-session-core\src\main\java\org\springframework\session\web\http\CookieHttpSessionIdResolver.java | 1 |
请完成以下Java代码 | public List<IInvoiceCandAggregate> aggregate()
{
final List<IInvoiceCandAggregate> invoiceCandAggregates = new ArrayList<>();
// ic2QtyInvoiceable keeps track of the qty that we have left to invoice,
// to make sure that we don't invoice more that the invoice candidate allows us to
final HashMap<InvoiceCandid... | if (!ic2QtyInvoicable.containsKey(ics.getInvoicecandidateId()))
{
// Initialize, if necessary
// task 08507: ic.getQtyToInvoice() is already the "effective" Qty.
// Even if QtyToInvoice_Override is set, the system will decide what to invoice (e.g. based on InvoiceRule and QtyDelivered)
// and u... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\spi\impl\aggregator\standard\DefaultAggregator.java | 1 |
请完成以下Java代码 | private ChangeLogEntry toRecordChangeLogEntry(@NonNull final I_AD_ChangeLog changeLog)
{
final boolean oldValueIsNull = changeLog.getOldValue() == null || changeLog.getOldValue().equals("NULL");
final boolean newValueIsNull = changeLog.getNewValue() == null || changeLog.getNewValue().equals("NULL");
return Chan... | {
final IQueryBuilder<I_AD_ChangeLog> query = queryBL.createQueryBuilder(I_AD_ChangeLog.class)
.addEqualsFilter(I_AD_ChangeLog.COLUMNNAME_AD_Table_ID, changeLogConfig.getTableId())
.addCompareFilter(I_AD_ChangeLog.COLUMNNAME_Created, CompareQueryFilter.Operator.LESS_OR_EQUAL, SystemTime.asInstant().minus(chan... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\table\ChangeLogEntryRepository.java | 1 |
请完成以下Java代码 | private Optional<IQueueProcessor> getAvailableQueueProcessorForWorkPackage(@NonNull final QueuePackageProcessorId packageProcessorId)
{
return queueProcessors
.values()
.stream()
.filter(processor -> processor.getAssignedPackageProcessorIds().contains(packageProcessorId))
.filter(IQueueProcessor::isA... | {
if (workPackage == null)
{
return false;
}
if (workPackage.isProcessed())
{
return false;
}
if (workPackage.isError())
{
return false;
}
return true;
}
private static void setupNewCtxForWorkPackage(@NonNull final I_C_Queue_WorkPackage workPackage, @NonNull final Properties commonCtx)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\processor\impl\planner\QueueProcessorPlanner.java | 1 |
请完成以下Java代码 | public final C_AllocationHdr_Builder dateAcct(LocalDate dateAcct)
{
return dateAcct(TimeUtil.asTimestamp(dateAcct));
}
public final C_AllocationHdr_Builder dateAcct(Timestamp dateAcct)
{
assertNotBuilt();
allocHdr.setDateAcct(dateAcct);
return this;
}
public final C_AllocationHdr_Builder currencyId(@Non... | {
assertNotBuilt();
allocHdr.setDescription(description);
return this;
}
public C_AllocationLine_Builder addLine()
{
assertNotBuilt();
final C_AllocationLine_Builder lineBuilder = new C_AllocationLine_Builder(this);
allocationLineBuilders.add(lineBuilder);
return lineBuilder;
}
public final Immut... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\allocation\api\C_AllocationHdr_Builder.java | 1 |
请完成以下Java代码 | default boolean isInvalid()
{
return isNoProducts() || isNoLocators() || isNoBPartners();
}
Set<Integer> getProductIds();
default boolean isNoProducts()
{
final Set<Integer> productIds = getProductIds();
return productIds == null || productIds.isEmpty();
}
default boolean isAnyProduct()
{
final Set<I... | default boolean isNoLocators()
{
final Set<Integer> locatorIds = getLocatorIds();
return locatorIds == null || locatorIds.isEmpty();
}
Set<Integer> getBillBPartnerIds();
default boolean isAnyBillBPartner()
{
final Set<Integer> billBPartnerIds = getBillBPartnerIds();
return billBPartnerIds.isEmpty() || bi... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\invalidation\segments\IShipmentScheduleSegment.java | 1 |
请完成以下Java代码 | public List<int[]> generate(int n, int r) {
List<int[]> combinations = new ArrayList<>();
helper(combinations, new int[r], 0, n-1, 0);
return combinations;
}
/**
* @param combinations - List to contain the generated combinations
* @param data - List of elements in the selectio... | } else if (start <= end) {
data[index] = start;
helper(combinations, data, start + 1, end, index + 1);
helper(combinations, data, start + 1, end, index);
}
}
public static void main(String[] args) {
SetRecursiveCombinationGenerator generator = new SetRecursiv... | repos\tutorials-master\core-java-modules\core-java-lang-math-2\src\main\java\com\baeldung\algorithms\combination\SetRecursiveCombinationGenerator.java | 1 |
请完成以下Java代码 | public class MybatisResourceDataManager extends AbstractCmmnDataManager<CmmnResourceEntity> implements CmmnResourceDataManager {
public MybatisResourceDataManager(CmmnEngineConfiguration cmmnEngineConfiguration) {
super(cmmnEngineConfiguration);
}
@Override
public Class<? extends CmmnResourceE... | @Override
public CmmnResourceEntity findResourceByDeploymentIdAndResourceName(String deploymentId, String resourceName) {
Map<String, Object> params = new HashMap<>();
params.put("deploymentId", deploymentId);
params.put("name", resourceName);
return (CmmnResourceEntity) getDbSqlSess... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\persistence\entity\data\impl\MybatisResourceDataManager.java | 1 |
请完成以下Java代码 | public void setTransactionManager(PlatformTransactionManager transactionManager) {
this.transactionManager = transactionManager;
}
public String getDeploymentName() {
return deploymentName;
}
public void setDeploymentName(String deploymentName) {
this.deploymentName = deploymen... | this.deploymentMode = deploymentMode;
}
/**
* Gets the {@link AutoDeploymentStrategy} for the provided mode. This method may be overridden to implement custom deployment strategies if required, but implementors should take care not to return
* <code>null</code>.
*
* @param mode
* ... | repos\Activiti-develop\activiti-core\activiti-spring\src\main\java\org\activiti\spring\SpringProcessEngineConfiguration.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CreateProductPriceRequest
{
@NonNull
OrgId orgId;
@NonNull
ProductId productId;
@NonNull
PriceListVersionId priceListVersionId;
@NonNull
BigDecimal priceStd;
@Nullable
Boolean isActive;
@NonNull
@Builder.Default | BigDecimal priceList = BigDecimal.ZERO;
@NonNull
@Builder.Default
BigDecimal priceLimit = BigDecimal.ZERO;
@NonNull
TaxCategoryId taxCategoryId;
@NonNull
UomId uomId;
@Nullable
Integer seqNo;
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\productprice\CreateProductPriceRequest.java | 2 |
请完成以下Java代码 | public void migrate(Context context) throws Exception {
// 创建 JdbcTemplate ,方便 JDBC 操作
JdbcTemplate template = new JdbcTemplate(context.getConfiguration().getDataSource());
// 查询所有用户,如果用户名为 yudaoyuanma ,则变更成 yutou
template.query("SELECT id, username, password, create_time FROM users", ne... | public Integer getChecksum() {
return 11; // 默认返回,是 null 。
}
@Override
public boolean canExecuteInTransaction() {
return true; // 默认返回,也是 true
}
@Override
public MigrationVersion getVersion() {
return super.getVersion(); // 默认按照约定的规则,从类名中解析获得。可以自定义
}
} | repos\SpringBoot-Labs-master\lab-20\lab-20-database-version-control-flyway\src\main\java\cn\iocoder\springboot\lab20\databaseversioncontrol\migration\V1_1__FixUsername.java | 1 |
请完成以下Java代码 | public String toString() {
String template = Objects.requireNonNull(config.getTemplate(), "template must not be null");
return filterToStringCreator(SetRequestUriGatewayFilterFactory.this).append("template", template)
.toString();
}
};
}
String getUri(ServerWebExchange exchange, Config config) {
... | }
catch (IllegalArgumentException e) {
log.info("Request url is invalid : url={}, error={}", config.getTemplate(), e.getMessage());
return Optional.ofNullable(null);
}
}
public static class Config {
private @Nullable String template;
public @Nullable String getTemplate() {
return template;
}
... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\SetRequestUriGatewayFilterFactory.java | 1 |
请完成以下Java代码 | public String toString()
{
StringBuffer sb = new StringBuffer ("X_M_InOutLineMA[")
.append(get_ID()).append("]");
return sb.toString();
}
public I_M_AttributeSetInstance getM_AttributeSetInstance() throws RuntimeException
{
return (I_M_AttributeSetInstance)MTable.get(getCtx(), I_M_At... | }
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), String.valueOf(getM_InOutLine_ID()));
}
/** Set Movement Quantity.
@param MovementQty
Quantity of a product moved.
*/
public void setMove... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_InOutLineMA.java | 1 |
请完成以下Java代码 | default Instant getExpiresAt() {
return getClaimAsInstant(OAuth2TokenIntrospectionClaimNames.EXP);
}
/**
* Returns a timestamp {@code (iat)} indicating when the token was issued
* @return a timestamp indicating when the token was issued
*/
@Nullable
default Instant getIssuedAt() {
return getClaimAsInstan... | }
/**
* Returns the issuer {@code (iss)} of the token
* @return the issuer of the token
*/
@Nullable
default URL getIssuer() {
return getClaimAsURL(OAuth2TokenIntrospectionClaimNames.ISS);
}
/**
* Returns the identifier {@code (jti)} for the token
* @return the identifier for the token
*/
@Nullabl... | repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\OAuth2TokenIntrospectionClaimAccessor.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.