details: https://code.openbravo.com/erp/devel/pi/rev/60a2a309d225 changeset: 33661:60a2a309d225 user: Javier Armendáriz <javier.armendariz <at> openbravo.com> date: Fri Mar 09 08:56:45 2018 +0100 summary: Fixed issue 37942: Removed deprecated code and removing all dep-ann warnings
Instead of adding the @Deprecated annotation, removed since its deprecated for a long time and not used anywhere in the project. details: https://code.openbravo.com/erp/devel/pi/rev/d3c8c0cf8e16 changeset: 33662:d3c8c0cf8e16 user: Javier Armendáriz <javier.armendariz <at> openbravo.com> date: Fri Mar 09 08:57:30 2018 +0100 summary: Related to issue 37942: Removed deprecated code and removing dep-ann warnings Marking code that cannot be removed with the @Deprecated annotation. These methods are being used in modules in the Forge. diffstat: modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java | 9 +- modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java | 26 +- modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelConstants.java | 11 +- src-test/src/org/openbravo/test/xml/ClientExportImportTest.java | 217 +--------- src/org/openbravo/base/model/ModelProvider.java | 87 +--- src/org/openbravo/base/model/RefList.java | 8 +- src/org/openbravo/base/model/Reference.java | 75 +--- src/org/openbravo/base/secureApp/HttpSecureAppServlet.java | 9 +- src/org/openbravo/dal/xml/ModelXMLConverter.java | 16 +- src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java | 9 - src/org/openbravo/erpCommon/modules/ImportModule.java | 50 +-- src/org/openbravo/erpCommon/modules/ImportModule_data.xsql | 37 +- src/org/openbravo/erpCommon/modules/VersionUtility.java | 33 +- src/org/openbravo/erpCommon/obps/ActivationKey.java | 10 +- src/org/openbravo/erpCommon/security/SessionLogin.java | 9 +- src/org/openbravo/erpCommon/utility/HttpsUtils.java | 63 +-- src/org/openbravo/erpCommon/utility/SequenceIdData.java | 25 +- src/org/openbravo/scheduling/ProcessBundle.java | 3 +- src/org/openbravo/service/system/SystemService.java | 125 +----- 19 files changed, 31 insertions(+), 791 deletions(-) diffs (truncated from 1292 to 300 lines): diff -r 3cb50b0b2a6b -r d3c8c0cf8e16 modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java Fri Mar 09 08:37:05 2018 +0100 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java Fri Mar 09 08:57:30 2018 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2010-2017 Openbravo SLU + * All portions are Copyright (C) 2010-2018 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -483,13 +483,6 @@ return menu; } - /** - * @deprecated Use instead setMenu(Menu menu, String userLanguageId) - */ - public void setMenu(Menu menu) { - setMenu(menu, OBContext.getOBContext().getLanguage().getId()); - } - public void setMenu(Menu menu, String userLanguageId) { this.menu = menu; for (MenuTrl menuTrl : menu.getADMenuTrlList()) { diff -r 3cb50b0b2a6b -r d3c8c0cf8e16 modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java Fri Mar 09 08:37:05 2018 +0100 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java Fri Mar 09 08:57:30 2018 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2011-2017 Openbravo SLU + * All portions are Copyright (C) 2011-2018 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -29,7 +29,6 @@ import org.hibernate.Hibernate; import org.hibernate.Query; import org.openbravo.base.exception.OBException; -import org.openbravo.base.secureApp.VariablesSecureApp; import org.openbravo.client.application.Parameter; import org.openbravo.dal.service.OBDal; import org.openbravo.dal.service.OBQuery; @@ -45,7 +44,6 @@ import org.openbravo.model.ad.ui.Field; import org.openbravo.model.ad.ui.Tab; import org.openbravo.model.ad.ui.Window; -import org.openbravo.service.db.DalConnectionProvider; import org.openbravo.userinterface.selector.Selector; import org.openbravo.userinterface.selector.SelectorField; import org.slf4j.Logger; @@ -368,28 +366,6 @@ } /** - * @deprecated use {@link #getComboTableData(Field)} - */ - public ComboTableData getComboTableData(VariablesSecureApp vars, String ref, String colName, - String objectReference, String validation, String orgList, String clientList) { - String comboId = ref + colName + objectReference + validation + orgList + clientList; - if (useCache() && comboTableDataMap.get(comboId) != null) { - return comboTableDataMap.get(comboId); - } - ComboTableData comboTableData; - try { - comboTableData = new ComboTableData(vars, new DalConnectionProvider(false), ref, colName, - objectReference, validation, orgList, clientList, 0); - } catch (Exception e) { - throw new OBException("Error while computing combo table data for column " + colName, e); - } - if (useCache() && comboTableData.canBeCached()) { - comboTableDataMap.put(comboId, comboTableData); - } - return comboTableData; - } - - /** * Returns the combo for the given field from cache if present, if not it also gets cached if * applicable. */ diff -r 3cb50b0b2a6b -r d3c8c0cf8e16 modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelConstants.java --- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelConstants.java Fri Mar 09 08:37:05 2018 +0100 +++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelConstants.java Fri Mar 09 08:57:30 2018 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2009-2017 Openbravo SLU + * All portions are Copyright (C) 2009-2018 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -50,15 +50,8 @@ /** * @deprecated use {@link #SKIN_PARAMETER} */ + @Deprecated public static final String SKIN_VERSION_PARAMETER = "_skinVersion"; - /** - * @deprecated use {@link #SKIN_DEFAULT} - */ - public static final String SKIN_VERSION_300 = "3.00"; - /** - * @deprecated use {@link #SKIN_CLASSIC} - */ - public static final String SKIN_VERSION_CLASSIC = "2.50_emulation"; public static final String SKIN_PARAMETER = "_skinVersion"; public static final String SKIN_DEFAULT = "Default"; diff -r 3cb50b0b2a6b -r d3c8c0cf8e16 src-test/src/org/openbravo/test/xml/ClientExportImportTest.java --- a/src-test/src/org/openbravo/test/xml/ClientExportImportTest.java Fri Mar 09 08:37:05 2018 +0100 +++ b/src-test/src/org/openbravo/test/xml/ClientExportImportTest.java Fri Mar 09 08:57:30 2018 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2008-2014 Openbravo SLU + * All portions are Copyright (C) 2008-2018 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -25,38 +25,24 @@ import static org.junit.Assert.fail; import java.io.File; -import java.io.FileReader; import java.io.FileWriter; import java.io.StringReader; import java.io.StringWriter; import java.util.HashMap; import java.util.Map; -import java.util.Set; import org.apache.ddlutils.Platform; import org.apache.ddlutils.model.Database; import org.apache.ddlutils.model.Table; import org.apache.ddlutils.platform.ExcludeFilter; -import org.hibernate.criterion.Restrictions; -import org.junit.Ignore; import org.junit.Test; import org.openbravo.base.exception.OBException; -import org.openbravo.base.model.Entity; -import org.openbravo.base.model.ModelProvider; import org.openbravo.base.session.OBPropertiesProvider; import org.openbravo.base.structure.BaseOBObject; import org.openbravo.base.structure.ClientEnabled; -import org.openbravo.dal.security.OrganizationStructureProvider; -import org.openbravo.dal.service.OBCriteria; import org.openbravo.dal.service.OBDal; -import org.openbravo.dal.service.OBQuery; import org.openbravo.ddlutils.util.DBSMOBUtil; import org.openbravo.model.ad.system.Client; -import org.openbravo.model.ad.utility.TreeNode; -import org.openbravo.model.common.enterprise.Organization; -import org.openbravo.model.financialmgmt.accounting.AccountingFact; -import org.openbravo.model.financialmgmt.payment.DebtPayment; -import org.openbravo.model.project.Project; import org.openbravo.service.db.ClientImportProcessor; import org.openbravo.service.db.DataExportService; import org.openbravo.service.db.DataImportService; @@ -74,155 +60,6 @@ // @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class ClientExportImportTest extends XMLBaseTest { - // public void _testImportReferenceData() throws Exception { - // setSystemAdministratorContext(); - // - // final String sourcePath = OBPropertiesProvider.getInstance().getOpenbravoProperties() - // .getProperty("source.path"); - // final File importDir = new File(sourcePath, "/referencedata/sampledata"); - // - // for (final File importFile : importDir.listFiles()) { - // if (importFile.isDirectory()) { - // continue; - // } - // final ClientImportProcessor importProcessor = new ClientImportProcessor(); - // importProcessor.setNewName(null); - // final ImportResult ir = DataImportService.getInstance().importClientData(importProcessor, - // false, new FileReader(importFile)); - // if (ir.hasErrorOccured()) { - // if (ir.getException() != null) { - // throw new OBException(ir.getException()); - // } - // if (ir.getErrorMessages() != null) { - // throw new OBException(ir.getErrorMessages()); - // } - // } - // } - // } - - /** - * Exports the "F&B International Group" client and then imports as a new client. Has as side - * effect that a completely new client is added in the database. - * - * Also tests mantis 8509: https://issues.openbravo.com/view.php?id=8509 - * - * Also tests mantis 9000: https://issues.openbravo.com/view.php?id=9000 - */ - @SuppressWarnings("deprecation") - @Ignore("This test has been temporarily disabled until the following issue related to the export client functionality is fixed: https://issues.openbravo.com/view.php?id=14848") - @Test - public void testExportImportClient1000000() { - - // This test has been temporarily disabled until the following issue related to the export - // client functionality is fixed: - // https://issues.openbravo.com/view.php?id=14848 - final String newClientId = exportImport(TEST_CLIENT_ID); - testMantis8509(newClientId); - testAccountingFactMantis9000(newClientId); - testTreeNodesMantis9000(newClientId); - SystemService.getInstance().removeAllClientData(newClientId); - } - - private void testTreeNodesMantis9000(String newClientID) { - final OBQuery<TreeNode> nodes = OBDal.getInstance().createQuery(TreeNode.class, - "client.id='" + newClientID + "'"); - nodes.setFilterOnReadableClients(false); - nodes.setFilterOnReadableOrganization(false); - assertTrue(nodes.list().size() > 0); - final Client newClient = OBDal.getInstance().get(Client.class, newClientID); - - boolean testDoneAtLeastOnce = false; - for (TreeNode node : nodes.list()) { - assertEquals(newClient, node.getClient()); - // also ignore 0 as there is a business partner/sales region tree node with 0 - if (node.getNode() != null && !node.getNode().equals("0")) { - final Entity entity = ModelProvider.getInstance().getEntityFromTreeType( - node.getTree().getTypeArea()); - if (entity.getName().equals(Project.ENTITY_NAME)) { - // can be removed when this issue: - // https://issues.openbravo.com/view.php?id=8745 - // is solved - continue; - } - - final BaseOBObject bob = OBDal.getInstance().get(entity.getName(), node.getNode()); - assertTrue("Entity instance not found " + entity.getName() + " " + node.getNode(), - bob != null); - if (bob instanceof ClientEnabled) { - assertEquals(newClient, ((ClientEnabled) bob).getClient()); - testDoneAtLeastOnce = true; - } - } - // also ignore 0 as there is a business partner/sales region tree node with 0 - if (node.getReportSet() != null && !node.getReportSet().equals("0")) { - final Entity entity = ModelProvider.getInstance().getEntityFromTreeType( - node.getTree().getTypeArea()); - if (entity.getName().equals(Project.ENTITY_NAME)) { - // can be removed when this issue: - // https://issues.openbravo.com/view.php?id=8745 - // is solved - continue; - } - - final BaseOBObject bob = OBDal.getInstance().get(entity.getName(), node.getReportSet()); - assertTrue("Entity instance not found " + entity.getName() + " " + node.getReportSet(), - bob != null); - if (bob instanceof ClientEnabled) { - assertEquals(newClient, ((ClientEnabled) bob).getClient()); - testDoneAtLeastOnce = true; - } - } - } - assertTrue(testDoneAtLeastOnce); - } - - private void testAccountingFactMantis9000(String newClientID) { - final OBQuery<AccountingFact> facts = OBDal.getInstance().createQuery(AccountingFact.class, - "client.id='" + newClientID + "'"); - facts.setFilterOnReadableClients(false); - facts.setFilterOnReadableOrganization(false); - assertTrue(facts.list().size() > 0); - final Client newClient = OBDal.getInstance().get(Client.class, newClientID); - boolean testDoneAtLeastOnce = false; - for (AccountingFact fact : facts.list()) { - assertEquals(newClient, fact.getClient()); - if (fact.getRecordID() != null) { - final BaseOBObject bob = OBDal.getInstance().get(fact.getTable().getName(), - fact.getRecordID()); - assertTrue( - "Entity instance not found " + fact.getTable().getName() + " " + fact.getRecordID(), - bob != null); - if (bob instanceof ClientEnabled) { - assertEquals(newClient, ((ClientEnabled) bob).getClient()); - testDoneAtLeastOnce = true; - } - } - if (fact.getRecordID2() != null) { - final BaseOBObject bob = OBDal.getInstance().get(DebtPayment.ENTITY_NAME, - fact.getRecordID2()); - assertTrue( - "Entity instance not found " + DebtPayment.ENTITY_NAME + " " + fact.getRecordID2(), - bob != null); - if (bob instanceof ClientEnabled) { - assertEquals(newClient, ((ClientEnabled) bob).getClient()); - testDoneAtLeastOnce = true; - } ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits