instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | protected String getTypeNameForDeserialized(Object deserializedObject) {
return dataFormat.getMapper().getCanonicalTypeName(deserializedObject);
}
protected byte[] serializeToByteArray(Object deserializedObject) throws Exception {
DataFormatMapper mapper = dataFormat.getMapper();
DataFormatWriter write... | IoUtil.closeSilently(bais);
IoUtil.closeSilently(inReader);
IoUtil.closeSilently(bufferedReader);
}
}
protected boolean canSerializeValue(Object value) {
return dataFormat.getMapper().canMap(value);
}
protected DeserializationTypeValidator getValidator(final ProcessEngineConfigurationImpl ... | repos\camunda-bpm-platform-master\engine-plugins\spin-plugin\src\main\java\org\camunda\spin\plugin\impl\SpinObjectValueSerializer.java | 1 |
请完成以下Java代码 | public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CompensateEventDefinition.class, BPMN_ELEMENT_COMPENSATE_EVENT_DEFINITION)
.namespaceUri(BPMN20_NS)
.extendsType(EventDefinition.class)
.instanceProvider(new ModelTypeInstance... | public CompensateEventDefinitionImpl(ModelTypeInstanceContext context) {
super(context);
}
public boolean isWaitForCompletion() {
return waitForCompletionAttribute.getValue(this);
}
public void setWaitForCompletion(boolean isWaitForCompletion) {
waitForCompletionAttribute.setValue(this, isWaitForC... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\CompensateEventDefinitionImpl.java | 1 |
请完成以下Spring Boot application配置 | spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
# Enabling H2 Console
spring.h2.console.enabled | =true
spring.h2.console.path=/h2
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true | repos\tutorials-master\spring-boot-modules\spring-caching-3\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public java.lang.String getProductName()
{
return get_ValueAsString(COLUMNNAME_ProductName);
}
@Override
public void setQtyCount (final BigDecimal QtyCount)
{
set_Value (COLUMNNAME_QtyCount, QtyCount);
}
@Override
public BigDecimal getQtyCount()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_... | return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setSeqNo (final int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, SeqNo);
}
@Override
public int getSeqNo()
{
return get_ValueAsInt(COLUMNNAME_SeqNo);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java-gen\de\metas\fresh\model\X_Fresh_QtyOnHand_Line.java | 1 |
请完成以下Java代码 | public ProductId getProductId()
{
return storage.getProductId();
}
@Override
public BigDecimal getQty()
{
return storage.getQtyCapacity();
}
@Override
public I_C_UOM getC_UOM()
{
return storage.getC_UOM();
}
@Override
public BigDecimal getQtyAllocated()
{
return storage.getQtyFree();
}
@Overr... | return referenceModel;
}
protected IProductStorage getStorage()
{
return storage;
}
@Override
public IAllocationSource createAllocationSource(final I_M_HU hu)
{
return HUListAllocationSourceDestination.of(hu);
}
@Override
public boolean isReadOnly()
{
return readonly;
}
@Override
public void set... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\document\impl\AbstractHUDocumentLine.java | 1 |
请完成以下Java代码 | public I_C_UOM getC_UOMOrNull()
{
return dao.getC_UOMOrNull(hu);
}
@Override
public boolean isSingleProductWithQtyEqualsTo(@NonNull final ProductId productId, @NonNull final Quantity qty)
{
final List<IHUProductStorage> productStorages = getProductStorages();
return productStorages.size() == 1
&& Produc... | final List<IHUProductStorage> productStorages = getProductStorages();
return isSingleProductStorageMatching(productStorages, productId);
}
private static boolean isSingleProductStorageMatching(@NonNull final List<IHUProductStorage> productStorages, @NotNull final ProductId productId)
{
return productStorages.si... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\storage\impl\HUStorage.java | 1 |
请完成以下Java代码 | public class PerformanceSettings {
/**
* Experimental setting: if true, whenever an execution is fetched from the data store,
* the whole execution tree is fetched in the same roundtrip.
*
* Less roundtrips to the database outweighs doing many, smaller fetches and often
* multiple executio... | }
public boolean isEnableExecutionRelationshipCounts() {
return enableExecutionRelationshipCounts;
}
public void setEnableExecutionRelationshipCounts(boolean enableExecutionRelationshipCounts) {
this.enableExecutionRelationshipCounts = enableExecutionRelationshipCounts;
}
public b... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cfg\PerformanceSettings.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static class SecurityFilterChainConfiguration {
@Bean
@Order(SecurityFilterProperties.BASIC_AUTH_ORDER)
SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) {
http.authorizeHttpRequests((requests) -> requests.anyRequest().authenticated());
http.formLogin(withDefaults());
http.httpBasic(with... | * default security auto-configuration and also if the user adds custom security and
* forgets to add the annotation. If {@link EnableWebSecurity @EnableWebSecurity} has
* already been added or if a bean with name
* {@value BeanIds#SPRING_SECURITY_FILTER_CHAIN} has been configured by the user, this
* will back-o... | repos\spring-boot-4.0.1\module\spring-boot-security\src\main\java\org\springframework\boot\security\autoconfigure\web\servlet\ServletWebSecurityAutoConfiguration.java | 2 |
请完成以下Java代码 | private int computeNumberOfPages()
{
if (!hasData())
{
return 0;
}
PdfReader reader = null;
try
{
reader = new PdfReader(getData());
return reader.getNumberOfPages();
}
catch (final IOException e)
{
throw new AdempiereException("Cannot get number of pages for C_Printing_Queue_ID=" + prin... | .filter(segment -> segment.isMatchingOutputType(outputType))
.collect(ImmutableList.toImmutableList());
return toBuilder()
.clearSegments()
.segments(filteredSegments)
.adjustSegmentPageRanges(false)
.build();
}
public PrintingData onlyQueuedForExternalSystems()
{
final ImmutableList<Printi... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java\de\metas\printing\printingdata\PrintingData.java | 1 |
请完成以下Java代码 | public Quantity calculateQtyEntered(@NonNull final I_C_Invoice_Candidate icRecord)
{
final UomId uomId = HandlerTools.retrieveUomId(icRecord);
final I_C_Flatrate_Term term = HandlerTools.retrieveTerm(icRecord);
return new Quantity(
term.getPlannedQtyPerUnit(),
loadOutOfTrx(uomId, I_C_UOM.class));
}
@... | final Timestamp startDateOfTerm = term.getStartDate();
final I_C_Flatrate_Conditions conditions = term.getC_Flatrate_Conditions();
final I_C_Flatrate_Transition transition = conditions.getC_Flatrate_Transition();
final String termOfNoticeUnit = transition.getTermOfNoticeUnit();
final int termOfNotice = transit... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\subscription\invoicecandidatehandler\FlatrateTermSubscription_Handler.java | 1 |
请完成以下Java代码 | public boolean containsKey(Object key) {
if ( (key==null) || (!String.class.isAssignableFrom(key.getClass())) ) {
return false;
}
return beanFactory.containsBean((String) key);
}
public Set<Object> keySet() {
return Collections.emptySet();
}
public void clear() {
throw new ProcessEng... | throw new ProcessEngineException("unsupported operation on configuration beans");
}
public Object put(Object key, Object value) {
throw new ProcessEngineException("unsupported operation on configuration beans");
}
public void putAll(Map< ? extends Object, ? extends Object> m) {
throw new ProcessEngine... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cfg\SpringBeanFactoryProxyMap.java | 1 |
请完成以下Java代码 | public static HUPIAttributeId ofRepoId(final int repoId)
{
return new HUPIAttributeId(repoId);
}
@Nullable
public static HUPIAttributeId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? ofRepoId(repoId) : null;
}
public static Optional<HUPIAttributeId> optionalOfRepoId(final int repoId)
{
return O... | @JsonValue
@Override
public int getRepoId()
{
return repoId;
}
public static boolean equals(@Nullable final HUPIAttributeId id1, @Nullable final HUPIAttributeId id2)
{
return Objects.equals(id1, id2);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\handlingunits\HUPIAttributeId.java | 1 |
请完成以下Java代码 | public void addDelegate(String contentType, MessageConverter messageConverter) {
this.delegates.put(contentType, messageConverter);
}
/**
* Remove the delegate for the content type.
* @param contentType the content type key to remove {@link MessageConverter} from delegates.
* @return the remove {@link Messag... | }
@Override
public Message toMessage(Object object, MessageProperties messageProperties) {
String contentType = messageProperties.getContentType();
return getConverterForContentType(contentType).toMessage(object, messageProperties);
}
protected MessageConverter getConverterForContentType(String contentType) {... | repos\spring-amqp-main\spring-amqp\src\main\java\org\springframework\amqp\support\converter\ContentTypeDelegatingMessageConverter.java | 1 |
请完成以下Java代码 | public ITrxConstraints setTrxTimeoutSecs(int secs, boolean logOnly)
{
return this;
}
@Override
public int getTrxTimeoutSecs()
{
return 0;
}
@Override
public boolean isTrxTimeoutLogOnly()
{
return false;
}
@Override
public ITrxConstraints setMaxTrx(int max)
{
return this;
}
@Override
public I... | @Override
public ITrxConstraints setMaxSavepoints(int maxSavePoints)
{
return this;
}
@Override
public boolean isAllowTrxAfterThreadEnd()
{
return false;
}
@Override
public ITrxConstraints setAllowTrxAfterThreadEnd(boolean allow)
{
return this;
}
@Override
public void reset()
{
}
@Override
pu... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\util\trxConstraints\api\impl\TrxConstraintsDisabled.java | 1 |
请完成以下Java代码 | public int getC_BPartner_Location_ID()
{
return get_ValueAsInt(COLUMNNAME_C_BPartner_Location_ID);
}
@Override
public void setEDI_cctop_000_v_ID (final int EDI_cctop_000_v_ID)
{
if (EDI_cctop_000_v_ID < 1)
set_ValueNoCheck (COLUMNNAME_EDI_cctop_000_v_ID, null);
else
set_ValueNoCheck (COLUMNNAME_EDI... | return get_ValueAsInt(COLUMNNAME_EDI_cctop_000_v_ID);
}
@Override
public void setEdiInvoicRecipientGLN (final @Nullable java.lang.String EdiInvoicRecipientGLN)
{
set_ValueNoCheck (COLUMNNAME_EdiInvoicRecipientGLN, EdiInvoicRecipientGLN);
}
@Override
public java.lang.String getEdiInvoicRecipientGLN()
{
re... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_cctop_000_v.java | 1 |
请完成以下Java代码 | public CamundaBpmProperties getCamundaBpmProperties() {
return camundaBpmProperties;
}
public void setCamundaBpmProperties(CamundaBpmProperties camundaBpmProperties) {
this.camundaBpmProperties = camundaBpmProperties;
}
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull... | }
return SQL_TEMPLATE.replace(TABLE_PREFIX_PLACEHOLDER, tablePrefix);
}
protected String getHistoryLevelFrom(Integer historyLevelFromDb) {
String result = defaultHistoryLevel;
if (historyLevelFromDb != null) {
for (HistoryLevel historyLevel : historyLevels) {
if (historyLevel.getId() == h... | repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\jdbc\HistoryLevelDeterminatorJdbcTemplateImpl.java | 1 |
请完成以下Java代码 | public int getS_Resource_ID()
{
return get_ValueAsInt(COLUMNNAME_S_Resource_ID);
}
@Override
public void setStorageAttributesKey (final @Nullable java.lang.String StorageAttributesKey)
{
set_Value (COLUMNNAME_StorageAttributesKey, StorageAttributesKey);
}
@Override
public java.lang.String getStorageAttri... | return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setYield (final int Yield)
{
set_Value (COLUMNNAME_Yield, Yield);
}
@Override
public int getYield()
{
return get_ValueAsInt(COLUMNNAME_Yield);
}
@Override
public void setC_Manufacturing_Aggregation_ID (final int C_Manufacturing_Aggrega... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Product_Planning.java | 1 |
请完成以下Java代码 | public String getUpdateId() {
return updateId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column user_info.update_id
*
* @param updateId the value for user_info.update_id
*
* @mbg.generated Sun Apr 28 14:54:53 CST 2... | */
public Boolean getEnabled() {
return enabled;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column user_info.enabled
*
* @param enabled the value for user_info.enabled
*
* @mbg.generated Sun Apr 28 14:54:53 CST ... | repos\springboot-demo-master\druid\src\main\java\com\et\druid\entity\UserInfo.java | 1 |
请完成以下Java代码 | public static boolean isValidDMSFormatWithCustomValidation(String coordinateString) {
try {
String[] dmsParts = coordinateString.split("[°',]");
if (dmsParts.length > 6) {
return false;
}
int degreesLatitude = Integer.parseInt(dmsParts[0].trim());... | } catch (NumberFormatException e) {
return false;
}
}
private static boolean isInvalidLatitude(int degrees, int minutes, double seconds, String hemisphere) {
return degrees < 0 || degrees > 90 || minutes < 0 || minutes >= 60 || seconds < 0 || seconds >= 60 ||
(!hemispher... | repos\tutorials-master\core-java-modules\core-java-lang-math-3\src\main\java\com\baeldung\geocoordinatevalidator\GeoCoordinateValidator.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PaymentAllocationPayableItem
{
InvoiceAmtMultiplier amtMultiplier;
Amount openAmt;
Amount payAmt;
Amount discountAmt;
Amount serviceFeeAmt;
ClientAndOrgId clientAndOrgId;
Instant paymentDate;
/**
* Payment-BPartner
*/
BPartnerId bPartnerId;
InvoiceId invoiceId;
BPartnerId invoiceBPartnerId... | @NonNull final Amount payAmt,
@NonNull final Amount discountAmt,
@Nullable final Amount serviceFeeAmt,
@NonNull final OrgId orgId,
@NonNull final ClientId clientId,
@Nullable final Instant paymentDate,
@NonNull final BPartnerId bPartnerId,
@NonNull final InvoiceId invoiceId,
@NonNull final BPart... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\payment\paymentallocation\PaymentAllocationPayableItem.java | 2 |
请完成以下Java代码 | public int cols()
{
return getColumnDimension();
}
/**
* 取出第j列作为一个列向量
* @param j
* @return
*/
public Matrix col(int j)
{
double[][] X = new double[m][1];
for (int i = 0; i < m; i++)
{
X[i][0] = A[i][j];
}
return new Mat... | {
for (int j = 0; j < n; j++)
{
X[i][j] = Math.pow(A[i][j], 3.);
}
}
return X;
}
public void setZero()
{
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
A[i][j] = 0.;
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dependency\nnparser\Matrix.java | 1 |
请完成以下Java代码 | public String getFormKey() {
return formKey;
}
@Override
public String getExtraValue() {
return extraValue;
}
@Override
public boolean hasVariable(String variableName) {
return variables.containsKey(variableName);
}
@Override
public Object getVariable(Strin... | public PlanItem getPlanItem() {
return planItem;
}
@Override
public String toString() {
return new StringJoiner(", ", getClass().getSimpleName() + "[", "]")
.add("id='" + id + "'")
.add("planItemDefinitionId='" + planItemDefinitionId + "'")
.a... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\delegate\ReadOnlyDelegatePlanItemInstanceImpl.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAttributeCount() {
return attributeCount;
}
public void setAttributeCount(Integer attributeCount) {
this.attributeCount = attributeCount;
}
... | public void setParamCount(Integer paramCount) {
this.paramCount = paramCount;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.ap... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\PmsProductAttributeCategory.java | 1 |
请完成以下Java代码 | private void createNote(MADBoilerPlate text, I_AD_User user, Exception e)
{
final AdMessageId adMessageId = Services.get(IMsgBL.class).getIdByAdMessage(AD_Message_UserNotifyError)
.orElseThrow(() -> new AdempiereException("@NotFound@ @AD_Message_ID@ " + AD_Message_UserNotifyError));
//
final IMsgBL msgBL = ... | get_TrxName());
note.setAD_Org_ID(0);
note.saveEx();
m_count_notes++;
}
static List<EMailAddress> toEMailAddresses(final String string)
{
final StringTokenizer st = new StringTokenizer(string, " ,;", false);
final ArrayList<EMailAddress> result = new ArrayList<>();
while (st.hasMoreTokens())
{
resu... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\letters\report\AD_BoilderPlate_SendToUsers.java | 1 |
请完成以下Java代码 | private void logVersionInfo()
{
try
{
final Enumeration<URL> resEnum = Thread.currentThread().getContextClassLoader().getResources(JarFile.MANIFEST_NAME);
while (resEnum.hasMoreElements())
{
try
{
final URL url = resEnum.nextElement();
final InputStream is = url.openStream();
if (is... | }
private void run()
{
final Context context = Context.getContext();
context.addSource(new ConfigFileContext());
logVersionInfo();
//
// Start the client
final PrintingClient client = new PrintingClient();
client.start();
final Thread clientThread = client.getDaemonThread();
try
{
clientThre... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing.client\src\main\java\de\metas\printing\client\PrintingClientStandaloneService.java | 1 |
请完成以下Java代码 | public Set<String> getMappableAttributes() {
return this.mappableAttributes;
}
/**
* Loads the web.xml file using the configured <tt>ResourceLoader</tt> and parses the
* role-name elements from it, using these as the set of <tt>mappableAttributes</tt>.
*/
@Override
public void afterPropertiesSet() throws ... | throw new RuntimeException("Unable to parse document object", ex);
}
finally {
try {
aStream.close();
}
catch (IOException ex) {
this.logger.warn("Failed to close input stream for web.xml", ex);
}
}
}
/**
* We do not need to resolve external entities, so just return an empty String.
*/
... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\preauth\j2ee\WebXmlMappableAttributesRetriever.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DataPoint save(String accountName, Account account) {
Instant instant = LocalDate.now().atStartOfDay()
.atZone(ZoneId.systemDefault()).toInstant();
DataPointId pointId = new DataPointId(accountName, Date.from(instant));
Set<ItemMetric> incomes = account.getIncomes().stream()
.map(this::createIte... | .map(ItemMetric::getAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
return ImmutableMap.of(
StatisticMetric.EXPENSES_AMOUNT, expensesAmount,
StatisticMetric.INCOMES_AMOUNT, incomesAmount,
StatisticMetric.SAVING_AMOUNT, savingAmount
);
}
/**
* Normalizes given item amount to {@link Currency#... | repos\piggymetrics-master\statistics-service\src\main\java\com\piggymetrics\statistics\service\StatisticsServiceImpl.java | 2 |
请完成以下Java代码 | private String elementToString(@Nullable final Object element)
{
if (element == null)
{
return null;
}
try
{
final StringResult result = new StringResult();
marshaller.marshal(element, result);
return cleanupPdfData(result.toString());
}
catch (final Exception ex) | {
throw new AdempiereException("Failed converting " + element + " to String", ex);
}
}
/**
* remove the pdfdata since it's long and useless and we also attach it to the PO record
*/
@NonNull
@VisibleForTesting
static String cleanupPdfData(@NonNull final String s)
{
return s.replaceAll(PARCELLABELS_PDF... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dpd\src\main\java\de\metas\shipper\gateway\dpd\logger\DpdClientLogEvent.java | 1 |
请完成以下Java代码 | public class PickingShipmentCandidate
{
@NonNull @Delegate private final PickingShipmentCandidateKey key;
@NonNull @Getter private final ImmutableSet<HuId> onlyLUIds;
@NonNull @Getter private final CreateShipmentPolicy createShipmentPolicy;
@NonNull private final HashSet<ShipmentScheduleAndJobScheduleId> scheduleI... | {
throw new AdempiereException("Invalid create shipment policy option: " + this.createShipmentPolicy);
}
}
public void addLine(@NonNull final PickingJobLine line)
{
scheduleIds.add(line.getScheduleId());
}
public ShipmentScheduleAndJobScheduleIdSet getScheduleIds()
{
return ShipmentScheduleAndJobSchedu... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\shipment\PickingShipmentCandidate.java | 1 |
请完成以下Java代码 | public Builder setM_PricingSystem(final I_M_PricingSystem pricingSystem)
{
_pricingSystem = pricingSystem;
return this;
}
public Builder setM_PricingSystemOf(@NonNull final I_M_PriceList_Version plv)
{
final IPriceListDAO priceListsRepo = Services.get(IPriceListDAO.class);
final PriceListId priceL... | Check.assumeNotNull(_allProductionOrders, "_qualityInspectionOrders not null");
return _allProductionOrders;
}
public Builder setNotYetInvoicedProductionOrders(final List<IQualityInspectionOrder> qualityInspectionOrders)
{
_notYetInvoicedPPOrderIDs = new HashSet<>();
for (final IQualityInspectionOrder o... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\qualityBasedInvoicing\impl\MaterialTrackingDocumentsPricingInfo.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void delete(@NonNull final FailedTimeBookingId failedTimeBookingId)
{
final I_S_FailedTimeBooking record = InterfaceWrapperHelper.load(failedTimeBookingId, I_S_FailedTimeBooking.class);
InterfaceWrapperHelper.delete(record);
}
public Optional<FailedTimeBooking> getOptionalByExternalIdAndSystem(@NonNull ... | }
private FailedTimeBooking buildFailedTimeBooking(@NonNull final I_S_FailedTimeBooking record)
{
final ExternalSystem externalSystem = externalSystemRepository.getById(ExternalSystemId.ofRepoId(record.getExternalSystem_ID()));
return FailedTimeBooking.builder()
.orgId(OrgId.ofRepoId(record.getAD_Org_ID()))... | repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\timebooking\importer\failed\FailedTimeBookingRepository.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Book getByIsbn(String isbn) {
simulateSlowService();
return new Book(isbn, "Some book", "vector");
}
/**
* 最好指定key,此时会根据key将cache中的内容更新为最新
* @param book
* @return
*/
@Override
@CachePut(cacheNames = "books", key = "#book.isbn.hashCode()") // 方法的返回值会被更新到缓存中
public Book update(Book book) {
logg... | }
/**
* 模拟慢查询
*/
private void simulateSlowService() {
try {
long time = 3000L;
Thread.sleep(time);
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
}
} | repos\spring-boot-quick-master\quick-cache\src\main\java\com\quick\cache\repo\SimpleBookRepository.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class DubboEndpointAnnotationAutoConfiguration {
@Bean
@ConditionalOnMissingBean
@CompatibleConditionalOnEnabledEndpoint
public DubboMetadataEndpoint dubboEndpoint() {
return new DubboMetadataEndpoint();
}
@Bean
@ConditionalOnMissingBean
@CompatibleConditionalOnEnabledEn... | @Bean
@ConditionalOnMissingBean
@CompatibleConditionalOnEnabledEndpoint
public DubboReferencesMetadataEndpoint dubboReferencesMetadataEndpoint() {
return new DubboReferencesMetadataEndpoint();
}
@Bean
@ConditionalOnMissingBean
@CompatibleConditionalOnEnabledEndpoint
public Dubbo... | repos\dubbo-spring-boot-project-master\dubbo-spring-boot-actuator\src\main\java\org\apache\dubbo\spring\boot\actuate\autoconfigure\DubboEndpointAnnotationAutoConfiguration.java | 2 |
请完成以下Java代码 | JSONDocumentChangedWebSocketEvent markActiveTabStaled()
{
activeTabStaled = Boolean.TRUE;
return this;
}
private HashMap<String, JSONIncludedTabInfo> getIncludedTabsInfo()
{
if (includedTabsInfoByTabId == null)
{
includedTabsInfoByTabId = new HashMap<>();
}
return includedTabsInfoByTabId;
}
priva... | public void staleIncludedRows(@NonNull final DetailId tabId, @NonNull final DocumentIdsSelection rowIds)
{
getIncludedTabInfo(tabId).staleRows(rowIds);
}
void mergeFrom(@NonNull final JSONDocumentChangedWebSocketEvent from)
{
if (!Objects.equals(windowId, from.windowId)
|| !Objects.equals(id, from.id))
{... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\events\JSONDocumentChangedWebSocketEvent.java | 1 |
请完成以下Java代码 | public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public T getData() {
return dat... | public static <E> ResponseData<E> success(Integer code, String message, E object) {
return new ResponseData(code, message, object);
}
public static ResponseData error() {
return new ResponseData(ResponseCode.FAILED.getCode(), ResponseCode.FAILED.getMessage(), null);
}
public static Res... | repos\spring-boot-quick-master\quick-flowable\src\main\java\com\quick\flowable\common\ResponseData.java | 1 |
请完成以下Java代码 | public IPOTreeSupport get(@NonNull final String tableName)
{
return get(TableName.ofString(tableName));
}
public IPOTreeSupport get(@NonNull final TableName tableName)
{
// NOTE: we need to create a new instance each time because IPOTreeSupport implementations are stateful
final Class<? extends IPOTreeSuppo... | }
@Override
public void register(@NonNull final String tableName, @NonNull final Class<? extends IPOTreeSupport> clazz)
{
// do checks
try
{
clazz.getConstructor();
}
catch (NoSuchMethodException e)
{
throw new AdempiereException("Class " + clazz + " does not have a public constructor without para... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\model\tree\impl\POTreeSupportFactory.java | 1 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
/**
* AD_Language AD_Reference_ID=106
* Reference name: AD_Language
*/
public static final int AD_LANGUAGE_AD_Reference_ID=106;
@Override
public void setAD_Language (final java.la... | set_ValueNoCheck (COLUMNNAME_Mobile_Application_ID, null);
else
set_ValueNoCheck (COLUMNNAME_Mobile_Application_ID, Mobile_Application_ID);
}
@Override
public int getMobile_Application_ID()
{
return get_ValueAsInt(COLUMNNAME_Mobile_Application_ID);
}
@Override
public void setName (final java.lang.Stri... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_Mobile_Application_Trl.java | 1 |
请完成以下Java代码 | public long getMaxMemoryUsed() {
return maxMemoryUsed;
}
public SecureJavascriptConfigurator setMaxMemoryUsed(long maxMemoryUsed) {
this.maxMemoryUsed = maxMemoryUsed;
return this;
}
public int getScriptOptimizationLevel() {
return scriptOptimizationLevel;
}
pu... | public SecureScriptContextFactory getSecureScriptContextFactory() {
return secureScriptContextFactory;
}
public static SecureScriptClassShutter getSecureScriptClassShutter() {
return secureScriptClassShutter;
}
public SecureJavascriptConfigurator setEnableAccessToBeans(boolean enableAc... | repos\flowable-engine-main\modules\flowable-secure-javascript\src\main\java\org\flowable\scripting\secure\SecureJavascriptConfigurator.java | 1 |
请完成以下Java代码 | public int getAD_PrintColor_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_PrintColor_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (... | @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\compiere\model\X_AD_OrgType.java | 1 |
请完成以下Java代码 | public PageData<WidgetTypeId> findAllWidgetTypesIds(PageLink pageLink) {
return DaoUtil.pageToPageData(widgetTypeRepository.findAllIds(DaoUtil.toPageable(pageLink)).map(WidgetTypeId::new));
}
@Override
public List<WidgetTypeInfo> findByTenantAndImageLink(TenantId tenantId, String imageUrl, int limi... | return widgetTypeRepository.findNextBatch(id, Limit.of(batchSize));
}
@Override
public List<EntityInfo> findByTenantIdAndResource(TenantId tenantId, String reference, int limit) {
return widgetTypeInfoRepository.findWidgetTypeInfosByTenantIdAndResourceLink(tenantId.getId(), reference, PageRequest.o... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\widget\JpaWidgetTypeDao.java | 1 |
请完成以下Java代码 | public class HistoricJobLogResourceImpl implements HistoricJobLogResource {
protected String id;
protected ProcessEngine engine;
public HistoricJobLogResourceImpl(String id, ProcessEngine engine) {
this.id = id;
this.engine = engine;
}
public HistoricJobLogDto getHistoricJobLog() {
HistoryServi... | return HistoricJobLogDto.fromHistoricJobLog(historicJobLog);
}
public String getStacktrace() {
try {
HistoryService historyService = engine.getHistoryService();
String stacktrace = historyService.getHistoricJobLogExceptionStacktrace(id);
return stacktrace;
} catch (AuthorizationException ... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\history\impl\HistoricJobLogResourceImpl.java | 1 |
请完成以下Java代码 | /* package */IValidationContext getValidationContext()
{
final GridField gridField = m_mField;
// 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(IValida... | getEditorComponent().removeFocusListener(l);
}
public void setInfoWindowEnabled(final boolean enabled)
{
this.infoWindowEnabled = enabled;
if (m_button != null)
{
m_button.setVisible(enabled);
}
}
@Override
public ICopyPasteSupportEditor getCopyPasteSupport()
{
return copyPasteSupport;
}
} // VL... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VLookup.java | 1 |
请完成以下Java代码 | public class CompiledExecutableScript extends ExecutableScript {
private final static ScriptLogger LOG = ProcessEngineLogger.SCRIPT_LOGGER;
protected CompiledScript compiledScript;
protected CompiledExecutableScript(String language) {
this(language, null);
}
protected CompiledExecutableScript(String l... | public Object evaluate(ScriptEngine scriptEngine, VariableScope variableScope, Bindings bindings) {
try {
LOG.debugEvaluatingCompiledScript(language);
return getCompiledScript().eval(bindings);
} catch (ScriptException e) {
if (e.getCause() instanceof BpmnError) {
throw (BpmnError) e.g... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\scripting\CompiledExecutableScript.java | 1 |
请完成以下Java代码 | public static void deliveryDateToPO(final I_GO_DeliveryOrder orderPO, final DeliveryDate deliveryDate)
{
final LocalDate date = deliveryDate != null ? deliveryDate.getDate() : null;
final LocalDateTime timeFrom = deliveryDate != null ? deliveryDate.getDateTimeFrom() : null;
final LocalDateTime timeTo = deliveryD... | .setScale(0, RoundingMode.UP)
.intValue();
orderPO.setGO_GrossWeightKg(go_grossWeightKg);
orderPO.setGO_PackageContentDescription(deliveryPosition.getContent());
}
// ------------
private static int createC_Location_ID(final Address address)
{
final I_C_Location locationPO = InterfaceWrapperHelper.newIns... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.go\src\main\java\de\metas\shipper\gateway\go\GODeliveryOrderConverters.java | 1 |
请完成以下Java代码 | public String modelChange(PO po, int type) throws Exception
{
if (I_AD_Tab.Table_Name.equals(po.get_TableName()) && type == TYPE_AFTER_CHANGE
&& po.is_ValueChanged(I_AD_Tab.COLUMNNAME_AD_Table_ID))
{
I_AD_Tab tab = InterfaceWrapperHelper.create(po, I_AD_Tab.class);
updateTabFieldColumns(po.getCtx(), tab,... | I_AD_Column columnOld = field.getAD_Column();
int columnId = MColumn.getColumn_ID(tableName, columnOld.getColumnName());
if (columnId > 0)
{
field.setAD_Column_ID(columnId);
InterfaceWrapperHelper.save(field);
log.info("Updated AD_Column_ID for field " + field.getName());
}
else
{
log.... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\appdict\validation\model\validator\ApplicationDictionary.java | 1 |
请完成以下Java代码 | protected DocumentBuilder getDocumentBuilder() {
try {
DocumentBuilder docBuilder = documentBuilderFactory.newDocumentBuilder();
LOG.createdDocumentBuilder();
return docBuilder;
}
catch (ParserConfigurationException e) {
throw LOG.unableToCreateParser(e);
}
}
protected JAX... | documentBuilderFactory.setIgnoringComments(true);
LOG.documentBuilderFactoryConfiguration("ignoringComments", "true");
documentBuilderFactory.setIgnoringElementContentWhitespace(false);
LOG.documentBuilderFactoryConfiguration("ignoringElementContentWhitespace", "false");
return documentBuilderFactory;... | repos\camunda-bpm-platform-master\clients\java\client\src\main\java\org\camunda\bpm\client\variable\impl\format\xml\DomXmlDataFormat.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public InsuranceContractSalesContracts careType(BigDecimal careType) {
this.careType = careType;
return this;
}
/**
* Art der Versorgung (0 = Unbekannt, 1 = Erstversorgung, 2 = Folgeversorgung)
* @return careType
**/
@Schema(example = "1", description = "Art der Versorgung (0 = Un... | public int hashCode() {
return Objects.hash(name, careType);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InsuranceContractSalesContracts {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" careTyp... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-article-api\src\main\java\io\swagger\client\model\InsuranceContractSalesContracts.java | 2 |
请完成以下Java代码 | static class ExternalTaskStateImpl implements ExternalTaskState {
public final int stateCode;
protected final String name;
public ExternalTaskStateImpl(int stateCode, String string) {
this.stateCode = stateCode;
this.name = string;
}
public int getStateCode() {
return stateCode;... | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ExternalTaskStateImpl other = (ExternalTaskStateImpl) obj;
return stateCode == other.stateCode;
}
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\history\ExternalTaskState.java | 1 |
请完成以下Java代码 | protected void checkSignature(String appKey, String signature, String timestamp, OpenApiAuth openApiAuth) {
if(openApiAuth==null){
throw new JeecgBootException("不存在认证信息");
}
if(!appKey.equals(openApiAuth.getAk())){
throw new JeecgBootException("appkey错误");
}
... | MessageDigest md = MessageDigest.getInstance("MD5");
md.update(sourceStr.getBytes("utf-8"));
byte[] hash = md.digest();
int i;
StringBuffer buf = new StringBuffer(32);
for (int offset = 0; offset < hash.length; offset++) {
i = hash[offset];
... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\openapi\filter\ApiAuthFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ContactType getContact() {
return contact;
}
/**
* Sets the value of the contact property.
*
* @param value
* allowed object is
* {@link ContactType }
*
*/
public void setContact(ContactType value) {
this.contact = value;
}
/*... | *
*/
public AddressType getAddress() {
return address;
}
/**
* Sets the value of the address property.
*
* @param value
* allowed object is
* {@link AddressType }
*
*/
public void setAddress(AddressType value) {
this.address = v... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\BusinessEntityType.java | 2 |
请完成以下Java代码 | public ConfigureConnectionsResult configureConnectionsIfArgsProvided(@Nullable final CommandLineOptions commandLineOptions)
{
if (commandLineOptions == null)
{
return new ConfigureConnectionsResult(false);
}
// CConnection
ConfigureConnectionsResult result;
if (Check.isNotBlank(commandLineOptions.getDb... | // RabbitMQ
if (Check.isNotBlank(commandLineOptions.getRabbitHost()))
{
System.setProperty("spring.rabbitmq.host", commandLineOptions.getRabbitHost());
}
if (commandLineOptions.getRabbitPort() != null)
{
System.setProperty("spring.rabbitmq.port", Integer.toString(commandLineOptions.getRabbitPort()));
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\de\metas\util\ConnectionUtil.java | 1 |
请完成以下Java代码 | private JsonDeliveryOrderParcel toJsonDeliveryOrderLine(@NonNull final DeliveryOrderParcel line)
{
return JsonDeliveryOrderParcel.builder()
.id(line.getId() != null ? String.valueOf(line.getId().getRepoId()) : null)
.content(line.getContent())
.grossWeightKg(line.getGrossWeightKg())
.packageDimension... | .collect(ImmutableList.toImmutableList()));
}
@NonNull
private JsonMappingConfig toJsonMappingConfig(@NonNull final ShipperMappingConfig config)
{
final CarrierProduct carrierProduct = config.getCarrierProductId() != null ? carrierProductRepository.getCachedShipperProductById(config.getCarrierProductId()) : null... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.commons\src\main\java\de\metas\shipper\gateway\commons\converters\v1\JsonShipperConverter.java | 1 |
请完成以下Java代码 | public int getDATEV_ExportFormat_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_DATEV_ExportFormat_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Decimal Separator.
@param DecimalSeparator Decimal Separator */
@Override
public void setDecimalSeparator (java.lang.String DecimalSe... | */
@Override
public java.lang.String getName ()
{
return (java.lang.String)get_Value(COLUMNNAME_Name);
}
/** Set Number Grouping Separator.
@param NumberGroupingSeparator Number Grouping Separator */
@Override
public void setNumberGroupingSeparator (java.lang.String NumberGroupingSeparator)
{
set_Valu... | repos\metasfresh-new_dawn_uat\backend\de.metas.datev\src\main\java-gen\de\metas\datev\model\X_DATEV_ExportFormat.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PaymentReservationCaptureRepository
{
public void save(@NonNull final PaymentReservationCapture capture)
{
final I_C_Payment_Reservation_Capture captureRecord = capture.getId() != null
? load(capture.getId(), I_C_Payment_Reservation_Capture.class)
: newInstance(I_C_Payment_Reservation_Capture.c... | private static PaymentReservationCaptureId extractCaptureId(final I_C_Payment_Reservation_Capture captureRecord)
{
return PaymentReservationCaptureId.ofRepoId(captureRecord.getC_Payment_Reservation_Capture_ID());
}
@SuppressWarnings("unused")
private static PaymentReservationCapture toPaymentReservationCapture(@... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\payment\reservation\PaymentReservationCaptureRepository.java | 2 |
请完成以下Java代码 | public class XxlJobLogReport {
private int id;
private Date triggerDay;
private int runningCount;
private int sucCount;
private int failCount;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Date getTriggerDay() {
... | public int getSucCount() {
return sucCount;
}
public void setSucCount(int sucCount) {
this.sucCount = sucCount;
}
public int getFailCount() {
return failCount;
}
public void setFailCount(int failCount) {
this.failCount = failCount;
}
} | repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-xxljob\src\main\java\com\xxl\job\admin\core\model\XxlJobLogReport.java | 1 |
请完成以下Java代码 | class DebugLogbackConfigurator extends LogbackConfigurator {
DebugLogbackConfigurator(LoggerContext context) {
super(context);
}
@Override
<T extends Converter<?>> void conversionRule(String conversionWord, Class<T> converterClass,
Supplier<T> converterSupplier) {
info("Adding conversion rule of type '" + ... | if (appender != null) {
info("Adding appender '" + appender + "' to logger '" + name + "'");
}
super.logger(name, level, additive, appender);
}
@Override
void start(LifeCycle lifeCycle) {
info("Starting '" + lifeCycle + "'");
super.start(lifeCycle);
}
private void info(String message) {
getContext()... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\logging\logback\DebugLogbackConfigurator.java | 1 |
请完成以下Java代码 | private static class HUReportRequest
{
@NonNull Properties ctx;
@NonNull AdProcessId adProcessId;
int windowNo;
@NonNull PrintCopies copies;
AdProcessId adJasperProcessId;
@NonNull OptionalBoolean printPreview;
@Nullable String adLanguage;
boolean onErrorThrowException;
@NonNull ImmutableSet<HuId> hu... | {
Check.assume(copies.toInt() > 0, "copies > 0");
Check.assumeNotEmpty(huIdsToProcess, "huIdsToProcess is not empty");
this.ctx = ctx;
this.adProcessId = adProcessId;
this.windowNo = windowNo > 0 ? windowNo : Env.WINDOW_None;
this.copies = copies;
this.adJasperProcessId = adJasperProcessId;
thi... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\report\HUReportExecutor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Book implements Serializable {
/**
* 编号
*/
@Id
@GeneratedValue
private Long id;
/**
* 书名
*/
private String name;
/**
* 作者
*/
private String writer;
/**
* 简介
*/
private String introduction;
public Long getId() {
... | this.name = name;
}
public String getWriter() {
return writer;
}
public void setWriter(String writer) {
this.writer = writer;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introductio... | repos\springboot-learning-example-master\chapter-5-spring-boot-data-jpa\src\main\java\demo\springboot\domain\Book.java | 2 |
请完成以下Java代码 | public class HelloApplicationRunListener implements SpringApplicationRunListener {
public HelloApplicationRunListener(SpringApplication application, String[] args) {
}
@Override
public void starting() {
System.out.println("HelloApplicationRunListener starting......");
}
@Override
... | @Override
public void started(ConfigurableApplicationContext context) {
}
@Override
public void running(ConfigurableApplicationContext context) {
}
@Override
public void failed(ConfigurableApplicationContext context, Throwable exception) {
}
} | repos\SpringAll-master\45.Spring-Boot-SpringApplication\src\main\java\com\example\demo\listener\HelloApplicationRunListener.java | 1 |
请完成以下Java代码 | public static LockFailedException wrapIfNeeded(final Exception e)
{
if (e instanceof LockFailedException)
{
return (LockFailedException)e;
}
else
{
return new LockFailedException("Lock failed: " + e.getLocalizedMessage(), e);
}
}
public LockFailedException(final String message)
{
super(message)... | @Override
public LockFailedException setSql(final String sql, final Object[] sqlParams)
{
super.setSql(sql, sqlParams);
return this;
}
public LockFailedException setRecordToLock(final TableRecordReference recordToLock)
{
super.setRecord(recordToLock);
return this;
}
public LockFailedException setExisti... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\lock\exceptions\LockFailedException.java | 1 |
请完成以下Java代码 | public JSONNotificationsList getNotifications(
@RequestParam(name = "limit", defaultValue = "-1") final int limit //
)
{
userSession.assertLoggedIn();
final UserId adUserId = userSession.getLoggedUserId();
final UserNotificationsList notifications = userNotificationsService.getNotifications(adUserId, QueryL... | @DeleteMapping
public void deleteByIds(@RequestParam(name = "ids") final String notificationIdsListStr)
{
userSession.assertLoggedIn();
final UserId adUserId = userSession.getLoggedUserId();
final List<String> notificationIds = Splitter.on(",")
.trimResults()
.omitEmptyStrings()
.splitToList(notif... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\notification\NotificationRestController.java | 1 |
请完成以下Java代码 | public static String getLocalIpAddress() {
try {
return Inet4Address.getLocalHost()
.getHostAddress();
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
}
public static List<String> getAllLocalIpAddressUsingNetworkInterface() {
... | try {
if (!networkInterface.isUp() || networkInterface.isLoopback()) {
continue;
}
} catch (SocketException e) {
throw new RuntimeException(e);
}
Enumeration<InetAddress> address = networkInterface.getInetAddresses(... | repos\tutorials-master\core-java-modules\core-java-networking-3\src\main\java\com\baeldung\iplookup\IPAddressLookup.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DubboShutdownMetadata extends AbstractDubboMetadata {
public Map<String, Object> shutdown() throws Exception {
Map<String, Object> shutdownCountData = new LinkedHashMap<>();
// registries
int registriesCount = getRegistries().size();
// protocols
int protoco... | }
shutdownCountData.put("services", serviceBeansMap.size());
// Reference Beans
ReferenceAnnotationBeanPostProcessor beanPostProcessor = getReferenceAnnotationBeanPostProcessor();
int referencesCount = beanPostProcessor.getReferenceBeans().size();
beanPostProcessor.destroy();
... | repos\dubbo-spring-boot-project-master\dubbo-spring-boot-compatible\actuator\src\main\java\org\apache\dubbo\spring\boot\actuate\endpoint\metadata\DubboShutdownMetadata.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public CommonResult<OmsOrderDetail> detail(@PathVariable Long id) {
OmsOrderDetail orderDetailResult = orderService.detail(id);
return CommonResult.success(orderDetailResult);
}
@ApiOperation("修改收货人信息")
@RequestMapping(value = "/update/receiverInfo", method = RequestMethod.POST)
@Respon... | }
@ApiOperation("备注订单")
@RequestMapping(value = "/update/note", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateNote(@RequestParam("id") Long id,
@RequestParam("note") String note,
@RequestParam("status") Integer... | repos\mall-master\mall-admin\src\main\java\com\macro\mall\controller\OmsOrderController.java | 2 |
请完成以下Java代码 | public LookupValuesList getAttributeTypeahead(final String attributeName, final String query)
{
throw new UnsupportedOperationException();
// return asiDoc.getFieldLookupValuesForQuery(attributeName, query);
}
@Override
public LookupValuesList getAttributeDropdown(final String attributeName)
{
throw new Unsu... | .collect(Collectors.toList());
jsonDocument.setFields(jsonFields);
return jsonDocument;
}
private JSONDocumentField toJSONDocumentField(final IDocumentFieldView field, final JSONOptions jsonOpts)
{
final String fieldName = field.getFieldName();
final Object jsonValue = field.getValueAsJsonObject(jsonOpts)... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\ASIViewRowAttributes.java | 1 |
请完成以下Java代码 | 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) {
if (this == obj) {
return true;
... | return false;
}
if (getClass() != obj.getClass()) {
return false;
}
BusinessKeyBook other = (BusinessKeyBook) obj;
return Objects.equals(isbn, other.getIsbn());
}
@Override
public int hashCode() {
return Objects.hash(isbn);
}
} | repos\Hibernate-SpringBoot-master\HibernateSpringBootLombokEqualsAndHashCode\src\main\java\com\app\BusinessKeyBook.java | 1 |
请完成以下Java代码 | public class FloatWrapperLookup extends Lookup {
private Float[] elements;
private final float pivot = 2;
@Override
@Setup
public void prepare() {
float common = 1;
elements = new Float[s];
for (int i = 0; i < s - 1; i++) {
elements[i] = common;
}
... | @BenchmarkMode(Mode.AverageTime)
public int findPosition() {
int index = 0;
Float pivotWrapper = pivot;
while (!pivotWrapper.equals(elements[index])) {
index++;
}
return index;
}
@Override
public String getSimpleClassName() {
return FloatWrapp... | repos\tutorials-master\core-java-modules\core-java-lang-2\src\main\java\com\baeldung\primitive\FloatWrapperLookup.java | 1 |
请完成以下Java代码 | private void onEmptyElement() throws XMLStreamException {
state = SEEN_ELEMENT;
if (depth > 0) {
super.writeCharacters("\n");
}
doIndent();
}
/**
* Print indentation for the current level.
*
* @exception org.xml.sax.SAXException
* If ... | public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
onEmptyElement();
super.writeEmptyElement(namespaceURI, localName);
}
public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
onEmptyE... | repos\Activiti-develop\activiti-core\activiti-bpmn-converter\src\main\java\org\activiti\bpmn\converter\IndentingXMLStreamWriter.java | 1 |
请完成以下Java代码 | public String getAlias()
{
return m_alias;
} // getAlias
/**
* Column has Alias.
* (i.e. has a key)
* @return true if Alias
*/
public boolean hasAlias()
{
return !m_columnName.equals(m_alias);
} // hasAlias
/**
* Column value forces page break
* @return true if page break
*/
public boole... | * @return info
*/
public String toString()
{
StringBuffer sb = new StringBuffer("PrintDataColumn[");
sb.append("ID=").append(m_AD_Column_ID)
.append("-").append(m_columnName);
if (hasAlias())
sb.append("(").append(m_alias).append(")");
sb.append(",DisplayType=").append(m_displayType)
.append(",Siz... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\PrintDataColumn.java | 1 |
请完成以下Java代码 | public void addField(String field) {
this.fields.add(field);
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName;
}
public String getName() {
return name;
}
... | public boolean existSameField(String fieldString) {
String[] controlFields = fieldString.split(",");
for (String sqlField : fields) {
for (String controlField : controlFields) {
if (sqlField.equals(controlField)) {
// 非常明确的列直接比较
... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\security\AbstractQueryBlackListHandler.java | 1 |
请完成以下Java代码 | public MigrationInstructionsBuilder mapEqualActivities() {
this.mapEqualActivities = true;
return this;
}
@Override
public MigrationPlanBuilder setVariables(Map<String, ?> variables) {
if (variables instanceof VariableMapImpl) {
this.variables = (VariableMapImpl) variables;
} else if (varia... | return mapEqualActivities;
}
public VariableMap getVariables() {
return variables;
}
public boolean isUpdateEventTriggersForGeneratedInstructions() {
return updateEventTriggersForGeneratedInstructions;
}
public List<MigrationInstructionImpl> getExplicitMigrationInstructions() {
return explici... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\migration\MigrationPlanBuilderImpl.java | 1 |
请完成以下Java代码 | private void configureSsl(AbstractHttp11Protocol<?> protocol, @Nullable SslBundle sslBundle,
Map<String, SslBundle> serverNameSslBundles) {
protocol.setSSLEnabled(true);
if (sslBundle != null) {
addSslHostConfig(protocol, protocol.getDefaultSSLHostConfigName(), sslBundle);
}
serverNameSslBundles.forEach((... | }
private void configureSslClientAuth(SSLHostConfig config) {
config.setCertificateVerification(ClientAuth.map(this.clientAuth, "none", "optional", "required"));
}
private void configureSslStores(SSLHostConfig sslHostConfig, SSLHostConfigCertificate certificate,
SslStoreBundle stores) {
try {
if (stores.... | repos\spring-boot-4.0.1\module\spring-boot-tomcat\src\main\java\org\springframework\boot\tomcat\SslConnectorCustomizer.java | 1 |
请完成以下Java代码 | public String getTypeName() {
return JSON;
}
public boolean isCachable() {
return true;
}
public Object getValue(ValueFields valueFields) {
Object loadedValue = null;
if (valueFields.getTextValue() != null && valueFields.getTextValue().length() > 0) {
try {
... | logger.error("Error writing json variable " + valueFields.getName(), e);
}
}
public boolean isAbleToStore(Object value) {
if (value == null) {
return true;
}
if (
JsonNode.class.isAssignableFrom(value.getClass()) ||
(objectMapper.canSerialize... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\variable\JsonType.java | 1 |
请完成以下Java代码 | public int getRecord_ID()
{
return get_ValueAsInt(COLUMNNAME_Record_ID);
}
@Override
public void setRoot_AD_Table_ID (final int Root_AD_Table_ID)
{
if (Root_AD_Table_ID < 1)
set_Value (COLUMNNAME_Root_AD_Table_ID, null);
else
set_Value (COLUMNNAME_Root_AD_Table_ID, Root_AD_Table_ID);
}
@Override... | }
/**
* Severity AD_Reference_ID=541949
* Reference name: Severity
*/
public static final int SEVERITY_AD_Reference_ID=541949;
/** Notice = N */
public static final String SEVERITY_Notice = "N";
/** Error = E */
public static final String SEVERITY_Error = "E";
@Override
public void setSeverity (final ja... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Record_Warning.java | 1 |
请完成以下Java代码 | default Optional<String> getTableName()
{
return Optional.empty();
}
default Optional<WindowId> getZoomIntoWindowId()
{
return Optional.empty();
}
@Override
boolean equals(Object obj);
@Override
int hashCode();
LookupDataSourceFetcher getLookupDataSourceFetcher();
boolean isHighVolume();
LookupSou... | default int getSearchStringMinLength()
{
return -1;
}
default Optional<Duration> getSearchStartDelay()
{
return Optional.empty();
}
default <T extends LookupDescriptor> T cast(final Class<T> ignoredLookupDescriptorClass)
{
@SuppressWarnings("unchecked")
final T thisCasted = (T)this;
return thisCasted... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\LookupDescriptor.java | 1 |
请完成以下Java代码 | public void onDeviceConnect(MqttPublishMessage mqttMsg) throws AdaptorException {
if (isJsonPayloadType()) {
onDeviceConnectJson(mqttMsg);
} else {
onDeviceConnectProto(mqttMsg);
}
}
public void onDeviceTelemetry(MqttPublishMessage mqttMsg) throws AdaptorExceptio... | }
@Override
protected GatewayDeviceSessionContext newDeviceSessionCtx(GetOrCreateDeviceFromGatewayResponse msg) {
return new GatewayDeviceSessionContext(this, msg.getDeviceInfo(), msg.getDeviceProfile(), mqttQoSMap, transportService);
}
public void onGatewayUpdate(TransportProtos.SessionInfoPr... | repos\thingsboard-master\common\transport\mqtt\src\main\java\org\thingsboard\server\transport\mqtt\session\GatewaySessionHandler.java | 1 |
请完成以下Java代码 | public boolean isLiteralText() {
return node.isLiteralText();
}
/**
* @return <code>true</code> if this is a method invocation expression
*/
@Override
public boolean isParametersProvided() {
return node.isMethodInvocation();
}
/**
* Answer <code>true</code> if th... | }
if (type != other.type) {
return false;
}
if (!Arrays.equals(types, other.types)) {
return false;
}
return (getStructuralId().equals(other.getStructuralId()) && bindings.equals(other.bindings));
}
return false;... | repos\Activiti-develop\activiti-core-common\activiti-juel-jakarta\src\main\java\org\activiti\core\el\juel\TreeMethodExpression.java | 1 |
请完成以下Java代码 | public class UniqueIdGenerator {
private static final String ALPHANUMERIC = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
private static final SecureRandom random = new SecureRandom();
private int idLength = 8; // Default length
/**
* Overrides the default ID length for g... | * @return A unique alphanumeric string.
*/
public String generateUniqueId(Set<String> existingIds) {
String newId;
do {
newId = generateRandomString(this.idLength);
} while (existingIds.contains(newId));
return newId;
}
private String generateRandomString(in... | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-10\src\main\java\com\baeldung\algorithms\randomuniqueidentifier\UniqueIdGenerator.java | 1 |
请完成以下Java代码 | public class SubConversationImpl extends ConversationNodeImpl implements SubConversation {
protected static ChildElementCollection<ConversationNode> conversationNodeCollection;
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(SubConvers... | conversationNodeCollection = sequenceBuilder.elementCollection(ConversationNode.class)
.build();
typeBuilder.build();
}
public SubConversationImpl(ModelTypeInstanceContext instanceContext) {
super(instanceContext);
}
public Collection<ConversationNode> getConversationNodes() {
return conver... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\SubConversationImpl.java | 1 |
请完成以下Java代码 | public class FilterIterator<E> implements Iterator<E>, IteratorWrapper<E>
{
private final Iterator<E> iterator;
private final Predicate<E> predicate;
private E next;
private boolean nextSet = false;
public FilterIterator(final Iterator<E> iterator, final Predicate<E> predicate)
{
super();
if (iterator == nu... | {
throw new NoSuchElementException();
}
}
nextSet = false;
return next;
}
/**
* Set next valid element
*
* @return true if next valid element was found and set
*/
private final boolean setNextValid()
{
while (iterator.hasNext())
{
final E element = iterator.next();
if (predicate.tes... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\collections\FilterIterator.java | 1 |
请完成以下Java代码 | public class JwtUserDto implements UserDetails {
@ApiModelProperty(value = "用户")
private final UserDto user;
@ApiModelProperty(value = "数据权限")
private final List<Long> dataScopes;
@ApiModelProperty(value = "角色权限")
private final List<AuthorityDto> authorities;
public Set<String> getRoles(... | }
@JSONField(serialize = false)
@Override
public boolean isAccountNonLocked() {
return true;
}
@JSONField(serialize = false)
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
@JSONField(serialize = false)
public boolean isEnabled... | repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\security\service\dto\JwtUserDto.java | 1 |
请完成以下Java代码 | public void forEach(BiConsumer<String, String> action) {
this.properties.forEach(action::accept);
}
@Override
public CharSequence getNormalForm(Iterable<? extends CharSequence> tokens) {
return PREFIX + Util.joinAsCamelCase(tokens);
}
@Override
public int getPriority() {
return -200;
}
@Override | public @Nullable String getProperty(String key) {
return this.properties.get(key);
}
@Override
public boolean containsProperty(String key) {
return this.properties.containsKey(key);
}
@Override
public Collection<String> getPropertyNames() {
return this.properties.keySet();
}
} | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\logging\log4j2\SpringBootPropertySource.java | 1 |
请完成以下Java代码 | public Date getDueDate(final I_SEPA_Export_Line line)
{
// NOTE: for now, return SystemTime + 1
// return TimeUtil.addDays(line.getSEPA_Export().getPaymentDate(), 1);
// ts: unrelated: don'T add another day, because it turn our that it makes the creditors get their money one day after they expected it
final T... | return SEPACreditTransferXML.builder()
.filename(FileUtil.stripIllegalCharacters(sepaExport.getDocumentNo()) + ".xml")
.contentType(MimeType.TYPE_XML)
.content(out.toByteArray())
.build();
}
private SEPAMarshaler newSEPAMarshaler(@NonNull final SEPAProtocol protocol, @NonNull final SEPAExportContext ... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\base\src\main\java\de\metas\payment\sepa\api\impl\SEPADocumentBL.java | 1 |
请完成以下Java代码 | public String asValue()
{
Check.assume(Type.VALUE.equals(type),
"The type of this instance needs to be {}; this={}", Type.VALUE, this);
final Matcher valueMatcher = Type.VALUE.pattern.matcher(rawValue);
if (!valueMatcher.matches())
{
throw new AdempiereException("External identifier of Value parsing f... | @AllArgsConstructor
@Getter
public enum Type
{
METASFRESH_ID(Pattern.compile("^\\d+$")),
EXTERNAL_REFERENCE(Pattern.compile("^ext-([a-zA-Z0-9_]+)-(.+)$")),
GLN(Pattern.compile("^gln-(.+)")),
/**
* GLN with an optional additional label that can be used in case metasfresh has multiple BPartners which share... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalreference\src\main\java\de\metas\externalreference\ExternalIdentifier.java | 1 |
请完成以下Java代码 | protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception {
SequenceFlow sequenceFlow = new SequenceFlow();
BpmnXMLUtil.addXMLLocation(sequenceFlow, xtr);
sequenceFlow.setSourceRef(xtr.getAttributeValue(null, ATTRIBUTE_FLOW_SOURCE_REF));
sequenceFlo... | writeDefaultAttribute(ATTRIBUTE_FLOW_TARGET_REF, sequenceFlow.getTargetRef(), xtw);
if (StringUtils.isNotEmpty(sequenceFlow.getSkipExpression())) {
writeDefaultAttribute(ATTRIBUTE_FLOW_SKIP_EXPRESSION, sequenceFlow.getSkipExpression(), xtw);
}
}
@Override
protected void writeAdd... | repos\Activiti-develop\activiti-core\activiti-bpmn-converter\src\main\java\org\activiti\bpmn\converter\SequenceFlowXMLConverter.java | 1 |
请完成以下Java代码 | public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
/**
* @return the label
*/
public String getLabel() {
return label;
}
/**
* @param label the label to set
*/
public void setLabel(String label) {
this.label = label;
}
/*... | this.value = value;
}
public String getSlotTitle() {
return slotTitle;
}
public void setSlotTitle(String slotTitle) {
this.slotTitle = slotTitle;
}
public Integer getRuleFlag() {
return ruleFlag;
}
public void setRuleFlag(Integer ruleFlag) {
this.ruleFlag = ruleFlag;
}
} | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\TreeModel.java | 1 |
请完成以下Java代码 | /* package */void collectEvent(final IDocumentFieldChangedEvent event)
{
final boolean init_isKey = false;
final boolean init_publicField = true;
final boolean init_advancedField = false;
final DocumentFieldWidgetType init_widgetType = event.getWidgetType();
fieldChangesOf(event.getFieldName(), init_isKey, i... | return allowDelete;
}
IncludedDetailInfo setAllowDelete(final LogicExpressionResult allowDelete)
{
this.allowDelete = allowDelete;
return this;
}
private void collectFrom(final IncludedDetailInfo from)
{
if (from.stale)
{
stale = from.stale;
}
if (from.allowNew != null)
{
allo... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\DocumentChanges.java | 1 |
请在Spring Boot框架中完成以下Java代码 | class OAuth2ClientConfigurations {
@Configuration(proxyBeanMethods = false)
@ConditionalOnOAuth2ClientRegistrationProperties
@EnableConfigurationProperties(OAuth2ClientProperties.class)
@ConditionalOnMissingBean(ClientRegistrationRepository.class)
static class ClientRegistrationRepositoryConfiguration {
@Bean
... | @Configuration(proxyBeanMethods = false)
@ConditionalOnBean(ClientRegistrationRepository.class)
static class OAuth2AuthorizedClientServiceConfiguration {
@Bean
@ConditionalOnMissingBean
OAuth2AuthorizedClientService authorizedClientService(
ClientRegistrationRepository clientRegistrationRepository) {
re... | repos\spring-boot-4.0.1\module\spring-boot-security-oauth2-client\src\main\java\org\springframework\boot\security\oauth2\client\autoconfigure\OAuth2ClientConfigurations.java | 2 |
请完成以下Java代码 | public void execute(@NonNull final Runnable command)
{
try
{
logger.debug("Going to acquire semaphore{}", semaphore.toString());
semaphore.acquire();
logger.debug("Done acquiring semaphore={}", semaphore.toString());
}
catch (final InterruptedException e)
{
logger.warn("execute - InterruptedExcep... | catch (final Throwable t)
{
logger.error("execute - Caught throwable while running command=" + command + "; -> rethrow", t);
throw t;
}
finally
{
semaphore.release();
logger.debug("Released semaphore={}", semaphore);
}
}
};
try
{
delegate.execute(r); // don't expect R... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\concurrent\BlockingExecutorWrapper.java | 1 |
请完成以下Java代码 | public String getTenantIdLike() {
return tenantIdLike;
}
public boolean isWithoutTenantId() {
return withoutTenantId;
}
public boolean isIncludeTaskLocalVariables() {
return includeTaskLocalVariables;
}
public boolean isIncludeProcessVariables() {
return includ... | public String getTaskId() {
return taskId;
}
public String getTaskDefinitionKey() {
return taskDefinitionKey;
}
public String getTaskOwnerLike() {
return taskOwnerLike;
}
public String getTaskOwner() {
return taskOwner;
}
public String getTaskParentTas... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\HistoricTaskInstanceQueryImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected final <T extends AbstractEntity> Map<String, T> mapByUuid(final List<T> list)
{
if (list.isEmpty())
{
return new HashMap<>();
}
final Map<String, T> map = new HashMap<>(list.size());
for (final T entry : list)
{
final String uuid = entry.getUuid();
final T entryOld = map.put(uuid, entry... | protected <T extends IConfirmableDTO> T assertNotDeleteRequest_WarnAndFix(@NonNull final T syncModel, final String reason)
{
if (syncModel.isDeleted())
{
logger.warn("Setting Deleted flag to " + syncModel + " is not allowed while: " + reason + ". Unsetting the flag and going forward.");
return (T)syncModel.w... | repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\sync\AbstractSyncImportService.java | 2 |
请完成以下Java代码 | public long sumThenReset() {
Cell[] as = cells; Cell a;
long sum = base;
base = 0L;
if (as != null) {
for (int i = 0; i < as.length; ++i) {
if ((a = as[i]) != null) {
sum += a.value;
a.value = 0L;
}
... | */
private final long value;
SerializationProxy(LongAdder a) {
value = a.sum();
}
/**
* Return a {@code LongAdder} object with initial state
* held by this proxy.
*
* @return a {@code LongAdder} object with initial state
* held b... | repos\tutorials-master\jmh\src\main\java\com\baeldung\falsesharing\LongAdder.java | 1 |
请完成以下Java代码 | protected String doIt() throws Exception
{
final IQueryBL queryBL = Services.get(IQueryBL.class);
final EventDescriptor eventDescriptor = EventDescriptor.ofClientAndOrg(Env.getClientAndOrgId());
queryBL.createQueryBuilder(I_MD_Candidate.class)
.addOnlyActiveRecordsFilter()
.filter(getProcessInfo().getQ... | if (context.isNoSelection())
{
return ProcessPreconditionsResolution.rejectBecauseNoSelection();
}
final boolean atLeastOneProperCandidateSelected = context.streamSelectedModels(I_MD_Candidate.class)
.anyMatch(selectedRecord -> hasSupportedBusinessCase.test(selectedRecord)
&& statusIsDocPlanned.tes... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java\de\metas\material\dispo\commons\process\MD_Candidate_Request_MaterialDocument.java | 1 |
请完成以下Java代码 | public CRPException setPP_Order(I_PP_Order order)
{
this.order = order;
resetMessageBuilt();
return this;
}
public CRPException setOrderActivity(PPOrderRoutingActivity orderActivity)
{
this.orderActivity = orderActivity;
resetMessageBuilt();
return this;
}
public CRPException setS_Resource(I_S_Resou... | final String info;
if (order instanceof IDocument)
{
info = ((IDocument)order).getSummary();
}
else
{
info = "" + order.getDocumentNo() + "/" + order.getDatePromised();
}
sb.append(" @PP_Order_ID@:").append(info);
}
if (this.orderActivity != null)
{
sb.append(" @PP_Order_Node_ID@:"... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\exceptions\CRPException.java | 1 |
请完成以下Java代码 | public class ProcessLoggerExporterMonitor implements IExporterMonitor
{
private static final Logger logger = LogManager.getLogger(ProcessLoggerExporterMonitor.class);
private final AdProcessId adProcessId;
private final Object params;
private final Class<?> paramsInterfaceClass;
private I_AD_PInstance pinstance;... | pinstance.setErrorMsg(error.getLocalizedMessage());
}
InterfaceWrapperHelper.save(pinstance);
}
}
private I_AD_PInstance createPInstance()
{
final I_AD_PInstance pinstance = Services.get(IADPInstanceDAO.class).createAD_PInstance(adProcessId);
pinstance.setIsProcessing(true);
InterfaceWrapperHelper.sav... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\data\export\api\impl\ProcessLoggerExporterMonitor.java | 1 |
请完成以下Java代码 | private static void answerWithEcho(ByteBuffer buffer, SelectionKey key) throws IOException {
SocketChannel client = (SocketChannel) key.channel();
int r = client.read(buffer);
if (r == -1 || new String(buffer.array()).trim()
.equals(POISON_PILL)) {
client.close();
... | SocketChannel client = serverSocket.accept();
client.configureBlocking(false);
client.register(selector, SelectionKey.OP_READ);
}
public static Process start() throws IOException, InterruptedException {
String javaHome = System.getProperty("java.home");
String javaBin = javaHome... | repos\tutorials-master\core-java-modules\core-java-nio\src\main\java\com\baeldung\selector\EchoServer.java | 1 |
请完成以下Java代码 | public java.lang.String getStructuredRemittanceInfo ()
{
return (java.lang.String)get_Value(COLUMNNAME_StructuredRemittanceInfo);
}
/** Set Swift code.
@param SwiftCode
Swift Code or BIC
*/
@Override
public void setSwiftCode (java.lang.String SwiftCode)
{
set_Value (COLUMNNAME_SwiftCode, SwiftCode);... | @Override
public void setIsGroupLine (final boolean IsGroupLine)
{
set_Value (COLUMNNAME_IsGroupLine, IsGroupLine);
}
@Override
public boolean isGroupLine()
{
return get_ValueAsBoolean(COLUMNNAME_IsGroupLine);
}
@Override
public void setNumberOfReferences (final int NumberOfReferences)
{
set_Value (CO... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\base\src\main\java-gen\de\metas\payment\sepa\model\X_SEPA_Export_Line.java | 1 |
请完成以下Java代码 | public class JsonLegacyQueryOrderingPropertyConverter {
public static final String ORDER_BY_DELIMITER = ",";
public static JsonLegacyQueryOrderingPropertyConverter INSTANCE =
new JsonLegacyQueryOrderingPropertyConverter();
public List<QueryOrderingProperty> fromOrderByString(String orderByString) {
L... | String[] propertyParts = propertyPart.split("\\.");
String property = null;
if (propertyParts.length == 1) {
property = propertyParts[0];
} else if (propertyParts.length == 2) {
property = propertyParts[1];
} else {
throw new ProcessEngineException("Invalid order by prop... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\json\JsonLegacyQueryOrderingPropertyConverter.java | 1 |
请完成以下Java代码 | private void showErrorMessage(String message) {
HTMLDivElement errorDiv = (HTMLDivElement) DomGlobal.document.createElement("div");
errorDiv.textContent = message;
errorDiv.classList.add("errorMessage");
addTaskButton.parentNode.insertBefore(errorDiv, taskList);
DomGlobal.setTim... | private void rewriteURLwithUUID(String newUUID) {
String url = DomGlobal.window.location.href;
URLSearchParams params = new URLSearchParams(DomGlobal.window.location.search);
params.set("uuid", newUUID);
// If original had ?... we replace; otherwise append ?uuid=...
String baseU... | repos\tutorials-master\j2cl\src\main\java\com\baeldung\j2cl\taskmanager\MyJ2CLApp.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DummyEdqsService implements EdqsService {
@Override
public void onUpdate(TenantId tenantId, EntityId entityId, Object entity) {}
@Override
public void onUpdate(TenantId tenantId, ObjectType objectType, EdqsObject object) {}
@Override
public void onDelete(TenantId tenantId, Entity... | public void processSystemRequest(ToCoreEdqsRequest request) {}
@Override
public void processSystemMsg(ToCoreEdqsMsg request) {}
@Override
public boolean isApiEnabled() {
return getState().isApiEnabled();
}
@Override
public EdqsState getState() {
return new EdqsState();
... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\query\DummyEdqsService.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.