instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请在Spring Boot框架中完成以下Java代码 | public void setShowSummaryOutput(@Nullable ShowSummaryOutput showSummaryOutput) {
this.showSummaryOutput = showSummaryOutput;
}
public @Nullable UiService getUiService() {
return this.uiService;
}
public void setUiService(@Nullable UiService uiService) {
this.uiService = uiService;
}
public @Nullable Boo... | /**
* Output the summary to the console.
*/
CONSOLE,
/**
* Log the summary and output it to the console.
*/
ALL
}
/**
* Enumeration of types of UIService. Values are the same as those on
* {@link UIServiceEnum}. To maximize backwards compatibility, the Liquibase enum is
* not used directly.... | repos\spring-boot-4.0.1\module\spring-boot-liquibase\src\main\java\org\springframework\boot\liquibase\autoconfigure\LiquibaseProperties.java | 2 |
请完成以下Java代码 | public static ActivityInstanceEntityManager getActivityInstanceEntityManager(CommandContext commandContext) {
return getProcessEngineConfiguration(commandContext).getActivityInstanceEntityManager();
}
public static HistoricActivityInstanceEntityManager getHistoricActivityInstanceEntityManager() {
... | return getProcessEngineConfiguration(commandContext).getEventDispatcher();
}
public static FailedJobCommandFactory getFailedJobCommandFactory() {
return getFailedJobCommandFactory(getCommandContext());
}
public static FailedJobCommandFactory getFailedJobCommandFactory(CommandContext commandCon... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\util\CommandContextUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class AutoConfigurations extends Configurations implements Ordered {
private static final SimpleMetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory();
private static final int ORDER = AutoConfigurationImportSelector.ORDER;
static final AutoConfigurationReplacements replacements = ... | @Override
public int getOrder() {
return ORDER;
}
@Override
protected AutoConfigurations merge(Set<Class<?>> mergedClasses) {
return new AutoConfigurations(this.replacementMapper, mergedClasses);
}
public static AutoConfigurations of(Class<?>... classes) {
return new AutoConfigurations(Arrays.asList(class... | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\AutoConfigurations.java | 2 |
请完成以下Java代码 | public static <T extends ReactiveJwtDecoder> T fromIssuerLocation(String issuer) {
Assert.hasText(issuer, "issuer cannot be empty");
Map<String, Object> configuration = JwtDecoderProviderConfigurationUtils
.getConfigurationForIssuerLocation(issuer);
return (T) withProviderConfiguration(configuration, issuer);
... | * "https://openid.net/specs/openid-connect-core-1_0.html#IssuerIdentifier">Issuer</a>
* @return {@link ReactiveJwtDecoder}
*/
private static ReactiveJwtDecoder withProviderConfiguration(Map<String, Object> configuration, String issuer) {
JwtDecoderProviderConfigurationUtils.validateIssuer(configuration, issuer);... | repos\spring-security-main\oauth2\oauth2-jose\src\main\java\org\springframework\security\oauth2\jwt\ReactiveJwtDecoders.java | 1 |
请完成以下Java代码 | private @Nullable ThreadPoolTaskScheduler createTaskScheduler(String cleanupCron) {
if (cleanupCron == null) {
return null;
}
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.setThreadNamePrefix("spring-one-time-tokens-");
taskScheduler.initialize();
taskScheduler.sche... | parameters.add(new SqlParameterValue(Types.VARCHAR, oneTimeToken.getTokenValue()));
parameters.add(new SqlParameterValue(Types.VARCHAR, oneTimeToken.getUsername()));
parameters.add(new SqlParameterValue(Types.TIMESTAMP, Timestamp.from(oneTimeToken.getExpiresAt())));
return parameters;
}
}
/**
* The def... | repos\spring-security-main\core\src\main\java\org\springframework\security\authentication\ott\JdbcOneTimeTokenService.java | 1 |
请完成以下Java代码 | public class InsertJsonData {
private static final String URL = "jdbc:postgresql://localhost:5432/database_name";
private static final String USER = "username";
private static final String PASSWORD = "password";
public Connection getConnection() throws SQLException {
return DriverManager.getCo... | pstmt.setString(1, name);
pstmt.setString(2, info.toString());
pstmt.executeUpdate();
System.out.println("Data inserted successfully.");
}
public static void main(String[] args) throws SQLException {
JSONObject jsonInfo = new JSONObject();
jsonInfo.put("email", "john.do... | repos\tutorials-master\persistence-modules\core-java-persistence-3\src\main\java\preparedstatement\InsertJsonData.java | 1 |
请完成以下Java代码 | public String helloSleuthNewSpan() throws InterruptedException {
logger.info("New Span");
sleuthService.doSomeWorkNewSpan();
return "success";
}
@GetMapping("/new-thread")
public String helloSleuthNewThread() {
logger.info("New Thread");
Runnable runnable = () -> {
... | };
executor.execute(runnable);
logger.info("I'm done - with the original span");
return "success";
}
@GetMapping("/async")
public String helloSleuthAsync() throws InterruptedException {
logger.info("Before Async Method Call");
sleuthService.asyncMethod();
lo... | repos\tutorials-master\spring-cloud-modules\spring-cloud-sleuth\src\main\java\com\baeldung\spring\session\SleuthController.java | 1 |
请完成以下Java代码 | public void setIsOrdered (boolean IsOrdered)
{
set_Value (COLUMNNAME_IsOrdered, Boolean.valueOf(IsOrdered));
}
/** Get Auftrag erteilt.
@return Auftrag erteilt */
@Override
public boolean isOrdered ()
{
Object oo = get_Value(COLUMNNAME_IsOrdered);
if (oo != null)
{
if (oo instanceof Boolean)
... | set_Value (COLUMNNAME_PhonecallTimeMin, PhonecallTimeMin);
}
/** Get Erreichbar von.
@return Erreichbar von */
@Override
public java.sql.Timestamp getPhonecallTimeMin ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_PhonecallTimeMin);
}
/** Set Kundenbetreuer.
@param SalesRep_ID Kundenbetreuer *... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Phonecall_Schedule.java | 1 |
请完成以下Java代码 | public void addImpression() {
setActualImpression(getActualImpression()+1);
if (getCurrentImpression()>=getMaxImpression())
setIsActive(false);
save();
}
/**
* Get Next of this Category, this Procedure will return the next Ad in a category and expire it if needed
* @param ctx Context
* @param CM_Ad_... | }
}
if (thisAd!=null)
thisAd.addImpression();
return thisAd;
}
/**
* Add Click Record to Log
*/
public void addClick()
{
setActualClick(getActualClick()+1);
if (getActualClick()>getMaxClick())
setIsActive(true);
save();
}
} // MAd | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MAd.java | 1 |
请完成以下Java代码 | public void deleteAttachmentsByTaskCaseInstanceIds(List<String> caseInstanceIds) {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("caseInstanceIds", caseInstanceIds);
deleteAttachments(parameters);
}
protected void deleteAttachments(Map<String, Object> parameters) {
... | public DbOperation deleteAttachmentsByRemovalTime(Date removalTime, int minuteFrom, int minuteTo, int batchSize) {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("removalTime", removalTime);
if (minuteTo - minuteFrom + 1 < 60) {
parameters.put("minuteFrom", minuteFrom);... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\AttachmentManager.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "productid")
private Long productId;
@Column(name = "productname")
private String productName;
@Column(name = "stock")
private Integer stock;
@Column(name = "price")
private BigDecimal ... | public Integer getStock() {
return stock;
}
public void setStock(Integer stock) {
this.stock = stock;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
} | repos\tutorials-master\spring-batch-2\src\main\java\com\baeldung\batch\model\Product.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class TaskEventResource extends TaskBaseResource {
@ApiOperation(value = "Get an event on a task", tags = { "Tasks" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Indicates the task and event were found and the event is returned."),
@ApiResponse(code = 404, messag... | })
@DeleteMapping(value = "/runtime/tasks/{taskId}/events/{eventId}")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteEvent(@ApiParam(name = "taskId") @PathVariable("taskId") String taskId, @ApiParam(name = "eventId") @PathVariable("eventId") String eventId) {
// Check if task exists
... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\task\TaskEventResource.java | 2 |
请完成以下Java代码 | public int getC_Phonecall_Schema_Version_Line_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Phonecall_Schema_Version_Line_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Beschreibung.
@param Description Beschreibung */
@Override
public void setDescription (java.lang.String Des... | /** Get Erreichbar von.
@return Erreichbar von */
@Override
public java.sql.Timestamp getPhonecallTimeMin ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_PhonecallTimeMin);
}
/** Set Reihenfolge.
@param SeqNo
Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst
*/
@Over... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Phonecall_Schema_Version_Line.java | 1 |
请完成以下Java代码 | public boolean isMainProduct()
{
return getTrxType() == PPOrderCostTrxType.MainProduct;
}
public boolean isCoProduct()
{
return getTrxType().isCoProduct();
}
public boolean isByProduct()
{
return getTrxType() == PPOrderCostTrxType.ByProduct;
}
@NonNull
public PPOrderCost addingAccumulatedAmountAndQty... | @NonNull final Quantity qty,
@NonNull final QuantityUOMConverter uomConverter)
{
return addingAccumulatedAmountAndQty(amt.negate(), qty.negate(), uomConverter);
}
public PPOrderCost withPrice(@NonNull final CostPrice newPrice)
{
if (this.getPrice().equals(newPrice))
{
return this;
}
return toBuild... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\api\PPOrderCost.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void handleParentChanged(@NonNull final HandleParentChangedRequest request)
{
if (request.getCurrentParentId() != null)
{
final IssueHierarchy issueHierarchy = issueRepository.buildUpStreamIssueHierarchy(request.getCurrentParentId());
issueHierarchy
.getUpStreamForId(request.getCurrentParentId(... | .forEach(parentIssue ->
{
parentIssue.addAggregatedEffort(request.getBookedEffort());
recomputeLatestActivityOnSubIssues(parentIssue);
issueRepository.save(parentIssue);
});
}
}
private void recomputeLatestActivityOnSubIssues(@NonNull final IssueEntity issueEntity)
{
final Immutabl... | repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\issue\IssueService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
/**
* Enable authentication with three in-memory users: UserA, UserB and UserC.
*
* Spring Security will provide a default login form where insert username
* and password.
*/
@Autowired
public void configureGlobal(Authentication... | /**
* Disable CSRF protection (to simplify this demo) and enable the default
* login form.
*/
@Override
protected void configure(HttpSecurity http) throws Exception {
http
// Disable CSRF protection
.csrf().disable()
// Set default configurations from Spring Security
.authorizeR... | repos\spring-boot-samples-master\spring-boot-web-socket-user-notifications\src\main\java\netgloo\configs\WebSecurityConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | static class StandaloneEngineConfiguration extends BaseEngineConfigurationWithConfigurers<SpringProcessEngineConfiguration> {
@Bean
public ProcessEngineFactoryBean processEngine(SpringProcessEngineConfiguration configuration) throws Exception {
ProcessEngineFactoryBean processEngine... | @ConditionalOnMissingBean
public ManagementService managementServiceBean(ProcessEngine processEngine) {
return processEngine.getManagementService();
}
@Bean
@ConditionalOnMissingBean
public DynamicBpmnService dynamicBpmnServiceBean(ProcessEngine processEngine) {
return processEn... | repos\flowable-engine-main\modules\flowable-spring-boot\flowable-spring-boot-starters\flowable-spring-boot-autoconfigure\src\main\java\org\flowable\spring\boot\ProcessEngineServicesAutoConfiguration.java | 2 |
请完成以下Java代码 | public class AdminUserDetails implements UserDetails {
private UmsAdmin umsAdmin;
public AdminUserDetails(UmsAdmin umsAdmin) {
this.umsAdmin = umsAdmin;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
//返回当前用户的权限
return Arrays.asList(new SimpleG... | }
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
retu... | repos\mall-master\mall-demo\src\main\java\com\macro\mall\demo\bo\AdminUserDetails.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Duration getHandshakeTimeout() {
return handshakeTimeout;
}
public void setHandshakeTimeout(Duration handshakeTimeout) {
this.handshakeTimeout = handshakeTimeout;
}
public Duration getCloseNotifyFlushTimeout() {
return closeNotifyFlushTimeout;
}
public void setCloseNotifyFlushTimeout(Dura... | }
public void setMaxFramePayloadLength(Integer maxFramePayloadLength) {
this.maxFramePayloadLength = maxFramePayloadLength;
}
public boolean isProxyPing() {
return proxyPing;
}
public void setProxyPing(boolean proxyPing) {
this.proxyPing = proxyPing;
}
@Override
public String toString() {
... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\config\HttpClientProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class AlipayService {
@Autowired
private AlipayConfig alipayConfig;
public String createOrder(String outTradeNo, String totalAmount, String subject) throws AlipayApiException {
AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig.getGatewayUrl(), alipayConfig.getAppId(), alipayC... | }
}
public String queryPayment(String outTradeNo) {
AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig.getGatewayUrl(), alipayConfig.getAppId(), alipayConfig.getMerchantPrivateKey(), "json", "UTF-8", alipayConfig.getAlipayPublicKey(), "RSA2");
AlipayTradeQueryRequest request = new ... | repos\springboot-demo-master\Alipay-facetoface\src\main\java\com\et\service\AlipayService.java | 2 |
请完成以下Java代码 | public int getM_HU_Attribute_ID()
{
return get_ValueAsInt(COLUMNNAME_M_HU_Attribute_ID);
}
@Override
public void setM_HU_Attribute_Snapshot_ID (final int M_HU_Attribute_Snapshot_ID)
{
if (M_HU_Attribute_Snapshot_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_HU_Attribute_Snapshot_ID, null);
else
set_ValueN... | @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);
}
@Override
public void setValueInitial (final @Nullable java.lang.String ValueInitial)
{
set_Val... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Attribute_Snapshot.java | 1 |
请完成以下Java代码 | public void setQtyOutgoing (java.math.BigDecimal QtyOutgoing)
{
set_Value (COLUMNNAME_QtyOutgoing, QtyOutgoing);
}
/** Get QtyOutgoing.
@return QtyOutgoing */
@Override
public java.math.BigDecimal getQtyOutgoing ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyOutgoing);
if (bd == null)
re... | public java.sql.Timestamp getResetDate ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_ResetDate);
}
/** Set ResetDateEffective.
@param ResetDateEffective ResetDateEffective */
@Override
public void setResetDateEffective (java.sql.Timestamp ResetDateEffective)
{
set_Value (COLUMNNAME_ResetDateEffec... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\inout\model\X_M_Material_Balance_Detail.java | 1 |
请完成以下Java代码 | public class PvmAtomicOperationActivityInitStack implements PvmAtomicOperation {
protected PvmAtomicOperation operationOnScopeInitialization;
public PvmAtomicOperationActivityInitStack(PvmAtomicOperation operationOnScopeInitialization) {
this.operationOnScopeInitialization = operationOnScopeInitialization;
... | propagatingExecution.setActivity(currentActivity);
propagatingExecution.initialize();
}
else {
propagatingExecution.setActivity(currentActivity);
}
// notify listeners for the instantiated activity
propagatingExecution.performOperation(operationOnScopeInitialization);
}
public bool... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\pvm\runtime\operation\PvmAtomicOperationActivityInitStack.java | 1 |
请完成以下Java代码 | public de.metas.handlingunits.model.I_M_HU getM_HU()
{
return get_ValueAsPO(COLUMNNAME_M_HU_ID, de.metas.handlingunits.model.I_M_HU.class);
}
@Override
public void setM_HU(final de.metas.handlingunits.model.I_M_HU M_HU)
{
set_ValueFromPO(COLUMNNAME_M_HU_ID, de.metas.handlingunits.model.I_M_HU.class, M_HU);
}... | set_ValueNoCheck (COLUMNNAME_M_Source_HU_ID, M_Source_HU_ID);
}
@Override
public int getM_Source_HU_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Source_HU_ID);
}
@Override
public void setPreDestroy_Snapshot_UUID (final @Nullable java.lang.String PreDestroy_Snapshot_UUID)
{
set_Value (COLUMNNAME_PreDestroy_S... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_Source_HU.java | 1 |
请完成以下Java代码 | public static void concatByFormatBy100(Blackhole blackhole) {
concatByFormat(FORMAT_STR_100, DATA_100, blackhole);
}
@Benchmark
public static void concatByFormatBy1000(Blackhole blackhole) {
concatByFormat(FORMAT_STR_1000, DATA_1000, blackhole);
}
@Benchmark
public static void ... | String concatString = "";
List<String> strList = List.of(data);
concatString = strList.stream().collect(Collectors.joining(""));
blackhole.consume(concatString);
}
public static void main(String[] args) throws Exception {
Options options = new OptionsBuilder()
.inclu... | repos\tutorials-master\core-java-modules\core-java-string-operations-6\src\main\java\com\baeldung\performance\BatchConcatBenchmark.java | 1 |
请完成以下Java代码 | public int compare(Map.Entry<E, Integer> o1, Map.Entry<E, Integer> o2)
{
return -o1.getValue().compareTo(o2.getValue());
}
});
for (Map.Entry<E, Integer> entry : entries)
{
sb.append(entry.getKey());
sb.append(' ');
sb.a... | if (param == null) return null;
String[] array = param.split(" ");
return create(array);
}
@SuppressWarnings("unchecked")
public static Map.Entry<String, Map.Entry<String, Integer>[]> create(String param[])
{
if (param.length % 2 == 0) return null;
int natureCount = (par... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\dictionary\item\EnumItem.java | 1 |
请完成以下Java代码 | private @NonNull <T> Iterable<T> asIterable(@NonNull Iterator<T> iterator) {
return () -> iterator;
}
// TODO configure via an SPI
private JsonToPdxConverter newJsonToPdxConverter() {
return new JSONFormatterJsonToPdxConverter();
}
// TODO configure via an SPI
private ObjectMapper newObjectMapper() {
retu... | for (JsonNode object : asIterable(CollectionUtils.nullSafeIterator(arrayNode.elements()))) {
pdxList.add(converter.convert(object.toString()));
}
}
else if (isObject(jsonNode)) {
ObjectNode objectNode = (ObjectNode) jsonNode;
pdxList.add(getJsonToPdxConverter().convert(objectNode.toString()));
... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\data\json\converter\support\JacksonJsonToPdxConverter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private synchronized String getEmail(String emailUrl, String oauth2Token) {
restTemplateBuilder = restTemplateBuilder.defaultHeader(AUTHORIZATION, "token " + oauth2Token);
RestTemplate restTemplate = restTemplateBuilder.build();
GithubEmailsResponse githubEmailsResponse;
try {
... | } else {
log.error("Could not find primary email from {}.", githubEmailsResponse);
throw new RuntimeException("Unable to login. Please contact your Administrator!");
}
}
private static class GithubEmailsResponse extends ArrayList<GithubEmailResponse> {}
@Data
@ToString
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\security\auth\oauth2\GithubOAuth2ClientMapper.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void save(User user) {
if (userMapper.findById(user.getId()) == null) {
userMapper.insert(user);
} else {
userMapper.update(user);
}
}
@Override
public Optional<User> findById(String id) {
return Optional.ofNullable(userMapper.findById(id));
}
@Override
public Optional<U... | return Optional.ofNullable(userMapper.findByEmail(email));
}
@Override
public void saveRelation(FollowRelation followRelation) {
if (!findRelation(followRelation.getUserId(), followRelation.getTargetId()).isPresent()) {
userMapper.saveRelation(followRelation);
}
}
@Override
public Optional<F... | repos\spring-boot-realworld-example-app-master\src\main\java\io\spring\infrastructure\repository\MyBatisUserRepository.java | 2 |
请完成以下Java代码 | final class DPoPProofVerifier {
private static final JwtDecoderFactory<DPoPProofContext> dPoPProofVerifierFactory = new DPoPProofJwtDecoderFactory();
private DPoPProofVerifier() {
}
static Jwt verifyIfAvailable(OAuth2AuthorizationGrantAuthenticationToken authorizationGrantAuthentication) {
String dPoPProof = (... | try {
// @formatter:off
DPoPProofContext dPoPProofContext = DPoPProofContext.withDPoPProof(dPoPProof)
.method(method)
.targetUri(targetUri)
.build();
// @formatter:on
JwtDecoder dPoPProofVerifier = dPoPProofVerifierFactory.createDecoder(dPoPProofContext);
dPoPProofJwt = dPoPProofVerifier.d... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\authentication\DPoPProofVerifier.java | 1 |
请完成以下Java代码 | public static List<Map<String, Object>> findListByHash(final String dbKey, String sql, HashMap<String, Object> data) {
List<Map<String, Object>> list;
JdbcTemplate jdbcTemplate = getJdbcTemplate(dbKey);
//根据模板获取sql
sql = FreemarkerParseFactory.parseTemplateContent(sql, data);
Nam... | NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate.getDataSource());
list = namedParameterJdbcTemplate.queryForList(sql, data, clazz);
return list;
}
/**
* 直接sql查询 返回实体类列表
*
* @param dbKey 数据源标识
* @param sql 执行sql语句,sql支持 mi... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\dynamic\db\DynamicDBUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static class RouteCacheConfiguration implements HasRouteId {
private @Nullable DataSize size;
private @Nullable Duration timeToLive;
private @Nullable String routeId;
public @Nullable DataSize getSize() {
return size;
}
public RouteCacheConfiguration setSize(@Nullable DataSize size) {
this... | public RouteCacheConfiguration setTimeToLive(@Nullable Duration timeToLive) {
this.timeToLive = timeToLive;
return this;
}
@Override
public void setRouteId(String routeId) {
this.routeId = routeId;
}
@Override
public @Nullable String getRouteId() {
return this.routeId;
}
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\cache\LocalResponseCacheGatewayFilterFactory.java | 2 |
请完成以下Java代码 | public static <S, T> void addCollectionToMapOfSets(Map<S, Set<T>> map, S key, Collection<T> values) {
Set<T> set = map.get(key);
if (set == null) {
set = new HashSet<>();
map.put(key, set);
}
set.addAll(values);
}
/**
* Chops a list into non-view sublists of length partitionSize. Not... | public static <T> List<T> collectInList(Iterator<T> iterator) {
List<T> result = new ArrayList<>();
while (iterator.hasNext()) {
result.add(iterator.next());
}
return result;
}
public static <T> T getLastElement(final Iterable<T> elements) {
T lastElement = null;
if (elements instanc... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\util\CollectionUtil.java | 1 |
请完成以下Java代码 | public CleanableHistoricCaseInstanceReport caseDefinitionKeyIn(String... caseDefinitionKeys) {
ensureNotNull(NotValidException.class, "", "caseDefinitionKeyIn", (Object[]) caseDefinitionKeys);
this.caseDefinitionKeyIn = caseDefinitionKeys;
return this;
}
@Override
public CleanableHistoricCaseInstance... | this.caseDefinitionIdIn = caseDefinitionIdIn;
}
public String[] getCaseDefinitionKeyIn() {
return caseDefinitionKeyIn;
}
public void setCaseDefinitionKeyIn(String[] caseDefinitionKeyIn) {
this.caseDefinitionKeyIn = caseDefinitionKeyIn;
}
public Date getCurrentTimestamp() {
return currentTimes... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\CleanableHistoricCaseInstanceReportImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public UserInfoResponse setUserInfo(@ApiParam(name = "userId") @PathVariable("userId") String userId, @ApiParam(name = "key") @PathVariable("key") String key, @RequestBody UserInfoRequest userRequest) {
User user = getUserFromRequest(userId);
String validKey = getValidKeyFromRequest(user, key);
... | if (restApiInterceptor != null) {
restApiInterceptor.deleteUser(user);
}
String validKey = getValidKeyFromRequest(user, key);
identityService.setUserInfo(user.getId(), validKey, null);
}
protected String getValidKeyFromRequest(User user, String key) {
Strin... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\identity\UserInfoResource.java | 2 |
请完成以下Java代码 | public @Nullable Object getCredentials() {
return this.credentials;
}
@Override
public Object getPrincipal() {
return this.identifier;
}
@Override
public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException {
Assert.isTrue(!isAuthenticated,
"Cannot set this token to trusted -... | private String principal;
private @Nullable Object credentials;
protected Builder(CasServiceTicketAuthenticationToken token) {
super(token);
this.principal = token.identifier;
this.credentials = token.credentials;
}
@Override
public B principal(@Nullable Object principal) {
Assert.isInstanceOf(... | repos\spring-security-main\cas\src\main\java\org\springframework\security\cas\authentication\CasServiceTicketAuthenticationToken.java | 1 |
请完成以下Java代码 | public void setValue(Object value)
{
if (value == m_value)
return;
m_value = value;
int S_ResourceAssignment_ID = 0;
if (m_value != null && m_value instanceof Integer)
S_ResourceAssignment_ID = ((Integer)m_value).intValue();
// Set Empty
if (S_ResourceAssignment_ID == 0)
{
m_text.setText("");
... | */
@Override
public void setField(GridField mField)
{
m_mField = mField;
EditorContextPopupMenu.onGridFieldSet(this);
} // setField
@Override
public GridField getField() {
return m_mField;
}
/**
* Action Listener Interface
* @param listener listener
*/
@Override
public void addActionListener... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VAssignment.java | 1 |
请完成以下Java代码 | public IStringExpression toStringExpression()
{
final String joinOnColumnNameFQ = !Check.isEmpty(joinOnTableNameOrAlias)
? joinOnTableNameOrAlias + "." + joinOnColumnName
: joinOnColumnName;
if (sqlExpression == null)
{
return ConstantStringExpression.of(joinOnColumnNameFQ);
}
else
{
return ... | public SqlSelectDisplayValue withJoinOnTableNameOrAlias(@Nullable final String joinOnTableNameOrAlias)
{
return !Objects.equals(this.joinOnTableNameOrAlias, joinOnTableNameOrAlias)
? toBuilder().joinOnTableNameOrAlias(joinOnTableNameOrAlias).build()
: this;
}
public String toSqlOrderByUsingColumnNameAlias... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\sql\SqlSelectDisplayValue.java | 1 |
请完成以下Java代码 | public class UserTaskActivityBehavior extends TaskActivityBehavior implements MigrationObserverBehavior {
protected TaskDecorator taskDecorator;
@Deprecated
public UserTaskActivityBehavior(ExpressionManager expressionManager, TaskDefinition taskDefinition) {
this.taskDecorator = new TaskDecorator(taskDefini... | parseContext.consume(variable);
}
}
}
}
// getters
public TaskDefinition getTaskDefinition() {
return taskDecorator.getTaskDefinition();
}
public ExpressionManager getExpressionManager() {
return taskDecorator.getExpressionManager();
}
public TaskDecorator getTaskDecorator()... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\behavior\UserTaskActivityBehavior.java | 1 |
请完成以下Java代码 | public LookupValuesPage getFieldTypeahead(@NonNull final String fieldName, final String query)
{
return getLookupDataSource(fieldName).findEntities(Evaluatees.empty(), query);
}
public LookupValuesList getFieldDropdown(@NonNull final String fieldName)
{
return getLookupDataSource(fieldName).findEntities(Evalua... | }
public String getTemporaryPriceConditionsColor()
{
return temporaryPriceConditionsColorCache.getOrLoad(0, this::retrieveTemporaryPriceConditionsColor);
}
private String retrieveTemporaryPriceConditionsColor()
{
final ColorId temporaryPriceConditionsColorId = Services.get(IOrderLinePricingConditions.class).... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\pricingconditions\view\PricingConditionsRowLookups.java | 1 |
请完成以下Java代码 | public int getUseLifeYears ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_UseLifeYears);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Use units.
@param UseUnits
Currently used units of the assets
*/
public void setUseUnits (int UseUnits)
{
set_Value (COLUMNNAME_UseUnits, Integer... | */
public String getValue ()
{
return (String)get_Value(COLUMNNAME_Value);
}
/** Set Version No.
@param VersionNo
Version Number
*/
public void setVersionNo (String VersionNo)
{
set_Value (COLUMNNAME_VersionNo, VersionNo);
}
/** Get Version No.
@return Version Number
*/
public String getVer... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_Asset.java | 1 |
请完成以下Java代码 | private class CInputVerifier extends InputVerifier {
@Override
public boolean verify(JComponent input) {
//NOTE: We return true no matter what since the InputVerifier is only introduced to fireVetoableChange in due time
if (getText() == null && m_oldText == null)
return true;
else if (getText().equals(m_... | return true;
}
catch (PropertyVetoException pve) {}
return true;
} // verify
} // CInputVerifier
// metas
@Override
public boolean isAutoCommit()
{
return true;
}
} // VMemo | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VMemo.java | 1 |
请完成以下Java代码 | final class ADMessageTranslatableString implements ITranslatableString
{
private final AdMessageKey adMessage;
private final List<Object> msgParameters;
ADMessageTranslatableString(@NonNull final AdMessageKey adMessage, @Nullable final Object... msgParameters)
{
this.adMessage = adMessage;
if (msgParameters ==... | @Override
public String translate(final String adLanguage)
{
return Msg.getMsg(adLanguage, adMessage.toAD_Message(), msgParameters.toArray());
}
@Override
public String getDefaultValue()
{
return adMessage.toAD_MessageWithMarkers();
}
@Override
public Set<String> getAD_Languages()
{
return Services.ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\impl\ADMessageTranslatableString.java | 1 |
请完成以下Spring Boot application配置 | spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/spring-boot-demo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
#### beetlsql starter不能开启下面选项
# type:... | ng:
level:
com.xkcoding: debug
com.xkcoding.orm.beetlsql: trace
beetl:
enabled: false
beetlsql:
enabled: true
sqlPath: /sql
daoSuffix: Dao
basePackage: com.xkcoding.orm.beetlsql.dao
dbStyle: org.beetl.sql.core.db.MySqlStyle
nameConversion: org.beetl.sql.core.UnderlinedNameConversion
beet-beetlsq... | repos\spring-boot-demo-master\demo-orm-beetlsql\src\main\resources\application.yml | 2 |
请完成以下Java代码 | private static HUAttributeChange mergeChange(
@Nullable final HUAttributeChange previousChange,
@NonNull final HUAttributeChange currentChange)
{
return previousChange != null
? previousChange.mergeWithNextChange(currentChange)
: currentChange;
}
public boolean isEmpty()
{
return attributes.isEmp... | private AttributesKey toAttributesKey(final Function<HUAttributeChange, AttributesKeyPart> keyPartExtractor)
{
if (attributes.isEmpty())
{
return AttributesKey.NONE;
}
final ImmutableList<AttributesKeyPart> parts = attributes.values()
.stream()
.map(keyPartExtractor)
.filter(Objects::nonNull)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\material\interceptor\HUAttributeChanges.java | 1 |
请完成以下Java代码 | public BaseCallableElement getCallableElement() {
return callableElement;
}
public void setCallableElement(BaseCallableElement callableElement) {
this.callableElement = callableElement;
}
protected String getDefinitionKey(CmmnActivityExecution execution) {
CmmnExecution caseExecution = (CmmnExecut... | protected CallableElementBinding getBinding() {
return getCallableElement().getBinding();
}
protected boolean isLatestBinding() {
return getCallableElement().isLatestBinding();
}
protected boolean isDeploymentBinding() {
return getCallableElement().isDeploymentBinding();
}
protected boolean i... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\behavior\CallingTaskActivityBehavior.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ExternalSystemNotificationHelper
{
private static final Logger log = LogManager.getLogger(ExternalSystemNotificationHelper.class);
private static final String SYS_CONFIG_EXTERNAL_SYSTEM_NOTIFICATION_USER_GROUP = "de.metas.externalsystem.externalservice.authorization.notificationUserGroupId";
private f... | log.error("No AD_UserGroup is configured to be in charge of the ExternalSystem services authorization! Just dumping the notification here: {}",
msgBL.getMsg(Env.getAD_Language(), messageKey, params));
return;
}
final Recipient recipient = Recipient.group(userGroupId);
final UserNotificationRequest ve... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\externalservice\authorization\ExternalSystemNotificationHelper.java | 2 |
请完成以下Java代码 | public String toString()
{
StringBuffer sb = new StringBuffer ("X_T_MRP_CRP[")
.append(get_ID()).append("]");
return sb.toString();
}
public I_AD_PInstance getAD_PInstance() throws RuntimeException
{
return (I_AD_PInstance)MTable.get(getCtx(), I_AD_PInstance.Table_Name)
.getPO(get... | @param SeqNo
Method of ordering records; lowest number comes first
*/
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Sequence.
@return Method of ordering records; lowest number comes first
*/
public int getSeqNo ()
{
Integer ii = (Integer)get_Va... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_T_MRP_CRP.java | 1 |
请完成以下Java代码 | protected void registerInterceptors(final IModelValidationEngine engine)
{
engine.addModelValidator(DLM_Partition_Config.INSTANCE);
engine.addModelValidator(DLM_Partition_Config_Line.INSTANCE);
final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
if (sysConfigBL.getBooleanValue(SYSCONFIG_DLM_PAR... | {
DBException.registerExceptionWrapper(DLMReferenceExceptionWrapper.INSTANCE);
// gh #1411: only register the connection customizer if it was enabled.
final IDLMService dlmService = Services.get(IDLMService.class);
if (dlmService.isConnectionCustomizerEnabled(AD_User_ID))
{
Services.get(IConnectionCustomi... | repos\metasfresh-new_dawn_uat\backend\de.metas.dlm\base\src\main\java\de\metas\dlm\model\interceptor\Main.java | 1 |
请完成以下Java代码 | public List<JobEntity> findJobsByProcessDefinitionId(final String processDefinitionId) {
Map<String, String> params = new HashMap<String, String>(1);
params.put("processDefinitionId", processDefinitionId);
return getDbSqlSession().selectList("selectJobByProcessDefinitionId", params);
}
... | public long findJobCountByQueryCriteria(JobQueryImpl jobQuery) {
return (Long) getDbSqlSession().selectOne("selectJobCountByQueryCriteria", jobQuery);
}
@Override
public void updateJobTenantIdForDeployment(String deploymentId, String newTenantId) {
HashMap<String, Object> params = new HashM... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\data\impl\MybatisJobDataManager.java | 1 |
请完成以下Java代码 | private boolean isExecutionGrantedOrLog(final RelatedProcessDescriptor relatedProcess, final IUserRolePermissions permissions)
{
if (relatedProcess.isExecutionGranted(permissions))
{
return true;
}
if (logger.isDebugEnabled())
{
logger.debug("Skip process {} because execution was not granted using {}"... | {
return true;
}
//
// Log and filter it out
if (logger.isDebugEnabled())
{
final String disabledReason = relatedProcess.getDisabledReason(Env.getAD_Language(Env.getCtx()));
logger.debug("Skip process {} because {} (silent={})", relatedProcess, disabledReason, relatedProcess.isSilentRejection());
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\process\ui\AProcessModel.java | 1 |
请完成以下Java代码 | public MNewsChannel getNewsChannel()
{
int[] thisNewsChannel = MNewsChannel.getAllIDs("CM_NewsChannel","CM_NewsChannel_ID=" + this.getCM_NewsChannel_ID(), get_TrxName());
if (thisNewsChannel!=null)
{
if (thisNewsChannel.length==1)
return new MNewsChannel(getCtx(), thisNewsChannel[0], get_TrxName());
}... | * @return true if saved
*/
protected boolean afterSave (boolean newRecord, boolean success)
{
if (!success)
return success;
if (!newRecord)
{
MIndex.cleanUp(get_TrxName(), getAD_Client_ID(), get_Table_ID(), get_ID());
}
reIndex(newRecord);
return success;
} // afterSave
/**
* reIndex
* @p... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MNewsItem.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void deleteAuthorsViaDeleteAllInBatch() {
authorRepository.deleteAllInBatch();
}
// good if the number of deletes can be converted into
// a DELETE of type, delete from author where id=? or id=? or id=? ...
// without exceeding the maximum accepted size (as a workaround,
// split t... | public void deleteAuthorsViaDeleteAll() {
List<Author> authors = authorRepository.findByAgeLessThan(60);
authorRepository.deleteAll(authors); // for deleting all Authors use deleteAll() with no arguments
}
// good if you need to delete in a classical batch approach
@Transactional
publ... | repos\Hibernate-SpringBoot-master\HibernateSpringBootBatchDeleteSingleEntity\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Spring Boot application配置 | server.port=80
# \u6570\u636E\u6E90\u914D\u7F6E
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.druid.url=jdbc:h2:mem:ssb_test
spring.datasource.druid.driver-class-name=org.h2.Driver
spring.datasource.druid.username=root
spring.datasource.druid.password=root
spring.datasource.schema=cla... | 9632\u706B\u5899
spring.datasource.druid.filters=stat,wall,log4j
# \u5408\u5E76\u591A\u4E2ADruidDataSource\u7684\u76D1\u63A7\u6570\u636E
spring.datasource.druid.use-global-data-source-stat=true
spring.datasource.druid.connection-properties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
#mybatis
#entity\u626B\u... | repos\spring-boot-student-master\spring-boot-student-mybatis-druid\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public Object getPersistentState() {
// details are not updatable so we always provide the same object as the state
return HistoricDetailEntityImpl.class;
}
// getters and setters //////////////////////////////////////////////////////
public String getProcessInstanceId() {
return p... | public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public String getDetailType() {
return detailType;
}
public void setDetailType(String detailType) {
this.detailType = detailType;
}
} | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\HistoricDetailEntityImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setBankFee(BigDecimal bankFee) {
this.bankFee = bankFee;
}
public String getOrgCheckFilePath() {
return orgCheckFilePath;
}
public void setOrgCheckFilePath(String orgCheckFilePath) {
this.orgCheckFilePath = orgCheckFilePath == null ? null : orgCheckFilePath.trim();
}
public String getReleaseC... | public void setFee(BigDecimal fee) {
this.fee = fee;
}
public String getCheckFailMsg() {
return checkFailMsg;
}
public void setCheckFailMsg(String checkFailMsg) {
this.checkFailMsg = checkFailMsg;
}
public String getBankErrMsg() {
return bankErrMsg;
}
public void setBankErrMsg(String bankErrMsg) {
... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\entity\RpAccountCheckBatch.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class PPOrderIssueScheduleId implements RepoIdAware
{
int repoId;
private PPOrderIssueScheduleId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "PP_Order_IssueSchedule_ID");
}
@JsonCreator
public static PPOrderIssueScheduleId ofRepoId(final int repoId) {return new PPOrderIssueSch... | {
return ofRepoId(Integer.parseInt(idStr));
}
catch (final Exception ex)
{
final AdempiereException metasfreshEx = new AdempiereException("Invalid id: `" + idStr + "`");
metasfreshEx.addSuppressed(ex);
throw metasfreshEx;
}
}
@Override
@JsonValue
public int getRepoId() {return repoId;}
public... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\pporder\api\issue_schedule\PPOrderIssueScheduleId.java | 2 |
请完成以下Java代码 | public void setDescription (final @Nullable java.lang.String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
@Override
public java.lang.String getDescription()
{
return get_ValueAsString(COLUMNNAME_Description);
}
@Override
public void setFileName (final java.lang.String FileName)
{
... | {
set_ValueNoCheck (COLUMNNAME_Type, Type);
}
@Override
public java.lang.String getType()
{
return get_ValueAsString(COLUMNNAME_Type);
}
@Override
public void setURL (final @Nullable java.lang.String URL)
{
set_Value (COLUMNNAME_URL, URL);
}
@Override
public java.lang.String getURL()
{
return g... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_AttachmentEntry.java | 1 |
请完成以下Java代码 | public Page<User> users(@PageableDefault(size = 5) Pageable pageable) {
return userManagement.findAll(pageable);
}
/**
* Registers a new {@link User} for the data provided by the given {@link UserForm}. Note, how an interface is used to
* bind request parameters.
*
* @param userForm the request data bound ... | interface UserForm {
String getUsername();
String getPassword();
String getRepeatedPassword();
/**
* Validates the {@link UserForm}.
*
* @param errors
* @param userManagement
*/
default void validate(BindingResult errors, UserManagement userManagement) {
rejectIfEmptyOrWhitespace(errors... | repos\spring-data-examples-main\web\example\src\main\java\example\users\web\UserController.java | 1 |
请完成以下Java代码 | public void setSetup_Place_No (final int Setup_Place_No)
{
set_ValueNoCheck (COLUMNNAME_Setup_Place_No, Setup_Place_No);
}
@Override
public int getSetup_Place_No()
{
return get_ValueAsInt(COLUMNNAME_Setup_Place_No);
}
/**
* ShipmentAllocation_BestBefore_Policy AD_Reference_ID=541043
* Reference name:... | public java.lang.String getShipperName()
{
return get_ValueAsString(COLUMNNAME_ShipperName);
}
@Override
public void setWarehouseName (final @Nullable java.lang.String WarehouseName)
{
set_ValueNoCheck (COLUMNNAME_WarehouseName, WarehouseName);
}
@Override
public java.lang.String getWarehouseName()
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\inoutcandidate\model\X_M_Packageable_V.java | 1 |
请完成以下Java代码 | private Quantity getQtyToPurchase()
{
return getPurchaseCandidate().getQtyToPurchase();
}
public boolean purchaseMatchesRequiredQty()
{
return getPurchasedQty().compareTo(getQtyToPurchase()) == 0;
}
private boolean purchaseMatchesOrExceedsRequiredQty()
{
return getPurchasedQty().compareTo(getQtyToPurchas... | {
return purchaseCandidate.getDiscountEff();
}
@Nullable
public String getExternalPurchaseOrderUrl()
{
return purchaseCandidate.getExternalPurchaseOrderUrl();
}
@Nullable
public ExternalId getExternalHeaderId()
{
return purchaseCandidate.getExternalHeaderId();
}
@Nullable
public ExternalSystemId get... | repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\remotepurchaseitem\PurchaseOrderItem.java | 1 |
请完成以下Java代码 | public void setM_CustomsTariff_ID (int M_CustomsTariff_ID)
{
if (M_CustomsTariff_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_CustomsTariff_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_CustomsTariff_ID, Integer.valueOf(M_CustomsTariff_ID));
}
/** Get Customs Tariff.
@return Customs Tariff */
@Override
... | @Override
public java.lang.String getName ()
{
return (java.lang.String)get_Value(COLUMNNAME_Name);
}
/** Set Suchschlüssel.
@param Value
Suchschlüssel für den Eintrag im erforderlichen Format - muss eindeutig sein
*/
@Override
public void setValue (java.lang.String Value)
{
set_Value (COLUMNNAME_V... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_CustomsTariff.java | 1 |
请完成以下Java代码 | default void onIgnore(final ICalloutRecord calloutRecord)
{
}
/**
* Note that this method is <b>not</b> fired if a record is cloned. To do something on a record clone, you can register an {@link Interceptor} or a {@code IOnRecordCopiedListener}
*/
default void onNew(final ICalloutRecord calloutRecord)
{
}
... | default void onRefresh(final ICalloutRecord calloutRecord)
{
}
default void onRefreshAll(final ICalloutRecord calloutRecord)
{
}
/**
* Called after {@link ICalloutRecord} was queried.
*/
default void onAfterQuery(final ICalloutRecord calloutRecord)
{
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\ui\spi\ITabCallout.java | 1 |
请完成以下Java代码 | private void setReadTimeout(ClientHttpRequestFactory factory, Duration readTimeout) {
Method method = tryFindMethod(factory, "setReadTimeout", Duration.class);
if (method != null) {
invoke(factory, method, readTimeout);
return;
}
method = findMethod(factory, "setReadTimeout", int.class);
int timeout = M... | private @Nullable Method tryFindMethod(ClientHttpRequestFactory requestFactory, String methodName,
Class<?>... parameters) {
Method method = ReflectionUtils.findMethod(requestFactory.getClass(), methodName, parameters);
if (method == null) {
return null;
}
if (method.isAnnotationPresent(Deprecated.class))... | repos\spring-boot-4.0.1\module\spring-boot-http-client\src\main\java\org\springframework\boot\http\client\ReflectiveComponentsClientHttpRequestFactoryBuilder.java | 1 |
请完成以下Java代码 | public void putAll(Map<? extends Object, ? extends Object> t)
{
getDelegate().putAll(t);
}
@Override
public void clear()
{
getDelegate().clear();
}
@Override
public Object clone()
{
return getDelegate().clone();
}
@Override
public String toString()
{
return getDelegate().toString();
}
@Overri... | {
getDelegate().storeToXML(os, comment, encoding);
}
@Override
public String getProperty(String key)
{
return getDelegate().getProperty(key);
}
@Override
public String getProperty(String key, String defaultValue)
{
return getDelegate().getProperty(key, defaultValue);
}
@Override
public Enumeration<?... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\AbstractPropertiesProxy.java | 1 |
请完成以下Java代码 | private List<I_PP_Order_BOMLine> getAllPPOrderBOMLines()
{
if (_ppOrderBOMLines == null)
{
_ppOrderBOMLines = ppOrderBOMDAO.retrieveOrderBOMLines(ppOrder);
}
return _ppOrderBOMLines;
}
/**
* Gets the main component BOM Line for a given Variant BOM Line.
*
* @param variantComponentBOMLine
* @retu... | // lines which does not have our variant group are not interesting for us
if (!Objects.equals(variantGroup, ppOrderBOMLine.getVariantGroup()))
{
continue;
}
// We found our main component line.
// Make sure is the only one that we found.
Check.assumeNull(componentBOMLine, "Only one main component... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\qualityBasedInvoicing\impl\ProductionMaterialQueryExecutor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class HttpRequest {
/** HTTP GET method */
public static final String METHOD_GET = "GET";
/** HTTP POST method */
public static final String METHOD_POST = "POST";
/**
* 待请求的url
*/
private String url = null;
/**
* 默认的请求方式
*/
private String method = METHOD_PO... | public void setUrl(String url) {
this.url = url;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public int getConnectionTimeout() {
return connectionTimeout;
}
public void setConnectionTime... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\utils\alipay\httpClient\HttpRequest.java | 2 |
请完成以下Java代码 | public void setDateDoc (java.sql.Timestamp DateDoc)
{
set_Value (COLUMNNAME_DateDoc, DateDoc);
}
/** Get Belegdatum.
@return Datum des Belegs
*/
@Override
public java.sql.Timestamp getDateDoc ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_DateDoc);
}
/** Set M_Material_Tracking_Report.
@para... | set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Verarbeitet.
@return Checkbox sagt aus, ob der Beleg verarbeitet wurde.
*/
@Override
public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Bo... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java-gen\de\metas\materialtracking\ch\lagerkonf\model\X_M_Material_Tracking_Report.java | 1 |
请完成以下Java代码 | public SimpleAsyncTaskSchedulerBuilder additionalCustomizers(
Iterable<? extends SimpleAsyncTaskSchedulerCustomizer> customizers) {
Assert.notNull(customizers, "'customizers' must not be null");
return new SimpleAsyncTaskSchedulerBuilder(this.threadNamePrefix, this.concurrencyLimit, this.virtualThreads,
this... | map.from(this.concurrencyLimit).to(taskScheduler::setConcurrencyLimit);
map.from(this.virtualThreads).to(taskScheduler::setVirtualThreads);
map.from(this.taskTerminationTimeout).as(Duration::toMillis).to(taskScheduler::setTaskTerminationTimeout);
map.from(this.taskDecorator).to(taskScheduler::setTaskDecorator);
... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\task\SimpleAsyncTaskSchedulerBuilder.java | 1 |
请完成以下Java代码 | public class MUserDefField extends X_AD_UserDef_Field
{
/**
*
*/
private static final long serialVersionUID = -5464451156146805763L;
public MUserDefField(Properties ctx, int AD_UserDef_Field_ID, String trxName)
{
super(ctx, AD_UserDef_Field_ID, trxName);
}
public MUserDefField(Properties ctx, ResultSet r... | if (this.getIsReadOnly() != null)
{
vo.setIsReadOnly(DisplayType.toBoolean(getIsReadOnly()));
}
if (this.getIsSameLine() != null)
{
layoutConstraints.setSameLine("Y".equals(this.getIsSameLine()));
}
if (this.getIsUpdateable() != null)
{
vo.setIsUpdateable(DisplayType.toBoolean(getIsUpdateable()))... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\model\MUserDefField.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private MilestoneId getMilestoneIdByExternalId(@NonNull final ExternalId externalId,
@NonNull final OrgId orgId)
{
final Integer milestoneId = externalReferenceRepository.getReferencedRecordIdOrNullBy(
ExternalReferenceQuery.builder()
.orgId(orgId)
.externalSystem(externalId.getExternalSystem())
... | .value(issueLabel.getValue())
.referenceId(ReferenceId.ofRepoId(LABEL_AD_Reference_ID))
.build();
}
private void extractAndPropagateAdempiereException(final CompletableFuture completableFuture)
{
try
{
completableFuture.get();
}
catch (final ExecutionException ex)
{
throw AdempiereException.... | repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\issue\importer\IssueImporterService.java | 2 |
请完成以下Java代码 | public void setUid(String uid) {
((InetOrgPerson) this.instance).uid = uid;
if (this.instance.getUsername() == null) {
setUsername(uid);
}
}
public void setInitials(String initials) {
((InetOrgPerson) this.instance).initials = initials;
}
public void setO(String organization) {
((InetOrgPe... | }
public void setHomePhone(String homePhone) {
((InetOrgPerson) this.instance).homePhone = homePhone;
}
public void setStreet(String street) {
((InetOrgPerson) this.instance).street = street;
}
public void setPostalCode(String postalCode) {
((InetOrgPerson) this.instance).postalCode = postalCode;
... | repos\spring-security-main\ldap\src\main\java\org\springframework\security\ldap\userdetails\InetOrgPerson.java | 1 |
请完成以下Java代码 | public BigDecimal generateNumericValue(final Properties ctx, final IAttributeSet attributeSet, final I_M_Attribute attribute)
{
return BigDecimal.ZERO;
}
@Override
protected boolean isExecuteCallout(final IAttributeValueContext attributeValueContext,
final IAttributeSet attributeSet,
final I_M_Attribute at... | if (!(attributeValueContext instanceof IHUAttributePropagationContext))
{
return false;
}
final IHUAttributePropagationContext huAttributePropagationContext = (IHUAttributePropagationContext)attributeValueContext;
final AttributeCode attr_WeightNet = weightable.getWeightNetAttribute();
if (huAttributeProp... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\org\adempiere\mm\attributes\spi\impl\WeightGrossAttributeValueCallout.java | 1 |
请完成以下Java代码 | public ZoneId getTimeZone(@NonNull final OrgId orgId)
{
if (!orgId.isRegular())
{
return SystemTime.zoneId();
}
final ZoneId timeZone = getOrgInfoById(orgId).getTimeZone();
return timeZone != null ? timeZone : SystemTime.zoneId();
}
@Override
public boolean isEUOneStopShop(@NonNull final OrgId orgId)
... | @Override
public UserGroupId getPartnerCreatedFromAnotherOrgNotifyUserGroupID(final OrgId orgId)
{
return getOrgInfoById(orgId).getPartnerCreatedFromAnotherOrgNotifyUserGroupID();
}
@Override
public String getOrgName(@NonNull final OrgId orgId)
{
return getById(orgId).getName();
}
@Override
public boolea... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\organization\impl\OrgDAO.java | 1 |
请完成以下Java代码 | public String getDeploymentId() {
return deploymentId;
}
@Override
public void setDeploymentId(String deploymentId) {
this.deploymentId = deploymentId;
}
@Override
public Object getPersistentState() {
return AppResourceEntityImpl.class;
}
@Override | public boolean isGenerated() {
return false;
}
@Override
public void setGenerated(boolean generated) {
this.generated = generated;
}
@Override
public String toString() {
return "CmmnResourceEntity[id=" + id + ", name=" + name + "]";
}
} | repos\flowable-engine-main\modules\flowable-app-engine\src\main\java\org\flowable\app\engine\impl\persistence\entity\AppResourceEntityImpl.java | 1 |
请完成以下Java代码 | public int getAD_Document_Action_Access_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Document_Action_Access_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public org.compiere.model.I_AD_Ref_List getAD_Ref_List() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_AD_R... | set_ValueNoCheck (COLUMNNAME_AD_Role_ID, Integer.valueOf(AD_Role_ID));
}
/** Get Rolle.
@return Responsibility Role
*/
@Override
public int getAD_Role_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Role_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public org.compiere... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Document_Action_Access.java | 1 |
请完成以下Java代码 | private XmlRecordOther createRecordXmlRecordOther(@NonNull final RecordOtherType recordOtherType)
{
final XmlRecordOtherBuilder xRecordOther = XmlRecordOther.builder();
xRecordOther.recordService(createXmlRecordService(recordOtherType));
xRecordOther.tariffType(recordOtherType.getTariffType());
return xReco... | for (final DocumentType document : documents.getDocument())
{
xDocuments.add(createXmlDocument(document));
}
return xDocuments.build();
}
private XmlDocument createXmlDocument(@NonNull final DocumentType documentType)
{
final XmlDocumentBuilder xDocument = XmlDocument.builder();
xDocument.filename(do... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\Invoice440ToCrossVersionModelTool.java | 1 |
请完成以下Java代码 | private static void streamOf() {
Map<String, Employee> map3 = Stream.of(map1, map2)
.flatMap(map -> map.entrySet().stream())
.collect(
Collectors.toMap(
Map.Entry::getKey,
Map.Entry::getValue,... | map3.entrySet().forEach(System.out::println);
}
private static void initialize() {
Employee employee1 = new Employee(1L, "Henry");
map1.put(employee1.getName(), employee1);
Employee employee2 = new Employee(22L, "Annie");
map1.put(employee2.getName(), employee2);
Employ... | repos\tutorials-master\core-java-modules\core-java-collections-maps-2\src\main\java\com\baeldung\map\mergemaps\MergeMaps.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MultiFileItemWriteDemo {
@Autowired
private JobBuilderFactory jobBuilderFactory;
@Autowired
private StepBuilderFactory stepBuilderFactory;
@Autowired
private ListItemReader<TestData> simpleReader;
@Autowired
private ItemStreamWriter<TestData> fileItemWriter;
@Autowired
... | return writer;
}
// 将数据分类,然后分别输出到对应的文件(此时需要将writer注册到ioc容器,否则报
// WriterNotOpenException: Writer must be open before it can be written to)
private ClassifierCompositeItemWriter<TestData> classifierMultiFileItemWriter() {
ClassifierCompositeItemWriter<TestData> writer = new ClassifierCompositeIt... | repos\SpringAll-master\69.spring-batch-itemwriter\src\main\java\cc\mrbird\batch\job\MultiFileItemWriteDemo.java | 2 |
请完成以下Java代码 | public static Optional<LocationBasicInfo> ofNullable(@Nullable final JsonLocation location)
{
return location != null ? of(location) : Optional.empty();
}
@NonNull
public static Optional<LocationBasicInfo> of(@NonNull final JsonLocation location)
{
if (Check.isBlank(location.getCountryCode())
|| Check.isB... | final List<String> streetAndHouseNoParts = Stream.of(location.getStreet(), location.getHouseNo())
.filter(Check::isNotBlank)
.collect(Collectors.toList());
final String streetAndHouseNo = !streetAndHouseNoParts.isEmpty()
? Joiner.on(",").join(streetAndHouseNoParts)
: null;
return Optional.of(Locat... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v1\shipping\LocationBasicInfo.java | 1 |
请在Spring Boot框架中完成以下Java代码 | void init(HttpSecurity httpSecurity) {
AuthorizationServerSettings authorizationServerSettings = OAuth2ConfigurerUtils
.getAuthorizationServerSettings(httpSecurity);
String authorizationServerMetadataEndpointUri = authorizationServerSettings.isMultipleIssuersAllowed()
? "/.well-known/oauth-authorization-serv... | if (this.defaultAuthorizationServerMetadataCustomizer != null) {
authorizationServerMetadataCustomizer = this.defaultAuthorizationServerMetadataCustomizer;
}
if (this.authorizationServerMetadataCustomizer != null) {
authorizationServerMetadataCustomizer = (authorizationServerMetadataCustomizer != null)
... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\oauth2\server\authorization\OAuth2AuthorizationServerMetadataEndpointConfigurer.java | 2 |
请完成以下Java代码 | public boolean isChannelTransacted() {
return this.transactional;
}
/**
* Flag to indicate that channels created by this component will be transactional.
*
* @param transactional the flag value to set
*/
public void setChannelTransacted(boolean transactional) {
this.transactional = transactional;
}
/... | /**
* Fetch an appropriate Channel from the given RabbitResourceHolder.
*
* @param holder the RabbitResourceHolder
* @return an appropriate Channel fetched from the holder, or <code>null</code> if none found
*/
protected @Nullable Channel getChannel(RabbitResourceHolder holder) {
return holder.getChannel()... | repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\connection\RabbitAccessor.java | 1 |
请完成以下Java代码 | public MaterialDescriptor withProductDescriptor(final ProductDescriptor productDescriptor)
{
final MaterialDescriptor result = MaterialDescriptor.builder()
.productDescriptor(productDescriptor)
.date(this.date)
.warehouseId(this.warehouseId)
.locatorId(this.locatorId)
.customerId(this.customerId)... | .quantity(this.quantity)
.build();
return result.asssertMaterialDescriptorComplete();
}
public MaterialDescriptor withStorageAttributes(
@NonNull final AttributesKey storageAttributesKey,
final int attributeSetInstanceId)
{
final ProductDescriptor newProductDescriptor = ProductDescriptor
.forProdu... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\commons\MaterialDescriptor.java | 1 |
请完成以下Java代码 | public Book getBook() {
return book;
}
public void setBook(Book book) {
this.book = book;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
} | if (getClass() != obj.getClass()) {
return false;
}
return id != null && id.equals(((Review) obj).id);
}
@Override
public int hashCode() {
return 2021;
}
@Override
public String toString() {
return "Review{" + "id=" + id + ", content=" + content + '... | repos\Hibernate-SpringBoot-master\HibernateSpringBootPropertyExpressions\src\main\java\com\bookstore\entity\Review.java | 1 |
请完成以下Java代码 | public Set<Method> getDateDeprecatedMethods() {
Reflections reflections = new Reflections(Date.class, new MethodAnnotationsScanner());
Set<Method> deprecatedMethodsSet = reflections.getMethodsAnnotatedWith(Deprecated.class);
return deprecatedMethodsSet;
}
@SuppressWarnings("rawtypes")
... | Reflections reflections = new Reflections(java.text.SimpleDateFormat.class, new MethodParameterScanner());
Set<Method> methodsSet = reflections.getMethodsReturn(void.class);
return methodsSet;
}
public Set<String> getPomXmlPaths() {
Reflections reflections = new Reflections(new Resource... | repos\tutorials-master\libraries-jdk8\src\main\java\reflections\ReflectionsApp.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ApplicationProperties {
/** Log the configuration to the log on startup */
private boolean showConfigOnStartup;
/** URL (host/port) for second service */
private RemoteService client = new RemoteService();
private Set<String> propagatedHeaders;
public boolean isShowConfigOnStartup... | }
public Set<String> getPropagatedHeaders() {
return propagatedHeaders;
}
public void setPropagatedHeaders(Set<String> propagatedHeaders) {
this.propagatedHeaders = propagatedHeaders;
}
@Override
public String toString() {
return "ApplicationProperties{" +
... | repos\spring-boot3-demo-master\src\main\java\com\giraone\sb3\demo\config\ApplicationProperties.java | 2 |
请完成以下Java代码 | default ITranslatableString getColumnTrl(@NonNull final String columnName, @Nullable final String defaultValue)
{
final Map<String, String> columnTrls = new HashMap<>();
for (final IModelTranslation modelTrl : getAllTranslations().values())
{
if (!modelTrl.isTranslated(columnName))
{
continue;
}
... | default Optional<String> translateColumn(final String columnName, final String adLanguage)
{
final IModelTranslation modelTrl = getTranslation(adLanguage);
if (NullModelTranslation.isNull(modelTrl))
{
return Optional.empty();
}
final String columnTrl = modelTrl.getTranslation(columnName);
if (columnTrl... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\IModelTranslationMap.java | 1 |
请完成以下Java代码 | public String getDisplay (final IValidationContext evalCtx, final Object key)
{
// linear search in m_data
final int size = getSize();
for (int i = 0; i < size; i++)
{
final Object oo = getElementAt(i);
if (oo != null && oo instanceof NamePair)
{
NamePair pp = (NamePair)oo;
if (pp.getID().equ... | final List<Object> list = new ArrayList<Object>(size);
for (int i = 0; i < size; i++)
{
final Object oo = getElementAt(i);
list.add(oo);
}
// Sort Data
if (m_keyColumn.endsWith("_ID"))
{
KeyNamePair p = KeyNamePair.EMPTY;
if (!mandatory)
list.add (p);
Collections.sort (list, p);
}
e... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\XLookup.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
RawAccessJwtToken token = new RawAccessJwtToken(tokenExtractor.extract(request));
return getAuthenticationManager().authenticate(new JwtAuthenticationToken(token));
... | if (header == null) {
// If there is NO auth header at all, let the JWT filter try to attempt Authentication and failure in the process.
return true;
}
return header.startsWith(BEARER_HEADER_PREFIX);
}
@Override
protected void unsuccessfulAuthentication(HttpServletRe... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\security\auth\jwt\JwtTokenAuthenticationProcessingFilter.java | 2 |
请完成以下Java代码 | public boolean isSplitAcctTrx()
{
return get_ValueAsBoolean(COLUMNNAME_IsSplitAcctTrx);
}
@Override
public void setLine (final int Line)
{
set_Value (COLUMNNAME_Line, Line);
}
@Override
public int getLine()
{
return get_ValueAsInt(COLUMNNAME_Line);
}
@Override
public void setProcessed (final bool... | * Type AD_Reference_ID=540534
* Reference name: GL_JournalLine_Type
*/
public static final int TYPE_AD_Reference_ID=540534;
/** Normal = N */
public static final String TYPE_Normal = "N";
/** Tax = T */
public static final String TYPE_Tax = "T";
@Override
public void setType (final java.lang.String Type)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_GL_JournalLine.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void logFailure(Throwable e) {
if (e instanceof CancellationException) {
//Probably this is fine and happens due to re-balancing.
log.trace("Partition fetch task error", e);
} else {
log.error("Partition fetch task error", e);
}
}
private voi... | protected void onRepartitionEvent() {
}
private Set<TopicPartitionInfo> getLatestPartitions() {
log.debug("getLatestPartitionsFromQueue, queue size {}", subscribeQueue.size());
Set<TopicPartitionInfo> partitions = null;
while (!subscribeQueue.isEmpty()) {
partitions = subscr... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\partition\AbstractPartitionBasedService.java | 2 |
请完成以下Java代码 | public void setHostname(String hostname) {
this.hostname = hostname;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public long getHeartbeatVersion() {
return heartbeatVersion;
}
public void setHeartbeatVersio... | @Override
public String toString() {
return new StringBuilder("MachineInfo {")
.append("app='").append(app).append('\'')
.append(",appType='").append(appType).append('\'')
.append(", hostname='").append(hostname).append('\'')
.append(", ip='").append(ip).appen... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\discovery\MachineInfo.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setDepartment(String value) {
this.department = value;
}
/**
* Gets the value of the customerReferenceNumber property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCustomerReferenceNumber() {
return cus... | *
*/
public String getFiscalNumber() {
return fiscalNumber;
}
/**
* Sets the value of the fiscalNumber property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setFiscalNumber(String value) {
this.fiscal... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\extensions\edifact\InvoiceRecipientExtensionType.java | 2 |
请完成以下Java代码 | public void onNext(ServerStreamingResponse value) {}
@Override
public void onError(Throwable t) {
CallServerStreamingRpc();
}
@Override
public void onCompleted() {
CallServerStreamingRpc();
}
});
}
... | }
@Override
public void onCompleted() {
CallBidStreamingRpc();
}
});
requestStreamObserver.onNext(request);
requestStreamObserver.onCompleted();
}
@Override
public void run(String... args) {... | repos\grpc-spring-master\examples\grpc-observability\frontend\src\main\java\net\devh\boot\grpc\examples\observability\frontend\FrontendApplication.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getReleaseYear() {
return releaseYear;
}
public void setReleaseYear(int releaseYear) {
this.releaseYear = releaseYear;
} | public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public Book(String name, int releaseYear, String isbn) {
this.name = name;
this.releaseYear = releaseYear;
this.isbn = isbn;
}
} | repos\tutorials-master\core-java-modules\core-java-collections-conversions\src\main\java\com\baeldung\convertToMap\Book.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ProductCategoryId implements RepoIdAware
{
int repoId;
@JsonCreator
public static ProductCategoryId ofRepoId(final int repoId)
{
return new ProductCategoryId(repoId);
}
@Nullable
public static ProductCategoryId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? new ProductCategoryId(repoI... | return productCategoryId != null ? productCategoryId.getRepoId() : -1;
}
private ProductCategoryId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "M_Product_Category_ID");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\product\ProductCategoryId.java | 2 |
请完成以下Java代码 | public synchronized void close() {
if (this.shutdown) {
return;
}
this.shutdown = true;
final List<ShutdownRecord> shutdownEntries = new ArrayList<>();
for (final Entry<String, ManagedChannel> entry : this.channels.entrySet()) {
final ManagedChannel channe... | final int channelCount = this.channels.size();
this.channels.clear();
this.channelStates.clear();
log.debug("GrpcChannelFactory closed (including {} channels)", channelCount);
}
private static class ShutdownRecord {
private final String name;
private final ManagedChanne... | repos\grpc-spring-master\grpc-client-spring-boot-starter\src\main\java\net\devh\boot\grpc\client\channelfactory\AbstractChannelFactory.java | 1 |
请完成以下Java代码 | public LinearRing createLinearRingByWKT(String ringWKT) throws ParseException{
WKTReader reader = new WKTReader( geometryFactory );
return (LinearRing) reader.read(ringWKT);
}
/**
* 几何对象转GeoJson对象
* @param geometry
* @return
* @throws Exception
*/
public static Stri... | writer.close();
return geojson;
}
/**
* GeoJson转几何对象
* @param geojson
* @return
* @throws Exception
*/
public static Geometry geoJsonToGeometry(String geojson) throws Exception {
return geometryJson.read(new StringReader(geojson));
}
} | repos\springboot-demo-master\GeoTools\src\main\java\com\et\geotools\geotools\GeometryCreator.java | 1 |
请完成以下Java代码 | public String getMediaType() {
return this.mediaType;
}
public boolean isNegated() {
return this.negated;
}
}
/**
* A description of a {@link NameValueExpression} in a request mapping condition.
*/
public static class NameValueExpressionDescription {
private final String name;
private final ... | this.value = expression.getValue();
this.negated = expression.isNegated();
}
public String getName() {
return this.name;
}
public @Nullable Object getValue() {
return this.value;
}
public boolean isNegated() {
return this.negated;
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-webflux\src\main\java\org\springframework\boot\webflux\actuate\web\mappings\RequestMappingConditionsDescription.java | 1 |
请完成以下Java代码 | private I_PP_Order getPP_Order()
{
// not null
return ppOrder;
}
/**
* Delete existing {@link I_PP_Order_Report}s lines linked to current manufacturing order.
*/
public void deleteReportLines()
{
final I_PP_Order ppOrder = getPP_Order();
queryBL.createQueryBuilder(I_PP_Order_Report.class, getContext(... | qty = qty.negate();
}
//
// Create report line
final I_PP_Order_Report reportLine = InterfaceWrapperHelper.newInstance(I_PP_Order_Report.class, getContext());
reportLine.setPP_Order(ppOrder);
reportLine.setAD_Org_ID(ppOrder.getAD_Org_ID());
reportLine.setSeqNo(seqNo);
reportLine.setIsActive(true);
//... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\qualityBasedInvoicing\impl\PPOrderReportWriter.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.