Attached Files | vector-object-functional.diff [^] (20,344 bytes) 2017-07-06 13:39 [Show Content] [Hide Content]diff -r f3b0864cfcb5 modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java Tue Jun 27 12:20:36 2017 +0000
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java Thu Jul 06 13:36:29 2017 +0200
@@ -622,7 +622,7 @@
xmlDocument.setParameter("paymType", strPaymType);
xmlDocument.setParameter("inclPaymentUsingCredit", strInclPaymentUsingCredit);
- Vector<Object> vector = new Vector<Object>(0);
+ Vector<SQLReturnObject> vector = new Vector<>(0);
SQLReturnObject sqlRO = new SQLReturnObject();
sqlRO.setData("ID", "FINPR_Receivables");
sqlRO.setData("NAME", Utility.messageBD(this, "FINPR_Receivables", vars.getLanguage()));
@@ -649,7 +649,7 @@
xmlDocument.setParameter("groupCrit", strGroupCrit);
- vector = new Vector<Object>(0);
+ vector = new Vector<>(0);
sqlRO = new SQLReturnObject();
sqlRO.setData("ID", "APRM_FATS_BPARTNER");
sqlRO.setData("NAME", Utility.messageBD(this, "APRM_FATS_BPARTNER", vars.getLanguage()));
@@ -681,7 +681,7 @@
xmlDocument.setData("reportGroupCrit", "liststructure", objectListData);
- vector = new Vector<Object>(0);
+ vector = new Vector<>(0);
sqlRO = new SQLReturnObject();
sqlRO.setData("ID", "Date");
sqlRO.setData("NAME", Utility.messageBD(this, "Date", vars.getLanguage()));
diff -r f3b0864cfcb5 src/org/openbravo/erpCommon/ad_process/CreateTaxReport.java
--- a/src/org/openbravo/erpCommon/ad_process/CreateTaxReport.java Tue Jun 27 12:20:36 2017 +0000
+++ b/src/org/openbravo/erpCommon/ad_process/CreateTaxReport.java Thu Jul 06 13:36:29 2017 +0200
@@ -181,7 +181,7 @@
StringBuilder strTreeOrg = new StringBuilder(strOrg);
treeOrg(vars, strOrg, strTreeOrg);
- Vector<Object> vectorArray = new Vector<Object>();
+ Vector<CreateTaxReportData> vectorArray = new Vector<>();
childData(vars, vectorArray, strTaxReportId, strDateFrom, strDateTo, strTreeOrg.toString(),
level, "0", 1);
@@ -227,7 +227,7 @@
return;
}
- private void childData(VariablesSecureApp vars, Vector<Object> vectorArray,
+ private void childData(VariablesSecureApp vars, Vector<CreateTaxReportData> vectorArray,
String strTaxReportId, String strPeriodFrom, String strPeriodTo, String strOrg, int level,
String strParent, int rownum) throws IOException, ServletException {
int localRownum = rownum;
@@ -281,12 +281,12 @@
}
}
- private CreateTaxReportData[] convertVector(Vector<Object> vectorArray) throws ServletException {
+ private CreateTaxReportData[] convertVector(Vector<CreateTaxReportData> vectorArray) throws ServletException {
CreateTaxReportData[] data = new CreateTaxReportData[vectorArray.size()];
BigDecimal count = BigDecimal.ZERO;
- Vector<Object> vectorArrayDisplay = new Vector<Object>();
+ Vector<CreateTaxReportData> vectorArrayDisplay = new Vector<>();
for (int i = 0; i < vectorArray.size(); i++) {
- data[i] = (CreateTaxReportData) vectorArray.elementAt(i);
+ data[i] = vectorArray.elementAt(i);
if (data[i].isshown.equals("Y")) {
vectorArrayDisplay.addElement(data[i]);
}
diff -r f3b0864cfcb5 src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java Tue Jun 27 12:20:36 2017 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java Thu Jul 06 13:36:29 2017 +0200
@@ -760,7 +760,7 @@
Utility.getContext(this, vars, "#User_Client", "ReportTrialBalance"));
log4j.debug("Calculating tree...");
- dataAux = calculateTree(dataAux, null, new Vector<Object>(), dataInitialBalance,
+ dataAux = calculateTree(dataAux, null, new Vector<String>(), dataInitialBalance,
strNotInitialBalance);
dataAux = levelFilter(dataAux, null, false, strLevel);
dataAux = dataFilter(dataAux);
@@ -781,7 +781,7 @@
}
private ReportTrialBalanceData[] filterTree(ReportTrialBalanceData[] data, String strLevel) {
- ArrayList<Object> arrayList = new ArrayList<Object>();
+ ArrayList<ReportTrialBalanceData> arrayList = new ArrayList<>();
for (int i = 0; data != null && i < data.length; i++) {
if (data[i].elementlevel.equals(strLevel))
arrayList.add(data[i]);
@@ -792,35 +792,35 @@
}
private ReportTrialBalanceData[] calculateTree(ReportTrialBalanceData[] data, String indice,
- Vector<Object> vecTotal, ReportTrialBalanceData[] dataIB, String strNotInitialBalance) {
- Vector<Object> localVecTotal = vecTotal;
+ Vector<String> vecTotal, ReportTrialBalanceData[] dataIB, String strNotInitialBalance) {
+ Vector<String> localVecTotal = vecTotal;
String localIndice = indice;
if (data == null || data.length == 0)
return data;
if (localIndice == null)
localIndice = "0";
ReportTrialBalanceData[] result = null;
- Vector<Object> vec = new Vector<Object>();
+ Vector<ReportTrialBalanceData> vec = new Vector<>();
// if (log4j.isDebugEnabled())
// log4j.debug("ReportTrialBalanceData.calculateTree() - data: " +
// data.length);
if (localVecTotal == null)
- localVecTotal = new Vector<Object>();
+ localVecTotal = new Vector<>();
if (localVecTotal.size() == 0) {
localVecTotal.addElement("0");
localVecTotal.addElement("0");
localVecTotal.addElement("0");
localVecTotal.addElement("0");
}
- BigDecimal totalDR = new BigDecimal((String) localVecTotal.elementAt(0));
- BigDecimal totalCR = new BigDecimal((String) localVecTotal.elementAt(1));
- BigDecimal totalInicial = new BigDecimal((String) localVecTotal.elementAt(2));
- BigDecimal totalFinal = new BigDecimal((String) localVecTotal.elementAt(3));
+ BigDecimal totalDR = new BigDecimal(localVecTotal.elementAt(0));
+ BigDecimal totalCR = new BigDecimal(localVecTotal.elementAt(1));
+ BigDecimal totalInicial = new BigDecimal(localVecTotal.elementAt(2));
+ BigDecimal totalFinal = new BigDecimal(localVecTotal.elementAt(3));
boolean encontrado = false;
for (int i = 0; i < data.length; i++) {
if (data[i].parentId.equals(localIndice)) {
encontrado = true;
- Vector<Object> vecParcial = new Vector<Object>();
+ Vector<String> vecParcial = new Vector<>();
vecParcial.addElement("0");
vecParcial.addElement("0");
vecParcial.addElement("0");
@@ -828,9 +828,9 @@
ReportTrialBalanceData[] dataChilds = calculateTree(data, data[i].id, vecParcial, dataIB,
strNotInitialBalance);
- BigDecimal parcialDR = new BigDecimal((String) vecParcial.elementAt(0));
- BigDecimal parcialCR = new BigDecimal((String) vecParcial.elementAt(1));
- BigDecimal parcialInicial = new BigDecimal((String) vecParcial.elementAt(2));
+ BigDecimal parcialDR = new BigDecimal(vecParcial.elementAt(0));
+ BigDecimal parcialCR = new BigDecimal(vecParcial.elementAt(1));
+ BigDecimal parcialInicial = new BigDecimal(vecParcial.elementAt(2));
data[i].amtacctdr = (new BigDecimal(data[i].amtacctdr).add(parcialDR)).toPlainString();
data[i].amtacctcr = (new BigDecimal(data[i].amtacctcr).add(parcialCR)).toPlainString();
data[i].saldoInicial = (new BigDecimal(data[i].saldoInicial).add(parcialInicial))
@@ -891,7 +891,7 @@
private ReportTrialBalanceData[] dataFilter(ReportTrialBalanceData[] data) {
if (data == null || data.length == 0)
return data;
- Vector<Object> dataFiltered = new Vector<Object>();
+ Vector<ReportTrialBalanceData> dataFiltered = new Vector<>();
for (int i = 0; i < data.length; i++) {
if (new BigDecimal(data[i].amtacctdr).compareTo(BigDecimal.ZERO) != 0
|| new BigDecimal(data[i].amtacctcr).compareTo(BigDecimal.ZERO) != 0
@@ -911,7 +911,7 @@
if (data == null || data.length == 0 || strLevel == null || strLevel.equals(""))
return data;
ReportTrialBalanceData[] result = null;
- Vector<Object> vec = new Vector<Object>();
+ Vector<ReportTrialBalanceData> vec = new Vector<>();
// if (log4j.isDebugEnabled())
// log4j.debug("ReportTrialBalanceData.levelFilter() - data: " +
// data.length);
@@ -955,7 +955,7 @@
ReportTrialBalanceData[] dataAccountCombinations = ReportTrialBalanceData
.selectAccountCombinations(this, strcAcctSchemaId, strAccountFromValue, strAccountToValue);
if (dataAccountCombinations.length > 0) {
- Vector<Object> vec = new Vector<Object>();
+ Vector<ReportTrialBalanceData> vec = new Vector<>();
List<String> dataAccounts = new ArrayList<String>(data.length);
for (int i = 0; i < data.length; i++) {
dataAccounts.add(data[i].id);
diff -r f3b0864cfcb5 src/org/openbravo/erpCommon/businessUtility/AccountTree.java
--- a/src/org/openbravo/erpCommon/businessUtility/AccountTree.java Tue Jun 27 12:20:36 2017 +0000
+++ b/src/org/openbravo/erpCommon/businessUtility/AccountTree.java Thu Jul 06 13:36:29 2017 +0200
@@ -11,7 +11,7 @@
* Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
* created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
* Contributor(s): Openbravo SLU
- * Contributions are Copyright (C) 2001-2016 Openbravo S.L.U.
+ * Contributions are Copyright (C) 2001-2017 Openbravo S.L.U.
******************************************************************************
*/
package org.openbravo.erpCommon.businessUtility;
@@ -84,7 +84,7 @@
Utility.getContext(conn, vars, "#User_Client", "AccountTree"),
OBDal.getInstance().get(ElementValue.class, reportNodes[0]).getAccountingElement()
.getId());
- reportElements = calculateTree(operands, reportNodes, new Vector<Object>());
+ reportElements = calculateTree(operands, reportNodes, new Vector<String>());
}
}
@@ -128,11 +128,11 @@
OBDal.getInstance().get(ElementValue.class, reportNodes[0]).getAccountingElement()
.getId());
- Vector<Object> vec = new Vector<Object>();
+ Vector<AccountTreeData> vec = new Vector<>();
AccountTreeData[] r;
for (int i = 0; i < reportNodes.length; i++) {
- r = calculateTree(operands, reportNodes[i], new Vector<Object>());
+ r = calculateTree(operands, reportNodes[i], new Vector<String>());
for (int j = 0; j < r.length; j++)
vec.addElement(r[j]);
}
@@ -240,7 +240,7 @@
if (accountsTree == null || accountsTree.length == 0)
return accountsTree;
AccountTreeData[] result = null;
- Vector<Object> vec = new Vector<Object>();
+ Vector<AccountTreeData> vec = new Vector<>();
// if (log4j.isDebugEnabled())
// log4j.debug("AccountTree.updateTreeQuantitiesSign() - elements: " +
// elements.length);
@@ -298,9 +298,9 @@
* @param vecTotal
* Vector with the totals of the operation.
*/
- private void operandsCalculate(Vector<Object> vecAll, AccountTreeData[] operands,
- String accountId, Vector<Object> vecTotal, boolean isExactValue) {
- Vector<Object> localVecTotal = vecTotal;
+ private void operandsCalculate(Vector<AccountTreeData> vecAll, AccountTreeData[] operands,
+ String accountId, Vector<String> vecTotal, boolean isExactValue) {
+ Vector<String> localVecTotal = vecTotal;
if (isExactValue) {
recursiveOperands = true;
} else {
@@ -315,13 +315,13 @@
return;
}
if (localVecTotal == null)
- localVecTotal = new Vector<Object>();
+ localVecTotal = new Vector<>();
if (localVecTotal.size() == 0) {
localVecTotal.addElement("0");
localVecTotal.addElement("0");
}
- BigDecimal total = new BigDecimal((String) localVecTotal.elementAt(0));
- BigDecimal totalRef = new BigDecimal((String) localVecTotal.elementAt(1));
+ BigDecimal total = new BigDecimal(localVecTotal.elementAt(0));
+ BigDecimal totalRef = new BigDecimal(localVecTotal.elementAt(1));
boolean encontrado = false;
for (int i = 0; i < operands.length; i++) {
if (operands[i].id.equals(accountId)) {
@@ -331,7 +331,7 @@
// calculateTree to obtain amount (b)
/* (a) */
for (int j = 0; j < vecAll.size(); j++) {
- AccountTreeData actual = (AccountTreeData) vecAll.elementAt(j);
+ AccountTreeData actual = vecAll.elementAt(j);
log4j.debug("AccountTree.formsCalculate - actual.nodeId: " + actual.nodeId
+ " - forms[i].nodeId: " + operands[i].nodeId);
if (actual.nodeId.equals(operands[i].nodeId)) {
@@ -353,12 +353,12 @@
if (log4j.isDebugEnabled())
log4j.debug("AccountTree.formsCalculate - C_ElementValue_ID: " + operands[i].nodeId
+ " not found");
- Vector<Object> amounts = new Vector<Object>();
+ Vector<String> amounts = new Vector<>();
amounts.addElement("0");
amounts.addElement("0");
calculateTree(operands, operands[i].nodeId, amounts, true, true);
- BigDecimal parcial = new BigDecimal((String) amounts.elementAt(0));
- BigDecimal parcialRef = new BigDecimal((String) amounts.elementAt(1));
+ BigDecimal parcial = new BigDecimal(amounts.elementAt(0));
+ BigDecimal parcialRef = new BigDecimal(amounts.elementAt(1));
if (log4j.isDebugEnabled())
log4j.debug("AccountTree.formsCalculate - parcial: " + parcial.toPlainString());
parcial = parcial.multiply(new BigDecimal(operands[i].sign));
@@ -387,7 +387,7 @@
* @return Array with the new calculated tree.
*/
private AccountTreeData[] calculateTree(AccountTreeData[] forms, String[] indice,
- Vector<Object> vecTotal) {
+ Vector<String> vecTotal) {
return calculateTree(forms, indice, vecTotal, true, false);
}
@@ -403,7 +403,7 @@
* @return Array with the new calculated tree.
*/
private AccountTreeData[] calculateTree(AccountTreeData[] operands, String reportNode,
- Vector<Object> vecTotal) {
+ Vector<String> vecTotal) {
return calculateTree(operands, reportNode, vecTotal, true, false);
}
@@ -430,7 +430,7 @@
* @return Array with the new calculated tree.
*/
private AccountTreeData[] calculateTree(AccountTreeData[] operands, String reportNode,
- Vector<Object> vecTotal, boolean applysign, boolean isExactValue) {
+ Vector<String> vecTotal, boolean applysign, boolean isExactValue) {
String[] i = new String[1];
i[0] = reportNode;
@@ -453,8 +453,8 @@
* @return Array with the new calculated tree.
*/
private AccountTreeData[] calculateTree(AccountTreeData[] operands, String[] reportNode,
- Vector<Object> totalAmounts, boolean applysign, boolean isExactValue) {
- Vector<Object> localTotalAmounts = totalAmounts;
+ Vector<String> totalAmounts, boolean applysign, boolean isExactValue) {
+ Vector<String> localTotalAmounts = totalAmounts;
String[] localReportNode = reportNode;
if (reportElements == null || reportElements.length == 0)
return reportElements;
@@ -463,17 +463,17 @@
localReportNode[0] = "0";
}
AccountTreeData[] result = null;
- Vector<Object> report = new Vector<Object>();
+ Vector<AccountTreeData> report = new Vector<>();
if (log4j.isDebugEnabled())
log4j.debug("AccountTree.calculateTree() - accounts: " + reportElements.length);
if (localTotalAmounts == null)
- localTotalAmounts = new Vector<Object>();
+ localTotalAmounts = new Vector<>();
if (localTotalAmounts.size() == 0) {
localTotalAmounts.addElement("0");
localTotalAmounts.addElement("0");
}
- BigDecimal total = new BigDecimal((String) localTotalAmounts.elementAt(0));
- BigDecimal totalRef = new BigDecimal((String) localTotalAmounts.elementAt(1));
+ BigDecimal total = new BigDecimal(localTotalAmounts.elementAt(0));
+ BigDecimal totalRef = new BigDecimal(localTotalAmounts.elementAt(1));
for (int i = 0; i < reportElements.length; i++) {
if ((isExactValue && nodeIn(reportElements[i].nodeId, localReportNode))
@@ -492,11 +492,11 @@
// times...
// why????
{
- Vector<Object> amounts = new Vector<Object>();
+ Vector<String> amounts = new Vector<>();
amounts.addElement("0");
amounts.addElement("0");
@SuppressWarnings("unchecked")
- Vector<Object> reportAux = (Vector<Object>) report.clone();
+ Vector<AccountTreeData> reportAux = (Vector<AccountTreeData>) report.clone();
reportElementChilds = calculateTree(operands, reportElements[i].nodeId, amounts);
if (reportElementChilds != null && reportElementChilds.length > 0) {
for (int h = 0; h < reportElementChilds.length; h++) {
@@ -504,8 +504,8 @@
}
}
if (!hasOperand(reportElements[i].nodeId, operands)) {
- BigDecimal parcial = new BigDecimal((String) amounts.elementAt(0));
- BigDecimal parcialRef = new BigDecimal((String) amounts.elementAt(1));
+ BigDecimal parcial = new BigDecimal(amounts.elementAt(0));
+ BigDecimal parcialRef = new BigDecimal(amounts.elementAt(1));
reportElements[i].qtyOperation = (new BigDecimal(reportElements[i].qtyOperation)
.add(parcial)).toPlainString();
reportElements[i].qtyOperationRef = (new BigDecimal(reportElements[i].qtyOperationRef)
@@ -517,8 +517,8 @@
amounts.set(0, "0");
amounts.set(1, "0");
operandsCalculate(reportAux, operands, reportElements[i].nodeId, amounts, isExactValue);
- BigDecimal parcial = new BigDecimal((String) amounts.elementAt(0));
- BigDecimal parcialRef = new BigDecimal((String) amounts.elementAt(1));
+ BigDecimal parcial = new BigDecimal(amounts.elementAt(0));
+ BigDecimal parcialRef = new BigDecimal(amounts.elementAt(1));
reportElements[i].qtyOperation = (new BigDecimal(reportElements[i].qtyOperation)
.add(parcial)).toPlainString();
reportElements[i].qtyOperationRef = (new BigDecimal(reportElements[i].qtyOperationRef)
@@ -593,7 +593,7 @@
|| strLevel.equals(""))
return reportElements;
AccountTreeData[] result = null;
- Vector<Object> vec = new Vector<Object>();
+ Vector<AccountTreeData> vec = new Vector<>();
if (log4j.isDebugEnabled())
log4j.debug("AccountTree.levelFilter() - accounts: " + reportElements.length);
@@ -663,7 +663,7 @@
if (reportElements == null || reportElements.length == 0)
return reportElements;
AccountTreeData[] result = null;
- Vector<Object> vec = new Vector<Object>();
+ Vector<AccountTreeData> vec = new Vector<>();
AccountTreeData[] r = levelFilter(indice, false, strLevel);
diff -r f3b0864cfcb5 src/org/openbravo/erpCommon/businessUtility/COAUtility.java
--- a/src/org/openbravo/erpCommon/businessUtility/COAUtility.java Tue Jun 27 12:20:36 2017 +0000
+++ b/src/org/openbravo/erpCommon/businessUtility/COAUtility.java Thu Jul 06 13:36:29 2017 +0200
@@ -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-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2017 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -481,7 +481,7 @@
return null;
log4j.debug("parseData() - Parsing " + data.length + " elements read from file.");
COAData[] result = null;
- Vector<Object> vec = new Vector<Object>();
+ Vector<COAData> vec = new Vector<>();
for (int i = 0; i < data.length; i++) {
log4j.debug("parseData() - Processing element " + data[i].getField("accountValue"));
COAData dataAux = new COAData();
|