instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
default <T extends RepoIdAware> T getParameterAsIdNotNull(@NonNull String parameterName, @NonNull Class<T> type) { final T id = getParameterAsId(parameterName, type); if (id == null) { throw Check.mkEx("Parameter " + parameterName + " is not set"); } return id; } /** * @return boolean value or <code>...
default <T extends Enum<T>> Optional<T> getParameterAsEnum(final String parameterName, final Class<T> enumType) { final String value = getParameterAsString(parameterName); return value != null ? Optional.of(ReferenceListAwareEnums.ofEnumCode(value, enumType)) : Optional.empty(); } @Nullable default Boo...
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\api\IParams.java
1
请完成以下Java代码
public String getNote() { return note; } public void setNote(String note) { this.note = note; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } public boolean isMarried() { ret...
public long getIncome() { return income; } public void setIncome(long income) { this.income = income; } @Override public String toString() { return "User [name=" + name + ", email=" + email + ", gender=" + gender + ", password=" + password + ", profession=" ...
repos\SpringBoot-Projects-FullStack-master\Part-5 Spring Boot Web Application\SpringBootFormValidationJSP\src\main\java\spring\validation\model\User.java
1
请完成以下Java代码
public GatewayFilter apply() { return apply((NameConfig) null); } @Override public GatewayFilter apply(@Nullable NameConfig config) { String defaultClientRegistrationId = (config == null) ? null : config.getName(); return (exchange, chain) -> exchange.getPrincipal() // .log("token-relay-filter") .filter...
private Mono<OAuth2AuthorizedClient> authorizedClient(OAuth2AuthorizeRequest request) { ReactiveOAuth2AuthorizedClientManager clientManager = clientManagerProvider.getIfAvailable(); if (clientManager == null) { return Mono.error(new IllegalStateException( "No ReactiveOAuth2AuthorizedClientManager bean was f...
repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\TokenRelayGatewayFilterFactory.java
1
请完成以下Java代码
public void setOpaque (boolean isOpaque) { // JScrollPane & Viewport is always not Opaque if (m_textArea == null) // during init of JScrollPane super.setOpaque(isOpaque); else m_textArea.setOpaque(isOpaque); } // setOpaque /** * Set Text Margin * @param m insets */ public void setMargin...
} /** * Get text Input Method Requests * @return requests */ @Override public InputMethodRequests getInputMethodRequests() { return m_textArea.getInputMethodRequests(); } /** * Set Text Input Verifier * @param l */ @Override public void setInputVerifier (InputVerifier l) { m_textArea.setInput...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\swing\CTextArea.java
1
请完成以下Java代码
public void setStructureXML (String StructureXML) { set_Value (COLUMNNAME_StructureXML, StructureXML); } /** Get StructureXML. @return Autogenerated Containerdefinition as XML Code */ public String getStructureXML () { return (String)get_Value(COLUMNNAME_StructureXML); } /** Set Title. @param Title
Name this entity is referred to as */ public void setTitle (String Title) { set_Value (COLUMNNAME_Title, Title); } /** Get Title. @return Name this entity is referred to as */ public String getTitle () { return (String)get_Value(COLUMNNAME_Title); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Container.java
1
请在Spring Boot框架中完成以下Java代码
public int getVersion() { return version; } public String getResource() { return resource; } public String getDeploymentId() { return deploymentId; } public String getDiagram() { return diagram; } public boolean isSuspended() { return suspended; } public String getTenantId()...
} public static ProcessDefinitionDto fromProcessDefinition(ProcessDefinition definition) { ProcessDefinitionDto dto = new ProcessDefinitionDto(); dto.id = definition.getId(); dto.key = definition.getKey(); dto.category = definition.getCategory(); dto.description = definition.getDescription(); ...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\repository\ProcessDefinitionDto.java
2
请在Spring Boot框架中完成以下Java代码
public class CommonRuntimeAutoConfiguration { @Bean public APIVariableInstanceConverter apiVariableInstanceConverter() { return new APIVariableInstanceConverter(); } @Bean public VariableEventFilter variableEventFilter() { return new VariableEventFilter(); } @Bean @Con...
); } private <T> List<T> getInitializedListeners(List<T> eventListeners) { return eventListeners != null ? eventListeners : emptyList(); } @Bean public InitializingBean registerVariableUpdatedListenerDelegate( RuntimeService runtimeService, @Autowired(required = false) List...
repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-runtime-shared-impl\src\main\java\org\activiti\runtime\api\conf\CommonRuntimeAutoConfiguration.java
2
请完成以下Java代码
public static void creatingJSONArray() { JSONArray ja = new JSONArray(); ja.put(Boolean.TRUE); ja.put("lorem ipsum"); // We can also put a JSONObject in JSONArray JSONObject jo = new JSONObject(); jo.put("name", "jon doe"); jo.put("age", "22"); j...
JSONArray ja = new JSONArray("[true, \"lorem ipsum\", 215]"); System.out.println(ja); } public static void jsonArrayFromCollectionObj() { List<String> list = new ArrayList<>(); list.add("California"); list.add("Texas"); list.add("Hawaii"); list.add("Alaska");...
repos\tutorials-master\json-modules\json\src\main\java\com\baeldung\jsonjava\JSONArrayDemo.java
1
请完成以下Java代码
public OrderLineBuilder manualPrice(@Nullable final Money manualPrice) { return manualPrice(manualPrice != null ? manualPrice.toBigDecimal() : null); } public OrderLineBuilder manualDiscount(final BigDecimal manualDiscount) { assertNotBuilt(); this.manualDiscount = manualDiscount; return this; } public ...
return this; } public OrderLineBuilder details(@NonNull final Collection<OrderLineDetailCreateRequest> details) { assertNotBuilt(); detailCreateRequests.addAll(details); return this; } public OrderLineBuilder detail(@NonNull final OrderLineDetailCreateRequest detail) { assertNotBuilt(); detailCreateRe...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\OrderLineBuilder.java
1
请完成以下Java代码
public String getProcessDefinitionId() { return processDefinitionId; } public String getProcessDefinitionKey() { return processDefinitionKey; } public String getProcessDefinitionVersionTag() { return processDefinitionVersionTag; } public String getProcessInstanceId() { return processInstance...
public String getBusinessKey() { return businessKey; } public static ExternalTaskDto fromExternalTask(ExternalTask task) { ExternalTaskDto dto = new ExternalTaskDto(); dto.activityId = task.getActivityId(); dto.activityInstanceId = task.getActivityInstanceId(); dto.errorMessage = task.getErrorM...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\externaltask\ExternalTaskDto.java
1
请完成以下Java代码
private EDIDesadvQuery buildEDIDesadvQuery(@NonNull final I_C_Order order) { final String poReference = Check.assumeNotNull(order.getPOReference(), "In the DESADV-Context, POReference is mandatory; C_Order_ID={}", order.getC_Order_ID()); final EDIDesadvQuery.EDIDesadvQueryBuilder ed...
return ediDesadvQueryBuilder .build(); } private boolean isMatchUsingBPartnerId() { return sysConfigBL.getBooleanValue(SYS_CONFIG_MATCH_USING_BPARTNER_ID, false); } private static void setExternalBPartnerInfo(@NonNull final I_EDI_DesadvLine newDesadvLine, @NonNull final I_C_OrderLine orderLineRecord) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java\de\metas\edi\api\impl\DesadvBL.java
1
请完成以下Java代码
public void print() { System.out.println("Signature is: print()"); } /* // Uncommenting this method will lead to a compilation error: java: method print() is already defined in class // The method signature is independent from return type public int print() { System.out.println("Sig...
// Uncommenting this method will lead to a compilation error: java: method print(int) is already defined in class // The method signature is independent from parameter names public void print(int anotherParameter) { System.out.println("Signature is: print(int)"); } */ public void printEleme...
repos\tutorials-master\core-java-modules\core-java-lang-oop-methods-2\src\main\java\com\baeldung\signature\OverloadingErrors.java
1
请完成以下Java代码
public ReplacedElement createReplacedElement(LayoutContext lc, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight) { Element e = box.getElement(); String nodeName = e.getNodeName(); if (nodeName.equals("img")) { String imagePath = e.getAttribute("src"); try ...
} } return null; } @Override public void reset() { } @Override public void remove(Element e) { } @Override public void setFormSubmissionListener(FormSubmissionListener listener) { } }
repos\tutorials-master\text-processing-libraries-modules\pdf\src\main\java\com\baeldung\pdf\openpdf\CustomElementFactoryImpl.java
1
请完成以下Java代码
public static MaterialNeedsPlannerRow ofDocument(@NonNull final Document document) { final ProductId productId = document.getFieldView(I_M_Material_Needs_Planner_V.COLUMNNAME_M_Product_ID).getValueAsId(ProductId.class) .orElseThrow(() -> new FillMandatoryException(I_M_Material_Needs_Planner_V.COLUMNNAME_M_Produc...
if (warehouseId == null) { throw new FillMandatoryException(I_M_Material_Needs_Planner_V.COLUMNNAME_M_Warehouse_ID); } return ReplenishInfo.builder() .identifier(ReplenishInfo.Identifier.builder() .productId(productId) .warehouseId(warehouseId) .build()) .min(StockQtyAndUOMQtys.ofQty...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\replenish\process\MaterialNeedsPlannerRow.java
1
请完成以下Java代码
/* package */class TrxItemProcessorContext implements ITrxItemProcessorContext { private final Properties ctx; private ITrx trx = null; private IParams params = null; public TrxItemProcessorContext(final Properties ctx) { super(); this.ctx = ctx; } @Override public TrxItemProcessorContext copy() { fina...
@Override public void setTrx(final ITrx trx) { this.trx = trx; } @Override public ITrx getTrx() { return trx; } @Override public IParams getParams() { return params; } public void setParams(IParams params) { this.params = params; } @Override public String toString() { return "TrxItemProce...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\processor\api\impl\TrxItemProcessorContext.java
1
请在Spring Boot框架中完成以下Java代码
public class Campaign { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name = "name") private String name; @Column(name = "budget") private BigDecimal budget; @Column(name = "start_date") private LocalDate startDate; @Column(name = "end_date...
public void setBudget(BigDecimal budget) { this.budget = budget; } public LocalDate getStartDate() { return startDate; } public void setStartDate(LocalDate startDate) { this.startDate = startDate; } public LocalDate getEndDate() { return endDate; } pub...
repos\tutorials-master\spring-boot-modules\spring-boot-3-observation\src\main\java\com\baeldung\logging\model\Campaign.java
2
请完成以下Java代码
public boolean add(TermFrequency termFrequency) { TermFrequency tf = termFrequencyMap.get(termFrequency.getTerm()); if (tf == null) { termFrequencyMap.put(termFrequency.getKey(), termFrequency); return true; } tf.increase(termFrequency.getFrequency());...
public List<String> getKeywords(List<Term> termList, int size) { clear(); add(termList); Collection<TermFrequency> topN = top(size); List<String> r = new ArrayList<String>(topN.size()); for (TermFrequency termFrequency : topN) { r.add(termFrequency.getTerm...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\mining\word\TermFrequencyCounter.java
1
请完成以下Java代码
public class ExecutionsWithSameRootProcessInstanceIdMatcher implements CachedEntityMatcher<ExecutionEntity> { @Override public boolean isRetained( Collection<ExecutionEntity> databaseEntities, Collection<CachedEntity> cachedEntities, ExecutionEntity entity, Object param ) { ...
// as we need to match the root process instance id later on. if (cachedEntities != null) { for (CachedEntity cachedEntity : cachedEntities) { ExecutionEntity executionEntity = (ExecutionEntity) cachedEntity.getEntity(); if (executionId.equals(executionEntity.getId()...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\data\impl\cachematcher\ExecutionsWithSameRootProcessInstanceIdMatcher.java
1
请完成以下Java代码
public class Person { private String firstName; private String lastName; public Person() { } public Person(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } public String getFirstName() { return firstName;
} public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } }
repos\tutorials-master\jackson-modules\jackson-exceptions\src\main\java\com\baeldung\mappingexception\Person.java
1
请在Spring Boot框架中完成以下Java代码
public void setMessageConverter(@Nullable MessageConverter messageConverter) { this.messageConverter = messageConverter; } /** * Set the {@link StreamMessageConverter} to use or {@code null} if the out-of-the-box * stream message converter should be used. * @param streamMessageConverter the {@link StreamMess...
/** * Configure the specified {@link RabbitStreamTemplate}. The template can be further * tuned and default settings can be overridden. * @param template the {@link RabbitStreamTemplate} instance to configure */ public void configure(RabbitStreamTemplate template) { if (this.messageConverter != null) { te...
repos\spring-boot-4.0.1\module\spring-boot-amqp\src\main\java\org\springframework\boot\amqp\autoconfigure\RabbitStreamTemplateConfigurer.java
2
请在Spring Boot框架中完成以下Java代码
public CommonResult getAuthCode(@RequestParam String telephone) { String authCode = memberService.generateAuthCode(telephone); return CommonResult.success(authCode,"获取验证码成功"); } @ApiOperation("会员修改密码") @RequestMapping(value = "/updatePassword", method = RequestMethod.POST) @ResponseBody...
@ApiOperation(value = "刷新token") @RequestMapping(value = "/refreshToken", method = RequestMethod.GET) @ResponseBody public CommonResult refreshToken(HttpServletRequest request) { String token = request.getHeader(tokenHeader); String refreshToken = memberService.refreshToken(token); i...
repos\mall-master\mall-portal\src\main\java\com\macro\mall\portal\controller\UmsMemberController.java
2
请在Spring Boot框架中完成以下Java代码
public at.erpel.schemas._1p0.documents.extensions.edifact.InvoiceRecipientExtensionType getInvoiceRecipientExtension() { return invoiceRecipientExtension; } /** * Sets the value of the invoiceRecipientExtension property. * * @param value * allowed object is * {@link at...
return erpelInvoiceRecipientExtension; } /** * Sets the value of the erpelInvoiceRecipientExtension property. * * @param value * allowed object is * {@link CustomType } * */ public void setErpelInvoiceRecipientExtension(CustomType value) { this.erpel...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ext\InvoiceRecipientExtensionType.java
2
请完成以下Java代码
public int getMaxResults() { if (maxResults > DEFAULT_LIMIT_SELECT_INTERVAL) { return DEFAULT_LIMIT_SELECT_INTERVAL; } return super.getMaxResults(); } protected class MetricsQueryIntervalCmd implements Command<Object> { protected MetricsQueryImpl metricsQuery; public MetricsQueryInterva...
protected class MetricsQuerySumCmd implements Command<Object> { protected MetricsQueryImpl metricsQuery; public MetricsQuerySumCmd(MetricsQueryImpl metricsQuery) { this.metricsQuery = metricsQuery; } @Override public Object execute(CommandContext commandContext) { return commandContex...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\metrics\MetricsQueryImpl.java
1
请在Spring Boot框架中完成以下Java代码
public class Item { @Id private Long id; private String name; @OneToMany(mappedBy = "item") private List<Characteristic> characteristics = new ArrayList<>(); 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 List<Characteristic> getCharacteristics() { return characteristics; } public void setCharacteristics(List<Characteristic> characteristics) { this.characterist...
repos\tutorials-master\persistence-modules\spring-data-jpa-query-2\src\main\java\com\baeldung\entitygraph\model\Item.java
2
请在Spring Boot框架中完成以下Java代码
class CommentRestController { private final CommentService commentService; CommentRestController(CommentService commentService) { this.commentService = commentService; } @PostMapping("/articles/{slug}/comments") public CommentModel postComments(@AuthenticationPrincipal UserJWTPayload jwtP...
public MultipleCommentModel getComments(@AuthenticationPrincipal UserJWTPayload jwtPayload, @PathVariable String slug) { final var comments = ofNullable(jwtPayload) .map(JWTPayload::getUserId) .map(userId -> commentService.getComments(u...
repos\realworld-springboot-java-master\src\main\java\io\github\raeperd\realworld\application\article\comment\CommentRestController.java
2
请在Spring Boot框架中完成以下Java代码
public void updateAuthor(Author author) { authorRepository.save(author); System.out.println("\n\nPersistent Context after update the entity:"); briefOverviewOfPersistentContextContent(); } private void briefOverviewOfPersistentContextContent() { org.hib...
entities.values().forEach(entry -> { EntityEntry ee = persistenceContext.getEntry(entry); System.out.println( "Entity name: " + ee.getEntityName() + " | Status: " + ee.getStatus() + " | State: " + Arrays.toString(ee.getL...
repos\Hibernate-SpringBoot-master\HibernateSpringBootReadOnlyQueries\src\main\java\com\bookstore\service\BookstoreService.java
2
请完成以下Java代码
public void setIgnoreRegistrationFailure(boolean ignoreRegistrationFailure) { this.ignoreRegistrationFailure = ignoreRegistrationFailure; } @Override public void setBeanName(String name) { this.beanName = name; } protected abstract @Nullable D addRegistration(String description, ServletContext servletContext...
* Deduces the name for this registration. Will return user specified name or fallback * to the bean name. If the bean name is not available, convention based naming is * used. * @param value the object used for convention based names * @return the deduced name */ protected final String getOrDeduceName(@Nulla...
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\web\servlet\DynamicRegistrationBean.java
1
请完成以下Java代码
public class DirectoryMonitoringExample { private static final Logger LOG = LoggerFactory.getLogger(DirectoryMonitoringExample.class); private static final int POLL_INTERVAL = 500; public static void main(String[] args) throws Exception { FileAlterationObserver observer = new FileAlterationObserv...
public void onFileDelete(File file) { LOG.debug("File: " + file.getName() + " deleted"); } @Override public void onFileChange(File file) { LOG.debug("File: " + file.getName() + " changed"); } }; observer.addListener(listene...
repos\tutorials-master\libraries-apache-commons\src\main\java\com\baeldung\dirmonitoring\DirectoryMonitoringExample.java
1
请完成以下Java代码
private final class ActionsContext implements IncludedDocumentsCollectionActionsContext { @Override public boolean isParentDocumentProcessed() { return parentDocument.isProcessed(); } @Override public boolean isParentDocumentActive() { return parentDocument.isActive(); } @Override public bo...
return parentDocument.asEvaluatee(); } @Override public void collectAllowNew(final DocumentPath parentDocumentPath, final DetailId detailId, final LogicExpressionResult allowNew) { parentDocument.getChangesCollector().collectAllowNew(parentDocumentPath, detailId, allowNew); } @Override public void co...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\HighVolumeReadWriteIncludedDocumentsCollection.java
1
请完成以下Java代码
public class Helpers { // Write Files public static Path fileOutAllPath() throws URISyntaxException { URI uri = ClassLoader.getSystemResource(Constants.CSV_All).toURI(); return Paths.get(uri); } public static Path fileOutBeanPath() throws URISyntaxException { URI uri = ClassLo...
return Paths.get(uri); } public static String readFile(Path path) throws IOException { return IOUtils.toString(path.toUri()); } // Dummy Data for Writing public static List<String[]> twoColumnCsvString() { List<String[]> list = new ArrayList<>(); list.add(new String[]{"Co...
repos\tutorials-master\libraries-data-io\src\main\java\com\baeldung\libraries\opencsv\helpers\Helpers.java
1
请完成以下Java代码
public NativeHistoricDetailQuery createNativeHistoricDetailQuery() { return new NativeHistoricDetailQueryImpl(commandExecutor); } @Override public HistoricVariableInstanceQuery createHistoricVariableInstanceQuery() { return new HistoricVariableInstanceQueryImpl(commandExecutor); } ...
public NativeHistoricTaskInstanceQuery createNativeHistoricTaskInstanceQuery() { return new NativeHistoricTaskInstanceQueryImpl(commandExecutor); } @Override public NativeHistoricActivityInstanceQuery createNativeHistoricActivityInstanceQuery() { return new NativeHistoricActivityInstanceQue...
repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\HistoryServiceImpl.java
1
请在Spring Boot框架中完成以下Java代码
public class ExternalReferenceTypes { private final ConcurrentHashMap<String, IExternalReferenceType> typesByCode = new ConcurrentHashMap<>(); public ExternalReferenceTypes() { registerType(NullExternalReferenceType.NULL); registerType(BPartnerExternalReferenceType.BPARTNER); registerType(BPLocationExternalRe...
typesByCode.put(type.getCode(), type); } @NonNull public Optional<IExternalReferenceType> ofCode(@NonNull final String code) { final IExternalReferenceType externalReferenceType = typesByCode.get(code); return Optional.ofNullable(externalReferenceType); } @NonNull public IExternalReferenceType ofCodeNotNul...
repos\metasfresh-new_dawn_uat\backend\de.metas.externalreference\src\main\java\de\metas\externalreference\ExternalReferenceTypes.java
2
请完成以下Java代码
public class InterceptorStatusToken { private SecurityContext securityContext; private Collection<ConfigAttribute> attr; private Object secureObject; private boolean contextHolderRefreshRequired; public InterceptorStatusToken(SecurityContext securityContext, boolean contextHolderRefreshRequired, Collection...
} public SecurityContext getSecurityContext() { return this.securityContext; } public Object getSecureObject() { return this.secureObject; } public boolean isContextHolderRefreshRequired() { return this.contextHolderRefreshRequired; } }
repos\spring-security-main\access\src\main\java\org\springframework\security\access\intercept\InterceptorStatusToken.java
1
请完成以下Java代码
public String getBusinessKey() { return businessKey; } public void setBusinessKey(String businessKey) { this.businessKey = businessKey; } public String getBusinessStatus() { return businessStatus; } public String getProcessInstanceName() { return processInstanc...
public String getInitialActivityId() { return initialActivityId; } public void setInitialActivityId(String initialActivityId) { this.initialActivityId = initialActivityId; } public FlowElement getInitialFlowElement() { return initialFlowElement; } public void setInitia...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\interceptor\AbstractStartProcessInstanceBeforeContext.java
1
请在Spring Boot框架中完成以下Java代码
public void setExpressionHandler(MethodSecurityExpressionHandler expressionHandler) { this.manager.setExpressionHandler(expressionHandler); } public void setObservationRegistry(ObservationRegistry registry) { this.observationRegistry = registry; } } public static final class PostAuthorizeAuthorizationM...
} public void setObservationRegistry(ObservationRegistry registry) { this.observationRegistry = registry; } } static class SecurityContextHolderStrategyFactory implements FactoryBean<SecurityContextHolderStrategy> { @Override public SecurityContextHolderStrategy getObject() throws Exception { return...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\method\MethodSecurityBeanDefinitionParser.java
2
请完成以下Java代码
private Optional<Date> handleAsDate(String value) { try { return Optional.ofNullable(dateFormatterProvider.parse(value)); } catch (DateTimeException e) { // ignore exception and return empty: it's not a date so let's keep initial value return Optional.empty(); ...
handleAsDate((String) value).ifPresent(updateTaskVariablePayload::setValue); } return updateTaskVariablePayload; } public Map<String, Object> handlePayloadVariables(Map<String, Object> variables) { if (variables != null) { Set<String> mismatchedVars = variableNameValidator.v...
repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-task-runtime-impl\src\main\java\org\activiti\runtime\api\impl\TaskVariablesPayloadValidator.java
1
请在Spring Boot框架中完成以下Java代码
public class ProductServiceImpl implements ProductService { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private ProductDao productDao; @Override @DS(value = "product-ds") @Transactional(propagation = Propagation.REQUIRES_NEW) // 开启新事物 public void reduceStock(Lo...
// 扣除成功 if (updateCount == 0) { logger.warn("[reduceStock] 扣除 {} 库存失败", productId); throw new Exception("库存不足"); } // 扣除失败 logger.info("[reduceStock] 扣除 {} 库存成功", productId); } private void checkStock(Long productId, Integer requiredAmount) throws Excepti...
repos\SpringBoot-Labs-master\lab-52\lab-52-multiple-datasource\src\main\java\cn\iocoder\springboot\lab52\seatademo\service\impl\ProductServiceImpl.java
2
请在Spring Boot框架中完成以下Java代码
public boolean matchesFilter(AlarmAssignmentTrigger trigger, AlarmAssignmentNotificationRuleTriggerConfig triggerConfig) { Action action = trigger.getActionType() == ActionType.ALARM_ASSIGNED ? Action.ASSIGNED : Action.UNASSIGNED; if (!triggerConfig.getNotifyOn().contains(action)) { return f...
.alarmOriginator(alarmInfo.getOriginator()) .alarmOriginatorName(alarmInfo.getOriginatorName()) .alarmOriginatorLabel(alarmInfo.getOriginatorLabel()) .alarmSeverity(alarmInfo.getSeverity()) .alarmStatus(alarmInfo.getStatus()) .alarmCustomer...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\notification\rule\trigger\AlarmAssignmentTriggerProcessor.java
2
请完成以下Java代码
public class M_QualityNote { /** * When a new M_QualityNote entry is created, also create an M_AttributeValue entry with the same Value, Name and IsActive values * * @param qualityNote */ @ModelChange(timings = { ModelValidator.TYPE_AFTER_NEW }) public void createOnNew(final I_M_QualityNote qualityNote) {...
// Note: the check for null is not needed. The deletion will only happen if the M_AttributeValue entry exists, any way. qualityNoteDAO.deleteAttribueValueForQualityNote(qualityNote); } /** * Modify the linked M_AttributeValue entry each time an M_QualityNote entry has its IsActive or Name values modified. * ...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inout\model\validator\M_QualityNote.java
1
请在Spring Boot框架中完成以下Java代码
public boolean matches(String className, @Nullable ClassLoader classLoader) { return isPresent(className, classLoader); } }, MISSING { @Override public boolean matches(String className, @Nullable ClassLoader classLoader) { return !isPresent(className, classLoader); } }; abstract boolean...
private static boolean isPresent(String className, @Nullable ClassLoader classLoader) { if (classLoader == null) { classLoader = ClassUtils.getDefaultClassLoader(); } try { resolve(className, classLoader); return true; } catch (Throwable ex) { return false; } } } }
repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\condition\FilteringSpringBootCondition.java
2
请完成以下Java代码
public int getAD_NotificationGroup_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_AD_NotificationGroup_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Beschreibung. @param Description Beschreibung */ @Override public void setDescription (java.lang.String Description) { set_Val...
@Override public java.lang.String getEntityType () { return (java.lang.String)get_Value(COLUMNNAME_EntityType); } /** Set Interner Name. @param InternalName Generally used to give records a name that can be safely referenced from code. */ @Override public void setInternalName (java.lang.String Interna...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_NotificationGroup.java
1
请完成以下Java代码
public static void main(final String[] args) { new PrintingClientStandaloneService().run(); } /** * Thanks to http://stackoverflow.com/questions/3777055/reading-manifest-mf-file-from-jar-file-using-java */ private void logVersionInfo() { try { final Enumeration<URL> resEnum = Thread.currentThread().g...
{ // Silently ignore wrong manifests on classpath? } } private void run() { final Context context = Context.getContext(); context.addSource(new ConfigFileContext()); logVersionInfo(); // // Start the client final PrintingClient client = new PrintingClient(); client.start(); final Thread clien...
repos\metasfresh-new_dawn_uat\backend\de.metas.printing.client\src\main\java\de\metas\printing\client\PrintingClientStandaloneService.java
1
请完成以下Java代码
public abstract class EDI_Export_JSON extends PostgRESTProcessExecutor { private final AttachmentEntryService attachmentEntryService = SpringContextHolder.instance.getBean(AttachmentEntryService.class); protected abstract I_EDI_Document_Extension loadRecordOutOfTrx(); protected abstract void saveRecord(I_EDI_Docum...
final TableRecordReference recordReference = TableRecordReference.of(record); addLog("Attaching result with filename {} to the {}-record with ID {}", reportData.getReportFilename(), recordReference.getTableName(), recordReference.getRecord_ID() ); attachmentEntryService.createNewAttachment( recor...
repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java\de\metas\edi\process\export\json\EDI_Export_JSON.java
1
请在Spring Boot框架中完成以下Java代码
public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired UserService userService; @Bean RoleHierarchy roleHierarchy() { RoleHierarchyImpl roleHierarchy = new RoleHierarchyImpl(); String hierarchy = "ROLE_dba > ROLE_admin ROLE_admin > ROLE_user"; roleH...
return object; } }) .and() .formLogin() .loginProcessingUrl("/login").permitAll() .and() .csrf().disable(); } @Bean CustomFilterInvocationSecurityMetadataSource cfisms() { return n...
repos\springboot-demo-master\security\src\main\java\com\et\security\config\WebSecurityConfig.java
2
请在Spring Boot框架中完成以下Java代码
public class DmnDeploymentResponse { protected String id; protected String name; @JsonSerialize(using = DateToStringSerializer.class, as = Date.class) protected Date deploymentTime; protected String category; protected String url; protected String parentDeploymentId; protected String te...
public void setCategory(String category) { this.category = category; } @ApiModelProperty(example = "http://localhost:8080/flowable-rest/dmn-api/dmn-repository/deployments/03ab310d-c1de-11e6-a4f4-62ce84ef239e") public String getUrl() { return url; } public void setUrl(String url) { ...
repos\flowable-engine-main\modules\flowable-dmn-rest\src\main\java\org\flowable\dmn\rest\service\api\repository\DmnDeploymentResponse.java
2
请完成以下Java代码
public InfoBuilder setKeyColumn(final String keyColumn) { _keyColumn = keyColumn; return this; } private String getKeyColumn() { if (_keyColumn != null) { return _keyColumn; } return getTableName() + "_ID"; } public InfoBuilder setSearchValue(final String value) { _searchValue = value; retu...
final I_AD_InfoWindow infoWindowFound = Services.get(IADInfoWindowDAO.class).retrieveInfoWindowByTableName(getCtx(), tableName); if (infoWindowFound != null && infoWindowFound.isActive()) { return infoWindowFound; } return null; } /** * @param iconName icon name (without size and without file extension...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\search\InfoBuilder.java
1
请完成以下Java代码
public void setC_Invoice_ID (int C_Invoice_ID) { if (C_Invoice_ID < 1) set_Value (COLUMNNAME_C_Invoice_ID, null); else set_Value (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID)); } /** Get Rechnung. @return Invoice Identifier */ @Override public int getC_Invoice_ID () { Integer ii = (...
} /** Set Recurrent Payment Line. @param C_RecurrentPaymentLine_ID Recurrent Payment Line */ @Override public void setC_RecurrentPaymentLine_ID (int C_RecurrentPaymentLine_ID) { if (C_RecurrentPaymentLine_ID < 1) set_ValueNoCheck (COLUMNNAME_C_RecurrentPaymentLine_ID, null); else set_ValueNoCheck (...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java-gen\de\metas\banking\model\X_C_RecurrentPaymentHistory.java
1
请完成以下Java代码
private Account getRevenueAccountFromCompensationSchema(@NonNull final AcctSchema as) { final ProductCategoryId productCategoryId = getProductCategoryForGroupTemplateId(); if (productCategoryId == null) { return null; } return getAccountProvider() .getProductCategoryAccount(as.getId(), productCategor...
} final GroupTemplateId groupTemplateId = group.getGroupTemplateId(); if (groupTemplateId == null) { return null; } return productDAO.retrieveProductCategoryForGroupTemplateId(groupTemplateId); } @Override protected OrderId getSalesOrderId() { final I_C_InvoiceLine invoiceLine = getC_InvoiceLine()...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\DocLine_Invoice.java
1
请完成以下Java代码
public void setDateInvoiced (java.sql.Timestamp DateInvoiced) { set_Value (COLUMNNAME_DateInvoiced, DateInvoiced); } /** Get Rechnungsdatum. @return Datum auf der Rechnung */ @Override public java.sql.Timestamp getDateInvoiced () { return (java.sql.Timestamp)get_Value(COLUMNNAME_DateInvoiced); } /**...
return BigDecimal.ZERO; return bd; } /** Set In Dispute. @param IsInDispute Document is in dispute */ @Override public void setIsInDispute (boolean IsInDispute) { set_Value (COLUMNNAME_IsInDispute, Boolean.valueOf(IsInDispute)); } /** Get In Dispute. @return Document is in dispute */ @Overrid...
repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java-gen\de\metas\dunning\model\X_C_Dunning_Candidate_Invoice_v1.java
1
请完成以下Java代码
public void parseLongestText(String text, AhoCorasickDoubleArrayTrie.IHit<CoreDictionary.Attribute> processor) { if (trie != null) { final int[] lengthArray = new int[text.length()]; final CoreDictionary.Attribute[] attributeArray = new CoreDictionary.Attribute[text.length()]...
else { processor.hit(i, i + lengthArray[i], attributeArray[i]); i += lengthArray[i]; } } } else dat.parseLongestText(text, processor); } /** * 热更新(重新加载)<br> * 集群环境(或其他IOAdapter)需要自行删除缓存文件(路...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dictionary\DynamicCustomDictionary.java
1
请完成以下Java代码
public int getM_Product_ID() { Object o = fProduct.getValue(); return o == null ? 0 : ((Number) o).intValue(); } public BigDecimal getQtyOrdered() { Object value = fQtyOrdered.getValue(); if (value == null || value.toString().trim().length() == 0) return Env.ZERO; else if (value instanceof BigDecimal) ...
BigDecimal qty = getQtyOrdered(); if (qty == null || qty.signum() == 0) throw new FillMandatoryException( I_C_OrderLine.COLUMNNAME_QtyOrdered); // MOrderLine line = new MOrderLine(order); line.setM_Product_ID(getM_Product_ID(), true); line.setQty(qty); line.saveEx(); // reset(true); changed = ...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\form\swing\OrderLineCreate.java
1
请在Spring Boot框架中完成以下Java代码
public ManufacturingJob execute() { trxManager.runInThreadInheritedTrx(this::execute0); return job; } private void execute0() { job = job.withChangedRawMaterialsIssueStep( request.getActivityId(), request.getIssueScheduleId(), (step) -> { if (processed) { // shall not happen ...
} private RawMaterialsIssueStep issueToStep(final RawMaterialsIssueStep step) { step.assertNotIssued(); final PPOrderIssueSchedule issueSchedule = ppOrderIssueScheduleService.issue(request); this.processed = true; return step.withIssued(issueSchedule.getIssued()); } private void save() { newSaver().sa...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\job\service\commands\issue\IssueRawMaterialsCommand.java
2
请在Spring Boot框架中完成以下Java代码
public User findUserByUserName(String userName) { Query query=new Query(Criteria.where("userName").is(userName)); User user = mongoTemplate.findOne(query , User.class); return user; } /** * 更新对象 * @param user */ @Override public long updateUser(User user) { ...
if(result!=null) return result.getMatchedCount(); else return 0; } /** * 删除对象 * @param id */ @Override public void deleteUserById(Long id) { Query query=new Query(Criteria.where("id").is(id)); mongoTemplate.remove(query,User.class); } }
repos\spring-boot-leaning-master\2.x_42_courses\第 4-7 课:Spring Boot 简单集成 MongoDB\spring-boot-mongodb-template\src\main\java\com\neo\repository\impl\UserRepositoryImpl.java
2
请完成以下Java代码
protected AsyncResultSet executeRead(TenantId tenantId, Statement statement) { return execute(tenantId, statement, defaultReadLevel, rateReadLimiter); } protected AsyncResultSet executeWrite(TenantId tenantId, Statement statement) { return execute(tenantId, statement, defaultWriteLevel, rateWri...
BufferedRateExecutor<CassandraStatementTask, TbResultSetFuture> rateExecutor) { if (log.isDebugEnabled()) { log.debug("Execute cassandra async statement {}", statementToString(statement)); } if (statement.getConsistencyLevel() == null) { statement = statement.setConsisten...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\nosql\CassandraAbstractDao.java
1
请完成以下Java代码
public Mono<String> sleep() { // System.out.println(Thread.currentThread().getName()); // return Mono.just("world").delayElement(Duration.ofMillis(100)); return Mono.defer(() -> { // System.out.println(Thread.currentThread().getName()); try { Thread.sleep(100...
public Mono<String> sleep2() { return Mono.defer(() -> { try { // System.out.println(Thread.currentThread().getName()); if (!MAP.containsKey(Thread.currentThread().getName())) { System.out.println(Thread.currentThread().getName()); ...
repos\SpringBoot-Labs-master\lab-06\lab-06-webflux-tomcat\src\main\java\cn\iocoder\springboot\labs\lab06\webflux\Controller.java
1
请完成以下Java代码
public ProductWithDemandSupplyCollection getByProductIds(@NonNull final Collection<ProductId> productIds) { if (productIds.isEmpty()) { return ProductWithDemandSupplyCollection.of(ImmutableMap.of()); } final ArrayList<Object> sqlParams = new ArrayList<>(); final String sql = "SELECT * FROM getQtyDemandQt...
.firstOnly(I_QtyDemand_QtySupply_V.class); return fromPO(po); } private QtyDemandQtySupply fromPO(@NonNull final I_QtyDemand_QtySupply_V po) { final UomId uomId = UomId.ofRepoId(po.getC_UOM_ID()); return QtyDemandQtySupply.builder() .id(QtyDemandQtySupplyId.ofRepoId(po.getQtyDemand_QtySupply_V_ID())) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\cockpit\src\main\java\de\metas\material\cockpit\QtyDemandSupplyRepository.java
1
请完成以下Spring Boot application配置
server: port: 8081 spring: graphql: schema: locations: classpath:error-handling/graphql/ datasource: url: "jdbc:h2:mem:graphqldb" driverClassName: "org.h2.Driver" username: sa password: jpa: show-sql: true properties: hibernate: dialect: org.hibernate.dialect.H2D...
ly_quoted_identifiers: true defer-datasource-initialization: true h2: console.enabled: true sql: init: platform: h2 mode: always
repos\tutorials-master\spring-boot-modules\spring-boot-graphql\src\main\resources\application-error-handling.yml
2
请完成以下Java代码
public HistoricDetailQueryImpl orderByProcessInstanceId() { orderBy(HistoricDetailQueryProperty.PROCESS_INSTANCE_ID); return this; } public HistoricDetailQueryImpl orderByTime() { orderBy(HistoricDetailQueryProperty.TIME); return this; } public HistoricDetailQueryImpl o...
} public String getActivityId() { return activityId; } public String getType() { return type; } public boolean getExcludeTaskRelated() { return excludeTaskRelated; } public String getExecutionId() { return executionId; } public String getActivityI...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\HistoricDetailQueryImpl.java
1
请完成以下Java代码
public boolean isLoaded() { return m_loaded; } /** * Returns a list of parameters on which this lookup depends. * * Those parameters will be fetched from context on validation time. * * @return list of parameter names */ public Set<String> getParameters() { return ImmutableSet.of(); } /** * ...
return null; } /** * Returns true if given <code>display</code> value was rendered for a not found item. * To be used together with {@link #getDisplay} methods. * * @param display * @return true if <code>display</code> contains not found markers */ public boolean isNotFoundDisplayValue(String display) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\Lookup.java
1
请完成以下Java代码
public boolean isPageBreak(final int row, final int col) { PrintDataElement pde = getPDE(row, col); return pde != null ? pde.isPageBreak() : false; } @Override public boolean isFunctionRow(final int row) { return m_printData.isFunctionRow(row); } @Override protected void formatPage(final Sheet sheet) {...
// paperSize = PrintSetup.ENVELOPE_CS_PAPERSIZE; // } else if (MediaSizeName.MONARCH_ENVELOPE.equals(mediaSizeName)) { paperSize = PrintSetup.ENVELOPE_MONARCH_PAPERSIZE; } if (paperSize != -1) { sheet.getPrintSetup().setPaperSize(paperSize); } // // Set Landscape/Portrait: sheet.getPrintSetup(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\print\export\PrintDataExcelExporter.java
1
请完成以下Java代码
public String toString() { return toJson(); } @JsonValue public String toJson() { return json; } public int getProcessIdAsInt() { int processIdAsInt = this.processIdAsInt; if (processIdAsInt <= 0) { final String processIdStr = getProcessId(); processIdAsInt = Integer.parseInt(processIdStr); ...
throw new AdempiereException("Cannot convert " + this + " to " + AdProcessId.class.getSimpleName() + " because the processHanderType=" + processHandlerType + " is not supported"); } return adProcessId; } /** * Convenience method to get the {@link AdProcessId} for this instance if its {@code processIdAsInt} mem...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\process\ProcessId.java
1
请完成以下Java代码
protected HistoryLevel getCaseDefinitionHistoryLevel(String caseDefinitionId) { HistoryLevel caseDefinitionHistoryLevel = null; try { CaseDefinition caseDefinition = CaseDefinitionUtil.getCaseDefinition(caseDefinitionId); CmmnModel cmmnModel = CaseDefinitionUtil.getCmmnModel(ca...
return caseDefinitionHistoryLevel; } protected boolean includePlanItemDefinitionInHistory(String caseDefinitionId, String activityId) { boolean includeInHistory = false; if (caseDefinitionId != null) { CmmnModel cmmnModel = CaseDefinitionUtil.getCmmnModel(caseDefinitionId); ...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\history\DefaultCmmnHistoryConfigurationSettings.java
1
请完成以下Java代码
public void setProcessing (final boolean Processing) { set_Value (COLUMNNAME_Processing, Processing); } @Override public boolean isProcessing() { return get_ValueAsBoolean(COLUMNNAME_Processing); } @Override public void setRecord_ID (final int Record_ID) { if (Record_ID < 0) set_Value (COLUMNNAME_...
set_Value (COLUMNNAME_WF_Initial_User_ID, WF_Initial_User_ID); } @Override public int getWF_Initial_User_ID() { return get_ValueAsInt(COLUMNNAME_WF_Initial_User_ID); } /** * WFState AD_Reference_ID=305 * Reference name: WF_Instance State */ public static final int WFSTATE_AD_Reference_ID=305; /** No...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_Process.java
1
请完成以下Java代码
public void generate() { trxManager.run(ITrx.TRXNAME_ThreadInherited, new TrxRunnableAdapter() { @Override public void run(final String localTrxName) throws Exception { generate0(); } }); } private void generate0() { final OrdersCollector ordersCollector = OrdersCollector.newInstance(); ...
public OrdersGenerator setCandidates(final Iterator<I_PMM_PurchaseCandidate> candidates) { Check.assumeNotNull(candidates, "candidates not null"); this.candidates = candidates; return this; } public OrdersGenerator setCandidates(final Iterable<I_PMM_PurchaseCandidate> candidates) { Check.assumeNotNull(cand...
repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\order\impl\OrdersGenerator.java
1
请完成以下Java代码
final IUserQueryField findSearchFieldByColumnName(@Nullable final String columnName) { if (columnName == null || columnName.isEmpty()) { return null; } for (final IUserQueryField searchField : getSearchFields()) { if (searchField.matchesColumnName(columnName)) { return searchField; } } ...
{ this.adTableId = adTableId; return this; } private int getAD_Table_ID() { Check.assumeNotNull(adTableId, "adTableId not null"); Check.assume(adTableId > 0, "adTableId > 0"); return adTableId; } public Builder setAD_User_ID(final int adUserId) { this.adUserId = adUserId; return this;...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\apps\search\UserQueryRepository.java
1
请完成以下Java代码
static I_M_HU_PI_Item_Product extractPIItemProductOrNull(@NonNull final I_M_HU hu) { final HUPIItemProductId piItemProductId = HUPIItemProductId.ofRepoIdOrNull(hu.getM_HU_PI_Item_Product_ID()); return piItemProductId != null ? Services.get(IHUPIItemProductDAO.class).getRecordById(piItemProductId) : null; ...
boolean isEmptyStorage(I_M_HU hu); boolean isDestroyedOrEmptyStorage(I_M_HU hu); void setClearanceStatusRecursively(final HuId huId, final ClearanceStatusInfo statusInfo); boolean isHUHierarchyCleared(@NonNull I_M_HU hu); ITranslatableString getClearanceStatusCaption(ClearanceStatus clearanceStatus); boolean ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\IHandlingUnitsBL.java
1
请完成以下Java代码
public List<String> getFromActivityIds() { return new ArrayList<>(fromActivityIds); } @Override public List<String> getToActivityIds() { ArrayList<String> list = new ArrayList<>(); list.add(toActivityId); return list; } public Str...
public String getWithNewAssignee() { return withNewAssignee; } @Override public ManyToOneMapping withNewOwner(String newOwner) { this.withNewOwner = newOwner; return this; } @Override public String getWithNewOwner() { retu...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\migration\ActivityMigrationMapping.java
1
请完成以下Java代码
public void updateProductFromBomVersions(final I_PP_Product_Planning planning) { final ProductBOMVersionsId bomVersionsId = ProductBOMVersionsId.ofRepoIdOrNull(planning.getPP_Product_BOMVersions_ID()); if (bomVersionsId == null) { return; // nothing to do } final I_PP_Product_BOMVersions bomVersions = bom...
if (!productPlanning.isAttributeDependant()) { return; } if (productPlanning.getBomVersionsId() == null) { return; } final I_PP_Product_BOM bom = bomDAO.getLatestBOMRecordByVersionId(productPlanning.getBomVersionsId()).orElse(null); if (bom == null) { return; } productBOMService.verifyBO...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\model\validator\PP_Product_Planning.java
1
请完成以下Java代码
public boolean add(E element) { if (set.add(element)) { list.add(element); return true; } return false; } public boolean remove(E element) { if (set.remove(element)) { list.remove(element); return true; } return fal...
return list.get(index); } public boolean contains(E element) { return set.contains(element); } public int size() { return list.size(); } public boolean isEmpty() { return list.isEmpty(); } public void clear() { list.clear(); set.clear(); } ...
repos\tutorials-master\core-java-modules\core-java-collections-set-2\src\main\java\com\baeldung\linkedhashsetindexof\ListAndSetApproach.java
1
请完成以下Java代码
public static boolean startupEnvironment(boolean isSwingClient) { final Adempiere adempiere = instance; final RunMode runMode = isSwingClient ? RunMode.SWING_CLIENT : RunMode.BACKEND; adempiere.startup(runMode); // this emulates the old behavior of startupEnvironment return adempiere.startupEnvironment(runMod...
{ unitTestMode = true; } public static boolean isUnitTestMode() { return unitTestMode; } public static void assertUnitTestMode() { if (!isUnitTestMode()) { throw new IllegalStateException("JUnit test mode shall be enabled"); } } private static boolean unitTestMode = false; public static boolea...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\Adempiere.java
1
请在Spring Boot框架中完成以下Java代码
public BookDTO save(BookDTO bookDTO) { log.debug("Request to save Book : {}", bookDTO); Book book = bookMapper.toEntity(bookDTO); book = bookRepository.save(book); return bookMapper.toDto(book); } /** * Get all the books. * * @return the list of entities */ ...
} /** * Delete the book by id. * * @param id the id of the entity */ @Override public void delete(Long id) { log.debug("Request to delete Book : {}", id); bookRepository.deleteById(id); } @Override public Optional<BookDTO> purchase(Long id) { Optiona...
repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\service\impl\BookServiceImpl.java
2
请在Spring Boot框架中完成以下Java代码
public String filtering() { // SomeBean someBean = new SomeBean("value1","value2", "value3"); var someBean = new SomeBean("value1","value2", "value3"); // MappingJacksonValue mappingJacksonValue = new MappingJacksonValue(someBean); // SimpleBeanPropertyFilter filter = // Si...
// MappingJacksonValue mappingJacksonValue = new MappingJacksonValue(list); // SimpleBeanPropertyFilter filter = // SimpleBeanPropertyFilter.filterOutAllExcept("field2","field3"); var filter = SimpleBeanPropertyFilter.filterOutAllExcept("field2", "field3"); // FilterProvider filters =...
repos\master-spring-and-spring-boot-main\12-rest-api\src\main\java\com\in28minutes\rest\webservices\restfulwebservices\filtering\FilteringController.java
2
请完成以下Java代码
public ValueGraph<Integer, Double> minSpanningTree(ValueGraph<Integer, Double> graph) { return spanningTree(graph, true); } public ValueGraph<Integer, Double> maxSpanningTree(ValueGraph<Integer, Double> graph) { return spanningTree(graph, false); } private ValueGraph<Integer, Double> ...
MutableValueGraph<Integer, Double> spanningTree = ValueGraphBuilder.undirected().build(); for (EndpointPair<Integer> edge : edgeList) { if (cycleDetector.detectCycle(edge.nodeU(), edge.nodeV())) { continue; } spanningTree.putEdgeValue(edge.nodeU(), edge.nodeV(...
repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-6\src\main\java\com\baeldung\algorithms\kruskal\Kruskal.java
1
请完成以下Java代码
public <T> List<T> getSelectedModels(final Class<T> modelClass) { return _selectedModelsSupplier.apply(modelClass).getModels(modelClass); } @NonNull @Override public <T> Stream<T> streamSelectedModels(@NonNull final Class<T> modelClass) { return view.streamModelsByIds(getSelectedRowIds(), modelClass); } @...
@Override public String toString() { return MoreObjects.toStringHelper(this) .omitNullValues() .add("modelClass", modelClass) .add("models", models) .toString(); } public <T> List<T> getModels(final Class<T> modelClass) { // If loaded models list is empty, we can return an empty lis...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\process\ViewAsPreconditionsContext.java
1
请在Spring Boot框架中完成以下Java代码
public Optional<BookDTO> findOne(Long id) { log.debug("Request to get Book : {}", id); return bookRepository.findById(id) .map(bookMapper::toDto); } /** * Delete the book by id. * * @param id the id of the entity */ @Override public void delete(Long id) {...
@Override public Optional<BookDTO> purchase(Long id) { Optional<BookDTO> bookDTO = findOne(id); if(bookDTO.isPresent()) { int quantity = bookDTO.get().getQuantity(); if(quantity > 0) { bookDTO.get().setQuantity(quantity - 1); Book book = bookMa...
repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\service\impl\BookServiceImpl.java
2
请完成以下Java代码
public String getProcess() { return processRefAttribute.getValue(this); } public void setProcess(String process) { processRefAttribute.setValue(this, process); } public ProcessRefExpression getProcessExpression() { return processRefExpressionChild.getChild(this); } public void setProcessExpre...
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ProcessTask.class, CMMN_ELEMENT_PROCESS_TASK) .namespaceUri(CMMN11_NS) .extendsType(Task.class) .instanceProvider(new ModelTypeInstanceProvider<ProcessTask>() { public ProcessTask newInstance(ModelTypeInstanceContext instanc...
repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\ProcessTaskImpl.java
1
请完成以下Java代码
protected IDocumentLUTUConfigurationManager createReceiptLUTUConfigurationManager() { final I_PP_Order ppOrder = getPP_Order(); return huPPOrderBL.createReceiptLUTUConfigurationManager(ppOrder); } @Override protected ReceiptCandidateRequestProducer newReceiptCandidateRequestProducer() { final I_PP_Order ord...
.locatorId(getLocatorId()) .pickingCandidateId(getPickingCandidateId()) .build(); } @Override protected void addAssignedHUs(final Collection<I_M_HU> hus) { final I_PP_Order ppOrder = getPP_Order(); huPPOrderBL.addAssignedHandlingUnits(ppOrder, hus); } @Override public IPPOrderReceiptHUProducer with...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\pporder\api\impl\CostCollectorCandidateFinishedGoodsHUProducer.java
1
请完成以下Java代码
public String getTrackingURL(@NonNull final String shipperInternalName) { final I_M_Shipper shipper = shipperByInternalName.computeIfAbsent(shipperInternalName, this::loadShipper); return shipper != null ? shipper.getTrackingURL() : null; } @Nullable private I_M_Shipper loadShipper(@NonNull final Stri...
.orgId(orgId) .includeAnyOrg(true) // include articles with org=* .build(); return productIdsByQuery.computeIfAbsent(query, this::retrieveProductIdByQuery); } private ProductId retrieveProductIdByQuery(@NonNull final ProductQuery query) { final ProductId productId = productDAO.retrieveProductIdBy(query...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\shipmentschedule\api\ShippingInfoCache.java
1
请在Spring Boot框架中完成以下Java代码
public String getReferenceType() { return referenceType; } public void setReferenceType(String referenceType) { this.referenceType = referenceType; } @ApiModelProperty(value = "The stage plan item instance id this process instance belongs to or null, if it is not part of a case at all ...
} @ApiModelProperty(example = "someTenantId") public String getTenantId() { return tenantId; } // Added by Ryan Johnston public boolean isCompleted() { return completed; } // Added by Ryan Johnston public void setCompleted(boolean completed) { this.completed = ...
repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\process\ProcessInstanceResponse.java
2
请在Spring Boot框架中完成以下Java代码
public class PaymentController { @Autowired private AlipayService alipayService; @GetMapping("/") public String index() { return "index"; } @PostMapping("/createOrder") public String createOrder(@RequestParam String totalAmount, @RequestParam String subject, Model model) { ...
model.addAttribute("outTradeNo", outTradeNo); return "payment"; } catch (Exception e) { model.addAttribute("error", "创建订单失败"); return "error"; } } @PostMapping("/queryPayment") public String queryPayment(String outTradeNo) { String TradeStatus=alip...
repos\springboot-demo-master\Alipay-facetoface\src\main\java\com.et\controller\PaymentController.java
2
请完成以下Java代码
public ImpliedCurrencyAmountRangeChoice getAmt() { return amt; } /** * Sets the value of the amt property. * * @param value * allowed object is * {@link ImpliedCurrencyAmountRangeChoice } * */ public void setAmt(ImpliedCurrencyAmountRangeChoice value...
public void setCdtDbtInd(CreditDebitCode value) { this.cdtDbtInd = value; } /** * Gets the value of the ccy property. * * @return * possible object is * {@link String } * */ public String getCcy() { return ccy; } /** * Sets the ...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\CurrencyAndAmountRange2.java
1
请完成以下Java代码
public String getCamundaProcessVersion() { return camundaProcessVersionAttribute.getValue(this); } public void setCamundaProcessVersion(String camundaProcessVersion) { camundaProcessVersionAttribute.setValue(this, camundaProcessVersion); } public String getCamundaProcessTenantId() { return camunda...
camundaProcessVersionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_PROCESS_VERSION) .namespace(CAMUNDA_NS) .build(); camundaProcessTenantIdAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_PROCESS_TENANT_ID) .namespace(CAMUNDA_NS) .build(); SequenceBuilder seque...
repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\ProcessTaskImpl.java
1
请完成以下Java代码
public void onCancel() { } @Override public void onReadyToSend() { } @Override public void onConnecting() { } @Override public void onDtlsRetransmission(int flight) { } @Override public void onSent(boolean retransmission) { } @Override public void on...
} @Override public void onResponseHandlingError(Throwable cause) { } @Override public void onContextEstablished(EndpointContext endpointContext) { } @Override public void onTransferComplete() { } }
repos\thingsboard-master\common\transport\coap\src\main\java\org\thingsboard\server\transport\coap\TbCoapMessageObserver.java
1
请完成以下Java代码
public org.compiere.model.I_AD_Window getAD_Window() throws RuntimeException { return get_ValueAsPO(COLUMNNAME_AD_Window_ID, org.compiere.model.I_AD_Window.class); } @Override public void setAD_Window(org.compiere.model.I_AD_Window AD_Window) { set_ValueFromPO(COLUMNNAME_AD_Window_ID, org.compiere.model.I_AD_...
else set_Value (COLUMNNAME_AD_Window_ID, Integer.valueOf(AD_Window_ID)); } /** Get Fenster. @return Eingabe- oder Anzeige-Fenster */ @Override public int getAD_Window_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_AD_Window_ID); if (ii == null) return 0; return ii.intValue(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Element_Link.java
1
请在Spring Boot框架中完成以下Java代码
public class CountryId implements RepoIdAware { public static final CountryId GERMANY = new CountryId(101); public static final CountryId SWITZERLAND = new CountryId(107); @JsonCreator @NonNull public static CountryId ofRepoId(final int repoId) { return new CountryId(repoId); } @Nullable public static Coun...
public int getRepoId() { return repoId; } public static boolean equals(@Nullable final CountryId countryId1, @Nullable final CountryId countryId2) { return Objects.equals(countryId1, countryId2); } public boolean equalsToRepoId(final int repoId) { return this.repoId == repoId; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\location\CountryId.java
2
请完成以下Java代码
public void setProcessed (final boolean Processed) { set_Value (COLUMNNAME_Processed, Processed); } @Override public boolean isProcessed() { return get_ValueAsBoolean(COLUMNNAME_Processed); } @Override public void setProcessing (final boolean Processing) { set_Value (COLUMNNAME_Processing, Processing)...
@Override public void setT_Qty (final @Nullable BigDecimal T_Qty) { set_Value (COLUMNNAME_T_Qty, T_Qty); } @Override public BigDecimal getT_Qty() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_T_Qty); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setT_Time (final @Nullabl...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_Test.java
1
请在Spring Boot框架中完成以下Java代码
private @Nullable String determineDatabaseName(R2dbcProperties properties) { if (properties.isGenerateUniqueName()) { return properties.determineUniqueName(); } if (StringUtils.hasLength(properties.getName())) { return properties.getName(); } return null; } private String determineEmbeddedUsername(R2...
this.url = url; this.embeddedDatabaseConnection = embeddedDatabaseConnection; } @Nullable String getUrl() { return this.url; } EmbeddedDatabaseConnection getEmbeddedDatabaseConnection() { return this.embeddedDatabaseConnection; } } }
repos\spring-boot-4.0.1\module\spring-boot-r2dbc\src\main\java\org\springframework\boot\r2dbc\autoconfigure\ConnectionFactoryOptionsInitializer.java
2
请完成以下Java代码
public final class MyUserPredicatesBuilder { private final List<SearchCriteria> params; public MyUserPredicatesBuilder() { params = new ArrayList<>(); } public MyUserPredicatesBuilder with(final String key, final String operation, final Object value) { params.add(new SearchCriteria(key...
} return result; } static class BooleanExpressionWrapper { private BooleanExpression result; public BooleanExpressionWrapper(final BooleanExpression result) { super(); this.result = result; } public BooleanExpression getRes...
repos\tutorials-master\spring-web-modules\spring-rest-query-language\src\main\java\com\baeldung\persistence\dao\MyUserPredicatesBuilder.java
1
请在Spring Boot框架中完成以下Java代码
class ArtemisConnectionFactoryConfiguration { @Configuration(proxyBeanMethods = false) @ConditionalOnBooleanProperty(name = "spring.artemis.pool.enabled", havingValue = false, matchIfMissing = true) static class SimpleConnectionFactoryConfiguration { @Bean(name = "jmsConnectionFactory") @ConditionalOnBooleanPr...
CachingConnectionFactory connectionFactory = new CachingConnectionFactory( createJmsConnectionFactory(properties, connectionDetails, beanFactory)); connectionFactory.setCacheConsumers(cacheProperties.isConsumers()); connectionFactory.setCacheProducers(cacheProperties.isProducers()); connectionFactory....
repos\spring-boot-4.0.1\module\spring-boot-artemis\src\main\java\org\springframework\boot\artemis\autoconfigure\ArtemisConnectionFactoryConfiguration.java
2
请完成以下Java代码
public void setDescription (String Description) { set_Value (COLUMNNAME_Description, Description); } /** Get Description. @return Optional short description of the record */ public String getDescription () { return (String)get_Value(COLUMNNAME_Description); } /** Set LinkURL. @param LinkURL Cont...
set_Value (COLUMNNAME_PubDate, PubDate); } /** Get Publication Date. @return Date on which this article will / should get published */ public Timestamp getPubDate () { return (Timestamp)get_Value(COLUMNNAME_PubDate); } /** Set Title. @param Title Name this entity is referred to as */ public voi...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_NewsItem.java
1
请完成以下Java代码
private void addWithEngineFactory(int x, int y) throws IllegalAccessException, InstantiationException, javax.script.ScriptException, FileNotFoundException { Class calcClass = (Class) engineFromFactory.eval( new FileReader(new File("src/main/groovy/com/baeldung/", "CalcMath.groovy"))); Gr...
LOG.info("Invocation of the run method of a dynamic groovy script..."); addWithGroovyShellRun(); LOG.info("Invocation of a dynamic groovy class loaded with GroovyClassLoader..."); addWithGroovyClassLoader(10, 30); LOG.info("Invocation of a dynamic groovy class loaded with GroovyScriptEng...
repos\tutorials-master\core-groovy-modules\core-groovy-2\src\main\java\com\baeldung\MyJointCompilationApp.java
1
请完成以下Java代码
public Builder append(final CtxName name) { append(new SingleParameterStringExpression(name.toStringWithMarkers(), name)); return this; } /** * Wraps the entire content of this builder using given wrapper. * After this method invocation the builder will contain only the wrapped expression. */ pu...
/** * If the {@link Condition} is <code>true</code> then it wraps the entire content of this builder using given wrapper. * After this method invocation the builder will contain only the wrapped expression. */ public Builder wrapIfTrue(final boolean condition, final IStringExpressionWrapper wrapper) { i...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\impl\CompositeStringExpression.java
1
请完成以下Java代码
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) { Mono<?> principal = exchange.getPrincipal().cast(Object.class).defaultIfEmpty(NONE); Mono<Object> session = exchange.getSession().cast(Object.class).defaultIfEmpty(NONE); return Mono.zip(PrincipalAndSession::new, principal, session) ....
PrincipalAndSession(Object[] zipped) { this.principal = (zipped[0] != NONE) ? (Principal) zipped[0] : null; this.session = (zipped[1] != NONE) ? (WebSession) zipped[1] : null; } @Nullable Principal getPrincipal() { return this.principal; } @Nullable String getSessionId() { return (this.session != ...
repos\spring-boot-4.0.1\module\spring-boot-webflux\src\main\java\org\springframework\boot\webflux\actuate\web\exchanges\HttpExchangesWebFilter.java
1
请完成以下Java代码
public class VariableAggregationDefinitions { protected Collection<VariableAggregationDefinition> aggregations = new ArrayList<>(); public Collection<VariableAggregationDefinition> getAggregations() { return aggregations; } public Collection<VariableAggregationDefinition> getOverviewAggregati...
@Override public VariableAggregationDefinitions clone() { VariableAggregationDefinitions aggregations = new VariableAggregationDefinitions(); aggregations.setValues(this); return aggregations; } public void setValues(VariableAggregationDefinitions otherAggregations) { for (...
repos\flowable-engine-main\modules\flowable-bpmn-model\src\main\java\org\flowable\bpmn\model\VariableAggregationDefinitions.java
1
请完成以下Java代码
public class Student { @Id private String id; private String name; private Long age; public Student(String id, String name, Long age) { this.id = id; this.name = name; this.age = age; } public String getId() { return id; } public void setId(String id)...
this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Long getAge() { return age; } public void setAge(Long age) { this.age = age; } }
repos\tutorials-master\persistence-modules\spring-data-mongodb-2\src\main\java\com\baeldung\projection\model\Student.java
1
请在Spring Boot框架中完成以下Java代码
public class ImgWatermarkServiceImpl implements WatermarkService { @Override public String watermarkAdd( File imageFile, String imageFileName, String uploadPath, String realUploadPath ) { String logoFileName = "watermark_" + imageFileName; OutputStream os = null; try { Ima...
while ( x < width*count ) { // 循环添加水印 y = -height / 2; while( y < height*count ) { g.drawImage(imageLogo, x, y, null); // 添加水印 y += markHeight + yInterval; } x += markWidth + xInterval; } g...
repos\Spring-Boot-In-Action-master\springbt_watermark\src\main\java\cn\codesheep\springbt_watermark\service\impl\ImgWatermarkServiceImpl.java
2
请在Spring Boot框架中完成以下Java代码
public boolean isCreditStopSales(@NonNull final BPartnerStats stat, @NonNull final BigDecimal grandTotal, @NonNull final Timestamp date) { final CalculateSOCreditStatusRequest request = CalculateSOCreditStatusRequest.builder() .stat(stat) .additionalAmt(grandTotal) .date(date) .build(); final Strin...
} @Override public void resetCreditStatusFromBPGroup(@NonNull final I_C_BPartner bpartner) { final BPartnerStats bpartnerStats = Services.get(IBPartnerStatsDAO.class).getCreateBPartnerStats(bpartner); final I_C_BP_Group bpGroup = bpartner.getC_BP_Group(); final String creditStatus = bpGroup.getSOCreditStatus(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\bpartner\service\impl\BPartnerStatsBL.java
2
请完成以下Java代码
public class MenuButton extends BaseModel { private MenuType type; private String name; private String key; private String url; /** * 菜单显示的永久素材的MaterialID,当MenuType值为media_id和view_limited时必需 */ @JSONField(name = "media_id") private String mediaId; /** * 二级菜单列表,每个一级菜单下最多5...
return url; } public void setUrl(String url) { this.url = url; } public String getMediaId() { return mediaId; } public void setMediaId(String mediaId) { this.mediaId = mediaId; } public List<MenuButton> getSubButton() { return subButton; } pub...
repos\spring-boot-quick-master\quick-wx-public\src\main\java\com\wx\pn\api\model\MenuButton.java
1
请完成以下Java代码
public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response, final Object handler) throws Exception { log.info("[preHandle][" + request + "]" + "[" + request.getMethod() + "]" + request.getRequestURI() + getParameters(request)); return true; } /** * Execut...
} else { posted.append(request.getParameter(curr)); } } final String ip = request.getHeader("X-FORWARDED-FOR"); final String ipAddr = (ip == null) ? getRemoteAddr(request) : ip; if (!Strings.isNullOrEmpty(ipAddr)) posted.append("&_psip=" + ipAddr)...
repos\tutorials-master\spring-security-modules\spring-security-web-mvc-custom\src\main\java\com\baeldung\web\interceptor\LoggerInterceptor.java
1
请完成以下Java代码
public int read(byte[] b) throws IOException { return read(b, 0, b.length); } @Override public int read(byte[] b, int off, int len) throws IOException { int read = (this.headerStream != null) ? this.headerStream.read(b, off, len) : -1; if (read <= 0) { return readRemainder(b, off, len); } this.position...
} return read; } boolean hasZipHeader() { return Arrays.equals(this.header, ZIP_HEADER); } private int readRemainder(byte[] b, int off, int len) throws IOException { int read = super.read(b, off, len); if (read > 0) { this.position += read; } return read; } }
repos\spring-boot-4.0.1\loader\spring-boot-loader-tools\src\main\java\org\springframework\boot\loader\tools\ZipHeaderPeekInputStream.java
1