instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public class InputSetImpl extends BaseElementImpl implements InputSet {
protected static Attribute<String> nameAttribute;
protected static ElementReferenceCollection<DataInput, DataInputRefs> dataInputDataInputRefsCollection;
protected static ElementReferenceCollection<DataInput, OptionalInputRefs> optionalInput... | typeBuilder.build();
}
public InputSetImpl(ModelTypeInstanceContext instanceContext) {
super(instanceContext);
}
public String getName() {
return nameAttribute.getValue(this);
}
public void setName(String name) {
nameAttribute.setValue(this, name);
}
public Collection<DataInput> getDataI... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\InputSetImpl.java | 1 |
请完成以下Java代码 | private IWorkpackageLogsRepository getLogsRepository()
{
return SpringContextHolder.instance.getBean(IWorkpackageLogsRepository.class);
}
@Override
public IQueueProcessor createAsynchronousQueueProcessor(final I_C_Queue_Processor config, final IWorkPackageQueue queue)
{
final IWorkpackageLogsRepository logsRe... | public IQueueProcessorEventDispatcher getQueueProcessorEventDispatcher()
{
return queueProcessorEventDispatcher;
}
@Override
public IQueueProcessor createAsynchronousQueueProcessor(@NonNull final QueuePackageProcessorId packageProcessorId)
{
final I_C_Queue_Processor queueProcessorConfig = queueProcessorDescr... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\processor\impl\QueueProcessorFactory.java | 1 |
请完成以下Java代码 | public String getCodingLine1() {
return codingLine1;
}
/**
* Sets the value of the codingLine1 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCodingLine1(String value) {
this.codingLine1 = value;
}
... | * possible object is
* {@link String }
*
*/
public String getCodingLine2() {
return codingLine2;
}
/**
* Sets the value of the codingLine2 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public vo... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\EsrRedType.java | 1 |
请完成以下Java代码 | public final class SecurityContextCallableProcessingInterceptor implements CallableProcessingInterceptor {
private @Nullable volatile SecurityContext securityContext;
private SecurityContextHolderStrategy securityContextHolderStrategy = SecurityContextHolder
.getContextHolderStrategy();
/**
* Create a new {@l... | setSecurityContext(this.securityContextHolderStrategy.getContext());
}
}
@Override
public <T> void preProcess(NativeWebRequest request, Callable<T> task) {
if (this.securityContext != null) {
this.securityContextHolderStrategy.setContext(this.securityContext);
}
}
@Override
public <T> void postProcess(... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\context\request\async\SecurityContextCallableProcessingInterceptor.java | 1 |
请完成以下Java代码 | public CountResultDto getHistoricDetailsCount(UriInfo uriInfo) {
HistoricDetailQueryDto queryDto = new HistoricDetailQueryDto(objectMapper, uriInfo.getQueryParameters());
HistoricDetailQuery query = queryDto.toQuery(processEngine);
long count = query.count();
CountResultDto result = new CountResultDto(... | if (!deserializeObjectValues) {
query.disableCustomObjectDeserialization();
}
List<HistoricDetail> queryResult = QueryUtil.list(query, firstResult, maxResults);
List<HistoricDetailDto> result = new ArrayList<HistoricDetailDto>();
for (HistoricDetail historicDetail : queryResult) {
Historic... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\history\HistoricDetailRestServiceImpl.java | 1 |
请完成以下Java代码 | public void setEmail(String email) {
this.email = email;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getRegTime() {
return regTime;
}
public void setRegTime(String regTime) { | this.regTime = regTime;
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", userName='" + userName + '\'' +
", password='" + password + '\'' +
", email='" + email + '\'' +
", nickname='" + nickname + '\'' +
", regTime='" + regTime + '\'' +
'}';
}
} | repos\spring-boot-leaning-master\2.x_42_courses\第 4-2 课:Spring Boot 和 Redis 常用操作\spring-boot-redis\src\main\java\com\neo\model\User.java | 1 |
请完成以下Java代码 | public class CustomUserDetails extends User {
private final String firstName;
private final String lastName;
private final String email;
private CustomUserDetails(Builder builder) {
super(builder.username, builder.password, builder.authorities);
this.firstName = builder.firstName;
... | private String firstName;
private String lastName;
private String email;
private String username;
private String password;
private Collection<? extends GrantedAuthority> authorities;
public Builder withFirstName(String firstName) {
this.firstName = firstName;... | repos\tutorials-master\spring-security-modules\spring-security-web-thymeleaf\src\main\java\com\baeldung\customuserdetails\CustomUserDetails.java | 1 |
请完成以下Java代码 | protected void handle(final HttpServletRequest request, final HttpServletResponse response, final Authentication authentication) throws IOException {
final String targetUrl = determineTargetUrl(authentication);
if (response.isCommitted()) {
logger.debug("Response has already been committed.... | throw new IllegalStateException();
}
}
/**
* Removes temporary authentication-related data which may have been stored in the session
* during the authentication process.
*/
protected final void clearAuthenticationAttributes(final HttpServletRequest request) {
final HttpSessio... | repos\tutorials-master\spring-security-modules\spring-security-web-mvc\src\main\java\com\baeldung\security\MySimpleUrlAuthenticationSuccessHandler.java | 1 |
请完成以下Java代码 | public ResponseEntity createReceipts(@RequestBody final JsonCreateReceiptsRequest jsonCreateReceiptsRequest)
{
try
{
final JsonCreateReceiptsResponse receiptsResponse = trxManager.callInNewTrx(() -> createReceipts_0(jsonCreateReceiptsRequest));
return ResponseEntity.ok(receiptsResponse);
}
catch (final ... | .stream()
.map(InOutId::getRepoId)
.map(JsonMetasfreshId::of)
.collect(ImmutableList.toImmutableList());
final List<JsonMetasfreshId> jsonReturnIds = returnIds
.stream()
.map(InOutId::getRepoId)
.map(JsonMetasfreshId::of)
.collect(ImmutableList.toImmutableList());
return JsonCreateRece... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\receipt\ReceiptRestController.java | 1 |
请完成以下Java代码 | public List<NameCountryEntity> getCountry() {
return country;
}
public void setCountry(List<NameCountryEntity> country) {
this.country = country;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == nu... | return false;
if (country == null) {
if (other.country != null)
return false;
} else if (!country.equals(other.country))
return false;
return true;
}
@Override
public String toString() {
return "NameCountriesModel [name=" + name + ", c... | repos\tutorials-master\spring-web-modules\spring-thymeleaf-attributes\accessing-session-attributes\src\main\java\com\baeldung\accesing_session_attributes\business\entities\NameCountriesEntity.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SecurityConfiguration {
@Bean
public InMemoryUserDetailsManager userDetailsService() {
UserDetails user1 = User
.withUsername("user")
.password(passwordEncoder().encode("baeldung"))
.roles("tenant_1")
.build();
UserDe... | @Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
final AuthenticationManager authenticationManager = authenticationManager(http.getSharedObject(AuthenticationConfiguration.class));
http
.authorizeHttpRequests(authorize ->
auth... | repos\tutorials-master\persistence-modules\spring-jpa\src\main\java\com\baeldung\multitenant\security\SecurityConfiguration.java | 2 |
请完成以下Java代码 | public EventLogEntryEntity generateEventLogEntry(CommandContext commandContext) {
ActivitiEntityWithVariablesEvent eventWithVariables = (ActivitiEntityWithVariablesEvent) event;
ExecutionEntity processInstanceEntity = (ExecutionEntity) eventWithVariables.getEntity();
Map<String, Object> data = ... | );
}
putInMapIfNotNull(data, Fields.VARIABLES, variableMap);
}
return createEventLogEntry(
TYPE,
processInstanceEntity.getProcessDefinitionId(),
processInstanceEntity.getId(),
null,
null,
data
);
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\event\logger\handler\ProcessInstanceStartedEventHandler.java | 1 |
请完成以下Java代码 | public static class Fact {
private final String name;
private final String value;
}
}
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class ActionCard {
@JsonProperty("@type")
private String type; // ActionCard, OpenUri
private Stri... | }
}
@Data
public static class Action {
@JsonProperty("@type")
private final String type; // HttpPOST
private final String name;
private final String target; // url
}
@Data
public static class Target {
private f... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\notification\channels\TeamsMessageCard.java | 1 |
请完成以下Java代码 | protected boolean afterDelete (boolean success)
{
if (success)
{
updateHeader();
//
Object ii = get_ValueOld("S_ResourceAssignment_ID");
if (ii instanceof Integer)
{
int old_S_ResourceAssignment_ID = ((Integer)ii).intValue();
// Deleted Assignment
if (old_S_ResourceAssignment_ID != 0)
... | /**
* Update Header.
* Set Approved Amount
*/
private void updateHeader()
{
String sql = "UPDATE S_TimeExpense te"
+ " SET ApprovalAmt = "
+ "(SELECT SUM(Qty*ConvertedAmt) FROM S_TimeExpenseLine tel "
+ "WHERE te.S_TimeExpense_ID=tel.S_TimeExpense_ID) "
+ "WHERE S_TimeExpense_ID=" + getS_TimeE... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MTimeExpenseLine.java | 1 |
请完成以下Java代码 | public void setAD_User(org.compiere.model.I_AD_User AD_User)
{
set_ValueFromPO(COLUMNNAME_AD_User_ID, org.compiere.model.I_AD_User.class, AD_User);
}
/** Set Ansprechpartner.
@param AD_User_ID
User within the system - Internal or Business Partner Contact
*/
@Override
public void setAD_User_ID (int AD_Us... | @param Node_ID Node_ID */
@Override
public void setNode_ID (int Node_ID)
{
if (Node_ID < 0)
set_Value (COLUMNNAME_Node_ID, null);
else
set_Value (COLUMNNAME_Node_ID, Integer.valueOf(Node_ID));
}
/** Get Node_ID.
@return Node_ID */
@Override
public int getNode_ID ()
{
Integer ii = (Integer)... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_TreeBar.java | 1 |
请完成以下Java代码 | public void setStopEditing(boolean stopediting)
{
m_stopediting = stopediting;
}
private VLookupAutoCompleter lookupAutoCompleter = null;
// metas-2009_0021_AP1_CR054: begin
/**
* @return true if enabled
*/
public boolean enableLookupAutocomplete()
{
if (lookupAutoCompleter != null)
{
return true;... | // In case there is no GridField set (e.g. VLookup was created from a custom swing form)
if (gridField == null)
{
return IValidationContext.DISABLED;
}
final IValidationContext evalCtx = Services.get(IValidationRuleFactory.class).createValidationContext(gridField);
// In case grid field validation contex... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VLookup.java | 1 |
请完成以下Java代码 | private final IAttributeValue toAttributeValue(final I_M_HU_Attribute huAttribute, final I_M_HU_PI_Attribute piAttribute)
{
return new HUAttributeValue(this, huAttribute, piAttribute, isSaveOnChange());
}
protected final IHandlingUnitsDAO getHandlingUnitsDAO()
{
return handlingUnitsDAO;
}
@Override
public ... | {
final IHUStorageFactory huStorageFactory = getAttributeStorageFactory().getHUStorageFactory();
final IHUStorage storage = huStorageFactory.getStorage(getM_HU());
final BigDecimal fullStorageQty = storage.getQtyForProductStorages().toBigDecimal();
return fullStorageQty;
}
@Override
public final boolean isV... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\storage\impl\AbstractHUAttributeStorage.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public abstract class AbstractJwtAuthenticationToken extends AbstractAuthenticationToken {
private static final long serialVersionUID = -6212297506742428406L;
private RawAccessJwtToken rawAccessToken;
private SecurityUser securityUser;
public AbstractJwtAuthenticationToken(RawAccessJwtToken unsafeTok... | }
@Override
public Object getCredentials() {
return rawAccessToken;
}
@Override
public Object getPrincipal() {
return this.securityUser;
}
@Override
public void eraseCredentials() {
super.eraseCredentials();
this.rawAccessToken = null;
}
} | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\security\auth\AbstractJwtAuthenticationToken.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class TaskActionRequest extends RestActionRequest {
public static final String ACTION_COMPLETE = "complete";
public static final String ACTION_CLAIM = "claim";
public static final String ACTION_DELEGATE = "delegate";
public static final String ACTION_RESOLVE = "resolve";
protected String as... | this.outcome = outcome;
}
public void setVariables(List<RestVariable> variables) {
this.variables = variables;
}
@ApiModelProperty(value = "If action is complete, you can use this parameter to set variables ")
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public List<... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\task\TaskActionRequest.java | 2 |
请完成以下Java代码 | public Class<? extends BaseElement> getHandledType() {
return SignalEventDefinition.class;
}
protected void executeParse(BpmnParse bpmnParse, SignalEventDefinition signalDefinition) {
Signal signal = null;
if (bpmnParse.getBpmnModel().containsSignalId(signalDefinition.getSignalRef())) {... | );
} else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
boundaryEvent.setBehavior(
bpmnParse
.getActivityBehaviorFactory()
.createB... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\parser\handler\SignalEventDefinitionParseHandler.java | 1 |
请完成以下Java代码 | public void setAttribute(String name, Object value) {
checkState();
Object oldValue = this.session.getAttribute(name);
this.session.setAttribute(name, value);
if (value != oldValue) {
if (oldValue instanceof HttpSessionBindingListener) {
try {
((HttpSessionBindingListener) oldValue)
.valueUnbo... | try {
((HttpSessionBindingListener) oldValue).valueUnbound(new HttpSessionBindingEvent(this, name, oldValue));
}
catch (Throwable th) {
logger.error("Error invoking session binding event listener", th);
}
}
}
@Override
public void invalidate() {
checkState();
this.invalidated = true;
}
@Ov... | repos\spring-session-main\spring-session-core\src\main\java\org\springframework\session\web\http\HttpSessionAdapter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setTaskId(String taskId) {
this.taskId = taskId;
}
@Override
public Date getCreateTime() {
return createTime;
}
@Override
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public Date getLastUpdatedTime() {
... | @Override
public String getMetaInfo() {
return metaInfo;
}
@Override
public void setMetaInfo(String metaInfo) {
this.metaInfo = metaInfo;
}
@Override
public ByteArrayRef getByteArrayRef() {
return byteArrayRef;
}
// common methods //////////////////////////... | repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\impl\persistence\entity\HistoricVariableInstanceEntityImpl.java | 2 |
请完成以下Java代码 | public Optional<MobileApplicationId> getApplicationId() {return getByPathAsString("applicationId").map(MobileApplicationId::ofNullableString);}
public Optional<String> getDeviceId() {return getByPathAsString("device", "deviceId");}
public Optional<String> getTabId() {return getByPathAsString("device", "tabId");}
... | }
}
return Optional.of(currentValue);
}
private static Optional<Object> getByKey(final Map<String, Object> map, final String key)
{
return map.entrySet()
.stream()
.filter(e -> e.getKey().equalsIgnoreCase(key))
.map(Map.Entry::getValue)
.filter(Objects::nonNull)
.findFirst();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\serverRoot\de.metas.adempiere.adempiere.serverRoot.base\src\main\java\de\metas\server\ui_trace\rest\JsonUITraceEvent.java | 1 |
请完成以下Java代码 | public static WarehouseId ofRepoId(final int repoId)
{
if (repoId == MAIN.repoId)
{
return MAIN;
}
else
{
return new WarehouseId(repoId);
}
}
@Nullable
public static WarehouseId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? ofRepoId(repoId) : null;
}
public static Optional<Warehous... | .map(WarehouseId::toRepoId)
.filter(id -> id > 0)
.collect(ImmutableSet.toImmutableSet());
}
int repoId;
private WarehouseId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "M_Warehouse_ID");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public static ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\warehouse\WarehouseId.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void delete(CalculatedField calculatedField, SecurityUser user) {
ActionType actionType = ActionType.DELETED;
TenantId tenantId = calculatedField.getTenantId();
CalculatedFieldId calculatedFieldId = calculatedField.getId();
try {
calculatedFieldService.deleteCalculated... | }
}
private void checkEntity(TenantId tenantId, EntityId entityId, CalculatedFieldType type) {
EntityType entityType = entityId.getEntityType();
Set<CalculatedFieldType> supportedTypes = CalculatedField.SUPPORTED_ENTITIES.get(entityType);
if (supportedTypes == null || supportedTypes.isE... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\entitiy\cf\DefaultTbCalculatedFieldService.java | 2 |
请完成以下Java代码 | private static boolean equalsConstantTime(String expected, @Nullable String actual) {
if (expected == actual) {
return true;
}
if (expected == null || actual == null) {
return false;
}
// Encode after ensure that the string is not null
byte[] expectedBytes = Utf8.encode(expected);
byte[] actualBytes... | private final HashSet<String> allowedMethods = new HashSet<>(Arrays.asList("GET", "HEAD", "TRACE", "OPTIONS"));
@Override
public boolean matches(HttpServletRequest request) {
return !this.allowedMethods.contains(request.getMethod());
}
@Override
public String toString() {
return "IsNotHttpMethod " + t... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\csrf\CsrfFilter.java | 1 |
请完成以下Java代码 | public abstract class CmmnElementImpl extends CmmnModelElementInstanceImpl implements CmmnElement {
protected static Attribute<String> idAttribute;
protected static ChildElement<ExtensionElements> extensionElementsChild;
// cmmn 1.0
@Deprecated
protected static Attribute<String> descriptionAttribute;
// ... | }
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CmmnElement.class, CMMN_ELEMENT)
.abstractType()
.namespaceUri(CMMN11_NS);
idAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_ID)
.idAttribute()
... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\CmmnElementImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public SourceHUsCollection getByProductId(@NonNull final ProductId productId)
{
switch (issueStrategy)
{
case AssignedHUsOnly:
return retrieveActiveSourceHusForHus(productId);
case DEFAULT:
return retrieveActiveSourceHusFromWarehouse(productId);
default:
throw new AdempiereException("Unknown i... | final ImmutableList<I_M_HU> activeHUsMatchingProduct = handlingUnitsDAO.createHUQueryBuilder()
.setOnlyActiveHUs(true)
.setAllowEmptyStorage()
.addOnlyHUIds(getPPOrderSourceHUIds())
.addOnlyWithProductId(productId)
.createQuery()
.listImmutable(I_M_HU.class);
final ImmutableList<I_M_Source_HU... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\job\service\commands\issue_what_was_received\SourceHUsCollectionProvider.java | 2 |
请完成以下Java代码 | default List<String> getScopes() {
return getClaimAsStringList(OAuth2TokenIntrospectionClaimNames.SCOPE);
}
/**
* Returns the type of the token {@code (token_type)}, for example {@code bearer}.
* @return the type of the token, for example {@code bearer}.
*/
@Nullable
default String getTokenType() {
retur... | * Returns usually a machine-readable identifier {@code (sub)} of the resource owner
* who authorized the token
* @return usually a machine-readable identifier of the resource owner who authorized
* the token
*/
@Nullable
default String getSubject() {
return getClaimAsString(OAuth2TokenIntrospectionClaimName... | repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\OAuth2TokenIntrospectionClaimAccessor.java | 1 |
请完成以下Java代码 | public Double getDoubleValue() {
return null;
}
@Override
public void setDoubleValue(Double doubleValue) {}
@Override
public byte[] getBytes() {
return null;
}
@Override
public void setBytes(byte[] bytes) {}
@Override
public Object getCachedValue() {
r... | @Override
public Object getValue() {
return variableValue;
}
@Override
public void setValue(Object value) {
variableValue = value;
}
@Override
public String getTypeName() {
return TYPE_TRANSIENT;
}
@Override
public void setTypeName(String typeName) {}
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\TransientVariableInstance.java | 1 |
请完成以下Java代码 | protected String doIt() throws Exception
{
final OrgId orgId = OrgId.ofRepoId(toOrgId);
final PInstanceId pinstanceId = getPinstanceId();
final ImmutableList<I_C_DocType> docTypes = docTypeBL.retrieveForSelection(pinstanceId);
for (final I_C_DocType docType : docTypes)
{
docTypeBL.cloneToOrg(docType, or... | DB.deleteT_Selection(adPInstanceId, ITrx.TRXNAME_ThreadInherited);
return queryBuilder
.create()
.createSelection(adPInstanceId);
}
@NonNull
private IQueryBuilder<I_C_DocType> createDocTypesQueryBuilder()
{
final IQueryFilter<I_C_DocType> userSelectionFilter = getProcessInfo().getQueryFilterOrElse(nul... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\document\process\C_DocType_Clone_Selection.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public final class H2ConsoleAutoConfiguration {
private static final Log logger = LogFactory.getLog(H2ConsoleAutoConfiguration.class);
private final H2ConsoleProperties properties;
H2ConsoleAutoConfiguration(H2ConsoleProperties properties) {
this.properties = properties;
}
@Bean
ServletRegistrationBean<Jaka... | action.run();
}
finally {
Thread.currentThread().setContextClassLoader(previous);
}
}
private List<String> getConnectionUrls(ObjectProvider<DataSource> dataSources) {
return dataSources.orderedStream(ObjectProvider.UNFILTERED)
.map(this::getConnectionUrl)
.filter(Objects::nonNull)
.toLi... | repos\spring-boot-4.0.1\module\spring-boot-h2console\src\main\java\org\springframework\boot\h2console\autoconfigure\H2ConsoleAutoConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Money getAmountToAllocateInitial()
{
return purchaseInvoicePayableDoc.getAmountsToAllocateInitial().getPayAmt().negate();
}
@Override
public Money getAmountToAllocate()
{
return purchaseInvoicePayableDoc.getAmountsToAllocate().getPayAmt().negate();
}
@Override
public void addAllocatedAmt(final Mone... | return false;
}
// if currency differs, do not allow payment
return CurrencyId.equals(payable.getCurrencyId(), purchaseInvoicePayableDoc.getCurrencyId());
}
@Override
public CurrencyId getCurrencyId()
{
return purchaseInvoicePayableDoc.getCurrencyId();
}
@Override
public LocalDate getDate()
{
retur... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\payment\paymentallocation\service\PurchaseInvoiceAsInboundPaymentDocumentWrapper.java | 2 |
请完成以下Java代码 | public class ResourceNameUtil {
public static final String[] DMN_RESOURCE_SUFFIXES = new String[] { "dmn.xml", "dmn" };
public static final String[] DIAGRAM_SUFFIXES = new String[] { "png", "jpg", "gif", "svg" };
public static String stripDmnFileSuffix(String dmnFileResource) {
for (String suffix ... | for (String diagramSuffix : DIAGRAM_SUFFIXES) {
String possibleName = dmnResourceBase + key + "." + diagramSuffix;
if (resources.containsKey(possibleName)) {
return possibleName;
}
possibleName = dmnResourceBase + diagramSuffix;
if (resources.... | repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\deployer\ResourceNameUtil.java | 1 |
请完成以下Java代码 | public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;... | return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
} | repos\tutorials-master\json-modules\gson-2\src\main\java\com\baeldung\gson\entities\Person.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean schedule(Runnable runnable, boolean isLongRunning) {
if(isLongRunning) {
return scheduleLongRunningWork(runnable);
} else {
return scheduleShortRunningWork(runnable);
}
}
protected boolean scheduleShortRunningWork(Runnable runnable) {
EnhancedQueueExecutor EnhancedQu... | EnhancedQueueExecutor.execute(runnable);
} catch (RejectedExecutionException e) {
rejected = true;
} catch (Exception e) {
// if it fails for some other reason, log a warning message
long now = System.currentTimeMillis();
// only log every 60 seconds to prevent log flooding
if((no... | repos\camunda-bpm-platform-master\distro\wildfly\subsystem\src\main\java\org\camunda\bpm\container\impl\jboss\service\MscExecutorService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class FooController {
private static final Logger logger = LoggerFactory.getLogger(FooController.class);
@Autowired
private ApplicationEventPublisher eventPublisher;
@Autowired
private IFooService service;
public FooController() {
super();
}
// read - one
@Ge... | // write
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public Foo create(@RequestBody final Foo resource, final HttpServletResponse response) {
Preconditions.checkNotNull(resource);
final Foo foo = service.create(resource);
final Long idOfCreatedResource = foo.getId();
e... | repos\tutorials-master\spring-web-modules\spring-boot-rest-2\src\main\java\com\baeldung\hateoas\web\controller\FooController.java | 2 |
请完成以下Java代码 | public java.lang.String getCode ()
{
return (java.lang.String)get_Value(COLUMNNAME_Code);
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
@Override
public void setName (java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifi... | @return Type of Validation (SQL, Java Script, Java Language)
*/
@Override
public java.lang.String getType ()
{
return (java.lang.String)get_Value(COLUMNNAME_Type);
}
/** Set Search Key.
@param Value
Search key for the record in the format required - must be unique
*/
@Override
public void setValue... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\letters\model\X_AD_BoilerPlate_Var.java | 1 |
请完成以下Java代码 | public class ResolveTaskCmd extends NeedsActiveTaskCmd<Void> {
private static final long serialVersionUID = 1L;
protected Map<String, Object> variables;
protected Map<String, Object> transientVariables;
public ResolveTaskCmd(String taskId, Map<String, Object> variables) {
super(taskId);
... | task.setVariables(variables);
}
if (transientVariables != null) {
task.setTransientVariables(transientVariables);
}
task.resolve();
return null;
}
@Override
protected String getSuspendedTaskException() {
return "Cannot resolve a suspended task";
... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\cmd\ResolveTaskCmd.java | 1 |
请完成以下Java代码 | public String toPermissionsKeyString()
{
String permissionsKeyStr = _permissionsKeyStr;
if (permissionsKeyStr == null)
{
_permissionsKeyStr = permissionsKeyStr = toPermissionsKeyString(roleId, userId, clientId, date);
}
return permissionsKeyStr;
}
public static long normalizeDate(final Instant date)
{... | public static long normalizeDate(final Date date)
{
final long dateDayMillis = TimeUtil.truncToMillis(date, TimeUtil.TRUNC_DAY);
// Make sure we are we are caching only on day level, else would make no sense,
// and performance penalty would be quite big
// (i.e. retrieve and load and aggregate the whole shit... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\UserRolePermissionsKey.java | 1 |
请完成以下Java代码 | public void refreshApplications() {
publisher.publishEvent(new RefreshInstancesEvent(this));
}
@GetMapping(path = "/applications/{name}", produces = MediaType.APPLICATION_JSON_VALUE)
public Mono<ResponseEntity<Application>> application(@PathVariable("name") String name) {
return registry.getApplication(name).ma... | @DeleteMapping(path = "/applications/{name}")
public Mono<ResponseEntity<Void>> unregister(@PathVariable("name") String name) {
log.debug("Unregister application with name '{}'", name);
return registry.deregister(name)
.collectList()
.map((deregistered) -> !deregistered.isEmpty() ? ResponseEntity.noContent()... | repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\web\ApplicationsController.java | 1 |
请完成以下Java代码 | protected Void executeCmd(CommandContext commandContext) {
ensureNotNull("user", user);
ensureWhitelistedResourceId(commandContext, "User", user.getId());
if (user instanceof UserEntity) {
validateUserEntity(commandContext);
}
IdentityOperationResult operationResult = commandContext
.g... | }
private void validateUserEntity(CommandContext commandContext) {
if(shouldCheckPasswordPolicy(commandContext)) {
if(!((UserEntity) user).checkPasswordAgainstPolicy()) {
throw new ProcessEngineException("Password does not match policy");
}
}
}
protected boolean shouldCheckPasswordPo... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\SaveUserCmd.java | 1 |
请完成以下Java代码 | public static List<MSearchDefinition> getForCode(String transactionCode) throws SQLException {
List<MSearchDefinition> list = new ArrayList<MSearchDefinition>();
String sql = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
sql = "SELECT AD_SearchDefinition_ID FROM AD_SearchDefinition WHERE IsAct... | if (transactionCode != null) {
String sql = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
sql = "SELECT AD_SearchDefinition_ID FROM AD_SearchDefinition WHERE UPPER(TransactionCode) = ? AND IsActive = 'Y'";
pstmt = DB.prepareStatement(sql, null);
pstmt.setString(1, transactionCode.toUppe... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MSearchDefinition.java | 1 |
请完成以下Java代码 | public class ResourceFinder {
private static final Logger LOGGER = LoggerFactory.getLogger(ResourceFinder.class);
private ResourcePatternResolver resourceLoader;
public ResourceFinder(ResourcePatternResolver resourceLoader) {
this.resourceLoader = resourceLoader;
}
public List<Resource> ... | if (resources.isEmpty()) {
LOGGER.info(resourceFinderDescriptor.getMsgForEmptyResources());
} else {
resourceFinderDescriptor.validate(resources);
List<String> foundResources = resources
.stream()
.map(Resource::getFile... | repos\Activiti-develop\activiti-core-common\activiti-spring-resource-finder\src\main\java\org\activiti\spring\resources\ResourceFinder.java | 1 |
请在Spring Boot框架中完成以下Java代码 | class ObservationRegistryConfigurer {
private final ObjectProvider<ObservationRegistryCustomizer<?>> customizers;
private final ObjectProvider<ObservationPredicate> observationPredicates;
private final ObjectProvider<GlobalObservationConvention<?>> observationConventions;
private final ObjectProvider<Observatio... | }
private void registerObservationPredicates(ObservationRegistry registry) {
this.observationPredicates.orderedStream().forEach(registry.observationConfig()::observationPredicate);
}
private void registerGlobalObservationConventions(ObservationRegistry registry) {
this.observationConventions.orderedStream().fo... | repos\spring-boot-4.0.1\module\spring-boot-micrometer-observation\src\main\java\org\springframework\boot\micrometer\observation\autoconfigure\ObservationRegistryConfigurer.java | 2 |
请完成以下Java代码 | public int getAD_User_PrinterMatchingConfig_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_User_PrinterMatchingConfig_ID);
}
@Override
public void setConfigHostKey (java.lang.String ConfigHostKey)
{
set_Value (COLUMNNAME_ConfigHostKey, ConfigHostKey);
}
@Override
public java.lang.String getConfigHostKey()
... | {
set_ValueFromPO(COLUMNNAME_C_Workplace_ID, org.compiere.model.I_C_Workplace.class, C_Workplace);
}
@Override
public void setC_Workplace_ID (final int C_Workplace_ID)
{
if (C_Workplace_ID < 1)
set_Value (COLUMNNAME_C_Workplace_ID, null);
else
set_Value (COLUMNNAME_C_Workplace_ID, C_Workplace_ID);
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java-gen\de\metas\printing\model\X_AD_Printer_Config.java | 1 |
请完成以下Java代码 | public String getDeploymentName() {
return deploymentName;
}
public void setDeploymentName(String deploymentName) {
this.deploymentName = deploymentName;
}
public Resource[] getDeploymentResources() {
return deploymentResources;
}
public void setDeploymentResources(Res... | /**
* Gets the {@link AutoDeploymentStrategy} for the provided mode. This method may be overridden to implement custom deployment strategies if required, but implementors should take care not to return
* <code>null</code>.
*
* @param mode
* the mode to get the strategy for
* @retu... | repos\Activiti-develop\activiti-core\activiti-spring\src\main\java\org\activiti\spring\SpringProcessEngineConfiguration.java | 1 |
请完成以下Java代码 | public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Date getCreateTime(... | }
public String getRootProcessInstanceId() {
return rootProcessInstanceId;
}
public void setRootProcessInstanceId(String rootProcessInstanceId) {
this.rootProcessInstanceId = rootProcessInstanceId;
}
public static AttachmentDto fromAttachment(Attachment attachment) {
AttachmentDto dto = new Att... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\task\AttachmentDto.java | 1 |
请完成以下Java代码 | public class ProcessVariables {
private static final Logger LOGGER = LoggerFactory.getLogger(ProcessVariables.class);
@Inject
private BusinessProcess businessProcess;
@Inject
private ProcessVariableMap processVariableMap;
protected String getVariableName(InjectionPoint ip) {
String va... | String processVariableName = getVariableName(ip);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Getting process variable '{}' from ProcessInstance[{}].", processVariableName, businessProcess.getProcessInstanceId());
}
return businessProcess.getVariable(processVariableName);
}
... | repos\flowable-engine-main\modules\flowable-cdi\src\main\java\org\flowable\cdi\ProcessVariables.java | 1 |
请完成以下Java代码 | public String getScopeType() {
return scopeType;
}
@Override
public void setScopeType(String scopeType) {
this.scopeType = scopeType;
}
@Override
public boolean isFailed() {
return failed;
}
@Override
public void setFailed(boolean failed) {
this.fai... | this.decisionKey = decisionKey;
}
@Override
public String getDecisionName() {
return decisionName;
}
public void setDecisionName(String decisionName) {
this.decisionName = decisionName;
}
@Override
public String getDecisionVersion() {
return decisionVersion;
... | repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\persistence\entity\HistoricDecisionExecutionEntityImpl.java | 1 |
请完成以下Java代码 | protected void prepare()
{
}
@Override
protected String doIt() throws Exception
{
expireLocks();
updateCCM_Bundle_Status();
return "Ok";
}
private int expireLocks()
{
final String sql = "UPDATE "+I_R_Group_Prospect.Table_Name+" SET "
+" "+I_R_Group_Prospect.COLUMNNAME_Locked+"=?"
+","+I_R_Grou... | return count;
}
private void updateCCM_Bundle_Status()
{
int[] ids = new Query(getCtx(), X_R_Group.Table_Name, null, get_TrxName())
//.setOnlyActiveRecords(true) // check all bundles
.setClient_ID()
.getIDs();
int count = 0;
for (int R_Group_ID : ids)
{
boolean updated = BundleUtil.updateCCM_Bundl... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\callcenter\process\CallCenterDailyMaintenance.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class OtherFilePreviewImpl implements FilePreview {
@Override
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
return this.notSupportedFile(model, fileAttribute, "系统还不支持该格式文件的在线预览");
}
/**
* 通用的预览失败,导向到不支持的文件响应页面
*
* @return 页面
... | * @return 页面
*/
public String notSupportedFile(Model model, String errMsg) {
return this.notSupportedFile(model, "未知", errMsg);
}
/**
* 通用的预览失败,导向到不支持的文件响应页面
*
* @return 页面
*/
public String notSupportedFile(Model model, String fileType, String errMsg) {
model.ad... | repos\kkFileView-master\server\src\main\java\cn\keking\service\impl\OtherFilePreviewImpl.java | 2 |
请完成以下Java代码 | public class InEnumValidator implements ConstraintValidator<InEnum, Integer> {
/**
* 值数组
*/
private Set<Integer> values;
@Override
public void initialize(InEnum annotation) {
IntArrayValuable[] values = annotation.value().getEnumConstants();
if (values.length == 0) {
... | @Override
public boolean isValid(Integer value, ConstraintValidatorContext context) {
// 校验通过
if (values.contains(value)) {
return true;
}
// 校验不通过,自定义提示语句(因为,注解上的 value 是枚举类,无法获得枚举类的实际值)
context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值
con... | repos\SpringBoot-Labs-master\lab-22\lab-22-validation-01\src\main\java\cn\iocoder\springboot\lab22\validation\core\validator\InEnumValidator.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getTruststore() {
return this.truststore;
}
public void setTruststore(String truststore) {
this.truststore = truststore;
}
public KeyStoreProperties getTruststoreConfig() {
return this.truststoreConfig;
}
public boolean isWebRequireAuthentication() {
return this.webRequireAuthentication;
... | this.all = all;
}
public String getCluster() {
return this.cluster;
}
public void setCluster(String cluster) {
this.cluster = cluster;
}
public String getDefaultAlias() {
return this.defaultAlias;
}
public void setDefaultAlias(String defaultAlias) {
this.defaultAlias = defaultAlias;
}
... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\configuration\support\SslProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public ImmutableList<I_PP_Order_BOMLine> getOrderBOMLines(@NonNull final PPOrderId ppOrderId) {return ImmutableList.copyOf(ppOrderBOMBL.getOrderBOMLines(ppOrderId));}
@NonNull
public ZonedDateTime getDateStartSchedule(@NonNull final I_PP_Order ppOrder)
{
return InstantAndOrgId.ofTimestamp(ppOrder.getDateStartSche... | .getStorage(hu)
.getQuantity(productId, uom);
}
@NonNull
public ValidateLocatorInfo getValidateSourceLocatorInfo(final @NonNull PPOrderId ppOrderId)
{
final ImmutableList<LocatorInfo> sourceLocatorList = getSourceLocatorIds(ppOrderId)
.stream()
.map(locatorId -> {
final String caption = getLocat... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\job\service\ManufacturingJobLoaderAndSaverSupportingServices.java | 2 |
请完成以下Java代码 | public static VariableService getVariableService(CommandContext commandContext) {
VariableService variableService = null;
VariableServiceConfiguration variableServiceConfiguration = getVariableServiceConfiguration(commandContext);
if (variableServiceConfiguration != null) {
variableS... | }
public static VariableServiceConfiguration getVariableServiceConfiguration() {
return getVariableServiceConfiguration(getCommandContext());
}
public static VariableServiceConfiguration getVariableServiceConfiguration(CommandContext commandContext) {
return getAppEngineConfiguration(c... | repos\flowable-engine-main\modules\flowable-app-engine\src\main\java\org\flowable\app\engine\impl\util\CommandContextUtil.java | 1 |
请完成以下Java代码 | public static DocumentSaveStatus notSavedJustCreated()
{
return STATUS_NotSavedJustCreated;
}
public static DocumentSaveStatus savedJustLoaded()
{
return STATUS_SavedJustLoaded;
}
private static final DocumentSaveStatus STATUS_Saved = builder().hasChangesToBeSaved(false).isPresentInDatabase(true).error(fals... | {
return isSaved() || isDeleted();
}
public DocumentSaveStatus throwIfError()
{
if (!error)
{
return this;
}
if (exception != null)
{
throw AdempiereException.wrapIfNeeded(exception);
}
else
{
throw new AdempiereException(reason != null ? reason : TranslatableStrings.anyLanguage("Error")... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\DocumentSaveStatus.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void configure(AbstractEngineConfiguration engineConfiguration) {
if (idmEngineConfiguration == null) {
idmEngineConfiguration = new StandaloneIdmEngineConfiguration();
}
initialiseCommonProperties(engineConfiguration, idmEngineConfiguration);
initEngine();
... | @Override
protected List<Class<? extends Entity>> getEntityDeletionOrder() {
return EntityDependencyOrder.DELETE_ORDER;
}
public IdmEngineConfiguration getIdmEngineConfiguration() {
return idmEngineConfiguration;
}
public IdmEngineConfigurator setIdmEngineConfiguration(IdmEngineCon... | repos\flowable-engine-main\modules\flowable-idm-engine-configurator\src\main\java\org\flowable\idm\engine\configurator\IdmEngineConfigurator.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class ExternalReferenceDispatchMessageProcessor implements Processor
{
@Override
public void process(final Exchange exchange) throws Exception
{
final JsonExternalReferenceLookupResponse jsonExternalReferenceLookupResponse = exchange.getIn().getBody(JsonExternalReferenceLookupResponse.class);
final Expor... | final DispatchMessageRequest dispatchMessageRequest = DispatchMessageRequest.builder()
.url(routeContext.getRemoteUrl())
.authToken(routeContext.getAuthToken())
.message(jsonRabbitMQHttpMessage)
.build();
exchange.getIn().setBody(dispatchMessageRequest);
}
@NonNull
private JsonRabbitMQProperties ... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-rabbitmq\src\main\java\de\metas\camel\externalsystems\rabbitmq\externalreference\processor\ExternalReferenceDispatchMessageProcessor.java | 2 |
请完成以下Java代码 | public String toString()
{
final ToStringHelper toStringHelper = MoreObjects.toStringHelper(this)
.add("timing", timing)
.add("active", active)
.add("invokeMethodJustOnce", invokeMethodJustOnce)
.add("registerWeakly", registerWeakly);
if (additionalToStringInfo != null)
{
toStringHelp... | default void runAfterCommit(@NonNull final Runnable runnable)
{
newEventListener(TrxEventTiming.AFTER_COMMIT)
.invokeMethodJustOnce(true)
.registerHandlingMethod(trx -> runnable.run());
}
default void runBeforeCommit(@NonNull final Runnable runnable)
{
newEventListener(TrxEventTiming.BEFORE_COMMIT)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\api\ITrxListenerManager.java | 1 |
请完成以下Java代码 | public void setPosition(long[] position) {
this.position = position;
}
/**
* Sets the {@link #speed}.
*
* @param speed
* the new {@link #speed}
*/
public void setSpeed(long[] speed) {
this.speed = speed;
}
/**
* Sets the {@link #fitness}.
*
* @param fitness
* the new {... | * (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Particle other = (Particle) obj;
if (Double.doubleToLongBits(bestFi... | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-4\src\main\java\com\baeldung\algorithms\multiswarm\Particle.java | 1 |
请完成以下Java代码 | /* package */class CompositeAggregationKeyValueHandler implements IAggregationKeyValueHandler<Object>
{
/**
* IMPORTANT:</b> we need the handlers to have a fixed ordering. We use their class names to achieve this.
*/
public final Set<IAggregationKeyValueHandler<Object>> aggregationKeyValueHandlers = new TreeSet<... | aggregationKeyValueHandlers.add(aggregationKeyValueHandler);
}
@Override
public List<Object> getValues(@NonNull final Object model)
{
final List<Object> values = new ArrayList<Object>();
for (final IAggregationKeyValueHandler<Object> aggregationKeyValueHandler : aggregationKeyValueHandlers)
{
final List<O... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\agg\key\impl\CompositeAggregationKeyValueHandler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static class JwtConverterConfiguration {
private final OAuth2ResourceServerProperties.Jwt properties;
JwtConverterConfiguration(OAuth2ResourceServerProperties properties) {
this.properties = properties.getJwt();
}
@Bean
JwtAuthenticationConverter getJwtAuthenticationConverter() {
JwtGrantedAuthoritie... | static class OnAuthorityPrefix {
}
@ConditionalOnProperty("spring.security.oauth2.resourceserver.jwt.principal-claim-name")
static class OnPrincipalClaimName {
}
@ConditionalOnProperty("spring.security.oauth2.resourceserver.jwt.authorities-claim-name")
static class OnAuthoritiesClaimName {
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-security-oauth2-resource-server\src\main\java\org\springframework\boot\security\oauth2\server\resource\autoconfigure\servlet\OAuth2ResourceServerJwtConfiguration.java | 2 |
请完成以下Java代码 | public class PasswordPolicyRuleDto {
protected String placeholder;
protected Map<String, String> parameter;
// transformers
public PasswordPolicyRuleDto(PasswordPolicyRule rule) {
this.placeholder = rule.getPlaceholder();
this.parameter = rule.getParameters();
}
// getters / setters
public St... | }
public void setPlaceholder(String placeholder) {
this.placeholder = placeholder;
}
public Map<String, String> getParameter() {
return parameter;
}
public void setParameter(Map<String, String> parameter) {
this.parameter = parameter;
}
} | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\identity\PasswordPolicyRuleDto.java | 1 |
请完成以下Java代码 | public StreamObserver<Stock> clientSideStreamingGetStatisticsOfStocks(final StreamObserver<StockQuote> responseObserver) {
return new StreamObserver<Stock>() {
int count;
double price = 0.0;
StringBuffer sb = new StringBuffer();
@Override
... | .setOfferNumber(i)
.setDescription("Price for stock:" + request.getTickerSymbol())
.build();
responseObserver.onNext(stockQuote);
}
}
@Override
public void onCompleted() {... | repos\tutorials-master\grpc\src\main\java\com\baeldung\grpc\streaming\StockServer.java | 1 |
请完成以下Java代码 | public void merge(ConfigurableEnvironment parent) {
for (PropertySource<?> ps : parent.getPropertySources()) {
if (!this.getPropertySources().contains(ps.getName())) {
this.getPropertySources().addLast(ps);
}
}
super.merge(parent);
}
/** {@inherit... | return super.getPropertySources();
}
/** {@inheritDoc} */
@Override
public void setEncryptablePropertySources(MutablePropertySources propertySources) {
this.encryptablePropertySources = propertySources;
((MutableConfigurablePropertyResolver)this.getPropertyResolver()).setPropertySources... | repos\jasypt-spring-boot-master\jasypt-spring-boot\src\main\java\com\ulisesbocchio\jasyptspringboot\environment\StandardEncryptableEnvironment.java | 1 |
请完成以下Java代码 | public static PickingJobLineId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? new PickingJobLineId(repoId) : null;
}
@NonNull
@JsonCreator
public static PickingJobLineId ofString(@NonNull final String string)
{
try
{
return ofRepoId(Integer.parseInt(string));
}
catch (final Exception ex)
{... | public static PickingJobLineId ofNullableString(@Nullable final String string)
{
final String stringNorm = StringUtils.trimBlankToNull(string);
return stringNorm != null ? ofString(stringNorm) : null;
}
public String getAsString() {return String.valueOf(getRepoId());}
public static boolean equals(@Nullable fi... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\model\PickingJobLineId.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable String get(String k) {
return null;
}
@Override
public boolean enabled() {
return obtain(GraphiteProperties::isEnabled, GraphiteConfig.super::enabled);
}
@Override
public Duration step() {
return obtain(GraphiteProperties::getStep, GraphiteConfig.super::step);
}
@Override
public TimeU... | public int port() {
return obtain(GraphiteProperties::getPort, GraphiteConfig.super::port);
}
@Override
public GraphiteProtocol protocol() {
return obtain(GraphiteProperties::getProtocol, GraphiteConfig.super::protocol);
}
@Override
public boolean graphiteTagsEnabled() {
return obtain(GraphiteProperties::... | repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\graphite\GraphitePropertiesConfigAdapter.java | 2 |
请完成以下Java代码 | public void setContext(CaseFileItem caseFileItem) {
contextRefAttribute.setReferenceTargetElement(this, caseFileItem);
}
public ConditionExpression getCondition() {
return conditionChild.getChild(this);
}
public void setCondition(ConditionExpression condition) {
conditionChild.setChild(this, condi... | .build();
contextRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_CONTEXT_REF)
.idAttributeReference(CaseFileItem.class)
.build();
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
conditionChild = sequenceBuilder.element(ConditionExpression.class)
.build();
... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\RequiredRuleImpl.java | 1 |
请完成以下Java代码 | public Iterable<Golfer> getPlayers() {
return Collections.unmodifiableSet(this.players);
}
public boolean isFinished() {
for (Pairing pairing : this) {
if (pairing.getHole() < 18) {
return false;
}
}
return true;
}
public GolfTournament at(GolfCourse golfCourse) {
Assert.notNull(golfCourse,... | }
public GolfTournament register(Golfer... players) {
return register(Arrays.asList(ArrayUtils.nullSafeArray(players, Golfer.class)));
}
public GolfTournament register(Iterable<Golfer> players) {
StreamSupport.stream(CollectionUtils.nullSafeIterable(players).spliterator(), false)
.filter(Objects::nonNull)
... | repos\spring-boot-data-geode-main\spring-geode-samples\caching\inline-async\src\main\java\example\app\caching\inline\async\client\model\GolfTournament.java | 1 |
请完成以下Java代码 | public void createFruit(
@NotNull(message = "Fruit name must not be null") @FormParam("name") String name,
@NotNull(message = "Fruit colour must not be null") @FormParam("colour") String colour) {
Fruit fruit = new Fruit(name, colour);
SimpleStorageService.storeFruit(fruit);
}
... | .build();
}
@GET
@Valid
@Produces(MediaType.APPLICATION_JSON)
@Path("/search/{name}")
public Fruit findFruitByName(@PathParam("name") String name) {
return SimpleStorageService.findByName(name);
}
@GET
@Produces(MediaType.TEXT_HTML)
@Path("/exception")
@Valid
pu... | repos\tutorials-master\web-modules\jersey\src\main\java\com\baeldung\jersey\server\rest\FruitResource.java | 1 |
请完成以下Java代码 | public ComplexGateway newInstance(ModelTypeInstanceContext instanceContext) {
return new ComplexGatewayImpl(instanceContext);
}
});
defaultAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_DEFAULT)
.idAttributeReference(SequenceFlow.class)
.build();
SequenceBuilder seq... | }
public SequenceFlow getDefault() {
return defaultAttribute.getReferenceTargetElement(this);
}
public void setDefault(SequenceFlow defaultFlow) {
defaultAttribute.setReferenceTargetElement(this, defaultFlow);
}
public ActivationCondition getActivationCondition() {
return activationConditionChi... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\ComplexGatewayImpl.java | 1 |
请完成以下Java代码 | protected final PaymentsToReconcileView getView()
{
return PaymentsToReconcileView.cast(super.getView());
}
@Override
protected final PaymentToReconcileRow getSingleSelectedRow()
{
return PaymentToReconcileRow.cast(super.getSingleSelectedRow());
}
@Override
protected final Stream<PaymentToReconcileRow> st... | invalidateView(getBanksStatementReconciliationViewId());
}
protected final BankStatementLineRow getSingleSelectedBankStatementRowOrNull()
{
final ViewRowIdsSelection selection = getParentViewRowIdsSelection();
if (selection == null || selection.isEmpty())
{
return null;
}
final ImmutableList<BankState... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\bankstatement_reconciliation\process\PaymentsToReconcileViewBasedProcess.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getDefaultAlias() {
return this.defaultAlias;
}
public void setDefaultAlias(String defaultAlias) {
this.defaultAlias = defaultAlias;
}
public String getGateway() {
return this.gateway;
}
public void setGateway(String gateway) {
this.gateway = gateway;
}
public String getJmx... | public String getServer() {
return this.server;
}
public void setServer(String server) {
this.server = server;
}
public String getWeb() {
return this.web;
}
public void setWeb(String web) {
this.web = web;
}
}
} | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\configuration\support\SslProperties.java | 2 |
请完成以下Java代码 | public String getUsername() {
return this.username;
}
@Override
public void setUsername(String username) {
this.username = username;
}
@Override
public char[] getPassword() {
return this.password;
}
@Override
public void setPassword(char[] password) {
... | @Override
public void setHost(String host) {
this.host = host;
}
@Override
public boolean isRememberMe() {
return this.rememberMe;
}
@Override
public void setRememberMe(boolean rememberMe) {
this.rememberMe = rememberMe;
}
public String getAccessToken() {
... | repos\springBoot-master\springboot-shiro2\src\main\java\cn\abel\rest\shiro\credentials\ThirdPartySupportedToken.java | 1 |
请完成以下Java代码 | public class ReplicationHelper
{
public static final String MSG_XMLInvalidContext = "XMLInvalidContext";
/**
* Method sets the given context values to the given context.
*
* @param ctx the context to be updated
* @param name the name of the context value to be updated
* @param value the actual new value
... | {
// nothing to do
return;
}
else if (overwrite || valueOldTS == null)
{
Env.setContext(ctx, name, valueTS);
}
else
{
throw new ReplicationException(MSG_XMLInvalidContext)
.setParameter("AttributeName", name)
.setParameter("Value", valueTS)
.setParameter("ValueOld", v... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\server\rpl\api\impl\ReplicationHelper.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getReferenceId() {
return referenceId;
}
public void setReferenceId(String referenceId) {
this.referenceId = referenceId;
}
public String getReferenceType() {
return referenceType;
}
public void setReferenceType(String referenceType) {
this.refere... | public String getCompletedBy() {
return completedBy;
}
public void setCompletedBy(String completedBy) {
this.completedBy = completedBy;
}
public String getExtraValue() {
return extraValue;
}
public void setExtraValue(String extraValue) {
this.extraValue = extra... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\planitem\PlanItemInstanceResponse.java | 2 |
请完成以下Java代码 | protected IPrintJobLinesAggregator createPrintJobLinesAggregator(
@NonNull final IPrintPackageCtx printPackageCtx,
@NonNull final I_C_Print_Job_Instructions jobInstructions)
{
return new PrintJobLinesAggregator(printingDataFactory, printPackageCtx, jobInstructions);
}
@Override
public IPrintPackageCtx crea... | {
throw new AdempiereException("The given ctx has no session.")
.appendParametersToMessage()
.setParameter("ctx", ctx);
}
logger.debug("Session: {}", session);
final String hostKey = session.getOrCreateHostKey(ctx);
Check.assumeNotEmpty(hostKey, "{} has a hostKey", session);
printCtx.setHostKey... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java\de\metas\printing\api\impl\PrintPackageBL.java | 1 |
请完成以下Java代码 | public class ListInfo
{
static Builder builder()
{
return new Builder();
}
private final int adReferenceId;
private final String name;
private final ImmutableList<ListItemInfo> items;
private ListInfo(final Builder builder)
{
super();
this.adReferenceId = builder.adReferenceId;
Check.assumeNotEmpty(... | public ListInfo build()
{
return new ListInfo(this);
}
public Builder setAD_Reference_ID(final int adReferenceId)
{
this.adReferenceId = adReferenceId;
return this;
}
public Builder setName(String name)
{
this.name = name;
return this;
}
public Builder addItem(final String value, fin... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\persistence\modelgen\ListInfo.java | 1 |
请完成以下Java代码 | public String toString()
{
// IMPORTANT: this is how it will be displayed to user
return caption;
}
@Override
public int hashCode()
{
return Objects.hashCode(value);
}
@Override
public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj instanceof Do... | return Objects.equal(value, other.value);
}
else
{
return false;
}
}
@Override
public String getValue()
{
return value;
}
@Override
public String getDescription()
{
return description;
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\document\engine\impl\AbstractDocumentBL.java | 1 |
请完成以下Java代码 | public void onMessage(@PathParam("username") String username, String message) {
logger.info("发送消息:"+message);
sendMessageAll("用户[" + username + "] : " + message);
}
@OnClose
public void onClose(@PathParam("username") String username, Session session) {
//当前的Session 移除
ONLINE... | }
}
@OnError
public void onError(Session session, Throwable throwable) {
try {
session.close();
} catch (IOException e) {
logger.error("onError excepiton",e);
}
logger.info("Throwable msg "+throwable.getMessage());
}
} | repos\spring-boot-leaning-master\2.x_42_courses\第 2-10 课: 使用 Spring Boot WebSocket 创建聊天室\spring-boot-websocket\src\main\java\com\neo\ChatRoomServerEndpoint.java | 1 |
请完成以下Java代码 | public static MSV3StockAvailabilityUpdatedEvent ofSingle(
@NonNull final MSV3StockAvailability msv3StockAvailability,
@NonNull final MSV3EventVersion eventVersion)
{
return builder()
.eventVersion(eventVersion)
.item(msv3StockAvailability)
.deleteAllOtherItems(false)
.build();
}
private fina... | */
private MSV3EventVersion eventVersion;
@JsonCreator
@Builder
private MSV3StockAvailabilityUpdatedEvent(
@JsonProperty("id") final String id,
@JsonProperty("items") @Singular final List<MSV3StockAvailability> items,
@JsonProperty("deleteAllOtherItems") final boolean deleteAllOtherItems,
@JsonProperty... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.server-peer\src\main\java\de\metas\vertical\pharma\msv3\server\peer\protocol\MSV3StockAvailabilityUpdatedEvent.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class InfinispanCacheService {
public static final String CACHE_NAME = "demoCache";
@Inject
EmbeddedCacheManager cacheManager;
private Cache<String, String> demoCache;
@PostConstruct
void init() {
Configuration cacheConfig = new ConfigurationBuilder()
.clustering().cacheMode(CacheMode.LOCAL)
... | public String get(String key) {
return demoCache.get(key);
}
public void bulkPut(Map<String, String> entries) {
demoCache.putAll(entries);
}
public int size() {
return demoCache.size();
}
public void clear() {
demoCache.clear();
}
public boolean isPassivationEnabled() {
return cacheManager.getCach... | repos\tutorials-master\quarkus-modules\quarkus-infinispan-embedded\src\main\java\com\baeldung\quarkus\infinispan\InfinispanCacheService.java | 2 |
请完成以下Java代码 | public static void checkJavaSerialization(String variableName, TypedValue value) {
if (isJavaSerializationProhibited(value)) {
throw CORE_LOGGER.javaSerializationProhibitedException(variableName);
}
}
public static void setVariables(Map<String, ?> variables,
SetVaria... | checkJavaSerialization(variableName, variableTypedValue);
VariableInstanceEntity variableInstance =
VariableInstanceEntity.createAndInsert(variableName, variableTypedValue);
variableInstance.setVariableScopeId(batchId);
variableInstance.setBatchId(batchId);
}
public static Map<String, ?> find... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\core\variable\VariableUtil.java | 1 |
请完成以下Java代码 | public String getPstCd() {
return pstCd;
}
/**
* Sets the value of the pstCd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPstCd(String value) {
this.pstCd = value;
}
/**
* Gets the value o... | /**
* Sets the value of the ctry property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCtry(String value) {
this.ctry = value;
}
/**
* Gets the value of the adrLine property.
*
* <p>
* This accessor... | 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\PostalAddress6.java | 1 |
请完成以下Java代码 | public List<MissingAuthorization> getMissingAuthorizations() {
return Collections.unmodifiableList(missingAuthorizations);
}
/**
* Generate exception message from the missing authorizations.
*
* @param userId to use
* @param missingAuthorizations to use
* @return The prepared exception message
... | first = false;
}
sBuilder.append(generateMissingAuthorizationMessage(missingAuthorization));
}
return sBuilder.toString();
}
/**
* Generated exception message for the missing authorization.
*
* @param exceptionInfo to use
*/
private static String generateMissingAuthorizationMessag... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\AuthorizationException.java | 1 |
请完成以下Java代码 | public class AdempiereThemeInnova extends org.adempiere.plaf.AdempiereTheme
{
/**
* Adempiere default Theme Blue Metal
*/
public AdempiereThemeInnova()
{
setDefault();
s_theme = this;
s_name = NAME;
} // AdempiereThemeBlueMetal
/** Name */
public static final String NAME = "Adempiere Theme";
/**
* ... | black = BLACK;
/** White */
white = WHITE;
/** Background for mandatory fields */
mandatory = new ColorUIResource(233, 238, 245); // blueish
/** Background for fields in error 180,220,143 */
error = new ColorUIResource(220, 241, 203); // green ;
/** Background for inactive fields */
inactive = new Colo... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\plaf\AdempiereThemeInnova.java | 1 |
请完成以下Java代码 | /* package */abstract class AbstractLockAutoCloseable implements ILockAutoCloseable
{
private final ILock lock;
public AbstractLockAutoCloseable(final ILock lock)
{
super();
Check.assumeNotNull(lock, "lock not null");
this.lock = lock;
}
@Override
public final String toString()
{
return ObjectUtils.toS... | return;
}
closeImpl();
}
/** Actual lock closing logic */
protected abstract void closeImpl();
protected final void closeNow()
{
lock.close();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\lock\api\impl\AbstractLockAutoCloseable.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserRepositoryCustomImpl implements UserRepositoryCustom {
@PersistenceContext
private EntityManager entityManager;
@Override
public List<User> findUserByEmails(Set<String> emails) {
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<User> query = cb.cr... | .where(cb.or(predicates.toArray(new Predicate[predicates.size()])));
return entityManager.createQuery(query)
.getResultList();
}
@Override
public List<User> findAllUsersByPredicates(Collection<java.util.function.Predicate<User>> predicates) {
List<User> allUsers = entityMan... | repos\tutorials-master\persistence-modules\spring-data-jpa-enterprise\src\main\java\com\baeldung\boot\daos\user\UserRepositoryCustomImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public final class ConfigChangeNotice extends BaseModel {
private Date noticeTime;
private String appid;
private ChangeType type;
private String value;
public ConfigChangeNotice() {
this.noticeTime = new Date();
}
public ConfigChangeNotice(String appid, ChangeType type, String ... | this.value = value;
}
public Date getNoticeTime() {
return noticeTime;
}
public void setNoticeTime(Date noticeTime) {
this.noticeTime = noticeTime;
}
@Override
public String toString() {
return "ConfigChangeNotice{" +
"noticeTime=" + noticeTime +
... | repos\spring-boot-quick-master\quick-wx-public\src\main\java\com\wx\pn\api\config\ConfigChangeNotice.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void saveData(PmsRole pmsRole) {
pmsRoleDao.insert(pmsRole);
}
/**
* 修改pmsOperator
*/
public void updateData(PmsRole pmsRole) {
pmsRoleDao.update(pmsRole);
}
/**
* 根据id获取数据pmsOperator
*
* @param id
* @return
*/
public PmsRole getDataById(Long id) {
return pmsRoleDao.getById(id);
}
... | */
public List<PmsRole> listByPermissionId(Long permissionId) {
return pmsRoleDao.listByPermissionId(permissionId);
}
/**
* 根据角色名或者角色编号查询角色
*
* @param roleName
* @param roleCode
* @return
*/
public PmsRole getByRoleNameOrRoleCode(String roleName, String roleCode) {
return pmsRoleDao.getByRoleNameO... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\permission\service\impl\PmsRoleServiceImpl.java | 2 |
请完成以下Java代码 | protected CaseDefinition findNewLatestCaseDefinitionAfterRemovalOf(CaseDefinition caseDefinitionToBeRemoved) {
// The case definition is not necessarily the one with 'version -1' (some versions could have been deleted)
// Hence, the following logic
CaseDefinitionQuery query = getCaseDefinition... | @Override
public CmmnDeploymentQuery createDeploymentQuery() {
return new CmmnDeploymentQueryImpl(engineConfiguration.getCommandExecutor());
}
@Override
public List<CmmnDeployment> findDeploymentsByQueryCriteria(CmmnDeploymentQuery deploymentQuery) {
return dataManager.findDeploymen... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\persistence\entity\CmmnDeploymentEntityManagerImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setRelayStateResolver(Converter<HttpServletRequest, String> relayStateResolver) {
Assert.notNull(relayStateResolver, "relayStateResolver cannot be null");
this.delegate.setRelayStateResolver(relayStateResolver);
}
public static final class LogoutRequestParameters {
private final HttpServletRequest... | parameters.getLogoutRequest());
}
public HttpServletRequest getRequest() {
return this.request;
}
public RelyingPartyRegistration getRelyingPartyRegistration() {
return this.registration;
}
public Authentication getAuthentication() {
return this.authentication;
}
public LogoutRequest getLog... | repos\spring-security-main\saml2\saml2-service-provider\src\opensaml5Main\java\org\springframework\security\saml2\provider\service\web\authentication\logout\OpenSaml5LogoutRequestResolver.java | 2 |
请完成以下Java代码 | private void writeCCFile(final I_AD_Archive archive)
{
final Object model = archiveDAO.retrieveReferencedModel(archive, Object.class);
if (model == null)
{
// No model attached?
// we shouldn't reach this point
throw new AdempiereException("@NotFound@ @AD_Archive_ID@ @Record_ID@");
}
final ICCAbleD... | OutputStream out = null;
try
{
out = new FileOutputStream(file, false); // append=false
final int bufferSize = 1024 * 4;
final OutputStream outBuffer = new BufferedOutputStream(out, bufferSize);
IOStreamUtils.copy(outBuffer, data);
}
catch (final FileNotFoundException e)
{
throw new AdempiereE... | repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive\de.metas.document.archive.base\src\main\java\de\metas\document\archive\async\spi\impl\DocOutboundCCWorkpackageProcessor.java | 1 |
请完成以下Java代码 | public static byte[] createRandomStringInByte(int size) {
Random random = new Random();
byte[] data = new byte[size];
for (int n = 0; n < data.length; n++) {
char randomChar;
int choice = random.nextInt(2); // 0 for uppercase, 1 for lowercase
if (choice == 0) ... | public File getFile() {
return file;
}
public List<String> getDataList() {
return dataList;
}
public static String getString(InputStream inputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(inputStream... | repos\tutorials-master\core-java-modules\core-java-io-5\src\main\java\com\baeldung\zip\ZipSampleFileStore.java | 1 |
请完成以下Java代码 | public PageData<RuleChain> findAutoAssignToEdgeRuleChainsByTenantId(UUID tenantId, PageLink pageLink) {
log.debug("Try to find auto assign to edge rule chains by tenantId [{}]", tenantId);
return DaoUtil.toPageData(ruleChainRepository
.findAutoAssignByTenantId(
te... | @Override
public PageData<RuleChain> findAllByTenantId(TenantId tenantId, PageLink pageLink) {
return findRuleChainsByTenantId(tenantId.getId(), pageLink);
}
@Override
public List<EntityInfo> findByTenantIdAndResource(TenantId tenantId, String reference, int limit) {
return ruleChainRep... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\rule\JpaRuleChainDao.java | 1 |
请完成以下Java代码 | public void setHeaderValue(HeaderValue headerValue) {
Assert.notNull(headerValue, "headerValue cannot be null");
this.headerValue = headerValue;
updateDelegate();
}
/**
* The value of the x-xss-protection header. One of: "0", "1", "1; mode=block"
*
* @author Daniel Garnier-Moiroux
* @since 5.8
*/
pu... | @Override
public String toString() {
return this.value;
}
}
private void updateDelegate() {
Builder builder = StaticServerHttpHeadersWriter.builder();
builder.header(X_XSS_PROTECTION, this.headerValue.toString());
this.delegate = builder.build();
}
} | repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\header\XXssProtectionServerHttpHeadersWriter.java | 1 |
请完成以下Java代码 | public void setIdClassMapping(Map<String, Class<?>> idClassMapping) {
this.idClassMapping.putAll(idClassMapping);
createReverseMap();
}
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}
protected @Nullable ClassLoader getClassLoader() {
return this.clas... | for (Map.Entry<String, Class<?>> entry : this.idClassMapping.entrySet()) {
String id = entry.getKey();
Class<?> clazz = entry.getValue();
this.classIdMapping.put(clazz, id.getBytes(StandardCharsets.UTF_8));
}
}
public Map<String, Class<?>> getIdClassMapping() {
return Collections.unmodifiableMap(this.id... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\mapping\AbstractJavaTypeMapper.java | 1 |
请完成以下Java代码 | public void setLogoWeb_ID (int LogoWeb_ID)
{
if (LogoWeb_ID < 1)
set_Value (COLUMNNAME_LogoWeb_ID, null);
else
set_Value (COLUMNNAME_LogoWeb_ID, Integer.valueOf(LogoWeb_ID));
}
/** Get Logo Web.
@return Logo Web */
@Override
public int getLogoWeb_ID ()
{
Integer ii = (Integer)get_Value(COLUMNN... | /** Set Produkt für Fracht.
@param M_ProductFreight_ID Produkt für Fracht */
@Override
public void setM_ProductFreight_ID (int M_ProductFreight_ID)
{
if (M_ProductFreight_ID < 1)
set_Value (COLUMNNAME_M_ProductFreight_ID, null);
else
set_Value (COLUMNNAME_M_ProductFreight_ID, Integer.valueOf(M_Produc... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_ClientInfo.java | 1 |
请完成以下Java代码 | public List<Fact> createFacts(final AcctSchema as)
{
// Other Acct Schema
if (!AcctSchemaId.equals(as.getId(), acctSchemaId))
{
return ImmutableList.of();
}
// create Fact Header
final Fact fact = new Fact(this, as, postingType);
if (services.getSysConfigBooleanValue(SYSCONFIG_DisableFactAcctTrxChec... | else
{
throw newPostingException()
.setAcctSchema(as)
.setDetailMessage("DocumentType unknown: " + getDocBaseType());
}
//
return ImmutableList.of(fact);
} // createFact
private CurrencyConversionContext createCurrencyConversionContext(
@NonNull final DocLine_GLJournal line,
@NonNull fin... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\Doc_GLJournal.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.