instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public String getGroupId() {
return this.groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getArtifactId() {
retu... | public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}
public String getLanguage() {
return this.language;
}
public void setLanguage(String language) {
this.language = language;
}
public String getConfigurationFileFormat() {
return this.configurationFileForma... | repos\initializr-main\initializr-web\src\main\java\io\spring\initializr\web\project\ProjectRequest.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private String getDefaultPrinterNameFromIni(final String propName)
{
log.debug("Looking for " + propName + " in ini file");
String printerName = Ini.getProperty(propName);
if (!Check.isEmpty(printerName))
{
log.debug("Found printerName: " + printerName);
return printerName;
}
log.debug("Looking for... | }
@Override
public String findPrinterName(final Properties ctx, final int C_DocType_ID,
final int AD_Process_ID,
final int AD_Table_ID,
final String printerType)
{
final IPrintingService printingService = findPrintingService(ctx,
C_DocType_ID,
AD_Process_ID,
AD_Table_ID,
printerType);
r... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\service\impl\PrinterRoutingBL.java | 2 |
请在Spring Boot框架中完成以下Java代码 | Configuration createConfiguration() {
ConfigurationImpl configuration = new ConfigurationImpl();
configuration.setSecurityEnabled(false);
configuration.setPersistenceEnabled(this.properties.isPersistent());
String dataDir = getDataDir();
configuration.setJournalDirectory(dataDir + "/journal");
if (this.prop... | private CoreAddressConfiguration createAddressConfiguration(String name) {
return new CoreAddressConfiguration().setName(name)
.addRoutingType(RoutingType.ANYCAST)
.addQueueConfiguration(QueueConfiguration.of(name).setRoutingType(RoutingType.ANYCAST).setAddress(name));
}
private String getDataDir() {
if (t... | repos\spring-boot-4.0.1\module\spring-boot-artemis\src\main\java\org\springframework\boot\artemis\autoconfigure\ArtemisEmbeddedConfigurationFactory.java | 2 |
请在Spring Boot框架中完成以下Java代码 | class PropertiesKafkaConnectionDetails implements KafkaConnectionDetails {
private final KafkaProperties properties;
private final @Nullable SslBundles sslBundles;
PropertiesKafkaConnectionDetails(KafkaProperties properties, @Nullable SslBundles sslBundles) {
this.properties = properties;
this.sslBundles = ss... | SslBundle sslBundle = getBundle(this.properties.getStreams().getSsl());
String protocol = this.properties.getStreams().getSecurity().getProtocol();
return Configuration.of((servers != null) ? servers : getBootstrapServers(),
(sslBundle != null) ? sslBundle : getSslBundle(),
(StringUtils.hasLength(protocol))... | repos\spring-boot-4.0.1\module\spring-boot-kafka\src\main\java\org\springframework\boot\kafka\autoconfigure\PropertiesKafkaConnectionDetails.java | 2 |
请完成以下Java代码 | protected void ensureProcessInstanceExists(String processInstanceId,
ExecutionEntity processInstance) {
if (processInstance == null) {
throw LOG.processInstanceDoesNotExist(processInstanceId);
}
}
protected String getLogEntryOperation() {
return UserOp... | Collections.singletonList(PropertyChange.EMPTY_CHANGE),
builder.getAnnotation());
}
public BatchConfiguration getConfiguration(String processDefinitionId, String deploymentId) {
return new ModificationBatchConfiguration(
Collections.singletonList(builder.getProcessInstanceId()),
Deploym... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\ModifyProcessInstanceAsyncCmd.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected static class MappingJackson2XmlHttpMessageConverterConfiguration {
@Bean
@ConditionalOnMissingBean(org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter.class)
Jackson2XmlMessageConvertersCustomizer mappingJackson2XmlHttpMessageConverter(
Jackson2ObjectMapperBuilder builder)... | Jackson2XmlMessageConvertersCustomizer(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}
@Override
public void customize(ClientBuilder builder) {
builder.withXmlConverter(new org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter(
this.objectMapper));
}
@Over... | repos\spring-boot-4.0.1\module\spring-boot-http-converter\src\main\java\org\springframework\boot\http\converter\autoconfigure\Jackson2HttpMessageConvertersConfiguration.java | 2 |
请完成以下Java代码 | public static class DefaultRabbitListenerObservationConvention implements RabbitListenerObservationConvention {
/**
* A singleton instance of the convention.
*/
public static final DefaultRabbitListenerObservationConvention INSTANCE =
new DefaultRabbitListenerObservationConvention();
@Override
publi... | @Override
public KeyValues getHighCardinalityKeyValues(RabbitMessageReceiverContext context) {
return KeyValues.of(RabbitListenerObservation.ListenerHighCardinalityTags.DELIVERY_TAG.asString(),
String.valueOf(context.getCarrier().getMessageProperties().getDeliveryTag()));
}
@Override
public String getC... | repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\support\micrometer\RabbitListenerObservation.java | 1 |
请完成以下Java代码 | private static class StubAclParent implements Acl {
private final Long id;
StubAclParent(Long id) {
this.id = id;
}
Long getId() {
return this.id;
}
@Override
public List<AccessControlEntry> getEntries() {
throw new UnsupportedOperationException("Stub only");
}
@Override
public ObjectI... | public boolean isEntriesInheriting() {
throw new UnsupportedOperationException("Stub only");
}
@Override
public boolean isGranted(List<Permission> permission, List<Sid> sids, boolean administrativeMode)
throws NotFoundException, UnloadedSidException {
throw new UnsupportedOperationException("Stub only"... | repos\spring-security-main\acl\src\main\java\org\springframework\security\acls\jdbc\BasicLookupStrategy.java | 1 |
请完成以下Java代码 | public Integer getMaxQueueingTimeMs() {
return maxQueueingTimeMs;
}
public void setMaxQueueingTimeMs(Integer maxQueueingTimeMs) {
this.maxQueueingTimeMs = maxQueueingTimeMs;
}
public boolean isClusterMode() {
return clusterMode;
}
public FlowRuleEntity setClusterMode(b... | flowRule.setCount(this.count);
flowRule.setGrade(this.grade);
flowRule.setResource(this.resource);
flowRule.setLimitApp(this.limitApp);
flowRule.setRefResource(this.refResource);
flowRule.setStrategy(this.strategy);
if (this.controlBehavior != null) {
flowRule... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\datasource\entity\rule\FlowRuleEntity.java | 1 |
请完成以下Java代码 | public void save(@NonNull final ProductPlanningSchema schema)
{
final I_M_Product_PlanningSchema record;
if (schema.getId() != null)
{
record = load(schema.getId(), I_M_Product_PlanningSchema.class);
}
else
{
record = newInstance(I_M_Product_PlanningSchema.class);
}
record.setM_ProductPlanningSc... | record.setIsAttributeDependant(schema.isAttributeDependant());
record.setPlanner_ID(UserId.toRepoId(schema.getPlannerId()));
record.setIsManufactured(StringUtils.ofBoolean(schema.getManufactured()));
record.setIsCreatePlan(schema.isCreatePlan());
record.setIsDocComplete(schema.isCompleteGeneratedDocuments());
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\product\impl\ProductPlanningSchemaDAO.java | 1 |
请完成以下Java代码 | public class AsyncBatchListeners implements IAsyncBatchListeners
{
private final IAsyncBatchBL asyncBatchBL = Services.get(IAsyncBatchBL.class);
private final Map<String, IAsyncBatchListener> listenersList = new HashMap<>();
@Override
public void registerAsyncBatchNoticeListener(final IAsyncBatchListener l, final... | private IAsyncBatchListener getListener(final String ascyncBatchType)
{
IAsyncBatchListener l = listenersList.get(ascyncBatchType);
// retrieve default implementation
if (l == null)
{
l = listenersList.get(AsyncBatchDAO.ASYNC_BATCH_TYPE_DEFAULT);
}
return l;
}
private final List<INotifyAsyncBatch>... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\api\impl\AsyncBatchListeners.java | 1 |
请完成以下Java代码 | private void setPhoneIfNotNull(
@NonNull final InvoiceWithDetails.InvoiceWithDetailsBuilder invoiceWithDetails,
@Nullable final XmlTelecom telecom,
@NonNull final String detailItemLabel)
{
if (telecom != null)
{
final List<String> phones = telecom.getPhones();
if (phones != null && !phones.isEmpty()... | {
createItemIfNotBlank(description, detailItemLabel).ifPresent(invoiceWithDetails::detailItem);
}
private Optional<InvoiceDetailItem> createItemIfNotBlank(
@Nullable final String description,
@NonNull final String detailItemLabel)
{
if (Check.isBlank(description))
{
return Optional.empty();
}
ret... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\export\HealthcareXMLToInvoiceDetailPersister.java | 1 |
请完成以下Java代码 | public Date getSubmissionDateConverted(String timezone) throws ParseException {
dateFormat.setTimeZone(TimeZone.getTimeZone(timezone));
return dateFormat.parse(this.date);
}
public void setSubmissionDate(Date date, String timezone) {
dateFormat.setTimeZone(TimeZone.getTimeZone(timezone)... | return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public UserDto getUser() {
return user;
}
public void setUser(UserDto user) {
... | repos\tutorials-master\spring-web-modules\spring-boot-rest\src\main\java\com\baeldung\springpagination\dto\PostDto.java | 1 |
请完成以下Java代码 | public static void listFilesCommonsIO(File dir) {
Iterator<File> fileIterator = FileUtils.iterateFiles(dir, null, true);
while (fileIterator.hasNext()) {
File file = fileIterator.next();
LOGGER.info("File: " + file.getAbsolutePath());
}
}
/**
* List files in... | }
}
/**
* List files in a directory using Java IO
* @param dir directory to list files
*/
public static void listFilesJavaIO(File dir) {
File[] files = dir.listFiles();
for (File file : files) {
if (file.isDirectory()) {
listFilesJavaIO(file);
... | repos\tutorials-master\core-java-modules\core-java-io-6\src\main\java\com\baeldung\filelisting\FileListing.java | 1 |
请完成以下Java代码 | public String getMktInfrstrctrTxId() {
return mktInfrstrctrTxId;
}
/**
* Sets the value of the mktInfrstrctrTxId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMktInfrstrctrTxId(String value) {
this.mktIn... | public void setPrcgId(String value) {
this.prcgId = value;
}
/**
* Gets the value of the prtry property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present insid... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\TransactionReferences3.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public JasperEntry getByJrxmlFile(@NonNull final File jrxmlFile)
{
return JasperEntry.builder()
.jrxmlFile(jrxmlFile)
.jasperFile(getCompiledAssetFile(jrxmlFile, jasperExtension))
.hashFile(getCompiledAssetFile(jrxmlFile, ".hash"))
.build();
}
private File getCompiledAssetFile(@NonNull fi... | final Path relativeDirPath = relativePath.getParent();
// 3. Resolve the cache directory path: compiledJaspersDir + relativeDirPath
final Path cacheDir = compiledJaspersDir.resolve(relativeDirPath);
// 4. Create the final compiled file name (only changes extension).
final String compiledFileName = FileUti... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\metasfresh-report-service\src\main\java\de\metas\report\jasper\class_loader\JasperCompileClassLoader.java | 2 |
请完成以下Java代码 | static DateTimeTranslatableString ofObject(@NonNull final Object obj)
{
return ofObject(obj, -1);
}
static DateTimeTranslatableString ofObject(@NonNull final Object obj, final int displayType)
{
if (obj instanceof java.util.Date)
{
final java.util.Date date = (java.util.Date)obj;
if (displayType == Di... | private final Instant instant;
private final int displayType;
private DateTimeTranslatableString(@NonNull final Instant instant, final boolean dateTime)
{
this(instant,
dateTime ? DisplayType.DateTime : DisplayType.Date);
}
private DateTimeTranslatableString(@NonNull final Instant instant, final int displa... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\DateTimeTranslatableString.java | 1 |
请完成以下Java代码 | public int getM_PromotionGroup_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_PromotionGroup_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_M_Promotion getM_Promotion() throws RuntimeException
{
return (I_M_Promotion)MTable.get(getCtx(), I_M_Promotion.Table_Name)
.getPO(ge... | @param M_PromotionLine_ID Promotion Line */
public void setM_PromotionLine_ID (int M_PromotionLine_ID)
{
if (M_PromotionLine_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_PromotionLine_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_PromotionLine_ID, Integer.valueOf(M_PromotionLine_ID));
}
/** Get Promotion ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_PromotionLine.java | 1 |
请完成以下Java代码 | public DeploymentQueryImpl deploymentNameLike(String nameLike) {
ensureNotNull("deploymentNameLike", nameLike);
this.nameLike = nameLike;
return this;
}
public DeploymentQuery deploymentSource(String source) {
sourceQueryParamEnabled = true;
this.source = source;
return this;
}
public ... | }
public DeploymentQuery orderByTenantId() {
return orderBy(DeploymentQueryProperty.TENANT_ID);
}
//results ////////////////////////////////////////////////////////
@Override
public long executeCount(CommandContext commandContext) {
checkQueryOk();
return commandContext
.getDeploymentMana... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\DeploymentQueryImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void pessimisticWriteDelete() throws InterruptedException {
Thread tA = new Thread(() -> {
template.setPropagationBehavior(
TransactionDefinition.PROPAGATION_REQUIRES_NEW);
template.execute(new TransactionCallbackWithoutResult() {
... | Thread tB = new Thread(() -> {
template.setPropagationBehavior(
TransactionDefinition.PROPAGATION_REQUIRES_NEW);
template.setTimeout(15); // 15 seconds
template.execute(new TransactionCallbackWithoutResult() {
@Override
protected ... | repos\Hibernate-SpringBoot-master\HibernateSpringBootPessimisticLocksDelInsUpd\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Java代码 | protected boolean calculateSize()
{
p_height = 0;
for (int r = 0; r < m_rows; r++)
{
p_height += m_rowHeight[r];
if (m_rowHeight[r] > 0)
p_height += m_rowGap;
}
p_height -= m_rowGap; // remove last
p_width = 0;
for (int c = 0; c < m_cols; c++)
{
p_width += m_colWidth[c];
if (m_colWidth[... | {
float yy = y + m_textLayout[row][col].getAscent();
// if (m_iterator[row][col] != null)
// g2D.drawString(m_iterator[row][col], x, yy);
// else
m_textLayout[row][col].draw(g2D, x, yy);
}
x += m_colWidth[col];
if (m_colWidth[col] > 0)
x += m_colGap;
}
y += m_rowHeight[row... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\layout\GridElement.java | 1 |
请完成以下Java代码 | public void setC_BPartner_ID (int C_BPartner_ID)
{
if (C_BPartner_ID < 1)
set_Value (COLUMNNAME_C_BPartner_ID, null);
else
set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID));
}
/** Get Business Partner .
@return Identifies a Business Partner
*/
public int getC_BPartner_ID ()
{
... | @param TextMsg
Text Message
*/
public void setTextMsg (String TextMsg)
{
set_Value (COLUMNNAME_TextMsg, TextMsg);
}
/** Get Text Message.
@return Text Message
*/
public String getTextMsg ()
{
return (String)get_Value(COLUMNNAME_TextMsg);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Info_Fin.java | 1 |
请完成以下Java代码 | public int getBatchSize() {
return events.size();
}
};
}
void safePutString(PreparedStatement ps, int parameterIdx, String value) throws SQLException {
if (value != null) {
ps.setString(parameterIdx, replaceNullChars(value));
} else {
... | ps.setObject(1, event.getId().getId());
ps.setObject(2, event.getTenantId().getId());
ps.setLong(3, event.getCreatedTime());
ps.setObject(4, event.getEntityId());
ps.setString(5, event.getServiceId());
}
private String replaceNullChars(String strValue) {
if (removeNullCh... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\event\EventInsertRepository.java | 1 |
请完成以下Java代码 | public boolean is1xxInformational() {
return HttpStatus.Series.INFORMATIONAL.equals(getSeries());
}
/**
* Whether this status code is in the HTTP series
* {@link HttpStatus.Series#SUCCESSFUL}.
* @return <code>true</code> if status code is in the SUCCESSFUL http series
*/
public boolean is2xxSuccessful() {... | return HttpStatus.Series.valueOf(httpStatus.value());
}
if (status != null) {
return HttpStatus.Series.valueOf(status);
}
return null;
}
/**
* Whether this status code is in the HTTP series
* {@link HttpStatus.Series#CLIENT_ERROR} or {@link HttpStatus.Series#SERVER_ERROR}.
* @return <code>true</code... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\common\HttpStatusHolder.java | 1 |
请完成以下Java代码 | default String replaceTableNameWithTableAlias(final String sql)
{
final String tableName = getTableName();
final String tableAlias = getTableAlias();
return replaceTableNameWithTableAlias(sql, tableName, tableAlias);
}
default String replaceTableNameWithTableAlias(final String sql, @NonNull final String table... | replaceTableNameWithTableAlias(sql.getSql(), tableAlias),
sql.getSqlParams());
}
static String replaceTableNameWithTableAlias(final String sql, @NonNull final String tableName, @NonNull final String tableAlias)
{
if (sql == null || sql.isEmpty())
{
return sql;
}
final String matchTableNameIgnoringCa... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\sql\SqlEntityBinding.java | 1 |
请完成以下Java代码 | public Acl getAcl() {
return this.acl;
}
@Override
public Serializable getId() {
return this.id;
}
@Override
public Permission getPermission() {
return this.permission;
}
@Override
public Sid getSid() {
return this.sid;
}
@Override
public boolean isAuditFailure() {
return this.auditFailure;
}... | return this.granting;
}
void setAuditFailure(boolean auditFailure) {
this.auditFailure = auditFailure;
}
void setAuditSuccess(boolean auditSuccess) {
this.auditSuccess = auditSuccess;
}
void setPermission(Permission permission) {
Assert.notNull(permission, "Permission required");
this.permission = perm... | repos\spring-security-main\acl\src\main\java\org\springframework\security\acls\domain\AccessControlEntryImpl.java | 1 |
请完成以下Java代码 | private void collectText(final String text, final ContentType contentType)
{
if (text == null || text.isEmpty())
{
return;
}
if (contentType == null || contentType.match("text/plain"))
{
logger.debug("Collecting text: {}", text);
this.text.append(text);
}
else if (contentType == null || content... | }
}
private void collectMailContent(final MailContent mailContent)
{
text.append(mailContent.getText());
html.append(mailContent.getHtml());
attachments.addAll(mailContent.getAttachments());
}
private void collectUnknown(@NonNull final Object contentObj, final ContentType contentType)
{
logger.debug("Ig... | repos\metasfresh-new_dawn_uat\backend\de.metas.inbound.mail\src\main\java\de\metas\inbound\mail\MailContentCollector.java | 1 |
请完成以下Java代码 | private boolean startupEnvironment(final RunMode runMode)
{
final ADSystemInfo system = Services.get(ISystemBL.class).get(); // Initializes Base Context too
// Initialize main cached Singletons
ModelValidationEngine.get();
try
{
String className = null;
if (className == null || className.length() =... | }
/**
* If enabled, everything will run database decoupled. Supposed to be called before an interface like org.compiere.model.I_C_Order is to be used in a unit test.
*/
public static void enableUnitTestMode()
{
unitTestMode = true;
}
public static boolean isUnitTestMode()
{
return unitTestMode;
}
pub... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\Adempiere.java | 1 |
请完成以下Java代码 | public ITranslatableString getShipperName(@NonNull final ShipperId shipperId)
{
final I_M_Shipper shipper = getById(shipperId);
return InterfaceWrapperHelper.getModelTranslationMap(shipper)
.getColumnTrl(I_M_Shipper.COLUMNNAME_Name, shipper.getName());
}
@Override
public Optional<ShipperId> getShipperIdByV... | .create()
.list();
return Maps.uniqueIndex(shipperList, (shipper) -> ShipperId.ofRepoId(shipper.getM_Shipper_ID()));
}
@NonNull
public ImmutableMap<String, I_M_Shipper> getByInternalName(@NonNull final Set<String> internalNameSet)
{
if (Check.isEmpty(internalNameSet))
{
return ImmutableMap.of();
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\shipping\impl\ShipperDAO.java | 1 |
请完成以下Java代码 | public String toString()
{
StringBuffer sb = new StringBuffer ("X_HR_ListType[")
.append(get_ID()).append("]");
return sb.toString();
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Valu... | /** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_HR_ListType.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private class AlarmUpdateCallback implements FutureCallback<AlarmApiCallResult> {
@Override
public void onSuccess(@Nullable AlarmApiCallResult result) {
onAlarmUpdated(result);
}
@Override
public void onFailure(Throwable t) {
log.warn("Failed to update al... | AlarmComment.AlarmCommentBuilder alarmComment = AlarmComment.builder()
.alarmId(alarm.getId())
.type(AlarmCommentType.SYSTEM)
.comment(JacksonUtil.newObjectNode()
.put("text", String.format(SEVERITY_CHANGED.getText()... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\telemetry\DefaultAlarmSubscriptionService.java | 2 |
请完成以下Java代码 | public Optional<LookupValue> getLookupValueById(@NonNull final RepoIdAware id)
{
final LookupDataSource lookupDataSource = getLookupDataSource();
final LookupValue value = lookupDataSource.findById(id);
lookupValuesStaled = false;
return Optional.ofNullable(value);
}
@Override
public ICalloutField asCallo... | }
@Override
public boolean hasChangesToSave()
{
if (isReadonlyVirtualField())
{
return false;
}
return !isInitialValue();
}
private boolean isInitialValue()
{
return DataTypes.equals(_value, _initialValue);
}
@Override
public Optional<WindowId> getZoomIntoWindowId()
{
final LookupDataSource... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\DocumentField.java | 1 |
请完成以下Java代码 | public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getBusinessKey() {
return businessKey;
}
public void setBusinessKey(String businessKey) {
this.businessKey = businessKey;
}
public Date getStartTime() {
return startTime;
} | public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public List<IncidentStatisticsDto> getIncidents() {
return incidents;
}
public void setIncidents(List<IncidentStatisticsDto> incidents) {
this.incidents = incidents;
}
public boolean isSuspended() {
return Suspension... | repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\cockpit\impl\plugin\base\dto\ProcessInstanceDto.java | 1 |
请完成以下Java代码 | public <X> JsonSerde<X> copyWithType(JavaType newTargetType) {
return new JsonSerde<>(this.jsonSerializer.copyWithType(newTargetType),
this.jsonDeserializer.copyWithType(newTargetType));
}
// Fluent API
/**
* Designate this Serde for serializing/deserializing keys (default is values).
* @return the serde.... | }
/**
* Ignore type information headers and use the configured target class.
* @return the serde.
* @since 2.3
*/
public JsonSerde<T> ignoreTypeHeaders() {
this.jsonDeserializer.ignoreTypeHeaders();
return this;
}
/**
* Use the supplied {@link org.springframework.kafka.support.mapping.Jackson2JavaTy... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\serializer\JsonSerde.java | 1 |
请完成以下Java代码 | public Product manualDeepClone(Product original) {
Product clone = new Product();
clone.setName(original.getName());
clone.setPrice(original.getPrice());
if (original.getCategory() != null) {
Category categoryClone = new Category();
categoryClone.setName(original.... | public Product cloneUsingBeanUtils(Product original) throws InvocationTargetException, IllegalAccessException {
Product clone = new Product();
BeanUtils.copyProperties(original, clone);
clone.setId(null);
return clone;
}
public Product cloneUsingModelMapper(Product original) {
... | repos\tutorials-master\persistence-modules\java-jpa-4\src\main\java\com\baeldung\jpa\cloneentity\ProductService.java | 1 |
请完成以下Java代码 | public void setHeader(String name, String value) {
validateCrlf(name, value);
super.setHeader(name, value);
}
@Override
public void addHeader(String name, String value) {
validateCrlf(name, value);
super.addHeader(name, value);
}
@Override
public void addCookie(Cookie cookie) {
if (cookie != null) {
... | validateCrlf(SET_COOKIE_HEADER, cookie.getValue());
validateCrlf(SET_COOKIE_HEADER, cookie.getPath());
validateCrlf(SET_COOKIE_HEADER, cookie.getDomain());
}
super.addCookie(cookie);
}
void validateCrlf(String name, String value) {
Assert.isTrue(!hasCrlf(name) && !hasCrlf(value), () -> "Invalid character... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\firewall\FirewalledResponse.java | 1 |
请完成以下Java代码 | public void setUseBase64Encoding(boolean useBase64Encoding) {
this.useBase64Encoding = useBase64Encoding;
}
/**
* Set the request attribute name that indicates remember-me login. If specified, the
* cookie will be written as Integer.MAX_VALUE.
* @param rememberMeRequestAttribute the remember-me request attri... | String contextPath = request.getContextPath();
return (contextPath != null && contextPath.length() > 0) ? contextPath : "/";
}
return this.cookiePath;
}
/**
* Gets the name of the request attribute that is checked to see if the cookie should
* be written with {@link Integer#MAX_VALUE}.
* @return the rem... | repos\spring-session-main\spring-session-core\src\main\java\org\springframework\session\web\http\DefaultCookieSerializer.java | 1 |
请完成以下Java代码 | public static <V> V getAndRemove(final Properties ctx, final String propertyName)
{
@SuppressWarnings("unchecked") final V value = (V)ctx.remove(propertyName);
return value;
}
public static void put(final Properties ctx, final String propertyName, final Object value)
{
ctx.put(propertyName, value);
}
/**
... | * @return true if given key is contained in context
*/
public static boolean containsKey(final Properties ctx, final String key)
{
return ctx.containsKey(key);
}
/**
* Returns given <code>ctx</code> or {@link #getCtx()} if null.
*
* @return ctx or {@link #getCtx()}; never returns null
*/
public static... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\Env.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public LegacyEndpointConverter infoLegacyEndpointConverter() {
return LegacyEndpointConverters.info();
}
@Bean
@ConditionalOnMissingBean(name = "envLegacyEndpointConverter")
public LegacyEndpointConverter envLegacyEndpointConverter() {
return LegacyEndpointConverters.env();
}
@Bean
@ConditionalOnM... | public LegacyEndpointConverter mappingsLegacyEndpointConverter() {
return LegacyEndpointConverters.mappings();
}
@Bean
@ConditionalOnMissingBean(name = "startupLegacyEndpointConverter")
public LegacyEndpointConverter startupLegacyEndpointConverter() {
return LegacyEndpointConverters.startup();
}
}
... | repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\config\AdminServerInstanceWebClientConfiguration.java | 2 |
请完成以下Java代码 | public static boolean isDark (Color color)
{
float r = color.getRed() / 255.0f;
float g = color.getGreen() / 255.0f;
float b = color.getBlue() / 255.0f;
double whiteDistance = colorDistance (r, g, b, 1.0, 1.0, 1.0);
double blackDistance = colorDistance (r, g, b, 0.0, 0.0, 0.0);
boolean dark = blackDista... | * Get darker color
* @param color color
* @param factor factor 0..1 (AWT 0.7) the smaller, the darker
* @return darker color
*/
public static Color darker(Color color, double factor)
{
if (factor < 0.0)
factor = 0.7;
else if (factor > 1.0)
factor = 0.7;
return new Color(
Math.max((int)... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\adempiere\apps\graph\GraphUtil.java | 1 |
请完成以下Java代码 | private IAutoCloseable setupLoggerContext()
{
return logger.temporaryChangeContext(context -> context.moduleName(LOGGER_MODULE)
.sourceRecordRef(sourceModelRef));
}
private IAutoCloseable updateLoggerContextFrom(final ImmutableList<BusinessRuleAndTriggers> rulesAndTriggers)
{
final BusinessRuleLogLevel max... | try
{
if (!trigger.isChangeTypeMatching(timing))
{
return BooleanWithReason.falseBecause("timing not matching");
}
matching = checkConditionMatching(trigger.getCondition());
}
catch (final Exception ex)
{
logger.debug("Failed evaluating trigger condition {}/{} for {}/{}", rule, trigger, sour... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\business_rule\trigger\BusinessRuleFireTriggersCommand.java | 1 |
请完成以下Java代码 | public CamundaConstraint newInstance(ModelTypeInstanceContext instanceContext) {
return new CamundaConstraintImpl(instanceContext);
}
});
camundaNameAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_NAME)
.namespace(CAMUNDA_NS)
.build();
camundaConfigAttribute = typ... | public String getCamundaName() {
return camundaNameAttribute.getValue(this);
}
public void setCamundaName(String camundaName) {
camundaNameAttribute.setValue(this, camundaName);
}
public String getCamundaConfig() {
return camundaConfigAttribute.getValue(this);
}
public void setCamundaConfig(S... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\camunda\CamundaConstraintImpl.java | 1 |
请完成以下Java代码 | public void setExportRole_ID (final int ExportRole_ID)
{
if (ExportRole_ID < 1)
set_Value (COLUMNNAME_ExportRole_ID, null);
else
set_Value (COLUMNNAME_ExportRole_ID, ExportRole_ID);
}
@Override
public int getExportRole_ID()
{
return get_ValueAsInt(COLUMNNAME_ExportRole_ID);
}
@Override
public v... | return get_ValueAsInt(COLUMNNAME_ExternalSystem_ExportAudit_ID);
}
@Override
public de.metas.externalsystem.model.I_ExternalSystem getExternalSystem()
{
return get_ValueAsPO(COLUMNNAME_ExternalSystem_ID, de.metas.externalsystem.model.I_ExternalSystem.class);
}
@Override
public void setExternalSystem(final de... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_ExportAudit.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PickingRequestedEvent implements MaterialEvent
{
public static final String TYPE = "PickingRequestedEvent";
EventDescriptor eventDescriptor;
int shipmentScheduleId;
int pickingSlotId;
Set<Integer> topLevelHuIdsToPick;
@Builder
@JsonCreator
public PickingRequestedEvent(
@JsonProperty("eventD... | public void assertValid()
{
Check.errorIf(eventDescriptor == null, "eventDescriptor may not be null");
Check.errorIf(topLevelHuIdsToPick == null, "topLevelHuIdsToPick may not be null");
Check.errorIf(topLevelHuIdsToPick.isEmpty(), "topLevelHuIdsToPick may not be empty");
checkIdGreaterThanZero("shipmentSched... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\picking\PickingRequestedEvent.java | 2 |
请完成以下Java代码 | public static void skipExchange(ServerWebExchange exchange) {
exchange.getAttributes().put(SHOULD_NOT_FILTER, Boolean.TRUE);
}
private Mono<Void> validateToken(ServerWebExchange exchange) {
return this.csrfTokenRepository.loadToken(exchange)
.switchIfEmpty(Mono.defer(() -> Mono.error(new CsrfException("An exp... | return this.csrfTokenRepository.generateToken(exchange)
.delayUntil((token) -> this.csrfTokenRepository.saveToken(exchange, token))
.cache();
}
private static class DefaultRequireCsrfProtectionMatcher implements ServerWebExchangeMatcher {
private static final Set<HttpMethod> ALLOWED_METHODS = new HashSet<>(... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\csrf\CsrfWebFilter.java | 1 |
请完成以下Java代码 | public void setSeqNo (final int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, SeqNo);
}
@Override
public int getSeqNo()
{
return get_ValueAsInt(COLUMNNAME_SeqNo);
}
@Override
public void setSupervisor_ID (final int Supervisor_ID)
{
if (Supervisor_ID < 1)
set_Value (COLUMNNAME_Supervisor_ID, null);
else ... | return get_ValueAsString(COLUMNNAME_Title);
}
@Override
public void setUnlockAccount (final @Nullable java.lang.String UnlockAccount)
{
set_Value (COLUMNNAME_UnlockAccount, UnlockAccount);
}
@Override
public java.lang.String getUnlockAccount()
{
return get_ValueAsString(COLUMNNAME_UnlockAccount);
}
@O... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_User.java | 1 |
请完成以下Java代码 | public boolean isFailOnException() {
return failOnException;
}
/**
* @return true, if the event is an {@link FlowableEntityEvent} and (if needed) the entityClass set in this instance, is assignable from the entity class in the event.
*/
protected boolean isValidEvent(FlowableEvent event) ... | */
protected void onInitialized(FlowableEvent event) {
// Default implementation is a NO-OP
}
/**
* Called when an entity delete event is received.
*/
protected void onDelete(FlowableEvent event) {
// Default implementation is a NO-OP
}
/**
* Called when an entit... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\delegate\event\BaseEntityEventListener.java | 1 |
请完成以下Java代码 | private void registerWsSession(String httpSessionId, WebSocketSession wsSession) {
Map<String, WebSocketSession> sessions = this.httpSessionIdToWsSessions.get(httpSessionId);
if (sessions == null) {
sessions = new ConcurrentHashMap<>();
this.httpSessionIdToWsSessions.putIfAbsent(httpSessionId, sessions);
s... | if (logger.isDebugEnabled()) {
logger.debug("Closing WebSocket connections associated to expired HTTP Session " + httpSessionId);
}
for (WebSocketSession toClose : sessionsToClose.values()) {
try {
toClose.close(SESSION_EXPIRED_STATUS);
}
catch (IOException ex) {
logger.debug("Failed to close We... | repos\spring-session-main\spring-session-core\src\main\java\org\springframework\session\web\socket\handler\WebSocketRegistryListener.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected void processRestoredState(CalculatedFieldEntityCtxId id, CalculatedFieldState state, TopicPartitionInfo partition, TbCallback callback) {
partition = partition.withTopic(DataConstants.CF_STATES_QUEUE_NAME);
actorSystemContext.tellWithHighPriority(new CalculatedFieldStateRestoreMsg(id, state, p... | public void delete(Set<TopicPartitionInfo> partitions) {
stateService.delete(partitions);
}
@Override
public Set<TopicPartitionInfo> getPartitions() {
return stateService.getPartitions().values().stream().flatMap(Collection::stream).collect(Collectors.toSet());
}
@Override
publ... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\cf\AbstractCalculatedFieldStateService.java | 2 |
请完成以下Java代码 | public class CompoundWord implements IWord, Iterable<Word>
{
/**
* 由这些词复合而来
*/
public List<Word> innerList;
/**
* 标签,通常是词性
*/
public String label;
@Override
public String getValue()
{
StringBuilder sb = new StringBuilder();
for (Word word : innerList)
... | * 转换为一个简单词
* @return
*/
public Word toWord()
{
return new Word(getValue(), getLabel());
}
public CompoundWord(List<Word> innerList, String label)
{
this.innerList = innerList;
this.label = label;
}
public static CompoundWord create(String param)
{
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\document\sentence\word\CompoundWord.java | 1 |
请完成以下Java代码 | static I_M_HU_PI_Item_Product extractHUPIItemProduct(@NonNull final I_M_HU_LUTU_Configuration lutuConfiguration)
{
final I_M_HU_PI_Item_Product huPIItemProduct = extractHUPIItemProductOrNull(lutuConfiguration);
if (huPIItemProduct == null)
{
throw new HUException("No PI Item Product set for " + lutuConfigurat... | {
@NonNull
I_M_HU_LUTU_Configuration baseLUTUConfiguration;
@NonNull
BigDecimal qtyTU;
@NonNull
BigDecimal qtyCUsPerTU;
@NonNull
Integer tuHUPIItemProductID;
@Nullable
BigDecimal qtyLU;
@Nullable
Integer luHUPIID;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\ILUTUConfigurationFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List<String> getResourceSuffixes() {
return resourceSuffixes;
}
public void setResourceSuffixes(List<String> resourceSuffixes) {
this.resourceSuffixes = resourceSuffixes;
}
public boolean isDeployResources() {
return deployResources;
}
public void setDeployResou... | public void setEventRegistryStartCaseInstanceAsync(boolean eventRegistryStartCaseInstanceAsync) {
this.eventRegistryStartCaseInstanceAsync = eventRegistryStartCaseInstanceAsync;
}
public boolean isEventRegistryUniqueCaseInstanceCheckWithLock() {
return eventRegistryUniqueCaseInstanceCheckWithLo... | repos\flowable-engine-main\modules\flowable-spring-boot\flowable-spring-boot-starters\flowable-spring-boot-autoconfigure\src\main\java\org\flowable\spring\boot\cmmn\FlowableCmmnProperties.java | 2 |
请完成以下Java代码 | public BigDecimal getUOMToStockRatio()
{
return Optional.ofNullable(uomQty)
.map(uomQuantity -> {
if (uomQuantity.isZero() || stockQty.isZero())
{
return BigDecimal.ZERO;
}
final UOMPrecision uomPrecision = UOMPrecision.ofInt(uomQuantity.getUOM().getStdPrecision());
return uomQua... | ? stockQtyAndUOMQty.toZero()
: stockQtyAndUOMQty;
}
public Quantity getQtyInUOM(@NonNull final UomId uomId, @NonNull final QuantityUOMConverter converter)
{
if (uomQty != null)
{
if (UomId.equals(uomQty.getUomId(), uomId))
{
return uomQty;
}
else if (UomId.equals(uomQty.getSourceUomId(), uom... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\quantity\StockQtyAndUOMQty.java | 1 |
请完成以下Java代码 | private final SideActionsGroupPanel createGroupComponent(final ISideActionsGroupModel group)
{
final SideActionsGroupPanel groupComp = new SideActionsGroupPanel();
groupComp.setModel(group);
groupComp.addPropertyChangeListener(SideActionsGroupPanel.PROPERTY_Visible, groupPanelChangedListener);
return groupComp... | /**
* Auto-hide if no groups or groups are not visible
*/
private final void autoHideIfNeeded()
{
boolean haveVisibleGroups = false;
for (Component groupComp : contentPanel.getComponents())
{
if (groupComp.isVisible())
{
haveVisibleGroups = true;
break;
}
}
setVisible(haveVisibleGroups)... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\adempiere\ui\sideactions\swing\SideActionsGroupsListPanel.java | 1 |
请完成以下Java代码 | private final Map<String, IAttributeStorage> retrieveChildrenAttributeStorages()
{
final IAttributeStorageFactory storageFactory = getAttributeStorageFactory();
final IHandlingUnitsDAO handlingUnitsDAO = getHandlingUnitsDAO();
final Map<String, IAttributeStorage> childrenAttributeSetStorages = new LinkedHashMap... | }
/**
* Add the given <code>childAttributeStorage</code> to this storage's children. If children were not yet loaded, then this method also loads them.
*
* @param childAttributeStorage
*/
@Override
protected void addChildAttributeStorage(final IAttributeStorage childAttributeStorage)
{
final Map<String, ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\storage\impl\HUAttributeStorage.java | 1 |
请完成以下Java代码 | public class BBANStructureEntry
{
private BBANCodeEntryType codeType;
private EntryCharacterType characterType;
private int length;
private String seqNo;
public BBANStructureEntry()
{
super();
}
public void setCharacterType(EntryCharacterType characterType)
{
this.characterType = characterType;
}
publ... | {
return seqNo;
}
public BBANCodeEntryType getCodeType()
{
return codeType;
}
public void setCodeType(BBANCodeEntryType codeType)
{
this.codeType = codeType;
}
/**
* Basic Bank Account Number Entry Types.
*/
public enum BBANCodeEntryType
{
bank_code,
branch_code,
... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\base\src\main\java\de\metas\payment\sepa\wrapper\BBANStructureEntry.java | 1 |
请完成以下Java代码 | public Map<String, VariableValueDto> getVariables() {
return variables;
}
public long getPriority() {
return priority;
}
public String getErrorDetails() {
return errorDetails;
}
public String getBusinessKey() {
return businessKey;
}
public Map<String, String> getExtensionProperties()... | @Override
public String toString() {
return
"LockedExternalTaskDto [activityId=" + activityId
+ ", activityInstanceId=" + activityInstanceId
+ ", errorMessage=" + errorMessage
+ ", errorDetails=" + errorDetails
+ ", executionId=" + executionId
+ ", id=" + id
... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\externaltask\LockedExternalTaskDto.java | 1 |
请完成以下Java代码 | public class ManagerDelomboked extends Employee {
private String departmentName;
private int uid;
public ManagerDelomboked(String departmentName, int uid, String name, int id, int age) {
super(name, id, age);
this.departmentName = departmentName;
this.uid = uid;
}
public bo... | if (this.getUid() != other.getUid()) return false;
final Object this$departmentName = this.getDepartmentName();
final Object other$departmentName = other.getDepartmentName();
if (this$departmentName == null ? other$departmentName != null : !this$departmentName.equals(other$departmentName)) retur... | repos\tutorials-master\lombok-modules\lombok\src\main\java\com\baeldung\lombok\equalsandhashcode\inheritance\ManagerDelomboked.java | 1 |
请完成以下Java代码 | private static Object decrypt(final Object encryptedValue)
{
if (encryptedValue == null)
{
return null;
}
return SecureEngine.decrypt(encryptedValue);
}
public static boolean isValueChanged(Object oldValue, Object value)
{
if (isNotNullAndIsEmpty(oldValue))
{
oldValue = null;
}
if (isNotNull... | {
bChanged = !oldValue.equals(value);
}
}
else if (value != null)
{
bChanged = !oldValue.toString().equals(value.toString());
}
}
return bChanged;
}
private static boolean isNotNullAndIsEmpty(final Object value)
{
if (value != null
&& value instanceof String
&& value.toString(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\GridTableUtils.java | 1 |
请完成以下Java代码 | public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
public I_PA_ReportLine getPA_ReportLine() throws RuntimeException
{
return (I_PA_ReportLine)MTable.get(getCtx(), I_PA_ReportLine.Table_Name)
.getPO(getPA_ReportLine_ID(), get_TrxName()); }
/** Set Report L... | set_ValueNoCheck (COLUMNNAME_Record_ID, Integer.valueOf(Record_ID));
}
/** Get Record ID.
@return Direct internal record ID
*/
public int getRecord_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Record_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Sequence.
@param SeqNo
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_T_Report.java | 1 |
请完成以下Java代码 | protected String getClientSecret() {
String clientSecret = oAuth2Properties.getWebClientConfiguration().getSecret();
if (clientSecret == null) {
throw new InvalidClientException("no client-secret configured in application properties");
}
return clientSecret;
}
protec... | /**
* Returns the configured OAuth2 token endpoint URI.
*
* @return the OAuth2 token endpoint URI.
*/
protected String getTokenEndpoint() {
String tokenEndpointUrl = jHipsterProperties.getSecurity().getClientAuthorization().getAccessTokenUri();
if (tokenEndpointUrl == null) {
... | repos\tutorials-master\jhipster-modules\jhipster-uaa\gateway\src\main\java\com\baeldung\jhipster\gateway\security\oauth2\OAuth2TokenEndpointClientAdapter.java | 1 |
请完成以下Spring Boot application配置 | management:
endpoint:
# AuditEventsEndpoint 端点配置项
auditevents:
enabled: true # 是否开启。默认为 true 开启
endpoints:
# Actuator HTTP 配置项,对应 WebEndpointProperties 配置类
web:
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
exposure:
include: '*' # 需要开放的端点。默认值只打开 health 和 in... | pring:
# Spring Security 配置项,对应 SecurityProperties 配置类
security:
# 配置默认的 InMemoryUserDetailsManager 的用户账号与密码。
user:
name: user # 账号
password: user # 密码 | repos\SpringBoot-Labs-master\lab-34\lab-34-actuator-demo-auditevents\src\main\resources\application.yaml | 2 |
请在Spring Boot框架中完成以下Java代码 | private ServiceRepairProjectTaskStatus computeStatusForSparePartsType()
{
if (getQtyToReserve().signum() <= 0)
{
return ServiceRepairProjectTaskStatus.COMPLETED;
}
else if (getQtyReservedOrConsumed().signum() == 0)
{
return ServiceRepairProjectTaskStatus.NOT_STARTED;
}
else
{
return ServiceRep... | @Nullable final ProductId repairServicePerformedId)
{
return toBuilder()
.isRepairOrderDone(true)
.repairOrderSummary(repairOrderSummary)
.repairServicePerformedId(repairServicePerformedId)
.build()
.withUpdatedStatus();
}
public ServiceRepairProjectTask withRepairOrderNotDone()
{
return to... | repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.base\src\main\java\de\metas\servicerepair\project\model\ServiceRepairProjectTask.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public EnableMemcachedServer.MemcachedProtocol getProtocol() {
return this.protocol;
}
public void setProtocol(EnableMemcachedServer.MemcachedProtocol protocol) {
this.protocol = protocol;
}
}
public static class RedisServerProperties {
public static final int DEFAULT_PORT = 6379;
private int port... | public String getBindAddress() {
return this.bindAddress;
}
public void setBindAddress(String bindAddress) {
this.bindAddress = bindAddress;
}
public int getPort() {
return this.port;
}
public void setPort(int port) {
this.port = port;
}
}
} | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\configuration\support\ServiceProperties.java | 2 |
请完成以下Java代码 | public void setTooltipIconName (java.lang.String TooltipIconName)
{
set_Value (COLUMNNAME_TooltipIconName, TooltipIconName);
}
/** Get Tooltip Icon Name.
@return Tooltip Icon Name */
@Override
public java.lang.String getTooltipIconName ()
{
return (java.lang.String)get_Value(COLUMNNAME_TooltipIconName)... | public static final String TYPE_Tooltip = "tooltip";
/** Set Art.
@param Type Art */
@Override
public void setType (java.lang.String Type)
{
set_Value (COLUMNNAME_Type, Type);
}
/** Get Art.
@return Art */
@Override
public java.lang.String getType ()
{
return (java.lang.String)get_Value(COLUMNNA... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_UI_ElementField.java | 1 |
请完成以下Java代码 | public class SingleResultReturningCollector<T> extends AbstractResultCollector<T, T> {
@Override
public void addResult(DistributedMember memberID, T resultOfSingleExecution) {
setResult(extractSingleResult(resultOfSingleExecution));
}
@SuppressWarnings("unchecked")
private <T> T extractSingleResult(Object resu... | }
private boolean isInstanceOfIterableOrIterator(Object obj) {
return obj instanceof Iterable || obj instanceof Iterator;
}
@SuppressWarnings("unchecked")
private <T> Iterator<T> toIterator(Object obj) {
return obj instanceof Iterator ? (Iterator<T>) obj : toIterator((Iterable<T>) obj);
}
private <T> Itera... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\function\support\SingleResultReturningCollector.java | 1 |
请完成以下Java代码 | public HistoricJobLogQuery orderByExecutionId() {
orderBy(HistoricJobLogQueryProperty.EXECUTION_ID);
return this;
}
public HistoricJobLogQuery orderByProcessInstanceId() {
orderBy(HistoricJobLogQueryProperty.PROCESS_INSTANCE_ID);
return this;
}
public HistoricJobLogQuery orderByProcessDefiniti... | public String[] getFailedActivityIds() {
return failedActivityIds;
}
public String[] getExecutionIds() {
return executionIds;
}
public String getProcessInstanceId() {
return processInstanceId;
}
public String getProcessDefinitionId() {
return processDefinitionId;
}
public String getP... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\HistoricJobLogQueryImpl.java | 1 |
请完成以下Java代码 | public class TextFile extends GenericFile {
private int wordCount;
public TextFile(String name, String content, String version) {
String[] words = content.split(" ");
this.setWordCount(words.length > 0 ? words.length : 1);
this.setContent(content.getBytes());
this.setName(name);... | return "Text File Impl";
}
public String read() {
return this.getContent()
.toString();
}
public String read(int limit) {
return this.getContent()
.toString()
.substring(0, limit);
}
public String read(int start, int stop) {
return t... | repos\tutorials-master\core-java-modules\core-java-lang-oop-inheritance-2\src\main\java\com\baeldung\polymorphism\TextFile.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SpringSecurityConfiguration {
//LDAP or Database
//In Memory
//InMemoryUserDetailsManager
//InMemoryUserDetailsManager(UserDetails... users)
@Bean
public InMemoryUserDetailsManager createUserDetailsManager() {
UserDetails userDetails1 = createNewUser("in28minutes", "dummy");
UserDetails u... | http.authorizeHttpRequests(
auth -> auth.anyRequest().authenticated());
http.formLogin(withDefaults());
http.csrf(AbstractHttpConfigurer::disable);
// OR
// http.csrf(AbstractHttpConfigurer::disable);
http.headers(headers -> headers.frameOptions(HeadersConfigurer.FrameOptionsConfig::disable)); // Star... | repos\master-spring-and-spring-boot-main\11-web-application\src\main\java\com\in28minutes\springboot\myfirstwebapp\security\SpringSecurityConfiguration.java | 2 |
请完成以下Java代码 | public class SubscriptionTermEventListener extends FallbackFlatrateTermEventListener
{
public static final String TYPE_CONDITIONS_SUBSCRIPTION = X_C_Flatrate_Term.TYPE_CONDITIONS_Subscription;
private static final String MSG_TERM_ERROR_DELIVERY_ALREADY_HAS_SHIPMENT_SCHED_0P = "Term_Error_Delivery_Already_Has_Shipmen... | next.setPriceActual(pricingInfo.getPriceStd());
next.setC_Currency_ID(pricingInfo.getCurrencyRepoId());
next.setC_UOM_ID(UomId.toRepoId(pricingInfo.getPriceUomId()));
next.setC_TaxCategory_ID(TaxCategoryId.toRepoId(pricingInfo.getTaxCategoryId()));
next.setIsTaxIncluded(pricingInfo.isTaxIncluded());
}
e... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\impl\SubscriptionTermEventListener.java | 1 |
请完成以下Java代码 | public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
... | @Override
public String toString() {
return (
"ProcessDefinition{" +
"id='" +
id +
'\'' +
", name='" +
name +
'\'' +
", key='" +
key +
'\'' +
", description='" +
de... | repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-process-model-impl\src\main\java\org\activiti\api\runtime\model\impl\ProcessDefinitionImpl.java | 1 |
请完成以下Java代码 | public TbQueueProducer<TbProtoQueueMsg<ToEdqsMsg>> createEdqsEventsProducer() {
return TbKafkaProducerTemplate.<TbProtoQueueMsg<ToEdqsMsg>>builder()
.clientId("edqs-events-producer-" + serviceInfoProvider.getServiceId())
.defaultTopic(topicService.buildTopicName(edqsConfig.getEve... | }
if (jsExecutorResponseAdmin != null) {
jsExecutorResponseAdmin.destroy();
}
if (notificationAdmin != null) {
notificationAdmin.destroy();
}
if (fwUpdatesAdmin != null) {
fwUpdatesAdmin.destroy();
}
if (cfAdmin != null) {
... | repos\thingsboard-master\common\queue\src\main\java\org\thingsboard\server\queue\provider\KafkaTbRuleEngineQueueFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public JSONObject getAllRoles() {
return userService.getAllRoles();
}
/**
* 角色列表
*/
@RequiresPermissions("role:list")
@GetMapping("/listRole")
public JSONObject listRole() {
return userService.listRole();
}
/**
* 查询所有权限, 给角色分配权限时调用
*/
@RequiresPermis... | @PostMapping("/updateRole")
public JSONObject updateRole(@RequestBody JSONObject requestJson) {
CommonUtil.hasAllRequired(requestJson, "roleId,roleName,permissions");
return userService.updateRole(requestJson);
}
/**
* 删除角色
*/
@RequiresPermissions("role:delete")
@PostMappi... | repos\SpringBoot-Shiro-Vue-master\back\src\main\java\com\heeexy\example\controller\UserController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void delMember(Long memberId) {
UmsMember umsMember = memberMapper.selectByPrimaryKey(memberId);
if (umsMember != null) {
String key = REDIS_DATABASE + ":" + REDIS_KEY_MEMBER + ":" + umsMember.getUsername();
redisService.del(key);
}
}
@Override
public ... | }
@CacheException
@Override
public void setAuthCode(String telephone, String authCode) {
String key = REDIS_DATABASE + ":" + REDIS_KEY_AUTH_CODE + ":" + telephone;
redisService.set(key,authCode,REDIS_EXPIRE_AUTH_CODE);
}
@CacheException
@Override
public String getAuthCode(S... | repos\mall-master\mall-portal\src\main\java\com\macro\mall\portal\service\impl\UmsMemberCacheServiceImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getDeploymentId() {
return deploymentId;
}
public List<String> getDeploymentIds() {
return deploymentIds;
}
public String getName() {
return name;
}
public String getNameLike() {
return nameLike;
}
public String getCategory() {
... | public boolean isLatest() {
return latest;
}
public String getTenantId() {
return tenantId;
}
public String getTenantIdLike() {
return tenantIdLike;
}
public boolean isWithoutTenantId() {
return withoutTenantId;
}
} | repos\flowable-engine-main\modules\flowable-app-engine\src\main\java\org\flowable\app\engine\impl\repository\AppDeploymentQueryImpl.java | 2 |
请完成以下Java代码 | public static List<SecurityFilterRule> createFilterRules(SecurityFilterConfig config,
String applicationPath) {
PathFilterConfig pathFilter = config.getPathFilter();
PathFilterRule rule = createPathFilterRule(pathFilter, applicationPath);
return ne... | * the given request.
*
* @param requestMethod
* @param requestUri
* @param filterRules
*
* @return the checked request with authorization information attached
*/
public static Authorization authorize(String requestMethod, String requestUri, List<SecurityFilterRule> filterRules) {
Authorizati... | repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\webapp\impl\security\filter\util\FilterRules.java | 1 |
请完成以下Java代码 | public List<NotificationRule> findEnabledNotificationRulesByTenantIdAndTriggerType(TenantId tenantId, NotificationRuleTriggerType triggerType) {
return notificationRuleDao.findByTenantIdAndTriggerTypeAndEnabled(tenantId, triggerType, true);
}
@Override
public void deleteNotificationRuleById(TenantI... | deleteNotificationRulesByTenantId(tenantId);
}
@Override
public Optional<HasId<?>> findEntity(TenantId tenantId, EntityId entityId) {
return Optional.ofNullable(findNotificationRuleById(tenantId, new NotificationRuleId(entityId.getId())));
}
@Override
public FluentFuture<Optional<HasId... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\notification\DefaultNotificationRuleService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | ClientCacheConfigurer clientCacheNameConfigurer(Environment environment) {
return (beanName, clientCacheFactoryBean) -> configureCacheName(environment, clientCacheFactoryBean);
}
@Bean
@Order(Ordered.HIGHEST_PRECEDENCE + 1) // apply next (e.g. after @UseMemberName)
@ConditionalOnMissingProperty({
SPRING_DATA_G... | if (StringUtils.hasText(springApplicationName)) {
setGemFireName(cacheFactoryBean, springApplicationName);
}
}
private String resolveSpringApplicationName(Environment environment) {
return Optional.ofNullable(environment)
.filter(it -> it.containsProperty(SPRING_APPLICATION_NAME_PROPERTY))
.map(it -> i... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\CacheNameAutoConfiguration.java | 2 |
请完成以下Java代码 | public ImportTableDescriptor getByTableId(@NonNull final AdTableId adTableId)
{
return importTableDescriptors.getOrLoad(adTableId, this::retrieveByTableId);
}
public ImportTableDescriptor getByTableName(@NonNull final String tableName)
{
final AdTableId adTableId = AdTableId.ofRepoId(adTablesRepo.retrieveTable... | .keyColumnName(keyColumnName)
//
.dataImportConfigIdColumnName(columnNameIfExists(COLUMNNAME_C_DataImport_ID, poInfo))
.adIssueIdColumnName(columnNameIfExists(COLUMNNAME_AD_Issue_ID, poInfo))
.importLineContentColumnName(columnNameIfExists(COLUMNNAME_I_LineContent, poInfo))
.importLineNoColumnName(c... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\format\ImportTableDescriptorRepository.java | 1 |
请完成以下Java代码 | public String toString()
{
return "ACCEPT_ALL";
}
@Override
public Set<String> getParameters(@Nullable final String contextTableName)
{
return ImmutableSet.of();
}
@Override
public boolean accept(final IValidationContext evalCtx, final NamePair item)
{
return true;
}
};
public static C... | {
return ACCEPT_ALL;
}
else if (collectedPredicates.size() == 1)
{
return collectedPredicates.iterator().next();
}
else
{
return new ComposedNamePairPredicate(collectedPredicates);
}
}
public Composer add(@Nullable final INamePairPredicate predicate)
{
if (predicate == null ||... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\validationRule\NamePairPredicates.java | 1 |
请完成以下Java代码 | public void setAD_User_ID (int AD_User_ID)
{
if (AD_User_ID < 0)
set_Value (COLUMNNAME_AD_User_ID, null);
else
set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID));
}
/** Get Ansprechpartner.
@return User within the system - Internal or Business Partner Contact
*/
@Override
public int g... | set_ValueNoCheck (COLUMNNAME_C_DataImport_Run_ID, Integer.valueOf(C_DataImport_Run_ID));
}
/** Get Data Import Run.
@return Data Import Run */
@Override
public int getC_DataImport_Run_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_DataImport_Run_ID);
if (ii == null)
return 0;
return ii.intVal... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_DataImport_Run.java | 1 |
请完成以下Java代码 | private boolean updateHeader()
{
String sql = "UPDATE C_Cash c"
+ " SET StatementDifference="
//replace null with 0 there is no difference with this
+ "(SELECT COALESCE(SUM(currencyConvert(cl.Amount, cl.C_Currency_ID, cb.C_Currency_ID, c.DateAcct, 0, c.AD_Client_ID, c.AD_Org_ID)),0) "
+ "FROM C_CashLin... | return getParent();
}
public String getSummary()
{
// TODO: improve summary message
StringBuffer sb = new StringBuffer();
MCash cash = getC_Cash();
if (cash != null && cash.getC_Cash_ID() > 0)
{
sb.append(cash.getSummary());
}
if (sb.length() > 0)
{
sb.append(" - ");
}
sb.append(Msg... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MCashLine.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String showTodos(ModelMap model) {
// String name = getLoggedInUserName(model);
model.put("todos", todoService.getTodosByUser(model));
// model.put("todos", service.retrieveTodos(name));
return "list-todos";
}
@RequestMapping(value = "/add-todo", method = RequestMethod.G... | todoService.updateTodo(todo);
return "redirect:/list-todos";
}
@RequestMapping(value = "/add-todo", method = RequestMethod.POST)
public String addTodo(ModelMap model, @Valid Todo todo, BindingResult result) {
if (result.hasErrors()) {
return "todo";
}
// todo.se... | repos\SpringBoot-Projects-FullStack-master\Part-8 Spring Boot Real Projects\0.ProjectToDoinDBNoSec\src\main\java\spring\hibernate\controller\TodoController.java | 2 |
请完成以下Java代码 | public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getStreet() {
return street;
}
public void ... | return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public int hashCode() {
return ... | repos\tutorials-master\json-modules\json-2\src\main\java\com\baeldung\jsonoptimization\Customer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ShipmentCandidatesRestController
{
private final ShipmentCandidateAPIService shipmentCandidateAPIService;
public ShipmentCandidatesRestController(@NonNull final ShipmentCandidateAPIService shipmentCandidateAPIService)
{
this.shipmentCandidateAPIService = shipmentCandidateAPIService;
}
@GetMapping(... | final QueryLimit limitEff = QueryLimit.ofNullableOrNoLimit(limit).ifNoLimitUse(10);
final JsonResponseShipmentCandidates result = shipmentCandidateAPIService.exportShipmentCandidates(limitEff);
return ResponseEntity.ok(result);
}
@PostMapping("shipmentCandidatesResult")
public ResponseEntity<String> postShipmen... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v1\shipping\ShipmentCandidatesRestController.java | 2 |
请完成以下Java代码 | public class DefaultDeploymentCache<T> implements DeploymentCache<T> {
private static final Logger logger = LoggerFactory.getLogger(DefaultDeploymentCache.class);
protected Map<String, T> cache;
/** Cache with no limit */
public DefaultDeploymentCache() {
this.cache = synchronizedMap(new Hash... | }
public void remove(String id) {
cache.remove(id);
}
@Override
public boolean contains(String id) {
return cache.containsKey(id);
}
public void clear() {
cache.clear();
}
// For testing purposes only
public int size() {
return cache.size();
}
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\deploy\DefaultDeploymentCache.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected final ItemDeprecation resolveItemDeprecation(MetadataGenerationEnvironment environment,
Element... elements) {
boolean deprecated = Arrays.stream(elements).anyMatch(environment::isDeprecated);
return deprecated ? environment.resolveItemDeprecation(getGetter()) : null;
}
private String resolveType(Me... | /**
* Resolve the {@link ItemDeprecation} for this property.
* @param environment the metadata generation environment
* @return the deprecation or {@code null}
*/
protected abstract ItemDeprecation resolveItemDeprecation(MetadataGenerationEnvironment environment);
/**
* Return true if this descriptor is fo... | repos\spring-boot-4.0.1\configuration-metadata\spring-boot-configuration-processor\src\main\java\org\springframework\boot\configurationprocessor\PropertyDescriptor.java | 2 |
请完成以下Java代码 | public class ThrottleGatewayFilter implements GatewayFilter {
private static final Log log = LogFactory.getLog(ThrottleGatewayFilter.class);
private volatile TokenBucket tokenBucket;
int capacity;
int refillTokens;
int refillPeriod;
TimeUnit refillUnit;
private TokenBucket getTokenBucket() {
if (tokenBu... | return refillPeriod;
}
public ThrottleGatewayFilter setRefillPeriod(int refillPeriod) {
this.refillPeriod = refillPeriod;
return this;
}
public TimeUnit getRefillUnit() {
return refillUnit;
}
public ThrottleGatewayFilter setRefillUnit(TimeUnit refillUnit) {
this.refillUnit = refillUnit;
return this;
... | repos\spring-cloud-gateway-main\spring-cloud-gateway-sample\src\main\java\org\springframework\cloud\gateway\sample\ThrottleGatewayFilter.java | 1 |
请完成以下Java代码 | public class AddressDetails {
private String address;
private String zipcode;
private List<ContactDetails> contactDetails;
public String getZipcode() {
return zipcode;
}
public void setZipcode(String zipcode) {
this.zipcode = zipcode;
} | public List<ContactDetails> getContactDetails() {
return contactDetails;
}
public void setContactDetails(List<ContactDetails> contactDetails) {
this.contactDetails = contactDetails;
}
public String getAddress() {
return address;
}
public void setAddress(String address)... | repos\tutorials-master\xml-modules\xstream\src\main\java\com\baeldung\pojo\AddressDetails.java | 1 |
请完成以下Java代码 | protected BooleanStringExpression createGeneralExpression(final ExpressionContext context, final String expressionStr, final List<Object> expressionChunks)
{
return new GeneralExpression(context, this, expressionStr, expressionChunks);
}
});
}
private static final class BooleanValueConverter implements V... | private SingleParameterExpression(final ExpressionContext context, final Compiler<Boolean, BooleanStringExpression> compiler, final String expressionStr, final CtxName parameter)
{
super(context, compiler, expressionStr, parameter);
}
@Override
protected Boolean extractParameterValue(Evaluatee ctx)
{
r... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\impl\BooleanStringExpressionSupport.java | 1 |
请完成以下Java代码 | public void setIsPrinted (boolean IsPrinted)
{
set_Value (COLUMNNAME_IsPrinted, Boolean.valueOf(IsPrinted));
}
/** Get Printed.
@return Indicates if this document / line is printed
*/
public boolean isPrinted ()
{
Object oo = get_Value(COLUMNNAME_IsPrinted);
if (oo != null)
{
if (oo instanceof ... | /** Set Sequence.
@param SeqNo
Method of ordering records; lowest number comes first
*/
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Sequence.
@return Method of ordering records; lowest number comes first
*/
public int getSeqNo ()
{
Integer ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_HR_PayrollConcept.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void copyPreliminaryValues(final I_C_InvoiceLine from, final I_C_InvoiceLine to)
{
// nothing right now
}
@Override
public void copyValues(final I_C_InvoiceLine from, final I_C_InvoiceLine to)
{
// 08864
// Make sure the Attribute Set Instance is cloned form the initial invoice line to the credit mem... | }
public static CreditMemoInvoiceLineCopyHandler getInstance()
{
return CreditMemoInvoiceLineCopyHandler.instance;
}
/**
*
*/
@Override
public Class<I_C_InvoiceLine> getSupportedItemsClass()
{
return I_C_InvoiceLine.class;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\service\impl\CreditMemoInvoiceLineCopyHandler.java | 2 |
请完成以下Java代码 | public void clear() {
headers.clear();
}
@Override
public Set<String> keySet() {
return headers.keySet();
}
@Override
public Collection<List<String>> values() {
return headers.values();
}
@Override
public Set<Entry<String, List<String>>> entrySet() {
... | }
return sb.toString();
}
public static HttpHeaders parseFromString(String headersString) {
HttpHeaders headers = new HttpHeaders(headersString);
if (StringUtils.isNotEmpty(headersString)) {
try (BufferedReader reader = new BufferedReader(new StringReader(headersString))) ... | repos\flowable-engine-main\modules\flowable-http-common\src\main\java\org\flowable\http\common\api\HttpHeaders.java | 1 |
请完成以下Java代码 | public class ActiveObjectCounter<T> {
private final ConcurrentMap<T, CountDownLatch> locks = new ConcurrentHashMap<>();
private volatile boolean active = true;
public void add(T object) {
CountDownLatch lock = new CountDownLatch(1);
this.locks.putIfAbsent(object, lock);
}
public void release(T object) {
... | public int getCount() {
return this.locks.size();
}
public void reset() {
this.locks.clear();
this.active = true;
}
public void deactivate() {
this.active = false;
}
public boolean isActive() {
return this.active;
}
} | repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\support\ActiveObjectCounter.java | 1 |
请完成以下Java代码 | public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getL... | }
public ByteArrayRef getByteArrayRef() {
return byteArrayRef;
}
// common methods //////////////////////////////////////////////////////////
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("HistoricVariableInstanceEntity[");
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\HistoricVariableInstanceEntityImpl.java | 1 |
请完成以下Java代码 | private final IHUProductStorage createProductStorage(final I_M_HU_Storage storage)
{
final ProductId productId = ProductId.ofRepoId(storage.getM_Product_ID());
final I_C_UOM uom = IHUStorageBL.extractUOM(storage);
final HUProductStorage productStorage = new HUProductStorage(this, productId, uom);
return produc... | && ProductId.equals(productStorages.get(0).getProductId(), productId)
&& productStorages.get(0).getQty(qty.getUOM()).compareTo(qty) == 0;
}
@Override
public boolean isSingleProductStorageMatching(@NonNull final ProductId productId)
{
final List<IHUProductStorage> productStorages = getProductStorages();
ret... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\storage\impl\HUStorage.java | 1 |
请完成以下Java代码 | public List<ConnectorDefinition> get() throws IOException {
List<ConnectorDefinition> connectorDefinitions = new ArrayList<>();
Optional<Resource[]> resourcesOptional = retrieveResources();
if (resourcesOptional.isPresent()) {
for (Resource resource : resourcesOptional.get()) {
... | if (name == null || name.isEmpty()) {
throw new IllegalStateException("connectorDefinition name cannot be null or empty");
}
if (name.contains(".")) {
throw new IllegalStateException("connectorDefinition name cannot have '.' character");
... | repos\Activiti-develop\activiti-core-common\activiti-spring-connector\src\main\java\org\activiti\core\common\spring\connector\ConnectorDefinitionService.java | 1 |
请完成以下Java代码 | public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
@Override
public boolean equals(Object obj) { ... | return true;
}
if(obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
IdManBook other = (IdManBook) obj;
return Objects.equals(id, other.getId());
}
@Override
public int hashCode() {
... | repos\Hibernate-SpringBoot-master\HibernateSpringBootLombokEqualsAndHashCode\src\main\java\com\app\IdManBook.java | 1 |
请完成以下Java代码 | public void release() {
this.parent = null;
this.id = null;
}
@Override
public void setPageContext(PageContext pageContext) {
this.pageContext = pageContext;
}
@Override
protected ServletRequest getRequest() {
return this.pageContext.getRequest();
}
@Override
protected ServletResponse getResponse() ... | @Override
public TypeConverter getTypeConverter() {
return this.delegate.getTypeConverter();
}
@Override
public TypeComparator getTypeComparator() {
return this.delegate.getTypeComparator();
}
@Override
public OperatorOverloader getOperatorOverloader() {
return this.delegate.getOperatorOverload... | repos\spring-security-main\taglibs\src\main\java\org\springframework\security\taglibs\authz\JspAuthorizeTag.java | 1 |
请完成以下Java代码 | public Object around(ProceedingJoinPoint point) throws Throwable {
// 获取类名
String className = point.getTarget().getClass().getName();
// 获取方法
String methodName = point.getSignature().getName();
// 记录开始时间
long beginTime = System.currentTimeMillis();
// 记录返回结果
... | throw e;
} finally {
// 计算消耗时间
long costTime = System.currentTimeMillis() - beginTime;
// 发生异常,则打印 ERROR 日志
if (ex != null) {
logger.error("[className: {}][methodName: {}][cost: {} ms][args: {}][发生异常]",
className, methodName... | repos\SpringBoot-Labs-master\lab-37\lab-37-logging-aop\src\main\java\cn\iocoder\springboot\lab37\loggingdemo\aspect\HttpAccessAspect.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.