conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
I_M_PriceList_Version getCreatePriceListVersion(ProductPriceCreateRequest request);
=======
I_M_PriceList getPriceListByPriceListVersionId(PriceListVersionId priceListVersionId);
>>>>>>>
I_M_PriceList_Version getCreatePriceListVersion(ProductPriceCreateRequest request);
I_M_PriceList getPriceListByPriceListVersionId(PriceListVersionId priceListVersionId); |
<<<<<<<
import org.adempiere.service.OrgId;
import org.adempiere.util.Services;
import org.adempiere.warehouse.LocatorId;
import org.adempiere.warehouse.WarehouseId;
import org.adempiere.warehouse.api.IWarehouseBL;
import org.adempiere.warehouse.api.IWarehouseDAO;
import org.compiere.model.I_M_Warehouse;
=======
>>>>>>>
import org.adempiere.service.OrgId;
import org.adempiere.warehouse.LocatorId;
import org.adempiere.warehouse.WarehouseId;
import org.adempiere.warehouse.api.IWarehouseBL;
import org.adempiere.warehouse.api.IWarehouseDAO;
import org.compiere.model.I_M_Warehouse; |
<<<<<<<
import org.adempiere.service.ClientId;
import org.adempiere.service.OrgId;
import org.adempiere.util.Check;
import org.adempiere.util.Services;
=======
>>>>>>>
import org.adempiere.service.ClientId;
import org.adempiere.service.OrgId;
<<<<<<<
import org.adempiere.util.time.SystemTime;
import org.adempiere.warehouse.WarehouseId;
=======
>>>>>>>
import org.adempiere.warehouse.WarehouseId; |
<<<<<<<
tboml.setAD_PInstance_ID(getAD_PInstance_ID());
tboml.setM_CostElement_ID(costElement.getId());
=======
tboml.setAD_PInstance_ID(getPinstanceId().getRepoId());
tboml.setM_CostElement_ID(costElement.getM_CostElement_ID());
>>>>>>>
tboml.setAD_PInstance_ID(getPinstanceId().getRepoId());
tboml.setM_CostElement_ID(costElement.getId()); |
<<<<<<<
import java.util.Optional;
import java.util.function.Supplier;
import javax.annotation.Nullable;
=======
import javax.annotation.Nullable;
>>>>>>>
import java.util.function.Supplier;
import javax.annotation.Nullable;
<<<<<<<
import org.compiere.model.I_C_UOM;
import org.compiere.util.Util;
=======
>>>>>>>
<<<<<<<
import de.metas.quantity.Quantity;
import de.metas.vendor.gateway.api.ProductAndQuantity;
import de.metas.vendor.gateway.api.order.PurchaseOrderRequestItem;
=======
import de.metas.quantity.Quantity;
>>>>>>>
import de.metas.quantity.Quantity;
<<<<<<<
/** If a sales order line is referenced, then this is the line's qtyOrdered minus qtyDelivered */
private final Quantity salesOrderQtyToDeliver;
/** ..in {@link PurchaseCandidateImmutableFields#getUomId()} */
@NonNull
private BigDecimal qtyToPurchase;
=======
@NonNull
private Quantity qtyToPurchase;
>>>>>>>
@NonNull
private Quantity qtyToPurchase;
<<<<<<<
@Nullable final OrderAndLineId salesOrderAndLineId,
=======
final OrderAndLineId salesOrderAndLineId,
final boolean prepared,
>>>>>>>
@Nullable final OrderAndLineId salesOrderAndLineId,
final boolean prepared,
<<<<<<<
@NonNull final BigDecimal qtyToPurchase,
@Nullable final Quantity salesOrderQtyToDeliver,
=======
@NonNull final Quantity qtyToPurchase,
>>>>>>>
@NonNull final Quantity qtyToPurchase,
<<<<<<<
dateRequiredInitial = dateRequired;
}
public PurchaseOrderRequestItem createPurchaseOrderRequestItem()
{
return PurchaseOrderRequestItem.builder()
.purchaseCandidateId(PurchaseCandidateId.getRepoIdOr(id, -1))
.productAndQuantity(createProductAndQuantity())
.build();
}
// TODO: move this thing out
public ProductAndQuantity createProductAndQuantity()
{
final String productValue = getVendorProductInfo().getProductNo();
final Supplier<BigDecimal> orderLineQty = () -> {
if (getSalesOrderQtyToDeliver() == null)
{
return null;
}
return Services.get(IUOMConversionBL.class)
.convertToProductUOM(getSalesOrderQtyToDeliver(), getProductId().getRepoId())
.getQty();
};
final Supplier<BigDecimal> purchaseQty = () -> {
final I_C_UOM uomRecord = loadOutOfTrx(getUomId(), I_C_UOM.class);
final Quantity quantity = Quantity.of(getQtyToPurchase(), uomRecord);
return Services.get(IUOMConversionBL.class)
.convertToProductUOM(quantity, getProductId().getRepoId())
.getQty();
};
final BigDecimal qtyToDeliver = Util.coalesceSuppliers(orderLineQty, purchaseQty);
return ProductAndQuantity.of(productValue, qtyToDeliver);
=======
purchaseDatePromisedInitial = purchaseDatePromised;
>>>>>>>
purchaseDatePromisedInitial = purchaseDatePromised; |
<<<<<<<
import de.metas.product.IProductBL;
=======
import de.metas.util.Services;
>>>>>>>
import de.metas.product.IProductBL;
import de.metas.util.Services;
<<<<<<<
// To
int M_LocatorTo_ID = wh.getDefaultLocator().getM_Locator_ID();
// From: Look-up Storage
String MMPolicy = Services.get(IProductBL.class).getMMPolicy(replenish.getM_Product_ID());
=======
// To
int M_LocatorTo_ID = Services.get(IWarehouseBL.class).getDefaultLocator(wh).getM_Locator_ID();
// From: Look-up Storage
MProduct product = MProduct.get(getCtx(), replenish.getM_Product_ID());
String MMPolicy = product.getMMPolicy();
>>>>>>>
// To
int M_LocatorTo_ID = Services.get(IWarehouseBL.class).getDefaultLocator(wh).getM_Locator_ID();
// From: Look-up Storage
String MMPolicy = Services.get(IProductBL.class).getMMPolicy(replenish.getM_Product_ID()); |
<<<<<<<
import org.adempiere.model.InterfaceWrapperHelper;
import org.adempiere.util.Check;
import org.adempiere.util.Services;
import org.compiere.model.I_C_AllocationLine;
=======
>>>>>>>
import org.adempiere.model.InterfaceWrapperHelper;
import org.compiere.model.I_C_AllocationLine; |
<<<<<<<
private Boolean enableFieldMatching;
private Boolean ignoreAmbiguity;
=======
Boolean enableFieldMatching;
Boolean ignoreAmbiguity;
private Boolean fullTypeMatchingRequired;
>>>>>>>
Boolean enableFieldMatching;
Boolean ignoreAmbiguity;
private Boolean fullTypeMatchingRequired;
<<<<<<<
provider = source.provider;
propertyCondition = source.propertyCondition;
=======
provider = source.provider;
propertyCondition = source.propertyCondition;
fullTypeMatchingRequired = source.fullTypeMatchingRequired;
>>>>>>>
provider = source.provider;
propertyCondition = source.propertyCondition;
fullTypeMatchingRequired = source.fullTypeMatchingRequired;
<<<<<<<
public Configuration setAmbiguityIgnored(boolean ignore) {
this.ignoreAmbiguity = ignore;
return this;
}
=======
public boolean isFullTypeMatchingRequired() {
return fullTypeMatchingRequired == null ? parent.isFullTypeMatchingRequired() : fullTypeMatchingRequired;
}
>>>>>>>
public boolean isFullTypeMatchingRequired() {
return fullTypeMatchingRequired == null ? parent.isFullTypeMatchingRequired()
: fullTypeMatchingRequired;
}
public Configuration setAmbiguityIgnored(boolean ignore) {
this.ignoreAmbiguity = ignore;
return this;
}
<<<<<<<
public Configuration setFieldMatchingEnabled(boolean enabled) {
enableFieldMatching = enabled;
return this;
}
=======
public Configuration setFullTypeMatchingRequired(boolean required) {
fullTypeMatchingRequired = required;
return this;
}
>>>>>>>
public Configuration setFieldMatchingEnabled(boolean enabled) {
enableFieldMatching = enabled;
return this;
}
public Configuration setFullTypeMatchingRequired(boolean required) {
fullTypeMatchingRequired = required;
return this;
} |
<<<<<<<
import com.google.common.collect.Multimaps;
import com.google.common.collect.UnmodifiableIterator;
import ch.qos.logback.classic.Level;
=======
import de.metas.bpartner.BPartnerContactId;
>>>>>>>
<<<<<<<
=======
import org.adempiere.ad.dao.IQueryBL;
import org.adempiere.ad.dao.QueryLimit;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.mm.attributes.AttributeSetInstanceId;
import org.adempiere.mm.attributes.api.IAttributeDAO;
import org.adempiere.mm.attributes.api.ImmutableAttributeSet;
import org.adempiere.util.lang.IPair;
import org.compiere.model.I_C_Order;
import org.compiere.model.I_C_OrderLine;
import org.compiere.util.Env;
import org.slf4j.Logger;
import org.slf4j.MDC;
import org.springframework.stereotype.Service;
import javax.annotation.Nullable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.function.Function;
import static de.metas.inoutcandidate.exportaudit.APIExportStatus.ExportedAndError;
import static de.metas.inoutcandidate.exportaudit.APIExportStatus.ExportedAndForwarded;
>>>>>>>
import org.adempiere.ad.dao.IQueryBL;
import org.adempiere.ad.dao.QueryLimit;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.mm.attributes.AttributeSetInstanceId;
import org.adempiere.mm.attributes.api.IAttributeDAO;
import org.adempiere.mm.attributes.api.ImmutableAttributeSet;
import org.adempiere.util.lang.IPair;
import org.compiere.model.I_C_Order;
import org.compiere.model.I_C_OrderLine;
import org.compiere.util.Env;
import org.slf4j.Logger;
import org.slf4j.MDC;
import org.springframework.stereotype.Service;
import javax.annotation.Nullable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.function.Function;
import static de.metas.inoutcandidate.exportaudit.APIExportStatus.ExportedAndError;
import static de.metas.inoutcandidate.exportaudit.APIExportStatus.ExportedAndForwarded;
import static de.metas.inoutcandidate.exportaudit.APIExportStatus.Pending;
<<<<<<<
final APIExportAuditBuilder<ShipmentScheduleExportAuditItem> auditBuilder = APIExportAudit
.<ShipmentScheduleExportAuditItem> builder()
.transactionId(transactionKey);
=======
>>>>>>> |
<<<<<<<
final ProductId productId = ProductId.ofRepoId(20);
final int vendorBPartnerId = 30;
=======
final int productId = 20;
final BPartnerId vendorBPartnerId = BPartnerId.ofRepoId(30);
>>>>>>>
final ProductId productId = ProductId.ofRepoId(20);
final BPartnerId vendorBPartnerId = BPartnerId.ofRepoId(30); |
<<<<<<<
import de.metas.product.ProductId;
=======
import de.metas.util.Services;
>>>>>>>
import de.metas.product.ProductId;
import de.metas.util.Services; |
<<<<<<<
import org.compiere.model.I_M_Product;
import org.eevolution.api.ComponentIssueCreateRequest;
=======
>>>>>>>
import org.eevolution.api.ComponentIssueCreateRequest; |
<<<<<<<
import de.metas.money.CurrencyId;
=======
import de.metas.organization.IOrgDAO;
import de.metas.organization.OrgId;
import de.metas.organization.OrgInfo;
import de.metas.organization.OrgInfoUpdateRequest;
>>>>>>>
import de.metas.money.CurrencyId;
import de.metas.organization.IOrgDAO;
import de.metas.organization.OrgId;
import de.metas.organization.OrgInfo;
import de.metas.organization.OrgInfoUpdateRequest; |
<<<<<<<
=======
package de.metas.product;
import de.metas.organization.OrgId;
import de.metas.util.ISingletonService;
import de.metas.util.lang.ExternalId;
import lombok.Builder;
import lombok.NonNull;
import lombok.Value;
import org.compiere.model.I_M_Product;
import org.compiere.model.I_M_Product_Category;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.stream.Stream;
import static de.metas.common.util.CoalesceUtil.coalesce;
import static de.metas.util.Check.assume;
import static de.metas.util.Check.isEmpty;
>>>>>>>
package de.metas.product;
import de.metas.organization.OrgId;
import de.metas.util.ISingletonService;
import de.metas.util.lang.ExternalId;
import lombok.Builder;
import lombok.NonNull;
import lombok.Value;
import org.adempiere.util.lang.ImmutablePair;
import org.compiere.model.I_M_Product;
import org.compiere.model.I_M_Product_Category;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.stream.Stream;
import static de.metas.common.util.CoalesceUtil.coalesce;
import static de.metas.util.Check.assume;
import static de.metas.util.Check.isEmpty;
<<<<<<<
package de.metas.product;
import static de.metas.util.Check.assume;
import static de.metas.util.Check.isEmpty;
import static de.metas.common.util.CoalesceUtil.coalesce;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.adempiere.util.lang.ImmutablePair;
import org.compiere.model.I_M_Product;
import org.compiere.model.I_M_Product_Category;
import de.metas.organization.OrgId;
import de.metas.util.ISingletonService;
import de.metas.util.lang.ExternalId;
import lombok.Builder;
import lombok.NonNull;
import lombok.Value;
=======
>>>>>>> |
<<<<<<<
import org.adempiere.service.OrgId;
import org.adempiere.util.Services;
import org.adempiere.warehouse.WarehouseId;
=======
>>>>>>>
import org.adempiere.service.OrgId;
import org.adempiere.warehouse.WarehouseId; |
<<<<<<<
@NonNull final ITranslatableString description,
@NonNull final List<PickingRow> rows,
@NonNull final PickingCandidateCommand pickingCandidateCommand)
=======
final ITranslatableString description,
final Supplier<List<PickingRow>> rowsSupplier)
>>>>>>>
@NonNull final ITranslatableString description,
@NonNull final Supplier<List<PickingRow>> rowsSupplier,
@NonNull final PickingCandidateCommand pickingCandidateCommand)
<<<<<<<
this.rows = Maps.uniqueIndex(rows, PickingRow::getId);
this.pickingCandidateCommand = pickingCandidateCommand;
=======
this.rowsSupplier = ExtendedMemorizingSupplier.of(() -> Maps.uniqueIndex(rowsSupplier.get(), PickingRow::getId));
>>>>>>>
this.rowsSupplier = ExtendedMemorizingSupplier.of(() -> Maps.uniqueIndex(rowsSupplier.get(), PickingRow::getId));
this.pickingCandidateCommand = pickingCandidateCommand;
<<<<<<<
/**
* Does nothing.
*/
=======
>>>>>>>
<<<<<<<
=======
rowsSupplier.forget();
ViewChangesCollector.getCurrentOrAutoflush()
.collectFullyChanged(this);
>>>>>>>
rowsSupplier.forget();
ViewChangesCollector.getCurrentOrAutoflush()
.collectFullyChanged(this); |
<<<<<<<
import java.util.stream.Stream;
=======
import java.util.Set;
>>>>>>>
import java.util.Set;
import java.util.stream.Stream;
<<<<<<<
I_M_InOut getById(final InOutId inoutId);
=======
I_M_InOut getById(InOutId inoutId);
>>>>>>>
I_M_InOut getById(InOutId inoutId);
<<<<<<<
Stream<InOutId> streamInOutIdsByBPartnerId(BPartnerId bpartnerId);
=======
Set<InOutAndLineId> retrieveLinesForInOutId(InOutId inOutId);
>>>>>>>
Stream<InOutId> streamInOutIdsByBPartnerId(BPartnerId bpartnerId);
Set<InOutAndLineId> retrieveLinesForInOutId(InOutId inOutId); |
<<<<<<<
/*
* #%L
* de.metas.fresh.base
* %%
* Copyright (C) 2015 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
import org.adempiere.ad.process.ISvrProcessDefaultParametersProvider;
=======
>>>>>>>
<<<<<<<
import org.compiere.model.GridField;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
=======
>>>>>>>
import org.compiere.model.GridField; |
<<<<<<<
import org.adempiere.util.Check;
import org.adempiere.util.Services;
import org.adempiere.warehouse.WarehouseId;
=======
>>>>>>>
import org.adempiere.warehouse.WarehouseId; |
<<<<<<<
Doc<?> getOrNull(final Properties ctx, MAcctSchema[] ass, int AD_Table_ID, int Record_ID, String trxName);
=======
Doc getOrNull(Properties ctx, MAcctSchema[] ass, TableRecordReference documentRef);
>>>>>>>
Doc<?> getOrNull(Properties ctx, MAcctSchema[] ass, TableRecordReference documentRef); |
<<<<<<<
import org.adempiere.mm.attributes.AttributeSetInstanceId;
=======
import javax.annotation.Nullable;
>>>>>>>
import org.adempiere.mm.attributes.AttributeSetInstanceId;
import javax.annotation.Nullable;
<<<<<<<
=======
if (pricingConditionsResult == null)
{
return;
}
>>>>>>>
if (pricingConditionsResult == null)
{
return;
} |
<<<<<<<
import org.adempiere.minventory.api.IInventoryDAO;
import org.adempiere.util.Services;
import org.compiere.model.I_C_AcctSchema;
=======
import org.adempiere.model.InterfaceWrapperHelper;
import org.adempiere.util.Services;
>>>>>>>
import org.adempiere.util.Services;
import org.compiere.model.I_C_AcctSchema;
<<<<<<<
@Override
protected void loadDocumentDetails()
=======
/**
* Load Document Details
* @return error message or null
*/
@Override
protected String loadDocumentDetails()
>>>>>>>
@Override
protected void loadDocumentDetails()
<<<<<<<
return Services.get(IInventoryDAO.class)
.retrieveLinesForInventory(inventory)
.stream()
.map(line -> new DocLine_Inventory(line, this))
.filter(docLine -> !docLine.getQty().isZero())
.collect(ImmutableList.toImmutableList());
}
=======
ArrayList<DocLine> list = new ArrayList<>();
for (final I_M_InventoryLine line : Services.get(IInventoryDAO.class).retrieveLinesForInventoryId(inventory.getM_Inventory_ID()))
{
final Quantity qty = Services.get(IInventoryBL.class).getMovementQty(line);
if(qty.signum() == 0)
{
// nothing to post
continue;
}
//
DocLine docLine = new DocLine (InterfaceWrapperHelper.getPO(line), this);
docLine.setQty (qty.getQty(), false); // -5 => -5
docLine.setReversalLine_ID(line.getReversalLine_ID());
log.debug(docLine.toString());
list.add (docLine);
}
>>>>>>>
return Services.get(IInventoryDAO.class)
.retrieveLinesForInventoryId(inventory.getM_Inventory_ID())
.stream()
.map(line -> new DocLine_Inventory(line, this))
.filter(docLine -> !docLine.getQty().isZero())
.collect(ImmutableList.toImmutableList());
}
<<<<<<<
@Override
public List<Fact> createFacts(final MAcctSchema as)
=======
@Override
public BigDecimal getBalance()
>>>>>>>
@Override
public List<Fact> createFacts(final MAcctSchema as)
<<<<<<<
private void createFactsForInventoryLine(final Fact fact, final DocLine_Inventory line)
=======
@Override
public ArrayList<Fact> createFacts (MAcctSchema as)
>>>>>>>
private void createFactsForInventoryLine(final Fact fact, final DocLine_Inventory line)
<<<<<<<
=======
//
ArrayList<Fact> facts = new ArrayList<>();
facts.add(fact);
return facts;
} // createFact
>>>>>>> |
<<<<<<<
=======
/*
* #%L
* de.metas.adempiere.libero.libero
* %%
* Copyright (C) 2015 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
import java.math.BigDecimal;
import java.util.Date;
>>>>>>>
<<<<<<<
=======
import org.adempiere.util.lang.IContextAware;
import org.compiere.model.I_C_UOM;
>>>>>>>
/*
* #%L
* de.metas.adempiere.libero.libero
* %%
* Copyright (C) 2015 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/ |
<<<<<<<
final Doc<?> doc = docFactory.getOrNull(ctx, ass, AD_Table_ID, Record_ID, trxName);
=======
final Doc doc = docFactory.getOrNull(ctx, ass, documentRef);
>>>>>>>
final Doc<?> doc = docFactory.getOrNull(ctx, ass, documentRef); |
<<<<<<<
import org.adempiere.location.CountryId;
import org.adempiere.util.ISingletonService;
=======
>>>>>>>
import org.adempiere.location.CountryId; |
<<<<<<<
import org.adempiere.ad.dao.IQueryBL;
import org.adempiere.model.InterfaceWrapperHelper;
import org.adempiere.util.Services;
=======
import org.adempiere.ad.dao.IQueryBL;
import org.adempiere.model.InterfaceWrapperHelper;
import org.adempiere.util.LegacyAdapters;
import org.adempiere.util.Services;
>>>>>>>
import org.adempiere.ad.dao.IQueryBL;
import org.adempiere.model.InterfaceWrapperHelper;
import org.adempiere.util.Services;
<<<<<<<
} // MExpenseType
/** Cached Product */
private I_M_Product m_product = null;
/**
* Get Product
*
* @return product
*/
private I_M_Product getProduct()
=======
} // MExpenseType
/** Cached Product */
private I_M_Product product = null;
private I_M_Product getProduct()
>>>>>>>
} // MExpenseType
/** Cached Product */
private I_M_Product product = null;
/**
* Get Product
*
* @return product
*/
private I_M_Product getProduct()
<<<<<<<
}
m_product = InterfaceWrapperHelper.newInstance(I_M_Product.class);
m_product.setProductType(X_M_Product.PRODUCTTYPE_ExpenseType);
updateProductFromExpenseType(m_product, this);
InterfaceWrapperHelper.save(m_product);
=======
}
product = new MProduct(this);
InterfaceWrapperHelper.save(product);
>>>>>>>
}
product = InterfaceWrapperHelper.newInstance(I_M_Product.class);
product.setProductType(X_M_Product.PRODUCTTYPE_ExpenseType);
updateProductFromExpenseType(product, this);
InterfaceWrapperHelper.save(product);
<<<<<<<
} // beforeSave
/**
* After Save
*
* @param newRecord new
* @param success success
* @return success
*/
=======
} // beforeSave
>>>>>>>
} // beforeSave
<<<<<<<
final I_M_Product product = getProduct();
if(updateProductFromExpenseType(product, this))
{
InterfaceWrapperHelper.save(product);
}
=======
MProduct prod = LegacyAdapters.convertToPO(getProduct());
if (prod.setExpenseType(this))
{
prod.saveEx(get_TrxName());
}
>>>>>>>
final I_M_Product product = getProduct();
if(updateProductFromExpenseType(product, this))
{
InterfaceWrapperHelper.save(product);
} |
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
import org.n52.iceland.exception.ows.OwsExceptionReport;
>>>>>>>
import org.n52.iceland.exception.ows.OwsExceptionReport; |
<<<<<<<
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.deser.std.StdConvertingDeserializer;
=======
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.deser.std.StdDelegatingDeserializer;
>>>>>>>
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.deser.std.StdConvertingDeserializer; |
<<<<<<<
import org.compiere.model.I_C_BPartner;
=======
import org.compiere.model.I_AD_OrgInfo;
>>>>>>>
import org.compiere.model.I_AD_OrgInfo;
import org.compiere.model.I_C_BPartner;
<<<<<<<
order.setAD_Org_ID(bp.getAD_OrgBP_ID());
MOrgInfo oi = MOrgInfo.get(getCtx(), bp.getAD_OrgBP_ID());
=======
order.setAD_Org_ID(bp.getAD_OrgBP_ID_Int());
final I_AD_OrgInfo oi = Services.get(IOrgDAO.class).retrieveOrgInfo(getCtx(), bp.getAD_OrgBP_ID_Int(), ITrx.TRXNAME_None);
>>>>>>>
order.setAD_Org_ID(bp.getAD_OrgBP_ID());
final I_AD_OrgInfo oi = Services.get(IOrgDAO.class).retrieveOrgInfo(getCtx(), bp.getAD_OrgBP_ID(), ITrx.TRXNAME_None);
<<<<<<<
bp = Services.get(IBPartnerDAO.class).getById(detail.getC_BPartner_ID());
MOrgInfo oi_target = MOrgInfo.get(getCtx(), bp.getAD_OrgBP_ID());
=======
bp = new MBPartner(getCtx(), detail.getC_BPartner_ID(), get_TrxName());
final I_AD_OrgInfo oi_target = Services.get(IOrgDAO.class).retrieveOrgInfo(getCtx(), bp.getAD_OrgBP_ID_Int(),ITrx.TRXNAME_None);
>>>>>>>
bp = Services.get(IBPartnerDAO.class).getById(detail.getC_BPartner_ID());
final I_AD_OrgInfo oi_target = Services.get(IOrgDAO.class).retrieveOrgInfo(getCtx(), bp.getAD_OrgBP_ID(),ITrx.TRXNAME_None); |
<<<<<<<
import org.adempiere.util.Services;
import org.adempiere.warehouse.WarehouseId;
import org.adempiere.warehouse.api.IWarehouseBL;
import org.adempiere.warehouse.api.IWarehouseDAO;
import org.compiere.model.I_M_Warehouse;
=======
>>>>>>>
import org.adempiere.warehouse.WarehouseId;
import org.adempiere.warehouse.api.IWarehouseBL;
import org.adempiere.warehouse.api.IWarehouseDAO;
import org.compiere.model.I_M_Warehouse; |
<<<<<<<
import java.util.Optional;
=======
import java.util.Map;
>>>>>>>
import java.util.Optional;
import java.util.Map;
<<<<<<<
import org.adempiere.ad.dao.ICompositeQueryUpdater;
import org.adempiere.ad.dao.IQueryBL;
=======
import org.adempiere.ad.trx.api.ITrxManager;
>>>>>>>
import org.adempiere.ad.dao.ICompositeQueryUpdater;
import org.adempiere.ad.dao.IQueryBL;
import org.adempiere.ad.trx.api.ITrxManager;
<<<<<<<
@Override
public Optional<Quantity> getCatchQtyOverride(@NonNull final I_M_ShipmentSchedule shipmentScheduleRecord)
{
final boolean hasCatchOverrideQty = !isNull(shipmentScheduleRecord, I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliverCatch_Override);
final boolean hasCatchUOM = shipmentScheduleRecord.getCatch_UOM_ID() > 0;
if (!hasCatchUOM)
{
return Optional.empty();
}
if (!hasCatchOverrideQty)
{
return Optional.empty();
}
final Quantity result = Quantitys.create(
shipmentScheduleRecord.getQtyToDeliverCatch_Override(),
UomId.ofRepoId(shipmentScheduleRecord.getCatch_UOM_ID()));
return Optional.of(result);
}
@Override
public void resetCatchQtyOverride(@NonNull final I_M_ShipmentSchedule shipmentScheduleRecord)
{
shipmentScheduleRecord.setQtyToDeliverCatch_Override(null);
saveRecord(shipmentScheduleRecord);
}
@Override
public void updateCatchUoms(@NonNull final ProductId productId, long delayMs)
{
if (delayMs < 0)
{
return; // doing nothing
}
// lambda doesn't work; see https://stackoverflow.com/questions/37970682/passing-lambda-to-a-timer-instead-of-timertask
final TimerTask task = new TimerTask()
{
@Override
public void run()
{
updateCatchUoms(productId);
}
};
if (delayMs <= 0)
{
task.run(); // run directly
return;
}
logger.info("Going to update shipment schedules for M_Product_ID={} in {}ms", productId.getRepoId(), delayMs);
final String timerName = ShipmentScheduleBL.class.getSimpleName() + "-updateCatchUoms-productId=" + productId.getRepoId();
new Timer(timerName).schedule(task, delayMs);
}
private void updateCatchUoms(@NonNull final ProductId productId)
{
final Stopwatch stopwatch = Stopwatch.createStarted();
final Integer catchUomRepoId = Services.get(IProductBL.class)
.getCatchUOMId(productId)
.map(UomId::getRepoId)
.orElse(null);
final IQueryBL queryBL = Services.get(IQueryBL.class);
final ICompositeQueryUpdater<I_M_ShipmentSchedule> queryUpdater = queryBL
.createCompositeQueryUpdater(I_M_ShipmentSchedule.class)
.addSetColumnValue(I_M_ShipmentSchedule.COLUMNNAME_Catch_UOM_ID, catchUomRepoId);
final ILockManager lockManager = Services.get(ILockManager.class);
final int count = queryBL
.createQueryBuilder(I_M_ShipmentSchedule.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_M_ShipmentSchedule.COLUMN_M_Product_ID, productId)
.addNotEqualsFilter(I_M_ShipmentSchedule.COLUMN_Catch_UOM_ID, catchUomRepoId)
.addEqualsFilter(I_M_ShipmentSchedule.COLUMN_Processed, false)
.filter(lockManager.getNotLockedFilter(I_M_ShipmentSchedule.class))
.create()
.update(queryUpdater);
final long durationSecs = stopwatch.stop().elapsed(TimeUnit.SECONDS);
logger.info("Updated {} shipment schedules for M_Product_ID={} in {}seconds", count, productId.getRepoId(), durationSecs);
}
=======
@Override
public Map<ShipmentScheduleId, I_M_ShipmentSchedule> getByIdsOutOfTrx(final Set<ShipmentScheduleId> ids)
{
return Services.get(IShipmentSchedulePA.class).getByIdsOutOfTrx(ids);
}
@Override
public BPartnerId getBPartnerId(@NonNull final I_M_ShipmentSchedule schedule)
{
final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class);
return shipmentScheduleEffectiveBL.getBPartnerId(schedule);
}
@Override
public WarehouseId getWarehouseId(@NonNull final I_M_ShipmentSchedule schedule)
{
final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class);
return shipmentScheduleEffectiveBL.getWarehouseId(schedule);
}
@Override
public ZonedDateTime getPreparationDate(I_M_ShipmentSchedule schedule)
{
final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class);
return TimeUtil.asZonedDateTime(shipmentScheduleEffectiveBL.getPreparationDate(schedule));
}
@Override
public void applyUserChanges(@NonNull final ShipmentScheduleUserChangeRequestsList userChanges)
{
final ITrxManager trxManager = Services.get(ITrxManager.class);
trxManager.runInThreadInheritedTrx(() -> applyUserChangesInTrx(userChanges));
}
private void applyUserChangesInTrx(@NonNull ShipmentScheduleUserChangeRequestsList userChanges)
{
final IShipmentSchedulePA shipmentSchedulesRepo = Services.get(IShipmentSchedulePA.class);
final Set<ShipmentScheduleId> shipmentScheduleIds = userChanges.getShipmentScheduleIds();
final Map<ShipmentScheduleId, I_M_ShipmentSchedule> recordsById = shipmentSchedulesRepo.getByIds(shipmentScheduleIds);
for (final ShipmentScheduleId shipmentScheduleId : shipmentScheduleIds)
{
final ShipmentScheduleUserChangeRequest userChange = userChanges.getByShipmentScheduleId(shipmentScheduleId);
final I_M_ShipmentSchedule record = recordsById.get(shipmentScheduleId);
if (record == null)
{
// shall not happen
logger.warn("No record found for {}. Skip applying user changes: {}", shipmentScheduleId, userChange);
continue;
}
updateRecord(record, userChange);
shipmentSchedulesRepo.save(record);
}
}
private static void updateRecord(
@NonNull final I_M_ShipmentSchedule record,
@NonNull final ShipmentScheduleUserChangeRequest from)
{
if (from.getQtyToDeliverOverride() != null)
{
record.setQtyToDeliver_Override(from.getQtyToDeliverOverride());
}
if (from.getAsiId() != null)
{
record.setM_AttributeSetInstance_ID(from.getAsiId().getRepoId());
}
}
>>>>>>>
@Override
public Optional<Quantity> getCatchQtyOverride(@NonNull final I_M_ShipmentSchedule shipmentScheduleRecord)
{
final boolean hasCatchOverrideQty = !isNull(shipmentScheduleRecord, I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliverCatch_Override);
final boolean hasCatchUOM = shipmentScheduleRecord.getCatch_UOM_ID() > 0;
if (!hasCatchUOM)
{
return Optional.empty();
}
if (!hasCatchOverrideQty)
{
return Optional.empty();
}
final Quantity result = Quantitys.create(
shipmentScheduleRecord.getQtyToDeliverCatch_Override(),
UomId.ofRepoId(shipmentScheduleRecord.getCatch_UOM_ID()));
return Optional.of(result);
}
@Override
public void resetCatchQtyOverride(@NonNull final I_M_ShipmentSchedule shipmentScheduleRecord)
{
shipmentScheduleRecord.setQtyToDeliverCatch_Override(null);
saveRecord(shipmentScheduleRecord);
}
@Override
public void updateCatchUoms(@NonNull final ProductId productId, long delayMs)
{
if (delayMs < 0)
{
return; // doing nothing
}
// lambda doesn't work; see https://stackoverflow.com/questions/37970682/passing-lambda-to-a-timer-instead-of-timertask
final TimerTask task = new TimerTask()
{
@Override
public void run()
{
updateCatchUoms(productId);
}
};
if (delayMs <= 0)
{
task.run(); // run directly
return;
}
logger.info("Going to update shipment schedules for M_Product_ID={} in {}ms", productId.getRepoId(), delayMs);
final String timerName = ShipmentScheduleBL.class.getSimpleName() + "-updateCatchUoms-productId=" + productId.getRepoId();
new Timer(timerName).schedule(task, delayMs);
}
private void updateCatchUoms(@NonNull final ProductId productId)
{
final Stopwatch stopwatch = Stopwatch.createStarted();
final Integer catchUomRepoId = Services.get(IProductBL.class)
.getCatchUOMId(productId)
.map(UomId::getRepoId)
.orElse(null);
final IQueryBL queryBL = Services.get(IQueryBL.class);
final ICompositeQueryUpdater<I_M_ShipmentSchedule> queryUpdater = queryBL
.createCompositeQueryUpdater(I_M_ShipmentSchedule.class)
.addSetColumnValue(I_M_ShipmentSchedule.COLUMNNAME_Catch_UOM_ID, catchUomRepoId);
final ILockManager lockManager = Services.get(ILockManager.class);
final int count = queryBL
.createQueryBuilder(I_M_ShipmentSchedule.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_M_ShipmentSchedule.COLUMN_M_Product_ID, productId)
.addNotEqualsFilter(I_M_ShipmentSchedule.COLUMN_Catch_UOM_ID, catchUomRepoId)
.addEqualsFilter(I_M_ShipmentSchedule.COLUMN_Processed, false)
.filter(lockManager.getNotLockedFilter(I_M_ShipmentSchedule.class))
.create()
.update(queryUpdater);
final long durationSecs = stopwatch.stop().elapsed(TimeUnit.SECONDS);
logger.info("Updated {} shipment schedules for M_Product_ID={} in {}seconds", count, productId.getRepoId(), durationSecs);
}
@Override
public Map<ShipmentScheduleId, I_M_ShipmentSchedule> getByIdsOutOfTrx(final Set<ShipmentScheduleId> ids)
{
return Services.get(IShipmentSchedulePA.class).getByIdsOutOfTrx(ids);
}
@Override
public BPartnerId getBPartnerId(@NonNull final I_M_ShipmentSchedule schedule)
{
final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class);
return shipmentScheduleEffectiveBL.getBPartnerId(schedule);
}
@Override
public WarehouseId getWarehouseId(@NonNull final I_M_ShipmentSchedule schedule)
{
final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class);
return shipmentScheduleEffectiveBL.getWarehouseId(schedule);
}
@Override
public ZonedDateTime getPreparationDate(I_M_ShipmentSchedule schedule)
{
final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class);
return TimeUtil.asZonedDateTime(shipmentScheduleEffectiveBL.getPreparationDate(schedule));
}
@Override
public void applyUserChanges(@NonNull final ShipmentScheduleUserChangeRequestsList userChanges)
{
final ITrxManager trxManager = Services.get(ITrxManager.class);
trxManager.runInThreadInheritedTrx(() -> applyUserChangesInTrx(userChanges));
}
private void applyUserChangesInTrx(@NonNull ShipmentScheduleUserChangeRequestsList userChanges)
{
final IShipmentSchedulePA shipmentSchedulesRepo = Services.get(IShipmentSchedulePA.class);
final Set<ShipmentScheduleId> shipmentScheduleIds = userChanges.getShipmentScheduleIds();
final Map<ShipmentScheduleId, I_M_ShipmentSchedule> recordsById = shipmentSchedulesRepo.getByIds(shipmentScheduleIds);
for (final ShipmentScheduleId shipmentScheduleId : shipmentScheduleIds)
{
final ShipmentScheduleUserChangeRequest userChange = userChanges.getByShipmentScheduleId(shipmentScheduleId);
final I_M_ShipmentSchedule record = recordsById.get(shipmentScheduleId);
if (record == null)
{
// shall not happen
logger.warn("No record found for {}. Skip applying user changes: {}", shipmentScheduleId, userChange);
continue;
}
updateRecord(record, userChange);
shipmentSchedulesRepo.save(record);
}
}
private static void updateRecord(
@NonNull final I_M_ShipmentSchedule record,
@NonNull final ShipmentScheduleUserChangeRequest from)
{
if (from.getQtyToDeliverOverride() != null)
{
record.setQtyToDeliver_Override(from.getQtyToDeliverOverride());
}
if (from.getAsiId() != null)
{
record.setM_AttributeSetInstance_ID(from.getAsiId().getRepoId());
}
} |
<<<<<<<
/**
* Throw an error message if the sysconfig for mandatory pricing conditions is set ( see de.metas.order.impl.OrderLineBL.SYSCONFIG_NoPriceConditionsColorName) but the order contains lines that don't have the pricing conditions set.
*/
void failForMissingPricingConditions(de.metas.adempiere.model.I_C_Order order);
=======
int getC_PaymentTerm_ID(org.compiere.model.I_C_OrderLine orderLine);
PriceLimitRuleResult computePriceLimit(org.compiere.model.I_C_OrderLine orderLine);
>>>>>>>
/**
* Throw an error message if the sysconfig for mandatory pricing conditions is set ( see de.metas.order.impl.OrderLineBL.SYSCONFIG_NoPriceConditionsColorName) but the order contains lines that don't have the pricing conditions set.
*/
void failForMissingPricingConditions(de.metas.adempiere.model.I_C_Order order);
int getC_PaymentTerm_ID(org.compiere.model.I_C_OrderLine orderLine);
PriceLimitRuleResult computePriceLimit(org.compiere.model.I_C_OrderLine orderLine); |
<<<<<<<
import de.metas.costing.CostingLevel;
import de.metas.costing.CostingMethod;
=======
import lombok.NonNull;
>>>>>>>
import de.metas.costing.CostingLevel;
import de.metas.costing.CostingMethod;
import lombok.NonNull;
<<<<<<<
default boolean isItem(final int productId)
{
final I_M_Product product = loadOutOfTrx(productId, I_M_Product.class);
return isItem(product);
}
=======
boolean isItem(int productId);
>>>>>>>
boolean isItem(int productId);
<<<<<<<
/**
* Check if ASI is mandatory
*
* @param product
* @param isSOTrx is outgoing trx?
* @return true if ASI is mandatory, false otherwise
*/
boolean isASIMandatory(I_M_Product product, boolean isSOTrx);
boolean isASIMandatory(int productId, boolean isSOTrx);
=======
/**
* Has the Product Instance Attribute
*
* @return true if instance attributes
*/
boolean isInstanceAttribute(I_M_Product product);
boolean isProductInCategory(int productId, int expectedProductCategoryId);
String getProductValueAndName(int productId);
String getProductValue(ProductId productId);
String getProductName(ProductId productId);
>>>>>>>
/**
* Check if ASI is mandatory
*
* @param product
* @param isSOTrx is outgoing trx?
* @return true if ASI is mandatory, false otherwise
*/
boolean isASIMandatory(I_M_Product product, boolean isSOTrx);
boolean isASIMandatory(int productId, boolean isSOTrx);
/**
* Has the Product Instance Attribute
*
* @return true if instance attributes
*/
boolean isInstanceAttribute(I_M_Product product);
boolean isProductInCategory(int productId, int expectedProductCategoryId);
String getProductValueAndName(int productId);
String getProductValue(ProductId productId);
String getProductName(ProductId productId); |
<<<<<<<
import org.compiere.util.Util;
import org.eevolution.api.IPPOrderRoutingRepository;
=======
import org.eevolution.api.IPPOrderWorkflowDAO;
>>>>>>>
import org.eevolution.api.IPPOrderRoutingRepository; |
<<<<<<<
import de.metas.organization.OrgId;
=======
import de.metas.logging.TableRecordMDC;
>>>>>>>
import de.metas.organization.OrgId;
import de.metas.logging.TableRecordMDC;
<<<<<<<
saveBPartnerBankAccounts(bpartner.getId(), bpartnerComposite.getBankAccounts(), bpartnerComposite.getOrgId());
}
=======
saveBPartnerBankAccounts(bpartner.getId(), bpartnerComposite.getBankAccounts());
}}
>>>>>>>
saveBPartnerBankAccounts(bpartner.getId(), bpartnerComposite.getBankAccounts(), bpartnerComposite.getOrgId());
}
}
<<<<<<<
@NonNull final BPartnerLocation bpartnerLocation,
@Nullable final OrgId orgId)
{
=======
@NonNull final BPartnerLocation bpartnerLocation)
{ try(final MDCCloseable bpartnerLocationRecordMDC = TableRecordMDC.putTableRecordReference(I_C_BPartner_Location.Table_Name, bpartnerLocation.getId())){
>>>>>>>
@NonNull final BPartnerLocation bpartnerLocation,
@Nullable final OrgId orgId)
{
try (final MDCCloseable bpartnerLocationRecordMDC = TableRecordMDC.putTableRecordReference(I_C_BPartner_Location.Table_Name, bpartnerLocation.getId()))
{
<<<<<<<
@NonNull final BPartnerContact bpartnerContact,
@Nullable final OrgId orgId)
{
=======
@NonNull final BPartnerContact bpartnerContact)
{try(final MDCCloseable bpartnerContactRecordMDC = TableRecordMDC.putTableRecordReference(I_AD_User.Table_Name, bpartnerContact.getId())){
>>>>>>>
@NonNull final BPartnerContact bpartnerContact,
@Nullable final OrgId orgId)
{
try (final MDCCloseable bpartnerContactRecordMDC = TableRecordMDC.putTableRecordReference(I_AD_User.Table_Name, bpartnerContact.getId()))
{
<<<<<<<
@NonNull final BPartnerBankAccount bankAccount,
@Nullable final OrgId orgId)
{
=======
@NonNull final BPartnerBankAccount bankAccount)
{try(final MDCCloseable bankAccountRecordMDC = TableRecordMDC.putTableRecordReference(I_C_BP_BankAccount.Table_Name, bankAccount.getId())){
>>>>>>>
@NonNull final BPartnerBankAccount bankAccount,
@Nullable final OrgId orgId)
{
try (final MDCCloseable bankAccountRecordMDC = TableRecordMDC.putTableRecordReference(I_C_BP_BankAccount.Table_Name, bankAccount.getId()))
{ |
<<<<<<<
import org.adempiere.ad.dao.QueryLimit;
import lombok.NonNull;
=======
import org.adempiere.ad.dao.IQueryFilter;
import org.adempiere.archive.AdArchive;
>>>>>>>
import org.adempiere.ad.dao.IQueryFilter;
import org.adempiere.archive.AdArchive;
<<<<<<<
import org.adempiere.util.lang.impl.TableRecordReference;
=======
import org.adempiere.util.lang.ITableRecordReference;
import org.adempiere.util.lang.impl.TableRecordReference;
>>>>>>>
import org.adempiere.util.lang.impl.TableRecordReference;
import org.adempiere.util.lang.impl.TableRecordReference;
<<<<<<<
<T extends I_AD_Archive> T retrieveArchive(@NonNull ArchiveId archiveId, @NonNull Class<T> modelClass);
=======
<T> Stream<AdArchive> streamArchivesForFilter(IQueryFilter<T> outboundLogFilter, Class<T> objectClass);
void updatePrintedRecords(ImmutableSet<ArchiveId> ids, UserId userId);
>>>>>>>
<T> Stream<AdArchive> streamArchivesForFilter(IQueryFilter<T> outboundLogFilter, Class<T> objectClass);
void updatePrintedRecords(ImmutableSet<ArchiveId> ids, UserId userId);
<T extends I_AD_Archive> T retrieveArchive(@NonNull ArchiveId archiveId, @NonNull Class<T> modelClass); |
<<<<<<<
import com.fasterxml.jackson.databind.type.CoercionTargetType;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.ArrayIterator;
=======
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.type.LogicalType;
>>>>>>>
import com.fasterxml.jackson.databind.type.LogicalType;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.ArrayIterator; |
<<<<<<<
import org.adempiere.uom.api.UOMConversionContext;
import org.adempiere.util.Check;
import org.adempiere.util.Services;
import org.adempiere.util.collections.CollectionUtils;
=======
import org.adempiere.uom.api.IUOMConversionContext;
>>>>>>>
import org.adempiere.uom.api.UOMConversionContext; |
<<<<<<<
import de.metas.money.CurrencyId;
=======
import de.metas.order.OrderId;
>>>>>>>
import de.metas.money.CurrencyId;
import de.metas.order.OrderId; |
<<<<<<<
import org.adempiere.util.Services;
import org.adempiere.warehouse.WarehouseId;
import org.adempiere.warehouse.api.IWarehouseDAO;
=======
>>>>>>>
import org.adempiere.warehouse.WarehouseId;
import org.adempiere.warehouse.api.IWarehouseDAO;
<<<<<<<
=======
import de.metas.process.ProcessInfoParameter;
import de.metas.util.Services;
>>>>>>> |
<<<<<<<
=======
/**
* Flag that indicates whether (fulll) annotation resolution should
* occur: starting with 2.11 is disabled for JDK container types.
*
* @since 2.11
*/
>>>>>>>
/**
* Flag that indicates whether (fulll) annotation resolution should
* occur: starting with 2.11 is disabled for JDK container types.
*/ |
<<<<<<<
import org.adempiere.util.Services;
import org.adempiere.util.time.TimeSource;
import org.compiere.model.I_AD_Client;
=======
>>>>>>>
import org.compiere.model.I_AD_Client;
<<<<<<<
=======
import de.metas.contracts.impl.PlainContractChangeDAO;
import de.metas.util.Services;
import de.metas.util.time.TimeSource;
>>>>>>>
import de.metas.util.Services;
import de.metas.util.time.TimeSource; |
<<<<<<<
import org.compiere.model.IQuery;
import org.compiere.util.TimeUtil;
=======
import org.compiere.model.IQuery.Aggregate;
>>>>>>>
import org.compiere.model.IQuery;
import org.compiere.model.IQuery.Aggregate;
import org.compiere.util.TimeUtil;
<<<<<<<
if (multiQuery.isAddToPredefinedBuckets())
=======
private Timestamp retrieveMaxDateLessOrEqual(@NonNull final Date date)
{
final Timestamp latestDateOrNull = Services.get(IQueryBL.class)
.createQueryBuilder(I_MD_Candidate_Stock_v.class)
.addCompareFilter(I_MD_Candidate_Stock_v.COLUMN_DateProjected, Operator.LESS_OR_EQUAL, new Timestamp(date.getTime()))
.orderBy().addColumnDescending(I_MD_Candidate_Stock_v.COLUMNNAME_DateProjected).endOrderBy()
.create()
.first(I_MD_Candidate_Stock_v.COLUMNNAME_DateProjected, Timestamp.class);
return latestDateOrNull;
}
@VisibleForTesting
IQueryBuilder<I_MD_Candidate_Stock_v> createDBQueryForMaterialQuery(@NonNull final MaterialQuery query)
{
final IQueryBL queryBL = Services.get(IQueryBL.class);
final IQueryBuilder<I_MD_Candidate_Stock_v> queryBuilder = createInitialQueryBuilderForDateAndWarehouse(query);
final ICompositeQueryFilter<I_MD_Candidate_Stock_v> orFilterForDifferentStorageAttributesKeys = queryBL
.createCompositeQueryFilter(I_MD_Candidate_Stock_v.class)
.setJoinOr();
queryBuilder.filter(orFilterForDifferentStorageAttributesKeys);
for (final String storageAttributesKey : query.getStorageAttributesKeys())
>>>>>>>
if (multiQuery.isAddToPredefinedBuckets()) |
<<<<<<<
import de.metas.security.permissions.Access;
=======
import de.metas.uom.IUOMDAO;
>>>>>>>
import de.metas.security.permissions.Access;
import de.metas.uom.IUOMDAO; |
<<<<<<<
import org.adempiere.uom.api.UOMConversionContext;
import org.adempiere.util.Check;
import org.adempiere.util.Services;
=======
>>>>>>>
import org.adempiere.uom.api.UOMConversionContext; |
<<<<<<<
import org.adempiere.service.OrgId;
import org.adempiere.util.Check;
import org.adempiere.util.Services;
=======
import org.adempiere.util.lang.IContextAware;
>>>>>>>
import org.adempiere.service.OrgId; |
<<<<<<<
public boolean isEmptyStorage(@NonNull final I_M_HU hu)
{
return getStorageFactory()
.streamHUProductStorages(hu)
.allMatch(IProductStorage::isEmpty);
}
=======
public void setHUStatus(@NonNull final I_M_HU hu, @NonNull final IContextAware contextProvider,@NonNull final String huStatus)
{
final IHUStatusBL huStatusBL = Services.get(IHUStatusBL.class);
final IHUContext huContext = createMutableHUContext(contextProvider);
huStatusBL.setHUStatus(huContext, hu, huStatus);
handlingUnitsRepo.saveHU(hu);
}
>>>>>>>
public void setHUStatus(@NonNull final I_M_HU hu, @NonNull final IContextAware contextProvider,@NonNull final String huStatus)
{
final IHUStatusBL huStatusBL = Services.get(IHUStatusBL.class);
final IHUContext huContext = createMutableHUContext(contextProvider);
huStatusBL.setHUStatus(huContext, hu, huStatus);
handlingUnitsRepo.saveHU(hu);
}
public boolean isEmptyStorage(@NonNull final I_M_HU hu)
{
return getStorageFactory()
.streamHUProductStorages(hu)
.allMatch(IProductStorage::isEmpty);
} |
<<<<<<<
import de.metas.product.IProductBL;
=======
import de.metas.util.Check;
import de.metas.util.Services;
import de.metas.util.time.SystemTime;
>>>>>>>
import de.metas.product.IProductBL;
import de.metas.util.Check;
import de.metas.util.Services;
import de.metas.util.time.SystemTime; |
<<<<<<<
import org.adempiere.ad.security.IUserRolePermissions;
import org.adempiere.ad.service.IADPInstanceDAO;
=======
import org.adempiere.ad.service.IDeveloperModeBL;
>>>>>>>
<<<<<<<
* @author Jorg Janke
* @version $Id: MPInstance.java,v 1.3 2006/07/30 00:58:36 jjanke Exp $
*
=======
>>>>>>>
<<<<<<<
/**
*
*/
private static final long serialVersionUID = 209806970824523840L;
=======
// NOTE: the only reason why we are still keeping it is because we want to enforce TRXNAME_None on load
>>>>>>>
// NOTE: the only reason why we are still keeping it is because we want to enforce TRXNAME_None on load
<<<<<<<
// gh #489: I agree with warning the developer, but in DLM, we frequently use this constructor and I neither want this warning to fill the log,
// nor want an if in there to explicitly deal with this case.
// if (!Check.equals(ITrx.TRXNAME_None, trxName_IGNORED) && Services.get(IDeveloperModeBL.class).isEnabled())
// {
// final AdempiereException ex = new AdempiereException("Warning: AD_PInstance was loaded using trxName '" + trxName_IGNORED + "' while only '" + ITrx.TRXNAME_None + "' is allowed.");
// log.warn(ex.getLocalizedMessage(), ex);
// }
// New Process
=======
if (!Check.equals(ITrx.TRXNAME_None, trxName_IGNORED) && Services.get(IDeveloperModeBL.class).isEnabled())
{
final AdempiereException ex = new AdempiereException("AD_PInstance was loaded using trxName '" + trxName_IGNORED + "' while only '" + ITrx.TRXNAME_None + "' is allowed.");
log.warn(ex.getLocalizedMessage(), ex);
}
// New Process
>>>>>>>
// gh #489: I agree with warning the developer, but in DLM, we frequently use this constructor and I neither want this warning to fill the log,
// nor want an if in there to explicitly deal with this case.
// if (!Check.equals(ITrx.TRXNAME_None, trxName_IGNORED) && Services.get(IDeveloperModeBL.class).isEnabled())
// {
// final AdempiereException ex = new AdempiereException("Warning: AD_PInstance was loaded using trxName '" + trxName_IGNORED + "' while only '" + ITrx.TRXNAME_None + "' is allowed.");
// log.warn(ex.getLocalizedMessage(), ex);
// }
// New Process
<<<<<<<
/**
* Dump Log
*/
public void log()
{
log.info(toString());
MPInstanceLog[] pil = getLog();
for (int i = 0; i < pil.length; i++)
log.info(i + "=" + pil[i]);
} // log
/** Result OK = 1 */
public static final int RESULT_OK = 1;
/** Result FALSE = 0 */
public static final int RESULT_ERROR = 0;
/**
* Is it OK
* @return Result == OK
*/
public boolean isOK()
{
return getResult() == RESULT_OK;
} // isOK
// /**
// * Set Result
// * @param ok
// */
// public void setResult (boolean ok)
// {
// super.setResult (ok ? RESULT_OK : RESULT_ERROR);
// } // setResult
/**
* After Save
* @param newRecord new
* @param success success
* @return success
*/
=======
>>>>>>>
<<<<<<<
// Update Statistics
if (!newRecord
&& !isProcessing()
&& is_ValueChanged("IsProcessing"))
{
long ms = System.currentTimeMillis() - getCreated().getTime();
int seconds = (int)(ms / 1000);
if (seconds < 1)
seconds = 1;
MProcess prc = MProcess.get(getCtx(), getAD_Process_ID());
prc.addStatistics(seconds);
if (prc.get_ID() != 0 && prc.save())
log.debug("afterSave - Process Statistics updated Sec=" + seconds);
else
log.warn("afterSave - Process Statistics not updated");
}
return success;
} // afterSave
/**
* Create Process Instance Parameter and save to database
* @param seqNo parameter sequence#
* @param parameterName parameter name
* @param value parameter value
* @return
*/
public MPInstancePara createParameter(int seqNo, String parameterName, Object value)
{
MPInstancePara ip = new MPInstancePara(this, seqNo);
if (value == null)
{
ip.setParameter(parameterName, (String)null);
}
else if (value instanceof BigDecimal)
{
ip.setParameter(parameterName, (BigDecimal)value);
}
else if (value instanceof Integer)
{
ip.setParameter(parameterName, (Integer)value);
}
else if (value instanceof Timestamp)
{
ip.setParameter(parameterName, (Timestamp)value);
}
else if (value instanceof Boolean)
{
ip.setParameter(parameterName, (Boolean)value);
}
else
{
ip.setParameter(parameterName, value.toString());
}
//
ip.saveEx();
return ip;
=======
return super.beforeSave(newRecord);
>>>>>>>
return super.beforeSave(newRecord);
} |
<<<<<<<
import org.adempiere.util.Check;
import org.adempiere.util.Services;
import org.adempiere.warehouse.WarehouseId;
=======
import org.adempiere.ad.trx.api.ITrx;
import org.adempiere.model.I_M_PackagingContainer;
>>>>>>>
import org.adempiere.warehouse.WarehouseId;
<<<<<<<
=======
import de.metas.product.IStoragePA;
import de.metas.util.Check;
import de.metas.util.Services;
>>>>>>>
import de.metas.util.Check;
import de.metas.util.Services; |
<<<<<<<
import org.adempiere.util.time.SystemTime;
import org.adempiere.warehouse.WarehouseId;
=======
>>>>>>>
import org.adempiere.warehouse.WarehouseId;
<<<<<<<
import de.metas.product.ProductId;
=======
import de.metas.util.Check;
import de.metas.util.time.SystemTime;
>>>>>>>
import de.metas.product.ProductId;
import de.metas.util.Check;
import de.metas.util.time.SystemTime; |
<<<<<<<
@Override
public I_M_HU_PI getEffectivePI(final I_M_HU hu)
{
if (!isAggregateHU(hu))
{
return hu.getM_HU_PI_Version().getM_HU_PI();
}
// note: if hu is an aggregate HU, then there won't be an NPE here.
final I_M_HU_PI_Item parentPIItem = hu.getM_HU_Item_Parent().getM_HU_PI_Item();
if (parentPIItem == null)
{
return null; // this is the case while the aggregate HU is still "under construction" by the HUBuilder and LUTU producer.
}
final I_M_HU_PI included_HU_PI = parentPIItem.getIncluded_HU_PI();
return included_HU_PI;
}
@Override
public I_M_Warehouse getEmptiesWarehouse(final Properties ctx, final I_M_Warehouse warehouse, final String trxName)
{
Check.assumeNotNull(warehouse, "warehouse not null");
// services
final IHandlingUnitsDAO handlingUnitsDAO = Services.get(IHandlingUnitsDAO.class);
final IDistributionNetworkDAO distributionNetworkDAO = Services.get(IDistributionNetworkDAO.class);
// In case the requirements will change and the empties ditribution network
// will be product based, here we will need to get the product gebinde
// and send it as parameter in the method above
final I_DD_NetworkDistribution emptiesNetworkDistribution = handlingUnitsDAO.retrieveEmptiesDistributionNetwork(ctx,
null, // Product
trxName);
if (emptiesNetworkDistribution == null)
{
throw new AdempiereException("@NotFound@ @DD_NetworkDistribution_ID@ (@IsHUDestroyed@=@Y@)");
}
final List<I_DD_NetworkDistributionLine> lines = distributionNetworkDAO.retrieveNetworkLinesBySourceWarehouse(emptiesNetworkDistribution, warehouse.getM_Warehouse_ID());
if (lines.isEmpty())
{
throw new AdempiereException("@NotFound@ @M_Warehouse_ID@ (@IsHUDestroyed@=@Y@): " + warehouse.getName()
+ "\n @DD_NetworkDistribution_ID@: " + emptiesNetworkDistribution);
}
return lines.get(0).getM_Warehouse();
}
=======
>>>>>>>
@Override
public I_M_HU_PI getEffectivePI(final I_M_HU hu)
{
if (!isAggregateHU(hu))
{
return hu.getM_HU_PI_Version().getM_HU_PI();
}
// note: if hu is an aggregate HU, then there won't be an NPE here.
final I_M_HU_PI_Item parentPIItem = hu.getM_HU_Item_Parent().getM_HU_PI_Item();
if (parentPIItem == null)
{
return null; // this is the case while the aggregate HU is still "under construction" by the HUBuilder and LUTU producer.
}
final I_M_HU_PI included_HU_PI = parentPIItem.getIncluded_HU_PI();
return included_HU_PI;
}
<<<<<<<
@Override
public void setHUStatusActive(final Collection<I_M_HU> hus)
{
if (hus == null || hus.isEmpty())
{
return;
}
final IHUTrxBL huTrxBL = Services.get(IHUTrxBL.class);
huTrxBL.process(huContext -> {
for (final I_M_HU hu : hus)
{
final boolean isPhysicalHU = isPhysicalHU(hu.getHUStatus());
if (isPhysicalHU)
{
// in case of a physical HU, we don't need to activate and collect it for the empties movements, because that was already done.
// concrete case: in both empfang and verteilung the boxes were coming from gebindelager to our current warehouse
// ... but when you get to verteilung the boxes are already there
return;
}
setHUStatus(huContext, hu, X_M_HU.HUSTATUS_Active);
InterfaceWrapperHelper.save(hu, ITrx.TRXNAME_ThreadInherited);
//
// Ask the API to get the packing materials needed to the HU which we just activate it
// TODO: i think we can remove this part because it's done automatically ?! (NOTE: this one was copied from swing UI, de.metas.handlingunits.client.terminal.pporder.receipt.view.HUPPOrderReceiptHUEditorPanel.onDialogOkBeforeSave(ITerminalDialog))
huContext.getHUPackingMaterialsCollector().removeHURecursively(hu);
}
});
}
@Override
public IEmptiesMovementBuilder createEmptiesMovementBuilder()
{
return new EmptiesMovementBuilder();
}
=======
>>>>>>>
@Override
public void setHUStatusActive(final Collection<I_M_HU> hus)
{
if (hus == null || hus.isEmpty())
{
return;
}
final IHUTrxBL huTrxBL = Services.get(IHUTrxBL.class);
huTrxBL.process(huContext -> {
for (final I_M_HU hu : hus)
{
final boolean isPhysicalHU = isPhysicalHU(hu.getHUStatus());
if (isPhysicalHU)
{
// in case of a physical HU, we don't need to activate and collect it for the empties movements, because that was already done.
// concrete case: in both empfang and verteilung the boxes were coming from gebindelager to our current warehouse
// ... but when you get to verteilung the boxes are already there
return;
}
setHUStatus(huContext, hu, X_M_HU.HUSTATUS_Active);
InterfaceWrapperHelper.save(hu, ITrx.TRXNAME_ThreadInherited);
//
// Ask the API to get the packing materials needed to the HU which we just activate it
// TODO: i think we can remove this part because it's done automatically ?! (NOTE: this one was copied from swing UI, de.metas.handlingunits.client.terminal.pporder.receipt.view.HUPPOrderReceiptHUEditorPanel.onDialogOkBeforeSave(ITerminalDialog))
huContext.getHUPackingMaterialsCollector().removeHURecursively(hu);
}
});
} |
<<<<<<<
protected Object _unwrapAndDeserialize(JsonParser p, DeserializationContext ctxt,
JavaType rootType, JsonDeserializer<Object> deser) throws IOException
{
PropertyName expRootName = ctxt.findRootName(rootType);
// 12-Jun-2015, tatu: Should try to support namespaces etc but...
String expSimpleName = expRootName.getSimpleName();
if (p.currentToken() != JsonToken.START_OBJECT) {
ctxt.reportWrongTokenException(rootType, JsonToken.START_OBJECT,
"Current token not START_OBJECT (needed to unwrap root name '%s'), but %s",
expSimpleName, p.currentToken());
}
if (p.nextToken() != JsonToken.FIELD_NAME) {
ctxt.reportWrongTokenException(rootType, JsonToken.FIELD_NAME,
"Current token not FIELD_NAME (to contain expected root name '%s'), but %s",
expSimpleName, p.currentToken());
}
String actualName = p.currentName();
if (!expSimpleName.equals(actualName)) {
ctxt.reportPropertyInputMismatch(rootType, actualName,
"Root name '%s' does not match expected ('%s') for type %s",
actualName, expSimpleName, rootType);
}
// ok, then move to value itself....
p.nextToken();
Object result;
if (_valueToUpdate == null) {
result = deser.deserialize(p, ctxt);
} else {
deser.deserialize(p, ctxt, _valueToUpdate);
result = _valueToUpdate;
}
// and last, verify that we now get matching END_OBJECT
if (p.nextToken() != JsonToken.END_OBJECT) {
ctxt.reportWrongTokenException(rootType, JsonToken.END_OBJECT,
"Current token not END_OBJECT (to match wrapper object with root name '%s'), but %s",
expSimpleName, p.currentToken());
}
return result;
}
=======
>>>>>>> |
<<<<<<<
import org.adempiere.util.Services;
=======
import org.adempiere.util.LegacyAdapters;
import de.metas.util.Services;
>>>>>>>
import de.metas.util.Services; |
<<<<<<<
private static final long serialVersionUID = 544868120L;
=======
private static final long serialVersionUID = -1832723065L;
>>>>>>>
private static final long serialVersionUID = -1832723065L;
<<<<<<<
/** Set Catch Einheit.
@param Catch_UOM_ID
Aus dem Produktstamm übenommene Catch Weight Einheit.
*/
@Override
public void setCatch_UOM_ID (int Catch_UOM_ID)
{
if (Catch_UOM_ID < 1)
set_Value (COLUMNNAME_Catch_UOM_ID, null);
else
set_Value (COLUMNNAME_Catch_UOM_ID, Integer.valueOf(Catch_UOM_ID));
}
/** Get Catch Einheit.
@return Aus dem Produktstamm übenommene Catch Weight Einheit.
*/
@Override
public int getCatch_UOM_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Catch_UOM_ID);
if (ii == null)
return 0;
return ii.intValue();
}
=======
>>>>>>>
/** Set Catch Einheit.
@param Catch_UOM_ID
Aus dem Produktstamm übenommene Catch Weight Einheit.
*/
@Override
public void setCatch_UOM_ID (int Catch_UOM_ID)
{
if (Catch_UOM_ID < 1)
set_Value (COLUMNNAME_Catch_UOM_ID, null);
else
set_Value (COLUMNNAME_Catch_UOM_ID, Integer.valueOf(Catch_UOM_ID));
}
/** Get Catch Einheit.
@return Aus dem Produktstamm übenommene Catch Weight Einheit.
*/
@Override
public int getCatch_UOM_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Catch_UOM_ID);
if (ii == null)
return 0;
return ii.intValue();
} |
<<<<<<<
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.TimeUtil;
import org.slf4j.Logger;
import de.metas.i18n.Language;
import de.metas.i18n.Msg;
import de.metas.logging.LogManager;
import de.metas.security.IUserRolePermissions;
import de.metas.security.permissions.Access;
=======
import org.adempiere.ad.security.IUserRolePermissions;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.TimeUtil;
import org.slf4j.Logger;
import de.metas.i18n.Language;
import de.metas.i18n.Msg;
import de.metas.logging.LogManager;
import de.metas.uom.LegacyUOMConversionUtils;
>>>>>>>
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.TimeUtil;
import org.slf4j.Logger;
import de.metas.i18n.Language;
import de.metas.i18n.Msg;
import de.metas.logging.LogManager;
import de.metas.security.IUserRolePermissions;
import de.metas.security.permissions.Access;
import de.metas.uom.LegacyUOMConversionUtils; |
<<<<<<<
* Cost Detail Model
*
* @author Jorg Janke
* @author Armen Rizal, Goodwill Consulting
* <li>BF: 2431123 Return Trx changes weighted average cost
* <li>BF: 1568752 Average invoice costing: landed costs incorrectly applied
* @author Armen Rizal & Bayu Cahya
* <li>BF [ 2129781 ] Cost Detail not created properly for multi acc schema
* @author Teo Sarca
* <li>BF [ 2847648 ] Manufacture & shipment cost errors
* https://sourceforge.net/tracker/?func=detail&aid=2847648&group_id=176962&atid=934929
* @version $Id: MCostDetail.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
*
=======
* Cost Detail Model
*
* @author Jorg Janke
* @author Armen Rizal, Goodwill Consulting
* <li>BF: 2431123 Return Trx changes weighted average cost
* <li>BF: 1568752 Average invoice costing: landed costs incorrectly applied
* @author Armen Rizal & Bayu Cahya
* <li>BF [ 2129781 ] Cost Detail not created properly for multi acc schema
* @author Teo Sarca
* <li>BF [ 2847648 ] Manufacture & shipment cost errors
* https://sourceforge.net/tracker/?func=detail&aid=2847648&group_id=176962&atid=934929
* @version $Id: MCostDetail.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
*
>>>>>>>
* Cost Detail Model
*
* @author Jorg Janke
* @author Armen Rizal, Goodwill Consulting
* <li>BF: 2431123 Return Trx changes weighted average cost
* <li>BF: 1568752 Average invoice costing: landed costs incorrectly applied
* @author Armen Rizal & Bayu Cahya
* <li>BF [ 2129781 ] Cost Detail not created properly for multi acc schema
* @author Teo Sarca
* <li>BF [ 2847648 ] Manufacture & shipment cost errors
* https://sourceforge.net/tracker/?func=detail&aid=2847648&group_id=176962&atid=934929
* @version $Id: MCostDetail.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
*
<<<<<<<
} // MCostDetail
=======
finally
{
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
s_log.debug("processProduct: OK={}, Errors={}", counterOK, counterError);
return counterError == 0;
} // processProduct
/** Logger */
private static Logger s_log = LogManager.getLogger(MCostDetail.class);
/**************************************************************************
* Standard Constructor
* @param ctx context
* @param M_CostDetail_ID id
* @param trxName trx
*/
public MCostDetail (Properties ctx, int M_CostDetail_ID, String trxName)
{
super (ctx, M_CostDetail_ID, trxName);
if (M_CostDetail_ID <= 0)
{
// setC_AcctSchema_ID (0);
// setM_Product_ID (0);
setM_AttributeSetInstance_ID (0);
// setC_OrderLine_ID (0);
// setM_InOutLine_ID(0);
// setC_InvoiceLine_ID (0);
setProcessed (false);
setAmt (Env.ZERO);
setQty (Env.ZERO);
setIsSOTrx (false);
setDeltaAmt (Env.ZERO);
setDeltaQty (Env.ZERO);
}
} // MCostDetail
>>>>>>>
} // MCostDetail
<<<<<<<
=======
/**
* New Constructor
* @param as accounting schema
* @param AD_Org_ID org
* @param M_Product_ID product
* @param M_AttributeSetInstance_ID asi
* @param M_CostElement_ID optional cost element for Freight
* @param Amt amt
* @param Qty qty
* @param Description optional description
* @param trxName transaction
*/
public MCostDetail (I_C_AcctSchema as, int AD_Org_ID,
int M_Product_ID, int M_AttributeSetInstance_ID,
int M_CostElement_ID, BigDecimal Amt, BigDecimal Qty,
String Description, String trxName)
{
this (InterfaceWrapperHelper.getCtx(as),
0,
trxName);
setClientOrg(as.getAD_Client_ID(), AD_Org_ID);
setC_AcctSchema_ID (as.getC_AcctSchema_ID());
setM_Product_ID (M_Product_ID);
setM_AttributeSetInstance_ID (M_AttributeSetInstance_ID);
//
setM_CostElement_ID(M_CostElement_ID);
//
setAmt (Amt);
setQty (Qty);
setDescription(Description);
} // MCostDetail
/**
* Set Amt
* @param Amt amt
*/
>>>>>>>
<<<<<<<
super.setAmt(Amt);
} // setAmt
=======
super.setAmt (Amt);
} // setAmt
/**
* Set Qty
* @param Qty qty
*/
>>>>>>>
super.setAmt(Amt);
} // setAmt
<<<<<<<
=======
/**
* Is Shipment
* @return true if sales order shipment
*/
public boolean isShipment()
{
return isSOTrx() && getM_InOutLine_ID() != 0;
} // isShipment
/**
* Is this a Delta Record (previously processed)?
* @return true if delta is not null
*/
public boolean isDelta()
{
return !(getDeltaAmt().signum() == 0
&& getDeltaQty().signum() == 0);
} // isDelta
/**
* Before Delete
* @return false if processed
*/
@Override
protected boolean beforeDelete ()
{
return !isProcessed();
} // beforeDelete
/**
* String Representation
* @return info
*/
>>>>>>>
<<<<<<<
StringBuilder sb = new StringBuilder("MCostDetail[");
sb.append(get_ID());
=======
final StringBuffer sb = new StringBuffer ("MCostDetail[");
sb.append (get_ID());
>>>>>>>
StringBuilder sb = new StringBuilder("MCostDetail[");
sb.append(get_ID());
<<<<<<<
sb.append(",M_InventoryLine_ID=").append(getM_InventoryLine_ID());
if (getM_ProductionLine_ID() != 0)
sb.append(",M_ProductionLine_ID=").append(getM_ProductionLine_ID());
=======
sb.append (",M_InventoryLine_ID=").append (getM_InventoryLine_ID());
>>>>>>>
sb.append(",M_InventoryLine_ID=").append(getM_InventoryLine_ID()); |
<<<<<<<
import de.metas.product.ProductId;
=======
import de.metas.util.Check;
import de.metas.util.Services;
>>>>>>>
import de.metas.product.ProductId;
import de.metas.util.Check;
import de.metas.util.Services; |
<<<<<<<
import de.metas.bpartner.BPartnerId;
=======
import de.metas.adempiere.model.I_C_Currency;
>>>>>>>
<<<<<<<
PlainCurrencyDAO.prepareCurrency()
.currencyId(CURRENCY_ID)
.currencyCode(CurrencyCode.EUR)
.precision(CurrencyPrecision.TWO)
.build();
=======
refundTestTools = new RefundTestTools();
final I_C_Currency currencyRecord = newInstance(I_C_Currency.class);
currencyRecord.setC_Currency_ID(CURRENCY_ID.getRepoId());
currencyRecord.setStdPrecision(2);
saveRecord(currencyRecord);
>>>>>>>
refundTestTools = new RefundTestTools();
PlainCurrencyDAO.prepareCurrency()
.currencyId(CURRENCY_ID)
.currencyCode(CurrencyCode.EUR)
.precision(CurrencyPrecision.TWO)
.build(); |
<<<<<<<
import de.metas.picking.api.PickingSlotId;
=======
import de.metas.util.ISingletonService;
>>>>>>>
import de.metas.picking.api.PickingSlotId;
import de.metas.util.ISingletonService; |
<<<<<<<
import de.metas.bpartner.BPartnerId;
=======
import de.metas.adempiere.model.I_C_Currency;
>>>>>>>
<<<<<<<
PlainCurrencyDAO.prepareCurrency()
.currencyId(CURRENCY_ID)
.currencyCode(CurrencyCode.EUR)
.precision(CurrencyPrecision.TWO)
.build();
=======
refundTestTools = new RefundTestTools();
final I_C_Currency currencyRecord = newInstance(I_C_Currency.class);
currencyRecord.setC_Currency_ID(CURRENCY_ID.getRepoId());
currencyRecord.setStdPrecision(2);
saveRecord(currencyRecord);
>>>>>>>
refundTestTools = new RefundTestTools();
PlainCurrencyDAO.prepareCurrency()
.currencyId(CURRENCY_ID)
.currencyCode(CurrencyCode.EUR)
.precision(CurrencyPrecision.TWO)
.build(); |
<<<<<<<
public void setParentHU(final IHUContext huContext, @Nullable final I_M_HU_Item parentHUItem, final I_M_HU hu)
=======
public void setParentHU(final IHUContext huContext, final @Nullable I_M_HU_Item parentHUItem, final I_M_HU hu)
>>>>>>>
public void setParentHU(final IHUContext huContext, @Nullable final @Nullable I_M_HU_Item parentHUItem, final I_M_HU hu)
<<<<<<<
final @Nullable I_M_HU_Item parentHUItem,
final @NonNull I_M_HU hu,
=======
@Nullable final I_M_HU_Item parentHUItem,
@NonNull final I_M_HU hu,
>>>>>>>
@Nullable final @Nullable I_M_HU_Item parentHUItem,
final @NonNull I_M_HU hu, |
<<<<<<<
import java.sql.Timestamp;
=======
>>>>>>>
import java.sql.Timestamp;
<<<<<<<
final int m_HU_PI_Item_Product_ID = getM_HU_PI_Item_Product_ID();
if (m_HU_PI_Item_Product_ID <= 0)
{
return null;
}
return loadOutOfTrx(m_HU_PI_Item_Product_ID, I_M_HU_PI_Item_Product.class);
=======
final Integer valueOverrideOrValue = InterfaceWrapperHelper.getValueOverrideOrValue(olCand, I_C_OLCand.COLUMNNAME_M_HU_PI_Item_Product_ID);
return valueOverrideOrValue == null ? 0 : valueOverrideOrValue;
>>>>>>>
final Integer valueOverrideOrValue = InterfaceWrapperHelper.getValueOverrideOrValue(olCand, I_C_OLCand.COLUMNNAME_M_HU_PI_Item_Product_ID);
return valueOverrideOrValue == null ? 0 : valueOverrideOrValue; |
<<<<<<<
=======
import org.adempiere.model.engines.CostDimension;
import org.adempiere.util.LegacyAdapters;
>>>>>>>
import org.adempiere.util.LegacyAdapters;
<<<<<<<
private final ICostElementRepository costElementsRepo = Adempiere.getBean(ICostElementRepository.class);
private final ICurrentCostsRepository currentCostsRepo = Adempiere.getBean(ICurrentCostsRepository.class);
private final IProductBL productBL = Services.get(IProductBL.class);
/* Organization */
private int p_AD_Org_ID = 0;
/* Account Schema */
private int p_C_AcctSchema_ID = 0;
/* Cost Type */
private int p_M_CostType_ID = 0;
/* Costing Method */
private String p_ConstingMethod = CostingMethod.StandardCosting.getCode();
/* Product */
private int p_M_Product_ID = 0;
/* Product Category */
private int p_M_Product_Category_ID = 0;
/* Product Type */
private String p_ProductType = null;
=======
// services
private final transient IProductBOMDAO productBOMsRepo = Services.get(IProductBOMDAO.class);
private final transient IMRPDAO mrpDAO = Services.get(IMRPDAO.class);
/* Organization */
private int p_AD_Org_ID = 0;
/* Account Schema */
private int p_C_AcctSchema_ID = 0;
/* Cost Type */
private int p_M_CostType_ID = 0;
/* Costing Method */
private String p_ConstingMethod = MCostElement.COSTINGMETHOD_StandardCosting;
/* Product */
private int p_M_Product_ID = 0;
/* Product Category */
private int p_M_Product_Category_ID = 0;
/* Product Type */
private String p_ProductType = null;
>>>>>>>
// services
private final transient ICurrentCostsRepository currentCostsRepo = Adempiere.getBean(ICurrentCostsRepository.class);
private final transient ICostElementRepository costElementsRepo = Adempiere.getBean(ICostElementRepository.class);
private final transient IProductBOMDAO productBOMsRepo = Services.get(IProductBOMDAO.class);
private final transient IProductBL productBL = Services.get(IProductBL.class);
private final transient IMRPDAO mrpDAO = Services.get(IMRPDAO.class);
/* Organization */
private int p_AD_Org_ID = 0;
/* Account Schema */
private int p_C_AcctSchema_ID = 0;
/* Cost Type */
private int p_M_CostType_ID = 0;
/* Costing Method */
private String p_ConstingMethod = CostingMethod.StandardCosting.getCode();
/* Product */
private int p_M_Product_ID = 0;
/* Product Category */
private int p_M_Product_Category_ID = 0;
/* Product Type */
private String p_ProductType = null;
<<<<<<<
final int maxLowLevel = Services.get(IMRPDAO.class).getMaxLowLevel(this);
=======
int maxLowLevel = mrpDAO.getMaxLowLevel(this);
>>>>>>>
final int maxLowLevel = mrpDAO.getMaxLowLevel(this);
<<<<<<<
final MPPProductBOM bom = MPPProductBOM.get(getCtx(), PP_Product_BOM_ID);
=======
final I_PP_Product_BOM bom = productBOMsRepo.retrieveBOMById(getCtx(), PP_Product_BOM_ID);
>>>>>>>
final I_PP_Product_BOM bom = productBOMsRepo.retrieveBOMById(getCtx(), PP_Product_BOM_ID);
<<<<<<<
protected void rollup(final MProduct product, final MPPProductBOM bom)
=======
protected void rollup(MProduct product, I_PP_Product_BOM bom)
>>>>>>>
protected void rollup(MProduct product, I_PP_Product_BOM bom)
<<<<<<<
private void updateCoProductCosts(final MPPProductBOM bom, final CurrentCost baseCost, final CostElement costElement)
=======
private void updateCoProductCosts(I_PP_Product_BOM bom, MCost baseCost)
>>>>>>>
private void updateCoProductCosts(final I_PP_Product_BOM bom, final CurrentCost baseCost, final CostElement costElement)
<<<<<<<
CostAmount costPriceTotal = zeroCosts();
for (final MPPProductBOMLine bomline : bom.getLines())
=======
BigDecimal costPriceTotal = BigDecimal.ZERO;
for (I_PP_Product_BOMLine bomline : productBOMsRepo.retrieveLines(bom))
>>>>>>>
CostAmount costPriceTotal = zeroCosts();
for (I_PP_Product_BOMLine bomline : productBOMsRepo.retrieveLines(bom))
<<<<<<<
final CostAmount costPrice = baseCost.getCurrentCostPriceLL().multiply(bomline.getCostAllocationPerc());
=======
final BigDecimal costPrice = baseCost.getCurrentCostPriceLL().multiply(getCostAllocationPerc(bomLinePO));
>>>>>>>
final CostAmount costPrice = baseCost.getCurrentCostPriceLL().multiply(getCostAllocationPerc(bomLinePO));
<<<<<<<
=======
* @return co-product cost allocation percent (i.e. -1/qty)
*/
private BigDecimal getCostAllocationPerc(final MPPProductBOMLine bomLine)
{
final BigDecimal qty = bomLine.getQty(false).negate();
BigDecimal allocationPercent = BigDecimal.ZERO;
if (qty.signum() != 0)
{
allocationPercent = BigDecimal.ONE.divide(qty, 4, RoundingMode.HALF_UP);
}
return allocationPercent;
}
/**
* Get the sum Current Cost Price Level Low for this Cost Element
* @param bom MPPProductBOM
* @param element MCostElement
>>>>>>>
* @return co-product cost allocation percent (i.e. -1/qty)
*/
private BigDecimal getCostAllocationPerc(final MPPProductBOMLine bomLine)
{
final BigDecimal qty = bomLine.getQty(false).negate();
BigDecimal allocationPercent = BigDecimal.ZERO;
if (qty.signum() != 0)
{
allocationPercent = BigDecimal.ONE.divide(qty, 4, RoundingMode.HALF_UP);
}
return allocationPercent;
}
/**
* Get the sum Current Cost Price Level Low for this Cost Element
* @param bom MPPProductBOM
* @param element MCostElement
<<<<<<<
for (final MPPProductBOMLine bomline : bom.getLines())
=======
for (I_PP_Product_BOMLine bomline : productBOMsRepo.retrieveLines(bom))
>>>>>>>
for (I_PP_Product_BOMLine bomline : productBOMsRepo.retrieveLines(bom))
<<<<<<<
final BigDecimal qty = bomline.getQty(true);
=======
BigDecimal qty = bomLinePO.getQty(true);
>>>>>>>
BigDecimal qty = bomLinePO.getQty(true);
<<<<<<<
cost.setCurrentCostPriceLL(zeroCosts());
=======
cost.setCurrentCostPriceLL(BigDecimal.ZERO);
>>>>>>>
cost.setCurrentCostPriceLL(zeroCosts()); |
<<<<<<<
=======
import java.sql.Timestamp;
import java.util.List;
/*
* #%L
* de.metas.handlingunits.base
* %%
* Copyright (C) 2015 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
import java.util.Properties;
>>>>>>>
import java.sql.Timestamp;
import java.util.List;
/*
* #%L
* de.metas.handlingunits.base
* %%
* Copyright (C) 2015 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
import java.util.Properties;
<<<<<<<
=======
/**
* Create an instance <code>of de.metas.handlingunits.inout.impl.EmptiesInOutProducer</code>
*
* @param ctx
* @return
*/
IReturnsInOutProducer createEmptiesInOutProducer(Properties ctx);
>>>>>>>
/**
* Create an instance <code>of de.metas.handlingunits.inout.impl.EmptiesInOutProducer</code>
*
* @param ctx
* @return
*/
IReturnsInOutProducer createEmptiesInOutProducer(Properties ctx); |
<<<<<<<
import android.text.TextUtils;
=======
>>>>>>> |
<<<<<<<
if ((_ignorableProps != null) && _ignorableProps.contains(propName)) {
=======
if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
>>>>>>>
if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
<<<<<<<
Object builder = null;
try {
builder = creator.build(ctxt, buffer);
} catch (Exception e) {
return wrapInstantiationProblem(e, ctxt);
=======
if (builder == null) {
try {
builder = creator.build(ctxt, buffer);
} catch (Exception e) {
return wrapInstantiationProblem(e, ctxt);
}
}
return _unwrappedPropertyHandler.processUnwrapped(p, ctxt, builder, tokens);
}
protected Object deserializeWithUnwrapped(JsonParser p,
DeserializationContext ctxt, Object builder, TokenBuffer tokens)
throws IOException
{
final Class<?> activeView = _needViewProcesing ? ctxt.getActiveView() : null;
for (JsonToken t = p.currentToken(); t == JsonToken.FIELD_NAME; t = p.nextToken()) {
String propName = p.getCurrentName();
SettableBeanProperty prop = _beanProperties.find(propName);
p.nextToken();
if (prop != null) { // normal case
if (activeView != null && !prop.visibleInView(activeView)) {
p.skipChildren();
continue;
}
try {
builder = prop.deserializeSetAndReturn(p, ctxt, builder);
} catch (Exception e) {
wrapAndThrow(e, builder, propName, ctxt);
}
continue;
}
if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
handleIgnoredProperty(p, ctxt, builder, propName);
continue;
}
// but... others should be passed to unwrapped property deserializers
tokens.writeFieldName(propName);
tokens.copyCurrentStructure(p);
// how about any setter? We'll get copies but...
if (_anySetter != null) {
_anySetter.deserializeAndSet(p, ctxt, builder, propName);
}
>>>>>>>
Object builder = null;
try {
builder = creator.build(ctxt, buffer);
} catch (Exception e) {
return wrapInstantiationProblem(e, ctxt);
<<<<<<<
final String propName = p.currentName();
if ((_ignorableProps != null) && (_ignorableProps.contains(propName))) {
=======
if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
>>>>>>>
final String propName = p.currentName();
if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) { |
<<<<<<<
import info.zamojski.soft.towercollector.MyApplication;
import info.zamojski.soft.towercollector.collector.validators.specific.WcdmaCellIdentityValidator;
import info.zamojski.soft.towercollector.model.Cell;
import timber.log.Timber;
=======
>>>>>>> |
<<<<<<<
import android.text.format.Time;
=======
import android.os.Build;
>>>>>>>
import android.text.format.Time;
import android.os.Build;
<<<<<<<
/**
* Load layout resource here. Also, load any theme settings
* @param layout The root layout
=======
/**
Load layout resource here. Also, load any theme settings
>>>>>>>
/**
* Load layout resource here. Also, load any theme settings
* @param layout The root layout
<<<<<<<
/**
* Fetch the root view of the theme
* @param layout The root layout
=======
/**
Fetch the root view of the theme
>>>>>>>
/**
* Fetch the root view of the theme
* @param layout The root layout
<<<<<<<
/**
* Show the time the notification arrived
* @param layout The root layout
* @param time Time object containing the time the notification arrived
*/
public void showTime(LinearLayout layout, Time time) {
final TextView timeView = (TextView) layout.findViewById(R.id.timeView);
timeView.setText(time.minute >= 10 ? time.hour + ":" + time.minute : time.hour + ":0" + time.minute);
timeView.setVisibility(View.VISIBLE);
}
/**
* The the time view
* @param layout The root layout
*/
public void hideTime(LinearLayout layout) {
layout.findViewById(R.id.timeView).setVisibility(View.GONE);
}
/**
* Fetch a reference to the action button area
* @param layout The root layout
=======
/**
Fetch a reference to the action button area
>>>>>>>
/**
* Show the time the notification arrived
* @param layout The root layout
* @param time Time object containing the time the notification arrived
*/
public void showTime(LinearLayout layout, Time time) {
final TextView timeView = (TextView) layout.findViewById(R.id.timeView);
timeView.setText(time.minute >= 10 ? time.hour + ":" + time.minute : time.hour + ":0" + time.minute);
timeView.setVisibility(View.VISIBLE);
}
/**
* The the time view
* @param layout The root layout
*/
public void hideTime(LinearLayout layout) {
layout.findViewById(R.id.timeView).setVisibility(View.GONE);
}
/**
* Fetch a reference to the action button area
* @param layout The root layout
<<<<<<<
/**
* Remove all action buttons from the layout, in case the layout needs to be re-used.
=======
/**
Remove all action buttons from the layout, in case the layout needs to be re-used.
>>>>>>>
/**
* Remove all action buttons from the layout, in case the layout needs to be re-used.
<<<<<<<
/**
* This notification does have action buttons. Display the action button area.
* @param layout The root layout
* @param count The number of action buttons.
* If count parameter is -1, only display the action button view
=======
/**
This notification does have action buttons. Display the action button area. If count parameter is -1, only display the action button view
>>>>>>>
/**
* This notification does have action buttons. Display the action button area.
* @param layout The root layout
* @param count The number of action buttons.
* If count parameter is -1, only display the action button view
<<<<<<<
/**
* This notification doesn't have any action buttons. Hide the action button area.
* @param layout The root layout
=======
/**
This notification doesn't have any action buttons. Hide the action button area.
>>>>>>>
/**
* This notification doesn't have any action buttons. Hide the action button area.
* @param layout The root layout
<<<<<<<
/**
* Add an action button to the layout.
=======
/**
Add an action button to the layout.
>>>>>>>
/**
Add an action button to the layout. |
<<<<<<<
import com.fasterxml.jackson.core.util.SimpleTokenWriteContext;
=======
import com.fasterxml.jackson.core.util.JacksonFeatureSet;
>>>>>>>
import com.fasterxml.jackson.core.util.JacksonFeatureSet;
import com.fasterxml.jackson.core.util.SimpleTokenWriteContext;
<<<<<<<
=======
@Override
public ObjectCodec getCodec() { return _codec; }
@Override
public void setCodec(ObjectCodec c) { _codec = c; }
>>>>>>>
<<<<<<<
@Override
public TokenBuffer getInputSource() {
return _source;
}
=======
// 20-May-2020, tatu: This may or may not be enough -- ideally access is
// via `DeserializationContext`, not parser, but if latter is needed
// then we'll need to pass this from parser contents if which were
// buffered.
@Override
public JacksonFeatureSet<StreamReadCapability> getReadCapabilities() {
return DEFAULT_READ_CAPABILITIES;
}
>>>>>>>
@Override
public int formatReadFeatures() {
return 0;
}
// 20-May-2020, tatu: This may or may not be enough -- ideally access is
// via `DeserializationContext`, not parser, but if latter is needed
// then we'll need to pass this from parser contents if which were
// buffered.
@Override
public JacksonFeatureSet<StreamReadCapability> getReadCapabilities() {
return DEFAULT_READ_CAPABILITIES;
}
@Override
public TokenBuffer getInputSource() {
return _source;
} |
<<<<<<<
// TODO: find a better way to flag internal errors
// if (testEnv.hasBeenStopped()) {
// // the execution has been forcefully stopped inform the user!
// throw new AssertionError("Test terminated due timeout!" +
// assertionError.getMessage());
// }
=======
>>>>>>>
// TODO: find a better way to flag internal errors
// if (testEnv.hasBeenStopped()) {
// // the execution has been forcefully stopped inform the user!
// throw new AssertionError("Test terminated due timeout!" +
// assertionError.getMessage());
// } |
<<<<<<<
/**********************************************************************
/* High-level handling of secondary input shapes (with
/* possible coercion)
/**********************************************************************
=======
/**********************************************************************
/* High-level handling of secondary input shapes (with possible coercion)
/**********************************************************************
>>>>>>>
/**********************************************************************
/* High-level handling of secondary input shapes (with possible coercion)
/**********************************************************************
<<<<<<<
=======
*
* @since 2.5
*
* @deprecated Since 2.12
>>>>>>>
*
* @deprecated Since 2.12
<<<<<<<
return (T) ctxt.handleUnexpectedToken(getValueType(ctxt), p);
}
} else if (t == JsonToken.VALUE_STRING) {
if (ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
String str = p.getText().trim();
if (str.isEmpty()) {
return null;
}
=======
return (T) ctxt.handleUnexpectedToken(getValueType(ctxt), p);
>>>>>>>
return (T) ctxt.handleUnexpectedToken(getValueType(ctxt), p); |
<<<<<<<
import butterknife.ButterKnife;
=======
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
>>>>>>>
import butterknife.ButterKnife;
<<<<<<<
Image image;
MorphingButton createPdf;
MorphingButton openPdf;
MorphingButton addImages;
TextView textView;
=======
Image image;
@BindView(R.id.pdfcreate) MorphingButton createPdf;
@BindView(R.id.pdfOpen) MorphingButton openPdf;
@BindView(R.id.addImages) MorphingButton addImages;
@BindView(R.id.text) TextView textView;
>>>>>>>
Image image;
MorphingButton createPdf;
MorphingButton openPdf;
MorphingButton addImages;
TextView textView;
<<<<<<<
addImages = (MorphingButton) root.findViewById(R.id.addImages);
createPdf = (MorphingButton) root.findViewById(R.id.pdfcreate);
openPdf = (MorphingButton) root.findViewById(R.id.pdfOpen);
textView = (TextView) root.findViewById(R.id.text);
=======
>>>>>>>
addImages = (MorphingButton) root.findViewById(R.id.addImages);
createPdf = (MorphingButton) root.findViewById(R.id.pdfcreate);
openPdf = (MorphingButton) root.findViewById(R.id.pdfOpen);
textView = (TextView) root.findViewById(R.id.text); |
<<<<<<<
/* Fields that can be updated */
public static final String[] FIELDS_TO_COMPARE =
{
"screen_name",
"link",
"text" // can embed rich content
};
public static PushReport saveMessagesAndImportProfile(List<Map<String, Object>> messages, int fileHash, RemoteAccess.Post post, SourceType sourceType) throws IOException {
=======
public static PushReport saveMessagesAndImportProfile(
List<Map<String, Object>> messages, int fileHash, RemoteAccess.Post post,
SourceType sourceType, String screenName) throws IOException {
>>>>>>>
/* Fields that can be updated */
public static final String[] FIELDS_TO_COMPARE =
{
"screen_name",
"link",
"text" // can embed rich content
};
public static PushReport saveMessagesAndImportProfile(
List<Map<String, Object>> messages, int fileHash, RemoteAccess.Post post,
SourceType sourceType, String screenName) throws IOException { |
<<<<<<<
jsonText = ClientConnection.download(url);
XContentParser parser = JsonXContent.jsonXContent.createParser(jsonText);
Map<String, Object> map = parser == null ? null : parser.map();
=======
byte[] jsonText = ClientConnection.download(url);
Map<String, Object> map = DAO.jsonMapper.readValue(jsonText, DAO.jsonTypeRef);
>>>>>>>
jsonText = ClientConnection.download(url);
Map<String, Object> map = DAO.jsonMapper.readValue(jsonText, DAO.jsonTypeRef); |
<<<<<<<
public final static String FOLLOWER_DUMP_FILE_PREFIX = "follower_";
public final static String FOLLOWING_DUMP_FILE_PREFIX = "following_";
=======
public final static String FOLLOWERS_DUMP_FILE_PREFIX = "followers_";
>>>>>>>
public final static String FOLLOWERS_DUMP_FILE_PREFIX = "followers_";
public final static String FOLLOWING_DUMP_FILE_PREFIX = "following_";
<<<<<<<
public static JsonDataset user_dump, follower_dump, following_dump;
private static File settings_dir, customized_config;
=======
public static JsonDataset user_dump, followers_dump;
private static File customized_config, schema_dir, conv_schema_dir;
>>>>>>>
public static JsonDataset user_dump, followers_dump, following_dump;
private static File customized_config, schema_dir, conv_schema_dir;
<<<<<<<
follower_dump = new JsonDataset(user_dump_dir, FOLLOWER_DUMP_FILE_PREFIX, new String[]{"id_str","screen_name"});
following_dump = new JsonDataset(user_dump_dir, FOLLOWING_DUMP_FILE_PREFIX, new String[]{"id_str","screen_name"});
=======
followers_dump = new JsonDataset(user_dump_dir, FOLLOWERS_DUMP_FILE_PREFIX, new String[]{"id_str","screen_name"});
// load schema folder
conv_schema_dir = new File("conf/conversion");
schema_dir = new File("conf/schema");
>>>>>>>
followers_dump = new JsonDataset(user_dump_dir, FOLLOWERS_DUMP_FILE_PREFIX, new String[]{"id_str","screen_name"});
following_dump = new JsonDataset(user_dump_dir, FOLLOWING_DUMP_FILE_PREFIX, new String[]{"id_str","screen_name"});
// load schema folder
conv_schema_dir = new File("conf/conversion");
schema_dir = new File("conf/schema"); |
<<<<<<<
import org.loklak.data.Timeline;
=======
import org.loklak.data.PrivacyStatus;
>>>>>>>
import org.loklak.data.Timeline;
import org.loklak.data.PrivacyStatus;
<<<<<<<
@SuppressWarnings("unchecked")
public static boolean checkMessageExistence(Map<String, Object> message) {
String source_type = (String) message.get("source_type");
List<Double> location_point = (List<Double>) message.get("location_point");
Double latitude = location_point.get(0);
Double longitude = location_point.get(1);
String query = "/source_type=" + source_type + " /location=" + latitude + "," + longitude;
// search only latest message
DAO.SearchLocalMessages search = new DAO.SearchLocalMessages(query, Timeline.Order.CREATED_AT, 0, 1, 0);
Iterator it = search.timeline.iterator();
while (it.hasNext()) {
MessageEntry messageEntry = (MessageEntry) it.next();
DAO.log(messageEntry.getIdStr());
if (compareMessage(messageEntry.toMap(), message)) {
return true;
}
}
return false;
}
private static boolean compareMessage(Map<String, Object> m1, Map<String, Object> m2) {
for (String field : FIELDS_TO_COMPARE) {
if ((m1.get(field) == null && m2.get(field) != null)
|| (m1.get(field) != null && m2.get(field) == null)
|| !m1.get(field).equals(m2.get(field))) {
return false;
}
}
return true;
}
public static String computeMessageId(Map<String, Object> message, Object initialId, SourceType sourceType) throws Exception {
=======
public static String computeMessageId(Map<String, Object> message, SourceType sourceType) throws Exception {
>>>>>>>
@SuppressWarnings("unchecked")
public static boolean checkMessageExistence(Map<String, Object> message) {
String source_type = (String) message.get("source_type");
List<Double> location_point = (List<Double>) message.get("location_point");
Double latitude = location_point.get(0);
Double longitude = location_point.get(1);
String query = "/source_type=" + source_type + " /location=" + latitude + "," + longitude;
// search only latest message
DAO.SearchLocalMessages search = new DAO.SearchLocalMessages(query, Timeline.Order.CREATED_AT, 0, 1, 0);
Iterator it = search.timeline.iterator();
while (it.hasNext()) {
MessageEntry messageEntry = (MessageEntry) it.next();
DAO.log(messageEntry.getIdStr());
if (compareMessage(messageEntry.toMap(), message)) {
return true;
}
}
return false;
}
private static boolean compareMessage(Map<String, Object> m1, Map<String, Object> m2) {
for (String field : FIELDS_TO_COMPARE) {
if ((m1.get(field) == null && m2.get(field) != null)
|| (m1.get(field) != null && m2.get(field) == null)
|| !m1.get(field).equals(m2.get(field))) {
return false;
}
}
return true;
}
public static String computeMessageId(Map<String, Object> message, SourceType sourceType) throws Exception {
<<<<<<<
// If initialId found, append it in the id. The new id has this format
// <source_type>_<id>_<lat>_<lon>_<mtime>
// otherwise, the new id is <source_type>_<lat>_<lon>_<mtime>
Object mtime = message.get("mtime");
boolean hasInitialId = initialId != null && !"".equals(initialId.toString());
if (hasInitialId) {
return sourceType.name() + "_" + initialId + "_" + latitude + "_" + longitude + "_" + mtime;
} else {
return sourceType.name() + "_" + latitude + "_" + longitude + "_" + mtime;
}
=======
// Modification time = 'mtime' value. If not found, take current time
Object mtime = message.get("mtime");
if (mtime == null) {
mtime = Long.toString(System.currentTimeMillis());
message.put("mtime", mtime);
}
// Id format : <source_type>_<lat>_<lon>_<mtime>
return sourceType.name() + "_" + latitude + "_" + longitude + "_" + mtime;
>>>>>>>
// Modification time = 'mtime' value. If not found, take current time
Object mtime = message.get("mtime");
if (mtime == null) {
mtime = Long.toString(System.currentTimeMillis());
message.put("mtime", mtime);
}
// Id format : <source_type>_<lat>_<lon>_<mtime>
return sourceType.name() + "_" + latitude + "_" + longitude + "_" + mtime; |
<<<<<<<
import java.util.Iterator;
=======
import java.util.List;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONObject;
>>>>>>>
import java.util.Iterator;
import java.util.List;
<<<<<<<
=======
/**
* to remember larger sets of thoughts, we can also think arguments
* @param argument
* @return self, the current argument
*/
public SusiArgument think(SusiArgument argument) {
argument.recall.forEach(thought -> think(thought));
return this;
}
private static final Pattern variable_pattern = Pattern.compile("\\$.*?\\$");
>>>>>>>
/**
* to remember larger sets of thoughts, we can also think arguments
* @param argument
* @return self, the current argument
*/
public SusiArgument think(SusiArgument argument) {
argument.recall.forEach(thought -> think(thought));
return this;
}
<<<<<<<
for (SusiThought t: this) {
String s = t.unify(statement);
if (s == null) break; // no more patterns to be instantiated left, not an error!
statement = s;
=======
remember: for (int mindstate_count = this.recall.size() - 1; mindstate_count >= 0; mindstate_count--) {
JSONArray table = this.recall.get(mindstate_count).getData();
if (table != null && table.length() > 0) {
JSONObject row = table.getJSONObject(0);
for (String key: row.keySet()) {
int i = statement.indexOf("$" + key + "$");
if (i >= 0) {
statement = statement.substring(0, i) + row.get(key).toString() + statement.substring(i + key.length() + 2);
}
}
if (!variable_pattern.matcher(statement).find()) break remember; //termination if no more patterns are included in statement
}
>>>>>>>
for (SusiThought t: this) {
statement = t.unify(statement);
if (!SusiThought.variable_pattern.matcher(statement).find()) return statement;
<<<<<<<
/**
* the iterator returns the thoughts in reverse order, latest thought first
*/
@Override
public Iterator<SusiThought> iterator() {
return new Iterator<SusiThought>() {
private int p = recall.size();
@Override public boolean hasNext() {return p > 0;}
@Override public SusiThought next() {return remember(--p);}
};
}
=======
/**
* Every argument may have a set of (re-)actions assigned.
* Those (re-)actions are methods to do something with the argument.
* @param action one (re-)action on this argument
* @return the argument
*/
public SusiArgument addAction(final SusiAction action) {
this.actions.add(action);
return this;
}
/**
* To be able to apply (re-)actions to this thought, the actions on the information can be retrieved.
* @return the (re-)actions which are applicable to this thought.
*/
public List<SusiAction> getActions() {
return this.actions;
}
>>>>>>>
/**
* the iterator returns the thoughts in reverse order, latest thought first
*/
@Override
public Iterator<SusiThought> iterator() {
return new Iterator<SusiThought>() {
private int p = recall.size();
@Override public boolean hasNext() {return p > 0;}
@Override public SusiThought next() {return recall.get(--p);}
};
}
/**
* Every argument may have a set of (re-)actions assigned.
* Those (re-)actions are methods to do something with the argument.
* @param action one (re-)action on this argument
* @return the argument
*/
public SusiArgument addAction(final SusiAction action) {
this.actions.add(action);
return this;
}
/**
* To be able to apply (re-)actions to this thought, the actions on the information can be retrieved.
* @return the (re-)actions which are applicable to this thought.
*/
public List<SusiAction> getActions() {
return this.actions;
}
public static void main(String[] args) {
SusiArgument a = new SusiArgument().think(new SusiThought().addObservation("a", "letter-a"));
System.out.println(a.unify("the letter $a$"));
} |
<<<<<<<
import org.apache.ibatis.annotations.Select;
=======
import com.fly4j.yshop.pms.pojo.vo.SkuLockVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
>>>>>>>
import org.apache.ibatis.annotations.Select;
import com.fly4j.yshop.pms.pojo.vo.SkuLockVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
<<<<<<<
public interface PmsSkuMapper extends BaseMapper<PmsSku> {
=======
@Select("<script>" +
"SELECT id AS sku_id,stock_locked AS quantity FROM pms_sku WHERE id = #{sku_id} AND stock-stock_locked >= #{quantity}" +
"</script>")
SkuLockVO getCanLocked(SkuLockVO skuLockVO);
>>>>>>>
public interface PmsSkuMapper extends BaseMapper<PmsSku> {
@Select("<script>" +
"SELECT id AS sku_id,stock_locked AS quantity FROM pms_sku WHERE id = #{sku_id} AND stock-stock_locked >= #{quantity}" +
"</script>")
SkuLockVO getCanLocked(SkuLockVO skuLockVO);
<<<<<<<
@Select("<script>"
+" SELECT"
+" a.id,"
+" a.specs,"
+" a.price,"
+" a.pic_url,"
+" ( a.stock - a.stock_locked ) AS stock,"
+" b.name AS spu_name,"
+" b.code AS spu_code"
+" FROM"
+" pms_sku a"
+" LEFT JOIN pms_spu b ON a.spu_id = b.id"
+" ORDER BY a.create_time"
+"</script>")
Page<PmsSkuDTO> page(Map<String, Object> params, Page<PmsSku> page);
=======
@Update("<script>" +
"UPDATE pms_sku SET stock_locked = stock_locked - #{stock_locked} WHERE id = #{sku_id}" +
"</script>")
void unLockSku(SkuLockVO skuLock);
>>>>>>>
@Select("<script>"
+" SELECT"
+" a.id,"
+" a.specs,"
+" a.price,"
+" a.pic_url,"
+" ( a.stock - a.stock_locked ) AS stock,"
+" b.name AS spu_name,"
+" b.code AS spu_code"
+" FROM"
+" pms_sku a"
+" LEFT JOIN pms_spu b ON a.spu_id = b.id"
+" ORDER BY a.create_time"
+"</script>")
Page<PmsSkuDTO> page(Map<String, Object> params, Page<PmsSku> page);
@Update("<script>" +
"UPDATE pms_sku SET stock_locked = stock_locked - #{stock_locked} WHERE id = #{sku_id}" +
"</script>")
void unLockSku(SkuLockVO skuLock); |
<<<<<<<
protected static final long emptyQueueSleepTime = 500; // 500 ms
=======
private static final long emptyQueueSleepTime = 500; // 500ms
private static final long reconnectSleepTime = 5000; // 5s
private static final int reconnectAttempts = 120; // Total time: 10min
>>>>>>>
protected static final long emptyQueueSleepTime = 500; // 500 ms
private static final long reconnectSleepTime = 5000; // 5s
private static final int reconnectAttempts = 120; // Total time: 10min
<<<<<<<
=======
private final AtomicReference<WorkerExceptionHandler> exceptionHandlerRef =
new AtomicReference<WorkerExceptionHandler>(new DefaultWorkerExceptionHandler());
>>>>>>>
private final AtomicReference<WorkerExceptionHandler> exceptionHandlerRef =
new AtomicReference<WorkerExceptionHandler>(new DefaultWorkerExceptionHandler()); |
<<<<<<<
public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) {
return new CreatorProperty(this, deser, _nullProvider);
=======
public CreatorProperty withValueDeserializer(JsonDeserializer<?> deser) {
if (_valueDeserializer == deser) {
return this;
}
return new CreatorProperty(this, deser);
>>>>>>>
public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) {
if (_valueDeserializer == deser) {
return this;
}
return new CreatorProperty(this, deser, _nullProvider); |
<<<<<<<
/**
* Factory to allow override of dismiss data
*/
protected PendingDismissData createPendingDismissData(int position, View view) {
return new PendingDismissData(position, view);
}
=======
@Override
public boolean isSwiping() {
return mSwiping;
}
>>>>>>>
@Override
public boolean isSwiping() {
return mSwiping;
}
/**
* Factory to allow override of dismiss data
*/
protected PendingDismissData createPendingDismissData(int position, View view) {
return new PendingDismissData(position, view);
}
<<<<<<<
/**
* Here you can manage dismissed View.
*/
protected void recycleDismissedViewsItems(List<PendingDismissData> pendingDismisses) {
ViewGroup.LayoutParams lp;
for (PendingDismissData pendingDismiss : pendingDismisses) {
// Reset view presentation
ViewHelper.setAlpha(pendingDismiss.view, 1f);
ViewHelper.setTranslationX(pendingDismiss.view, 0);
lp = pendingDismiss.view.getLayoutParams();
lp.height = 0;
pendingDismiss.view.setLayoutParams(lp);
}
}
protected void finalizeDismiss() {
--mDismissAnimationRefCount;
if (mDismissAnimationRefCount == 0) {
// No active animations, process all pending dismisses.
// Sort by descending position
Collections.sort(mPendingDismisses);
int[] dismissPositions = new int[mPendingDismisses.size()];
for (int i = mPendingDismisses.size() - 1; i >= 0; i--) {
dismissPositions[i] = mPendingDismisses.get(i).position;
}
mCallback.onDismiss(mListView, dismissPositions);
recycleDismissedViewsItems(mPendingDismisses);
mPendingDismisses.clear();
}
}
public void setIsParentHorizontalScrollContainer(boolean isParentHorizontalScrollContainer) {
mIsParentHorizontalScrollContainer = isParentHorizontalScrollContainer;
}
=======
void setIsParentHorizontalScrollContainer(boolean isParentHorizontalScrollContainer) {
mIsParentHorizontalScrollContainer = (mResIdOfTouchChild == 0) ? isParentHorizontalScrollContainer : false;
}
void setTouchChild(int childResId) {
mResIdOfTouchChild = childResId;
if (childResId != 0) {
setIsParentHorizontalScrollContainer(false);
}
}
>>>>>>>
/**
* Here you can manage dismissed View.
*/
protected void recycleDismissedViewsItems(List<PendingDismissData> pendingDismisses) {
ViewGroup.LayoutParams lp;
for (PendingDismissData pendingDismiss : pendingDismisses) {
// Reset view presentation
ViewHelper.setAlpha(pendingDismiss.view, 1f);
ViewHelper.setTranslationX(pendingDismiss.view, 0);
lp = pendingDismiss.view.getLayoutParams();
lp.height = 0;
pendingDismiss.view.setLayoutParams(lp);
}
}
protected void finalizeDismiss() {
--mDismissAnimationRefCount;
if (mDismissAnimationRefCount == 0) {
// No active animations, process all pending dismisses.
// Sort by descending position
Collections.sort(mPendingDismisses);
int[] dismissPositions = new int[mPendingDismisses.size()];
for (int i = mPendingDismisses.size() - 1; i >= 0; i--) {
dismissPositions[i] = mPendingDismisses.get(i).position;
}
mCallback.onDismiss(mListView, dismissPositions);
recycleDismissedViewsItems(mPendingDismisses);
mPendingDismisses.clear();
}
}
void setIsParentHorizontalScrollContainer(boolean isParentHorizontalScrollContainer) {
mIsParentHorizontalScrollContainer = (mResIdOfTouchChild == 0) ? isParentHorizontalScrollContainer : false;
}
void setTouchChild(int childResId) {
mResIdOfTouchChild = childResId;
if (childResId != 0) {
setIsParentHorizontalScrollContainer(false);
}
} |
<<<<<<<
}
if (matchDataset == null) {
LOG.warn("Dataset "+datasetName+" not found in file "+split.getPath());
// Just work on the first dataset to ensure we return some data
matchDataset = firstDataset;
}
=======
if (matchDataset == null) {
LOG.warn("Dataset "+datasetName+" not found in file "+split.getPath());
}
// Just work on the first dataset to ensure we return some data
matchDataset = firstDataset;
>>>>>>>
if (matchDataset == null) {
LOG.warn("Dataset "+datasetName+" not found in file "+split.getPath());
// Just work on the first dataset to ensure we return some data
matchDataset = firstDataset;
} |
<<<<<<<
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
=======
>>>>>>>
<<<<<<<
import com.urbanairship.http.ResponseParser;
import com.urbanairship.util.Checks;
=======
>>>>>>>
import com.urbanairship.http.ResponseParser;
import com.urbanairship.util.Checks;
<<<<<<<
import java.util.List;
=======
>>>>>>>
import java.util.List; |
<<<<<<<
Logger.warn("Automation - Cannot access the Automation API outside of the main process");
PendingResult<ActionSchedule> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult;
=======
Logger.error("Automation - Cannot access the Automation API outside of the main process");
return null;
>>>>>>>
Logger.error("Automation - Cannot access the Automation API outside of the main process");
PendingResult<ActionSchedule> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult;
<<<<<<<
Logger.warn("Automation - Cannot access the Automation API outside of the main process");
PendingResult<Collection<ActionSchedule>> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult;
=======
Logger.error("Automation - Cannot access the Automation API outside of the main process");
return null;
>>>>>>>
Logger.error("Automation - Cannot access the Automation API outside of the main process");
PendingResult<Collection<ActionSchedule>> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult;
<<<<<<<
Logger.warn("Automation - Cannot access the Automation API outside of the main process");
PendingResult<Collection<ActionSchedule>> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult;
=======
Logger.error("Automation - Cannot access the Automation API outside of the main process");
return null;
>>>>>>>
Logger.error("Automation - Cannot access the Automation API outside of the main process");
PendingResult<Collection<ActionSchedule>> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult;
<<<<<<<
Logger.warn("Automation - Cannot access the Automation API outside of the main process");
PendingResult<Collection<ActionSchedule>> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult;
=======
Logger.error("Automation - Cannot access the Automation API outside of the main process");
return null;
>>>>>>>
Logger.error("Automation - Cannot access the Automation API outside of the main process");
PendingResult<Collection<ActionSchedule>> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult;
<<<<<<<
Logger.warn("Automation - Cannot access the Automation API outside of the main process");
PendingResult<ActionSchedule> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult;
=======
Logger.error("Automation - Cannot access the Automation API outside of the main process");
return null;
>>>>>>>
Logger.error("Automation - Cannot access the Automation API outside of the main process");
PendingResult<ActionSchedule> pendingResult = new PendingResult<>();
pendingResult.setResult(null);
return pendingResult; |
<<<<<<<
import com.urbanairship.TestClock;
import com.urbanairship.TestLocaleManager;
=======
>>>>>>>
import com.urbanairship.TestClock;
<<<<<<<
runtimeConfig, testLocaleManager, mockDispatcher, clock,
mockClient, mockAttributeRegistrar, mockTagGroupRegistrar);
=======
runtimeConfig, mockClient, mockTagGroupRegistrar, localeManager,
mockDispatcher, mockPendingAttributeStore, mockAttributeClient);
>>>>>>>
runtimeConfig, localeManager, mockDispatcher, clock,
mockClient, mockAttributeRegistrar, mockTagGroupRegistrar);
<<<<<<<
airshipChannel = new AirshipChannel(getApplication(), dataStore,
runtimeConfig, testLocaleManager, mockDispatcher, clock,
mockClient, mockAttributeRegistrar, mockTagGroupRegistrar);
=======
airshipChannel = new AirshipChannel(getApplication(), getApplication().preferenceDataStore,
runtimeConfig, mockClient, mockTagGroupRegistrar, localeManager,
mockDispatcher, mockPendingAttributeStore, mockAttributeClient);
>>>>>>>
airshipChannel = new AirshipChannel(getApplication(), dataStore,
runtimeConfig, localeManager, mockDispatcher, clock,
mockClient, mockAttributeRegistrar, mockTagGroupRegistrar);
<<<<<<<
airshipChannel = new AirshipChannel(getApplication(), dataStore,
runtimeConfig, testLocaleManager, mockDispatcher, clock,
mockClient, mockAttributeRegistrar, mockTagGroupRegistrar);
=======
airshipChannel = new AirshipChannel(getApplication(), getApplication().preferenceDataStore,
runtimeConfig, mockClient, mockTagGroupRegistrar, localeManager,
mockDispatcher, mockPendingAttributeStore, mockAttributeClient);
>>>>>>>
airshipChannel = new AirshipChannel(getApplication(), dataStore,
runtimeConfig, localeManager, mockDispatcher, clock,
mockClient, mockAttributeRegistrar, mockTagGroupRegistrar);
<<<<<<<
airshipChannel = new AirshipChannel(getApplication(), dataStore,
runtimeConfig, testLocaleManager, mockDispatcher, clock,
mockClient, mockAttributeRegistrar, mockTagGroupRegistrar);
=======
airshipChannel = new AirshipChannel(getApplication(), getApplication().preferenceDataStore,
runtimeConfig, mockClient, mockTagGroupRegistrar, localeManager,
mockDispatcher, mockPendingAttributeStore, mockAttributeClient);
>>>>>>>
airshipChannel = new AirshipChannel(getApplication(), dataStore,
runtimeConfig, localeManager, mockDispatcher, clock,
mockClient, mockAttributeRegistrar, mockTagGroupRegistrar); |
<<<<<<<
UAirship.sharedAirship.channel = new AirshipChannel(this, preferenceDataStore, UAirship.sharedAirship.runtimeConfig);
UAirship.sharedAirship.analytics = new Analytics(this, preferenceDataStore, testRuntimeConfig, UAirship.sharedAirship.channel);
=======
UAirship.sharedAirship.localeManager = new LocaleManager(this, preferenceDataStore);
TagGroupRegistrar tagGroupRegistrar = new TagGroupRegistrar(UAirship.sharedAirship.runtimeConfig, preferenceDataStore);
UAirship.sharedAirship.channel = new AirshipChannel(this, preferenceDataStore, UAirship.sharedAirship.runtimeConfig, tagGroupRegistrar, UAirship.sharedAirship.localeManager);
UAirship.sharedAirship.analytics = new Analytics(this, preferenceDataStore, testRuntimeConfig, UAirship.sharedAirship.channel, UAirship.sharedAirship.localeManager);
>>>>>>>
UAirship.sharedAirship.localeManager = new LocaleManager(this, preferenceDataStore);
UAirship.sharedAirship.channel = new AirshipChannel(this, preferenceDataStore, UAirship.sharedAirship.runtimeConfig, UAirship.sharedAirship.localeManager);
UAirship.sharedAirship.analytics = new Analytics(this, preferenceDataStore, testRuntimeConfig, UAirship.sharedAirship.channel, UAirship.sharedAirship.localeManager); |
<<<<<<<
public static final String DEFAULT_WINRM_PASSWORD_OPTION = "option.winrmPassword";
public static final int DEFAULT_WINRM_PORT = 5986;
public static final int DEFAULT_WINRM_UNENCRYPTED_PORT = 5985;
public static final String WINRM_CONNTYPE_PROPERTY = "winrm-encrypted";
public static final String WINRM_TIMEOUT_PROPERTY = "winrm-timeout";
=======
public static final String DEFAULT_WINRM_PASSWORD_OPTION = "winrmPassword";
public static final int DEFAULT_HTTPS_PORT = 5986;
public static final int DEFAULT_HTTP_PORT = 5985;
public static final String WINRM_CONNECTION_TIMEOUT_PROPERTY = "winrm-connection-timeout";
>>>>>>>
public static final String DEFAULT_WINRM_PASSWORD_OPTION = "winrmPassword";
public static final int DEFAULT_HTTPS_PORT = 5986;
public static final int DEFAULT_HTTP_PORT = 5985;
public static final String WINRM_CONNECTION_TIMEOUT_PROPERTY = "winrm-connection-timeout";
<<<<<<<
public boolean getConnectionType() {
return resolveBooleanProperty(WINRM_CONNTYPE_PROPERTY, DEFAULT_WINRM_CONNECTION_ENCRYPTED,
node, frameworkProject, framework);
}
public int getConnectionTimeout() {
return resolveIntProperty(WINRM_TIMEOUT_PROPERTY, DEFAULT_WINRM_CONNECTION_TIMEOUT, node, frameworkProject,
framework);
=======
public int getConnectionTimeout() throws ConfigurationException {
return resolveIntProperty(WINRM_CONNECTION_TIMEOUT_PROPERTY, DEFAULT_WINRM_CONNECTION_TIMEOUT, getNode(),
getFrameworkProject(),
getFramework());
>>>>>>>
public int getConnectionTimeout() throws ConfigurationException {
return resolveIntProperty(WINRM_CONNECTION_TIMEOUT_PROPERTY, DEFAULT_WINRM_CONNECTION_TIMEOUT, getNode(),
getFrameworkProject(),
getFramework());
<<<<<<<
private int getPort(boolean encrypted) {
=======
public Boolean isDebugKerberosAuth() {
return resolveBooleanProperty(DEBUG_KERBEROS_AUTH, DEFAULT_DEBUG_KERBEROS_AUTH, getNode(), getFrameworkProject(),
getFramework());
}
public Boolean isWinrmSpnAddPort() {
return resolveBooleanProperty(WINRM_SPN_ADD_PORT, false, getNode(), getFrameworkProject(),
getFramework());
}
public Boolean isWinrmSpnUseHttp() {
return resolveBooleanProperty(WINRM_SPN_USE_HTTP, false, getNode(), getFrameworkProject(),
getFramework());
}
public String getWinrmLocale() {
return resolveProperty(WINRM_LOCALE, null, getNode(), getFrameworkProject(), getFramework());
}
public String getWinrmTimeout() {
return resolveProperty(WINRM_TIMEOUT, null, getNode(), getFrameworkProject(), getFramework());
}
private int getPort(final int defaultPort) throws ConfigurationException {
>>>>>>>
public Boolean isDebugKerberosAuth() {
return resolveBooleanProperty(DEBUG_KERBEROS_AUTH, DEFAULT_DEBUG_KERBEROS_AUTH, getNode(), getFrameworkProject(),
getFramework());
}
public Boolean isWinrmSpnAddPort() {
return resolveBooleanProperty(WINRM_SPN_ADD_PORT, false, getNode(), getFrameworkProject(),
getFramework());
}
public Boolean isWinrmSpnUseHttp() {
return resolveBooleanProperty(WINRM_SPN_USE_HTTP, false, getNode(), getFrameworkProject(),
getFramework());
}
public String getWinrmLocale() {
return resolveProperty(WINRM_LOCALE, null, getNode(), getFrameworkProject(), getFramework());
}
public String getWinrmTimeout() {
return resolveProperty(WINRM_TIMEOUT, null, getNode(), getFrameworkProject(), getFramework());
}
private int getPort(final int defaultPort) throws ConfigurationException {
<<<<<<<
final int defaultPort = encrypted ? DEFAULT_WINRM_PORT : DEFAULT_WINRM_UNENCRYPTED_PORT;
return resolveIntProperty(WINRM_PORT, defaultPort, node, frameworkProject, framework);
=======
return resolveIntProperty(WINRM_PORT, defaultPort, getNode(), getFrameworkProject(), getFramework());
>>>>>>>
return resolveIntProperty(WINRM_PORT, defaultPort, getNode(), getFrameworkProject(), getFramework());
<<<<<<<
final boolean encrypted = getConnectionType();
=======
if (isHttps) {
final String certTrustStrategy = getCertTrustStrategy();
WinrmHttpsCertificateTrustStrategy strategy = WinrmHttpsCertificateTrustStrategy.valueOf
(certTrustStrategy);
if (null != certTrustStrategy) {
options.set(CifsConnectionBuilder.WINRM_HTTPS_CERTIFICATE_TRUST_STRATEGY, strategy);
}
final String hostnameTrustStrategy = getHostnameTrustStrategy();
WinrmHttpsHostnameVerificationStrategy hostStrat = WinrmHttpsHostnameVerificationStrategy.valueOf
(hostnameTrustStrategy);
if (null != hostnameTrustStrategy) {
options.set(CifsConnectionBuilder.WINRM_HTTPS_HOSTNAME_VERIFICATION_STRATEGY, hostStrat);
}
}
options.set(ADDRESS, getHostname());
options.set(USERNAME, username);
>>>>>>>
if (isHttps) {
final String certTrustStrategy = getCertTrustStrategy();
WinrmHttpsCertificateTrustStrategy strategy = WinrmHttpsCertificateTrustStrategy.valueOf
(certTrustStrategy);
if (null != certTrustStrategy) {
options.set(CifsConnectionBuilder.WINRM_HTTPS_CERTIFICATE_TRUST_STRATEGY, strategy);
}
final String hostnameTrustStrategy = getHostnameTrustStrategy();
WinrmHttpsHostnameVerificationStrategy hostStrat = WinrmHttpsHostnameVerificationStrategy.valueOf
(hostnameTrustStrategy);
if (null != hostnameTrustStrategy) {
options.set(CifsConnectionBuilder.WINRM_HTTPS_HOSTNAME_VERIFICATION_STRATEGY, hostStrat);
}
}
options.set(ADDRESS, getHostname());
options.set(USERNAME, username);
<<<<<<<
options.set(CONNECTION_TYPE, encrypted ? WINRM_HTTPS : WINRM_HTTP);
=======
>>>>>>>
<<<<<<<
options.set(PORT, getPort(encrypted));
=======
options.set(PORT, getPort(isHttps ? DEFAULT_HTTPS_PORT : DEFAULT_HTTP_PORT));
options.set(CifsConnectionBuilder.CONNECTION_TYPE, CifsConnectionType.WINRM);
options.set(CifsConnectionBuilder.WINRM_ENABLE_HTTPS, isHttps);
options.set(CifsConnectionBuilder.WINRM_KERBEROS_ADD_PORT_TO_SPN, isWinrmSpnAddPort());
options.set(CifsConnectionBuilder.WINRM_KERBEROS_USE_HTTP_SPN, isWinrmSpnUseHttp());
if (null != getWinrmLocale()) {
options.set(CifsConnectionBuilder.WINRM_LOCALE, getWinrmLocale());
}
if (null != getWinrmTimeout()) {
options.set(CifsConnectionBuilder.WINRM_TIMEMOUT, getWinrmTimeout());
}
>>>>>>>
options.set(PORT, getPort(isHttps ? DEFAULT_HTTPS_PORT : DEFAULT_HTTP_PORT));
options.set(CifsConnectionBuilder.CONNECTION_TYPE, CifsConnectionType.WINRM);
options.set(CifsConnectionBuilder.WINRM_ENABLE_HTTPS, isHttps);
options.set(CifsConnectionBuilder.WINRM_KERBEROS_ADD_PORT_TO_SPN, isWinrmSpnAddPort());
options.set(CifsConnectionBuilder.WINRM_KERBEROS_USE_HTTP_SPN, isWinrmSpnUseHttp());
if (null != getWinrmLocale()) {
options.set(CifsConnectionBuilder.WINRM_LOCALE, getWinrmLocale());
}
if (null != getWinrmTimeout()) {
options.set(CifsConnectionBuilder.WINRM_TIMEMOUT, getWinrmTimeout());
} |
<<<<<<<
// Configuration is null in some contexts (e.g. TableDesc#getDeserializer)
// so we have to be defensive here
if (configuration != null) {
configuration.set(HAIVVREO_SCHEMA, schema.toString(false));
// force output files to have a .avro extension
configuration.set("hive.output.file.extension", ".avro");
}
=======
if(configuration == null) {
LOG.info("Configuration null, not inserting schema");
} else {
configuration.set(HAIVVREO_SCHEMA, schema.toString(false));
}
>>>>>>>
if(configuration == null) {
LOG.info("Configuration null, not inserting schema");
} else {
// force output files to have a .avro extension
configuration.set("hive.output.file.extension", ".avro");
configuration.set(HAIVVREO_SCHEMA, schema.toString(false));
} |
<<<<<<<
import org.droidplanner.android.proxy.mission.item.MissionItemProxy;
import org.droidplanner.android.proxy.mission.MissionProxy;
=======
import org.droidplanner.android.mission.MissionRender;
import org.droidplanner.android.mission.MissionSelection;
import org.droidplanner.android.mission.item.MissionItemRender;
>>>>>>>
import org.droidplanner.android.mission.MissionSelection;
import org.droidplanner.android.proxy.mission.item.MissionItemProxy;
import org.droidplanner.android.proxy.mission.MissionProxy;
<<<<<<<
OnClickListener, MissionProxy.OnSelectionUpdateListener {
=======
OnClickListener, MissionSelection.OnSelectionUpdateListener {
>>>>>>>
OnClickListener, MissionSelection.OnSelectionUpdateListener {
<<<<<<<
missionProxy.addSelectionUpdateListener(this);
=======
missionRender.selection.addSelectionUpdateListener(this);
>>>>>>>
missionProxy.selection.addSelectionUpdateListener(this);
<<<<<<<
missionProxy.removeSelectionUpdateListener(this);
=======
missionRender.selection.removeSelectionUpdateListener(this);
>>>>>>>
missionProxy.selection.removeSelectionUpdateListener(this);
<<<<<<<
public void deleteSelected() {
SparseBooleanArray selected = list.getCheckedItemPositions();
ArrayList<MissionItemProxy> toRemove = new ArrayList<MissionItemProxy>();
for (int i = 0; i < selected.size(); i++) {
if (selected.valueAt(i)) {
MissionItemProxy item = adapter.getItem(selected.keyAt(i));
toRemove.add(item);
}
}
missionProxy.removeWaypoints(toRemove);
}
=======
>>>>>>> |
<<<<<<<
// 15-Oct-2010, tatu: Can't assume missing message is an error, since it may be
// suppressed during serialization, as per [JACKSON-388].
//
// Should probably allow use of default constructor, too...
//throw new XxxException("No 'message' property found: could not deserialize "+_beanType);
=======
/* 15-Oct-2010, tatu: Can't assume missing message is an error, since it may be
* suppressed during serialization.
*
* Should probably allow use of default constructor, too...
*/
//throw new XxxException("No 'message' property found: could not deserialize "+_beanType);
>>>>>>>
// 15-Oct-2010, tatu: Can't assume missing message is an error, since it may be
// suppressed during serialization.
//
// Should probably allow use of default constructor, too...
//throw new XxxException("No 'message' property found: could not deserialize "+_beanType); |
<<<<<<<
import com.o3dr.services.android.lib.drone.action.CameraActions;
=======
import com.o3dr.services.android.lib.coordinate.LatLongAlt;
>>>>>>>
import com.o3dr.services.android.lib.drone.action.CameraActions;
import com.o3dr.services.android.lib.coordinate.LatLongAlt;
<<<<<<<
if (droneMgr != null) {
final DroneAttribute attribute = droneMgr.getAttribute(type);
if (attribute != null)
=======
if(droneMgr != null) {
DroneAttribute attribute = droneMgr.getAttribute(type);
if (attribute != null) {
//Check if the client supports the ResetROI mission item.
// Replace it with a RegionOfInterest with coordinate set to 0 if it doesn't.
if(getClientVersionCode() < RESET_ROI_LIB_VERSION && attribute instanceof Mission){
Mission proxyMission = (Mission) attribute;
List<MissionItem> missionItems = proxyMission.getMissionItems();
int missionItemsCount = missionItems.size();
for(int i = 0; i < missionItemsCount; i++){
MissionItem missionItem = missionItems.get(i);
if(missionItem instanceof ResetROI){
missionItems.remove(i);
RegionOfInterest replacement = new RegionOfInterest();
replacement.setCoordinate(new LatLongAlt(0, 0, 0));
missionItems.add(i, replacement);
}
}
}
>>>>>>>
if(droneMgr != null) {
DroneAttribute attribute = droneMgr.getAttribute(type);
if (attribute != null) {
//Check if the client supports the ResetROI mission item.
// Replace it with a RegionOfInterest with coordinate set to 0 if it doesn't.
if(getClientVersionCode() < RESET_ROI_LIB_VERSION && attribute instanceof Mission){
Mission proxyMission = (Mission) attribute;
List<MissionItem> missionItems = proxyMission.getMissionItems();
int missionItemsCount = missionItems.size();
for(int i = 0; i < missionItemsCount; i++){
MissionItem missionItem = missionItems.get(i);
if(missionItem instanceof ResetROI){
missionItems.remove(i);
RegionOfInterest replacement = new RegionOfInterest();
replacement.setCoordinate(new LatLongAlt(0, 0, 0));
missionItems.add(i, replacement);
}
}
} |
<<<<<<<
=======
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.MapperFeature;
>>>>>>>
import com.fasterxml.jackson.databind.MapperFeature;
<<<<<<<
_propsInOrder = props.toArray(new SettableBeanProperty[0]);
// Former `assignIndexes`
// order is arbitrary, but stable:
if (assignIndexes) {
// note: only assign to primary entries, not to aliased (since they are dups)
for (int i = 0, end = props.size(); i < end; ++i) {
_propsInOrder[i].assignIndex(i);
=======
_aliasMapping = _buildAliasMapping(aliasDefs);
_locale = locale;
init(props);
}
/**
* @deprecated since 2.11
*/
@Deprecated
public BeanPropertyMap(boolean caseInsensitive, Collection<SettableBeanProperty> props,
Map<String,List<PropertyName>> aliasDefs) {
this(caseInsensitive, props, aliasDefs, Locale.getDefault());
}
/* Copy constructors used when a property can replace existing one
*
* @since 2.9.6
*/
private BeanPropertyMap(BeanPropertyMap src,
SettableBeanProperty newProp, int hashIndex, int orderedIndex)
{
// First, copy most fields as is:
_caseInsensitive = src._caseInsensitive;
_locale = src._locale;
_hashMask = src._hashMask;
_size = src._size;
_spillCount = src._spillCount;
_aliasDefs = src._aliasDefs;
_aliasMapping = src._aliasMapping;
// but then make deep copy of arrays to modify
_hashArea = Arrays.copyOf(src._hashArea, src._hashArea.length);
_propsInOrder = Arrays.copyOf(src._propsInOrder, src._propsInOrder.length);
_hashArea[hashIndex] = newProp;
_propsInOrder[orderedIndex] = newProp;
}
/* Copy constructors used when a property needs to be appended (can't replace)
*
* @since 2.9.6
*/
private BeanPropertyMap(BeanPropertyMap src,
SettableBeanProperty newProp, String key, int slot)
{
// First, copy most fields as is:
_caseInsensitive = src._caseInsensitive;
_locale = src._locale;
_hashMask = src._hashMask;
_size = src._size;
_spillCount = src._spillCount;
_aliasDefs = src._aliasDefs;
_aliasMapping = src._aliasMapping;
// but then make deep copy of arrays to modify
_hashArea = Arrays.copyOf(src._hashArea, src._hashArea.length);
int last = src._propsInOrder.length;
// and append property at the end of ordering
_propsInOrder = Arrays.copyOf(src._propsInOrder, last+1);
_propsInOrder[last] = newProp;
final int hashSize = _hashMask+1;
int ix = (slot<<1);
// primary slot not free?
if (_hashArea[ix] != null) {
// secondary?
ix = (hashSize + (slot >> 1)) << 1;
if (_hashArea[ix] != null) {
// ok, spill over.
ix = ((hashSize + (hashSize >> 1) ) << 1) + _spillCount;
_spillCount += 2;
if (ix >= _hashArea.length) {
_hashArea = Arrays.copyOf(_hashArea, _hashArea.length + 4);
}
>>>>>>>
_propsInOrder = props.toArray(new SettableBeanProperty[0]);
// Former `assignIndexes`
// order is arbitrary, but stable:
if (assignIndexes) {
// note: only assign to primary entries, not to aliased (since they are dups)
for (int i = 0, end = props.size(); i < end; ++i) {
_propsInOrder[i].assignIndex(i);
<<<<<<<
=======
@Deprecated // since 2.8
public BeanPropertyMap(boolean caseInsensitive, Collection<SettableBeanProperty> props)
{
this(caseInsensitive, props, Collections.<String,List<PropertyName>>emptyMap(),
Locale.getDefault());
}
/**
* @since 2.8
*/
>>>>>>>
<<<<<<<
=======
protected void init(Collection<SettableBeanProperty> props)
{
_size = props.size();
// First: calculate size of primary hash area
final int hashSize = findSize(_size);
_hashMask = hashSize-1;
// and allocate enough to contain primary/secondary, expand for spillovers as need be
int alloc = (hashSize + (hashSize>>1)) * 2;
Object[] hashed = new Object[alloc];
int spillCount = 0;
for (SettableBeanProperty prop : props) {
// Due to removal, renaming, theoretically possible we'll have "holes" so:
if (prop == null) {
continue;
}
String key = getPropertyName(prop);
int slot = _hashCode(key);
int ix = (slot<<1);
// primary slot not free?
if (hashed[ix] != null) {
// secondary?
ix = (hashSize + (slot >> 1)) << 1;
if (hashed[ix] != null) {
// ok, spill over.
ix = ((hashSize + (hashSize >> 1) ) << 1) + spillCount;
spillCount += 2;
if (ix >= hashed.length) {
hashed = Arrays.copyOf(hashed, hashed.length + 4);
}
}
}
hashed[ix] = key;
hashed[ix+1] = prop;
// and aliases
}
_hashArea = hashed;
_spillCount = spillCount;
}
private final static int findSize(int size)
{
if (size <= 5) {
return 8;
}
if (size <= 12) {
return 16;
}
int needed = size + (size >> 2); // at most 80% full
int result = 32;
while (result < needed) {
result += result;
}
return result;
}
/**
* @since 2.11
*/
public static BeanPropertyMap construct(MapperConfig<?> config,
Collection<SettableBeanProperty> props,
Map<String,List<PropertyName>> aliasMapping) {
return new BeanPropertyMap(config.isEnabled(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES),
props, aliasMapping,
config.getLocale());
}
/**
* @deprecated since 2.11
*/
@Deprecated
public static BeanPropertyMap construct(Collection<SettableBeanProperty> props,
boolean caseInsensitive, Map<String,List<PropertyName>> aliasMapping) {
return new BeanPropertyMap(caseInsensitive, props, aliasMapping);
}
@Deprecated // since 2.9
public static BeanPropertyMap construct(Collection<SettableBeanProperty> props, boolean caseInsensitive) {
return construct(props, caseInsensitive,
Collections.<String,List<PropertyName>>emptyMap());
}
>>>>>>>
<<<<<<<
=======
// Confining this case insensitivity to this function (and the find method) in case we want to
// apply a particular locale to the lower case function. For now, using the default.
protected final String getPropertyName(SettableBeanProperty prop) {
return _caseInsensitive ? prop.getName().toLowerCase(_locale) : prop.getName();
}
>>>>>>>
<<<<<<<
for (SettableBeanProperty prop : _propsInOrder) {
if (key.equals(prop.getName())) {
return prop;
=======
if (_caseInsensitive) {
key = key.toLowerCase(_locale);
}
// inlined `_hashCode(key)`
int slot = key.hashCode() & _hashMask;
// int h = key.hashCode();
// int slot = (h + (h >> 13)) & _hashMask;
int ix = (slot<<1);
Object match = _hashArea[ix];
if ((match == key) || key.equals(match)) {
return (SettableBeanProperty) _hashArea[ix+1];
}
return _find2(key, slot, match);
}
private final SettableBeanProperty _find2(String key, int slot, Object match)
{
if (match == null) {
// 26-Feb-2017, tatu: Need to consider aliases
return _findWithAlias(_aliasMapping.get(key));
}
// no? secondary?
int hashSize = _hashMask+1;
int ix = hashSize + (slot>>1) << 1;
match = _hashArea[ix];
if (key.equals(match)) {
return (SettableBeanProperty) _hashArea[ix+1];
}
if (match != null) { // _findFromSpill(...)
int i = (hashSize + (hashSize>>1)) << 1;
for (int end = i + _spillCount; i < end; i += 2) {
match = _hashArea[i];
if ((match == key) || key.equals(match)) {
return (SettableBeanProperty) _hashArea[i+1];
}
}
}
// 26-Feb-2017, tatu: Need to consider aliases
return _findWithAlias(_aliasMapping.get(key));
}
private SettableBeanProperty _findWithAlias(String keyFromAlias)
{
if (keyFromAlias == null) {
return null;
}
// NOTE: need to inline much of handling do avoid cyclic calls via alias
// first, inlined main `find(String)`
int slot = _hashCode(keyFromAlias);
int ix = (slot<<1);
Object match = _hashArea[ix];
if (keyFromAlias.equals(match)) {
return (SettableBeanProperty) _hashArea[ix+1];
}
if (match == null) {
return null;
}
return _find2ViaAlias(keyFromAlias, slot, match);
}
private SettableBeanProperty _find2ViaAlias(String key, int slot, Object match)
{
// no? secondary?
int hashSize = _hashMask+1;
int ix = hashSize + (slot>>1) << 1;
match = _hashArea[ix];
if (key.equals(match)) {
return (SettableBeanProperty) _hashArea[ix+1];
}
if (match != null) { // _findFromSpill(...)
int i = (hashSize + (hashSize>>1)) << 1;
for (int end = i + _spillCount; i < end; i += 2) {
match = _hashArea[i];
if ((match == key) || key.equals(match)) {
return (SettableBeanProperty) _hashArea[i+1];
}
>>>>>>>
for (SettableBeanProperty prop : _propsInOrder) {
if (key.equals(prop.getName())) {
return prop;
<<<<<<<
=======
/*
/**********************************************************
/* Helper methods
/**********************************************************
*/
protected SettableBeanProperty _rename(SettableBeanProperty prop, NameTransformer xf)
{
if (prop == null) {
return prop;
}
String newName = xf.transform(prop.getName());
prop = prop.withSimpleName(newName);
JsonDeserializer<?> deser = prop.getValueDeserializer();
if (deser != null) {
@SuppressWarnings("unchecked")
JsonDeserializer<Object> newDeser = (JsonDeserializer<Object>)
deser.unwrappingDeserializer(xf);
if (newDeser != deser) {
prop = prop.withValueDeserializer(newDeser);
}
}
return prop;
}
protected void wrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt)
throws IOException
{
// inlined 'throwOrReturnThrowable'
while (t instanceof InvocationTargetException && t.getCause() != null) {
t = t.getCause();
}
// Errors to be passed as is
ClassUtil.throwIfError(t);
// StackOverflowErrors are tricky ones; need to be careful...
boolean wrap = (ctxt == null) || ctxt.isEnabled(DeserializationFeature.WRAP_EXCEPTIONS);
// Ditto for IOExceptions; except we may want to wrap JSON exceptions
if (t instanceof IOException) {
if (!wrap || !(t instanceof JsonProcessingException)) {
throw (IOException) t;
}
} else if (!wrap) { // allow disabling wrapping for unchecked exceptions
ClassUtil.throwIfRTE(t);
}
throw JsonMappingException.wrapWithPath(t, bean, fieldName);
}
/**
* Helper method used to find exact location of a property with name
* given exactly, not subject to case changes, within hash area.
* Expectation is that such property SHOULD exist, although no
* exception is thrown.
*
* @since 2.7
*/
private final int _findIndexInHash(String key)
{
final int slot = _hashCode(key);
int ix = (slot<<1);
// primary match?
if (key.equals(_hashArea[ix])) {
return ix+1;
}
// no? secondary?
int hashSize = _hashMask+1;
ix = hashSize + (slot>>1) << 1;
if (key.equals(_hashArea[ix])) {
return ix+1;
}
// perhaps spill then
int i = (hashSize + (hashSize>>1)) << 1;
for (int end = i + _spillCount; i < end; i += 2) {
if (key.equals(_hashArea[i])) {
return i+1;
}
}
return -1;
}
private final int _findFromOrdered(SettableBeanProperty prop) {
for (int i = 0, end = _propsInOrder.length; i < end; ++i) {
if (_propsInOrder[i] == prop) {
return i;
}
}
throw new IllegalStateException("Illegal state: property '"+prop.getName()+"' missing from _propsInOrder");
}
// Offlined version for convenience if we want to change hashing scheme
private final int _hashCode(String key) {
// This method produces better hash, fewer collisions... yet for some
// reason produces slightly worse performance. Very strange.
// 05-Aug-2015, tatu: ... still true?
/*
int h = key.hashCode();
return (h + (h >> 13)) & _hashMask;
*/
return key.hashCode() & _hashMask;
}
// @since 2.9
private Map<String,String> _buildAliasMapping(Map<String,List<PropertyName>> defs)
{
if ((defs == null) || defs.isEmpty()) {
return Collections.emptyMap();
}
Map<String,String> aliases = new HashMap<>();
for (Map.Entry<String,List<PropertyName>> entry : defs.entrySet()) {
String key = entry.getKey();
if (_caseInsensitive) {
key = key.toLowerCase(_locale);
}
for (PropertyName pn : entry.getValue()) {
String mapped = pn.getSimpleName();
if (_caseInsensitive) {
mapped = mapped.toLowerCase();
}
aliases.put(mapped, key);
}
}
return aliases;
}
>>>>>>> |
<<<<<<<
import org.droidplanner.services.android.core.survey.CameraInfo;
=======
>>>>>>>
<<<<<<<
import org.droidplanner.services.android.core.drone.manager.DroneManager;
=======
import org.droidplanner.services.android.communication.connection.AndroidMavLinkConnection;
import org.droidplanner.services.android.communication.connection.AndroidTcpConnection;
import org.droidplanner.services.android.communication.connection.AndroidUdpConnection;
import org.droidplanner.services.android.communication.connection.BluetoothConnection;
import org.droidplanner.services.android.communication.connection.SoloConnection;
import org.droidplanner.services.android.communication.connection.usb.UsbConnection;
import org.droidplanner.services.android.core.MAVLink.connection.MavLinkConnection;
import org.droidplanner.services.android.core.MAVLink.connection.MavLinkConnectionListener;
import org.droidplanner.services.android.core.drone.DroneManager;
import org.droidplanner.services.android.core.survey.CameraInfo;
>>>>>>>
import org.droidplanner.services.android.communication.connection.AndroidMavLinkConnection;
import org.droidplanner.services.android.communication.connection.AndroidTcpConnection;
import org.droidplanner.services.android.communication.connection.AndroidUdpConnection;
import org.droidplanner.services.android.communication.connection.BluetoothConnection;
import org.droidplanner.services.android.communication.connection.SoloConnection;
import org.droidplanner.services.android.communication.connection.usb.UsbConnection;
import org.droidplanner.services.android.core.MAVLink.connection.MavLinkConnection;
import org.droidplanner.services.android.core.MAVLink.connection.MavLinkConnectionListener;
import org.droidplanner.services.android.core.drone.DroneManager;
import org.droidplanner.services.android.core.survey.CameraInfo;
import org.droidplanner.services.android.core.drone.manager.DroneManager;
<<<<<<<
=======
import org.droidplanner.services.android.utils.analytics.GAUtils;
import org.droidplanner.services.android.utils.connection.WifiConnectionHandler;
>>>>>>>
import org.droidplanner.services.android.utils.analytics.GAUtils;
<<<<<<<
droneMgr = DroneManager.generateDroneManager(getApplicationContext(), connParams, new Handler(Looper.getMainLooper()));
=======
droneMgr = new DroneManager(context, connParams, new Handler(Looper.getMainLooper()),
mavlinkApi);
>>>>>>>
droneMgr = DroneManager.generateDroneManager(getApplicationContext(), connParams, new Handler(Looper.getMainLooper()));
<<<<<<<
=======
* Setup a MAVLink connection using the given parameter.
*
* @param connParams Parameter used to setup the MAVLink connection.
* @param listenerTag Used to identify the connection requester.
* @param listener Callback to receive the connection events.
*/
void connectMAVConnection(final ConnectionParameter connParams, final String listenerTag, final MavLinkConnectionListener listener) {
AndroidMavLinkConnection conn = mavConnections.get(connParams.getUniqueId());
final int connectionType = connParams.getConnectionType();
final Bundle paramsBundle = connParams.getParamsBundle();
if (conn == null) {
//Create a new mavlink connection
switch (connectionType) {
case ConnectionType.TYPE_USB:
final int baudRate = paramsBundle.getInt(ConnectionType.EXTRA_USB_BAUD_RATE,
ConnectionType.DEFAULT_USB_BAUD_RATE);
conn = new UsbConnection(getApplicationContext(), baudRate);
Timber.d("Connecting over usb.");
break;
case ConnectionType.TYPE_BLUETOOTH:
//Retrieve the bluetooth address to connect to
final String bluetoothAddress = paramsBundle.getString(ConnectionType.EXTRA_BLUETOOTH_ADDRESS);
conn = new BluetoothConnection(getApplicationContext(), bluetoothAddress);
Timber.d("Connecting over bluetooth.");
break;
case ConnectionType.TYPE_TCP:
//Retrieve the server ip and port
final String tcpServerIp = paramsBundle.getString(ConnectionType.EXTRA_TCP_SERVER_IP);
final int tcpServerPort = paramsBundle.getInt(ConnectionType
.EXTRA_TCP_SERVER_PORT, ConnectionType.DEFAULT_TCP_SERVER_PORT);
conn = new AndroidTcpConnection(getApplicationContext(), tcpServerIp, tcpServerPort);
Timber.d("Connecting over tcp.");
break;
case ConnectionType.TYPE_UDP:
final int udpServerPort = paramsBundle
.getInt(ConnectionType.EXTRA_UDP_SERVER_PORT, ConnectionType.DEFAULT_UDP_SERVER_PORT);
conn = new AndroidUdpConnection(getApplicationContext(), udpServerPort);
Timber.d("Connecting over udp.");
break;
case ConnectionType.TYPE_SOLO: {
Timber.i("Creating solo connection");
final String soloLinkId = paramsBundle.getString(ConnectionType.EXTRA_SOLO_LINK_ID, null);
final String linkPassword = paramsBundle.getString(ConnectionType.EXTRA_SOLO_LINK_PASSWORD, null);
conn = new SoloConnection(getApplicationContext(), soloLinkId, linkPassword);
break;
}
default:
Timber.e("Unrecognized connection type: %s", connectionType);
return;
}
mavConnections.put(connParams.getUniqueId(), conn);
}
if (connectionType == ConnectionType.TYPE_UDP) {
final String pingIpAddress = paramsBundle.getString(ConnectionType.EXTRA_UDP_PING_RECEIVER_IP);
if (!TextUtils.isEmpty(pingIpAddress)) {
try {
final InetAddress resolvedAddress = InetAddress.getByName(pingIpAddress);
final int pingPort = paramsBundle.getInt(ConnectionType.EXTRA_UDP_PING_RECEIVER_PORT);
final long pingPeriod = paramsBundle.getLong(ConnectionType.EXTRA_UDP_PING_PERIOD,
ConnectionType.DEFAULT_UDP_PING_PERIOD);
final byte[] pingPayload = paramsBundle.getByteArray(ConnectionType.EXTRA_UDP_PING_PAYLOAD);
((AndroidUdpConnection) conn).addPingTarget(resolvedAddress, pingPort, pingPeriod, pingPayload);
} catch (UnknownHostException e) {
Timber.e(e, "Unable to resolve UDP ping server ip address.");
}
}
}
conn.addMavLinkConnectionListener(listenerTag, listener);
if (conn.getConnectionStatus() == MavLinkConnection.MAVLINK_DISCONNECTED) {
conn.connect();
// Record which connection type is used.
GAUtils.sendEvent(new HitBuilders.EventBuilder()
.setCategory(GAUtils.Category.MAVLINK_CONNECTION)
.setAction("MavLink connect")
.setLabel(connParams.toString()));
}
}
/**
* Disconnect the MAVLink connection for the given listener.
*
* @param connParams Connection parameters
* @param listenerTag Listener to be disconnected.
*/
void disconnectMAVConnection(ConnectionParameter connParams, String listenerTag) {
final AndroidMavLinkConnection conn = mavConnections.get(connParams.getUniqueId());
if (conn == null)
return;
conn.removeMavLinkConnectionListener(listenerTag);
if (conn.getMavLinkConnectionListenersCount() == 0 && conn.getConnectionStatus() !=
MavLinkConnection.MAVLINK_DISCONNECTED) {
Timber.d("Disconnecting...");
conn.disconnect();
GAUtils.sendEvent(new HitBuilders.EventBuilder()
.setCategory(GAUtils.Category.MAVLINK_CONNECTION)
.setAction("MavLink disconnect")
.setLabel(connParams.toString()));
}
}
/**
* Register a log listener.
*
* @param connParams Parameters whose connection's data to log.
* @param tag Tag for the listener.
* @param loggingFilePath File path for the logging file.
*/
void addLoggingFile(ConnectionParameter connParams, String tag, String loggingFilePath) {
AndroidMavLinkConnection conn = mavConnections.get(connParams.getUniqueId());
if (conn == null)
return;
conn.addLoggingPath(tag, loggingFilePath);
}
/**
* Unregister a log listener.
*
* @param connParams Connection parameters from whom to stop the logging.
* @param tag Tag for the listener.
*/
void removeLoggingFile(ConnectionParameter connParams, String tag) {
AndroidMavLinkConnection conn = mavConnections.get(connParams.getUniqueId());
if (conn == null)
return;
conn.removeLoggingPath(tag);
}
/**
>>>>>>>
<<<<<<<
final WifiManager wifiMgr = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
wifiLock = wifiMgr.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, TAG);
Timber.i("Acquiring wifi wake lock.");
wifiLock.acquire();
=======
mavlinkApi = new MavLinkServiceApi(this);
>>>>>>> |
<<<<<<<
/* 05-Aug-2011, tatu: Also, must check for EOF here before
* calling readValue(), since that'll choke on it otherwise
*/
JsonToken t = p.currentToken();
=======
// Must check for EOF here before calling readValue(), since that'll choke on it otherwise
DeserializationConfig cfg = getDeserializationConfig();
JsonToken t = p.getCurrentToken();
>>>>>>>
// Must check for EOF here before calling readValue(), since that'll choke on it otherwise
JsonToken t = p.currentToken();
<<<<<<<
DeserializationContext ctxt = createDeserializationContext(p);
JsonNode n = (JsonNode) _readValue(ctxt, p, JSON_NODE_TYPE);
=======
// NOTE! _readValue() will check for trailing tokens
JsonNode n = (JsonNode) _readValue(cfg, p, JSON_NODE_TYPE);
>>>>>>>
DeserializationContext ctxt = createDeserializationContext(p);
// NOTE! _readValue() will check for trailing tokens
JsonNode n = (JsonNode) _readValue(ctxt, p, JSON_NODE_TYPE); |
<<<<<<<
public void setFailsafe(String newFailsafe) {
if (!this.failsafe.equals(newFailsafe)) {
this.failsafe = newFailsafe;
myDrone.notifyDroneEvent(DroneEventsType.FAILSAFE);
=======
public void setWarning(String newFailsafe) {
if (!this.warning.equals(newFailsafe)) {
this.warning = newFailsafe;
myDrone.events.notifyDroneEvent(DroneEventsType.FAILSAFE);
>>>>>>>
public void setWarning(String newFailsafe) {
if (!this.warning.equals(newFailsafe)) {
this.warning = newFailsafe;
myDrone.notifyDroneEvent(DroneEventsType.FAILSAFE); |
<<<<<<<
=======
@Deprecated // since 2.8, remove soon
protected BeanSerializerBase(BeanSerializerBase src, String[] toIgnore)
{
this(src, ArrayBuilders.arrayToSet(toIgnore), null);
}
@Deprecated // since 2.12
protected BeanSerializerBase(BeanSerializerBase src, Set<String> toIgnore) {
this(src, toIgnore, null);
}
>>>>>>>
<<<<<<<
JsonIgnoreProperties.Value ignorals = intr.findPropertyIgnoralByName(config, accessor);
if (ignorals != null) {
ignoredProps = ignorals.findIgnoredForSerialization();
}
JsonIncludeProperties.Value inclusions = intr.findPropertyInclusionByName(config, accessor);
if (inclusions != null) {
includedProps = inclusions.getIncluded();
}
ObjectIdInfo objectIdInfo = intr.findObjectIdInfo(config, accessor);
=======
ignoredProps = intr.findPropertyIgnoralByName(config, accessor).findIgnoredForSerialization();
includedProps = intr.findPropertyInclusionByName(config, accessor).getIncluded();
ObjectIdInfo objectIdInfo = intr.findObjectIdInfo(accessor);
>>>>>>>
ignoredProps = intr.findPropertyIgnoralByName(config, accessor).findIgnoredForSerialization();
includedProps = intr.findPropertyInclusionByName(config, accessor).getIncluded();
ObjectIdInfo objectIdInfo = intr.findObjectIdInfo(config, accessor); |
<<<<<<<
import com.droidplanner.fragments.SetupFragment;
=======
import com.droidplanner.fragments.SettingsFragment;
import com.droidplanner.fragments.SetupFragment;
>>>>>>>
import com.droidplanner.fragments.SetupFragment;
<<<<<<<
public class ConfigurationActivity extends SuperUI {
=======
public class ConfigurationActivity extends SuperUI implements
OnPageChangeListener {
public static final String SCREEN_INTENT = "screen";
public static final String SETTINGS = "settings";
private ViewPager viewPager;
private List<OnPageChangeListener> pageListeners = new ArrayList<OnPageChangeListener>();
>>>>>>>
public class ConfigurationActivity extends SuperUI {
<<<<<<<
=======
@Override
public void onPageScrollStateChanged(int arg0) {
if (arg0 == ViewPager.SCROLL_STATE_IDLE) {
onPageSelected(viewPager.getCurrentItem());
}
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
// TODO Auto-generated method stub
}
@Override
public void onPageSelected(int arg0) {
if (pageListeners != null && pageListeners.size() > 0) {
for (OnPageChangeListener listener : pageListeners) {
listener.onPageSelected(arg0);
}
}
}
@Override
public CharSequence[][] getHelpItems() {
return new CharSequence[][] { {}, {} };
}
>>>>>>>
@Override
public CharSequence[][] getHelpItems() {
return new CharSequence[][] { {}, {} };
} |
<<<<<<<
import android.view.Surface;
=======
import android.util.Pair;
>>>>>>>
import android.util.Pair;
<<<<<<<
import com.o3dr.android.client.apis.CapabilityApi;
import com.o3dr.services.android.lib.coordinate.LatLong;
import com.o3dr.services.android.lib.coordinate.LatLongAlt;
import com.o3dr.services.android.lib.drone.action.CapabilityActions;
=======
>>>>>>>
<<<<<<<
import com.o3dr.services.android.lib.drone.attribute.AttributeType;
import com.o3dr.services.android.lib.drone.attribute.error.CommandExecutionError;
import com.o3dr.services.android.lib.drone.companion.solo.SoloControllerMode;
import com.o3dr.services.android.lib.drone.companion.solo.action.SoloLinkActions;
import com.o3dr.services.android.lib.drone.companion.solo.tlv.SoloButtonSettingSetter;
import com.o3dr.services.android.lib.drone.companion.solo.tlv.TLVPacket;
=======
>>>>>>>
<<<<<<<
final Drone drone = getDrone();
switch (type) {
case AttributeType.STATE:
carrier.putParcelable(type, DroneApiUtils.getState(drone, isConnected()));
break;
case AttributeType.GPS:
carrier.putParcelable(type, DroneApiUtils.getGps(drone));
break;
case AttributeType.PARAMETERS:
carrier.putParcelable(type, DroneApiUtils.getParameters(drone, context));
break;
case AttributeType.SPEED:
carrier.putParcelable(type, DroneApiUtils.getSpeed(drone));
break;
case AttributeType.ATTITUDE:
carrier.putParcelable(type, DroneApiUtils.getAttitude(drone));
break;
case AttributeType.HOME:
carrier.putParcelable(type, DroneApiUtils.getHome(drone));
break;
case AttributeType.BATTERY:
carrier.putParcelable(type, DroneApiUtils.getBattery(drone));
break;
case AttributeType.ALTITUDE:
carrier.putParcelable(type, DroneApiUtils.getAltitude(drone));
break;
case AttributeType.MISSION:
carrier.putParcelable(type, DroneApiUtils.getMission(drone));
break;
case AttributeType.SIGNAL:
carrier.putParcelable(type, DroneApiUtils.getSignal(drone));
break;
case AttributeType.TYPE:
carrier.putParcelable(type, DroneApiUtils.getType(drone));
break;
case AttributeType.GUIDED_STATE:
carrier.putParcelable(type, DroneApiUtils.getGuidedState(drone));
break;
case AttributeType.FOLLOW_STATE:
carrier.putParcelable(type, DroneApiUtils.getFollowState(getFollowMe()));
break;
case AttributeType.CAMERA:
carrier.putParcelable(type, DroneApiUtils.getCameraProxy(drone, service.getCameraDetails()));
break;
case AttributeType.MAGNETOMETER_CALIBRATION_STATUS:
carrier.putParcelable(type, DroneApiUtils.getMagnetometerCalibrationStatus(drone));
break;
case AttributeType.SOLOLINK_STATE:
carrier.putParcelable(type, DroneApiUtils.getSoloLinkState(getDroneManager()));
break;
}
=======
carrier.putParcelable(type, attribute);
>>>>>>>
carrier.putParcelable(type, attribute);
<<<<<<<
// MISSION ACTIONS
case MissionActions.ACTION_GENERATE_DRONIE:
final float bearing = DroneApiUtils.generateDronie(getDrone());
if (bearing != -1) {
Bundle bundle = new Bundle(1);
bundle.putFloat(AttributeEventExtra.EXTRA_MISSION_DRONIE_BEARING, bearing);
notifyAttributeUpdate(AttributeEvent.MISSION_DRONIE_CREATED, bundle);
}
break;
case MissionActions.ACTION_LOAD_WAYPOINTS:
DroneApiUtils.loadWaypoints(getDrone());
break;
case MissionActions.ACTION_SET_MISSION:
Mission mission = data.getParcelable(MissionActions.EXTRA_MISSION);
boolean pushToDrone = data.getBoolean(MissionActions.EXTRA_PUSH_TO_DRONE);
DroneApiUtils.setMission(getDrone(), mission, pushToDrone);
break;
case MissionActions.ACTION_START_MISSION:
boolean forceModeChange = data.getBoolean(MissionActions.EXTRA_FORCE_MODE_CHANGE);
boolean forceArm = data.getBoolean(MissionActions.EXTRA_FORCE_ARM);
DroneApiUtils.startMission(droneMgr, forceModeChange, forceArm, listener);
break;
case MissionActions.ACTION_GOTO_MISSION_ITEM:
int missionItemIndex = data.getInt(MissionActions.EXTRA_MISSION_ITEM_INDEX);
int repeatCount = data.getInt(MissionActions.EXTRA_REPEAT_COUNT);
DroneApiUtils.jumpToMissionItem(getDrone(), missionItemIndex, repeatCount, listener);
break;
case MissionActions.ACTION_BUILD_COMPLEX_MISSION_ITEM:
DroneApiUtils.buildComplexMissionItem(getDrone(), data);
break;
=======
>>>>>>> |
<<<<<<<
import com.droidplanner.fragments.ChecklistFragment;
import com.droidplanner.fragments.ModesSetupFragment;
import com.droidplanner.fragments.ParamsFragment;
import com.droidplanner.fragments.RcSetupFragment;
import com.droidplanner.fragments.SettingsFragment;
import com.droidplanner.fragments.TuningFragment;
import com.droidplanner.widgets.viewPager.TabPageIndicator;
=======
import com.droidplanner.drone.Drone;
import com.droidplanner.drone.DroneInterfaces.DroneEventsType;
import com.droidplanner.fragments.*;
>>>>>>>
import com.droidplanner.drone.Drone;
import com.droidplanner.drone.DroneInterfaces.DroneEventsType;
import com.droidplanner.fragments.ChecklistFragment;
import com.droidplanner.fragments.ModesSetupFragment;
import com.droidplanner.fragments.ParamsFragment;
import com.droidplanner.fragments.RcSetupFragment;
import com.droidplanner.fragments.SettingsFragment;
import com.droidplanner.fragments.TuningFragment;
import com.droidplanner.widgets.viewPager.TabPageIndicator;
<<<<<<<
/**
* This is the fragment pager adapter to handle the tabs of the Configuration activity.
* @since 1.2.0
*/
private static class ConfigurationPagerAdapter extends FragmentPagerAdapter {
/**
* Application context object used to retrieve the tabs' title.
* @since 1.2.0
*/
private final Context mContext;
public ConfigurationPagerAdapter(Context context, FragmentManager fm){
super(fm);
mContext = context;
}
@Override
public Fragment getItem(int position){
switch(position){
case 0:
return new SettingsFragment();
case 1:
return new TuningFragment();
case 2:
return new RcSetupFragment();
case 3:
return new ModesSetupFragment();
case 4:
return new ChecklistFragment();
case 5:
return new ParamsFragment();
default:
return null;
}
}
@Override
public int getCount(){
return 6;
}
@Override
public CharSequence getPageTitle(int position){
switch(position){
case 0:
return mContext.getText(R.string.settings);
case 1:
return mContext.getString(R.string.screen_tuning);
case 2:
return mContext.getText(R.string.screen_rc);
case 3:
return mContext.getString(R.string.screen_modes);
case 4:
return mContext.getString(R.string.screen_checklist);
case 5:
return mContext.getText(R.string.screen_parameters);
default:
return null;
}
}
}
=======
@Override
public void onDroneEvent(DroneEventsType event, Drone drone) {
super.onDroneEvent(event,drone);
}
>>>>>>>
/**
* This is the fragment pager adapter to handle the tabs of the Configuration activity.
* @since 1.2.0
*/
private static class ConfigurationPagerAdapter extends FragmentPagerAdapter {
/**
* Application context object used to retrieve the tabs' title.
* @since 1.2.0
*/
private final Context mContext;
public ConfigurationPagerAdapter(Context context, FragmentManager fm){
super(fm);
mContext = context;
}
@Override
public Fragment getItem(int position){
switch(position){
case 0:
return new SettingsFragment();
case 1:
return new TuningFragment();
case 2:
return new RcSetupFragment();
case 3:
return new ModesSetupFragment();
case 4:
return new ChecklistFragment();
case 5:
return new ParamsFragment();
default:
return null;
}
}
@Override
public int getCount(){
return 6;
}
@Override
public CharSequence getPageTitle(int position){
switch(position){
case 0:
return mContext.getText(R.string.settings);
case 1:
return mContext.getString(R.string.screen_tuning);
case 2:
return mContext.getText(R.string.screen_rc);
case 3:
return mContext.getString(R.string.screen_modes);
case 4:
return mContext.getString(R.string.screen_checklist);
case 5:
return mContext.getText(R.string.screen_parameters);
default:
return null;
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.