diff --git a/org.adempiere.base.process/src/org/adempiere/process/Export.java b/org.adempiere.base.process/src/org/adempiere/process/Export.java index 091f33c20c..6b3a6aee7f 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/Export.java +++ b/org.adempiere.base.process/src/org/adempiere/process/Export.java @@ -197,7 +197,7 @@ public class Export extends SvrProcess outbandProcessor.process(getCtx(), ediProcessor, result.toString(), "C_Invoice-"+p_Record_ID+".txt", Trx.get( get_TrxName(), false )); } catch (Exception e) { - result = new StringBuffer( e.toString() ); + result = new StringBuilder( e.toString() ); } */ addLog(0, null, null, Msg.getMsg (getCtx(), "ExportProcessResult") + "\n" + outDocument.toString()); diff --git a/org.adempiere.base.process/src/org/adempiere/process/ImportPriceList.java b/org.adempiere.base.process/src/org/adempiere/process/ImportPriceList.java index 23bc134c8d..1e8524c457 100755 --- a/org.adempiere.base.process/src/org/adempiere/process/ImportPriceList.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ImportPriceList.java @@ -183,7 +183,7 @@ public class ImportPriceList extends SvrProcess /* UOM For Future USE // Set UOM (System/own) - sql = new StringBuffer ("UPDATE I_PriceList " + sql = new StringBuilder ("UPDATE I_PriceList " + "SET X12DE355 = " + "(SELECT MAX(X12DE355) FROM C_UOM u WHERE u.IsDefault='Y' AND u.AD_Client_ID IN (0,I_PriceList.AD_Client_ID)) " + "WHERE X12DE355 IS NULL AND C_UOM_ID IS NULL" @@ -191,14 +191,14 @@ public class ImportPriceList extends SvrProcess no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set UOM Default=" + no); // - sql = new StringBuffer ("UPDATE I_PriceList " + sql = new StringBuilder ("UPDATE I_PriceList " + "SET C_UOM_ID = (SELECT C_UOM_ID FROM C_UOM u WHERE u.X12DE355=I_PriceList.X12DE355 AND u.AD_Client_ID IN (0,I_PriceList.AD_Client_ID)) " + "WHERE C_UOM_ID IS NULL" + " AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Set UOM=" + no); // - sql = new StringBuffer ("UPDATE I_PriceList " + sql = new StringBuilder ("UPDATE I_PriceList " + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid UOM, ' " + "WHERE C_UOM_ID IS NULL" + " AND I_IsImported<>'Y'").append(clientCheck); diff --git a/org.adempiere.base.process/src/org/adempiere/process/InOutGenerateRMA.java b/org.adempiere.base.process/src/org/adempiere/process/InOutGenerateRMA.java index 5abc47d3a2..fc366f707d 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/InOutGenerateRMA.java +++ b/org.adempiere.base.process/src/org/adempiere/process/InOutGenerateRMA.java @@ -249,7 +249,7 @@ public class InOutGenerateRMA extends SvrProcess log.log(Level.WARNING, msglog.toString()); } - StringBuffer processMsg = new StringBuffer().append(shipment.getDocumentNo()); + StringBuilder processMsg = new StringBuilder().append(shipment.getDocumentNo()); if (!shipment.processIt(p_docAction)) { diff --git a/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java b/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java index d5038761e3..a877e0f96e 100644 --- a/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java +++ b/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java @@ -330,7 +330,7 @@ public class CommissionCalc extends SvrProcess /** String sd = DB.TO_DATE(p_StartDate, true); - StringBuffer sql = new StringBuffer ("SELECT "); + StringBuilder sql = new StringBuilder ("SELECT "); if (MCommission.FREQUENCYTYPE_Quarterly.equals(m_com.getFrequencyType())) sql.append("TRUNC(").append(sd).append(", 'Q'), TRUNC(").append(sd).append("+92, 'Q')-1"); else if (MCommission.FREQUENCYTYPE_Weekly.equals(m_com.getFrequencyType())) diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java b/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java index 95bb3e947f..8b39068079 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java @@ -149,7 +149,7 @@ implements ImportProcess // Set Country /** - sql = new StringBuffer ("UPDATE I_BPartner i " + sql = new StringBuilder ("UPDATE I_BPartner i " + "SET CountryCode=(SELECT CountryCode FROM C_Country c WHERE c.IsDefault='Y'" + " AND c.AD_Client_ID IN (0, i.AD_Client_ID) AND ROWNUM=1) " + "WHERE CountryCode IS NULL AND C_Country_ID IS NULL" diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java b/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java index 320eae1dc0..2b909ac221 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java @@ -220,7 +220,7 @@ public class ImportConversionRate extends SvrProcess no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Rates =" + no); - // sql = new StringBuffer ("UPDATE I_Conversion_Rate i " // Rate diff > 10% + // sql = new StringBuilder ("UPDATE I_Conversion_Rate i " // Rate diff > 10% // + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Inconsistent Rates='||(MultiplyRate - (1/DivideRate)) " // + "WHERE ((MultiplyRate - (1/DivideRate)) > (MultiplyRate * .1))" // + " AND I_IsImported<>'Y'").append (clientCheck); diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java b/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java index 618702a5f3..3e81fb0c72 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java @@ -572,7 +572,7 @@ public class ImportGLJournal extends SvrProcess //AZ Goodwill //BF: 2391401 Remove account balance limitation in Import GL Journal /* - sql = new StringBuffer ("UPDATE I_GLJournal i " + sql = new StringBuilder ("UPDATE I_GLJournal i " + "SET I_ErrorMsg=I_ErrorMsg||'WARN=Check Acct Balance, ' " + "WHERE ABS(AmtAcctDr-AmtAcctCr)>100000000" // 100 mio + " AND I_IsImported<>'Y'").append (clientCheck); diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java b/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java index 91e77e49ce..170e31e717 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java @@ -368,7 +368,7 @@ public class ImportInvoice extends SvrProcess // Set Country /** - sql = new StringBuffer ("UPDATE I_Invoice o " + sql = new StringBuilder ("UPDATE I_Invoice o " + "SET CountryCode=(SELECT MAX(CountryCode) FROM C_Country c WHERE c.IsDefault='Y'" + " AND c.AD_Client_ID IN (0, o.AD_Client_ID)) " + "WHERE C_BPartner_ID IS NULL AND CountryCode IS NULL AND C_Country_ID IS NULL" diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java index e197228a50..59a276d86b 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java @@ -369,7 +369,7 @@ public class ImportOrder extends SvrProcess // Set Country /** - sql = new StringBuffer ("UPDATE I_Order o " + sql = new StringBuilder ("UPDATE I_Order o " + "SET CountryCode=(SELECT MAX(CountryCode) FROM C_Country c WHERE c.IsDefault='Y'" + " AND c.AD_Client_ID IN (0, o.AD_Client_ID)) " + "WHERE C_BPartner_ID IS NULL AND CountryCode IS NULL AND C_Country_ID IS NULL" diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java b/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java index b5279bd06b..dfb7c47f48 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java @@ -359,7 +359,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess log.warning("No Mandatory Value=" + no); // Vendor Product No - // sql = new StringBuffer ("UPDATE I_Product i " + // sql = new StringBuilder ("UPDATE I_Product i " // + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory VendorProductNo,' " // + "WHERE I_IsImported<>'Y'" // + " AND VendorProductNo IS NULL AND (C_BPartner_ID IS NOT NULL OR BPartner_Value IS NOT NULL)").append(clientCheck); diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java index f75922f5e6..fcb0b70c68 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java @@ -634,7 +634,7 @@ public class ReplenishReport extends SvrProcess order = new MDDOrder (getCtx(), 0, get_TrxName()); order.setC_DocType_ID(p_C_DocType_ID); - StringBuffer msgsd = new StringBuffer(Msg.getMsg(getCtx(), "Replenishment")) + StringBuilder msgsd = new StringBuilder(Msg.getMsg(getCtx(), "Replenishment")) .append(": ").append(whSource.getName()).append("->").append(wh.getName()); order.setDescription(msgsd.toString()); // Set Org diff --git a/org.adempiere.base.process/src/org/idempiere/process/RecurringRun.java b/org.adempiere.base.process/src/org/idempiere/process/RecurringRun.java index 776c5cd259..0b7212043a 100644 --- a/org.adempiere.base.process/src/org/idempiere/process/RecurringRun.java +++ b/org.adempiere.base.process/src/org/idempiere/process/RecurringRun.java @@ -97,7 +97,7 @@ public class RecurringRun extends SvrProcess + ", Cut_Date=" + p_Cut_Date + ", DocAction=" + p_DocAction); ArrayList parameters = new ArrayList(); - StringBuffer whereClause = new StringBuffer("RunsMax>(SELECT COUNT(*) FROM C_Recurring_Run WHERE C_Recurring_Run.C_Recurring_ID=C_Recurring.C_Recurring_ID)"); + StringBuilder whereClause = new StringBuilder("RunsMax>(SELECT COUNT(*) FROM C_Recurring_Run WHERE C_Recurring_Run.C_Recurring_ID=C_Recurring.C_Recurring_ID)"); if (p_C_RecurringGroup_ID > 0) { whereClause.append(" AND C_RecurringGroup_ID=?"); parameters.add(p_C_RecurringGroup_ID); diff --git a/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookup.java b/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookup.java index 64212e292f..9238806926 100644 --- a/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookup.java +++ b/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookup.java @@ -118,7 +118,7 @@ public class AddressLookup implements AddressLookupInterface { */ private URL buildUrl(String postcode) { try { - StringBuffer urlStr = new StringBuffer(); + StringBuilder urlStr = new StringBuilder(); urlStr.append(serverUrl); urlStr.append(serverUrl.endsWith("/") ? "" : "/"); urlStr.append("/query?op=query&"); diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultDocumentFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultDocumentFactory.java index 190c3948a3..10f679ccf5 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultDocumentFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultDocumentFactory.java @@ -41,7 +41,7 @@ public class DefaultDocumentFactory implements IDocFactory { String tableName = MTable.getTableName(Env.getCtx(), AD_Table_ID); // Doc doc = null; - StringBuffer sql = new StringBuffer("SELECT * FROM ") + StringBuilder sql = new StringBuilder("SELECT * FROM ") .append(tableName) .append(" WHERE ").append(tableName).append("_ID=? AND Processed='Y'"); PreparedStatement pstmt = null; diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultModelFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultModelFactory.java index 309f58a47d..3e565a332f 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultModelFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultModelFactory.java @@ -165,7 +165,7 @@ public class DefaultModelFactory implements IModelFactory { // Search packages for (int i = 0; i < s_packages.length; i++) { - StringBuffer name = new StringBuffer(s_packages[i]).append(".M").append(className); + StringBuilder name = new StringBuilder(s_packages[i]).append(".M").append(className); Class clazz = getPOclass(name.toString(), tableName); if (clazz != null) { diff --git a/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java b/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java index 011146edcc..b34b1bf293 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java @@ -412,7 +412,7 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed */ private String getMailTrailer(MRequest r, String serverAddress) { - StringBuffer sb = new StringBuffer("\n").append(MRequest.SEPARATOR) + StringBuilder sb = new StringBuilder("\n").append(MRequest.SEPARATOR) .append(Msg.translate(r.getCtx(), "R_Request_ID")) .append(": ").append(r.getDocumentNo()) .append(" ").append(r.getMailTag()) diff --git a/org.adempiere.base/src/org/adempiere/exceptions/TaxCriteriaNotFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/TaxCriteriaNotFoundException.java index 556267cd7f..0d1d5e8a68 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/TaxCriteriaNotFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/TaxCriteriaNotFoundException.java @@ -35,7 +35,7 @@ public class TaxCriteriaNotFoundException extends AdempiereException private static final String buildMessage (String criteriaName, int criteria_ID) { - StringBuffer msg = new StringBuffer("@").append(AD_Message).append("@"); + StringBuilder msg = new StringBuilder("@").append(AD_Message).append("@"); msg.append(" @").append(criteriaName).append("@"); msg.append(" (ID ").append(criteria_ID).append(")"); return msg.toString(); diff --git a/org.adempiere.base/src/org/adempiere/exceptions/TaxForChangeNotFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/TaxForChangeNotFoundException.java index 19679ee6f4..b3138372a6 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/TaxForChangeNotFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/TaxForChangeNotFoundException.java @@ -40,7 +40,7 @@ public class TaxForChangeNotFoundException extends AdempiereException private static final String buildMessage(int C_Charge_ID, int AD_Org_ID, int M_Warehouse_ID, int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID, String additionalMsg) { - StringBuffer msg = new StringBuffer("@").append(AD_Message).append("@"); + StringBuilder msg = new StringBuilder("@").append(AD_Message).append("@"); if (!Util.isEmpty(additionalMsg, true)) { msg.append(" ").append(additionalMsg).append(" - "); diff --git a/org.adempiere.base/src/org/adempiere/exceptions/TaxNoExemptFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/TaxNoExemptFoundException.java index c06730a878..b60a207633 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/TaxNoExemptFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/TaxNoExemptFoundException.java @@ -37,7 +37,7 @@ public class TaxNoExemptFoundException extends AdempiereException private static final String buildMessage (int AD_Org_ID) { - StringBuffer msg = new StringBuffer("@").append(AD_Message).append("@"); + StringBuilder msg = new StringBuilder("@").append(AD_Message).append("@"); msg.append("@AD_Org_ID@:").append(getOrgString(AD_Org_ID)); // return msg.toString(); diff --git a/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java index 4cdeb8551e..8e9f888c35 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java @@ -50,7 +50,7 @@ public class TaxNotFoundException extends AdempiereException Timestamp billDate, int billFromC_Location_ID, int billToC_Location_ID) { final DateFormat df = DisplayType.getDateFormat(); - StringBuffer msg = new StringBuffer("@").append(AD_Message).append("@"); + StringBuilder msg = new StringBuilder("@").append(AD_Message).append("@"); // msg.append(" - @C_TaxCategory_ID@:").append(getTaxCategoryString(C_TaxCategory_ID)); msg.append(", @IsSOTrx@:@").append(IsSOTrx ? "Y":"N").append("@"); diff --git a/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java b/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java index 3b8130bc48..71ce14a024 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java @@ -203,7 +203,7 @@ public abstract class AbstractExcelExporter * @return number excel format string */ private String getFormatString(NumberFormat df, boolean isHighlightNegativeNumbers) { - StringBuffer format = new StringBuffer(); + StringBuilder format = new StringBuilder(); int integerDigitsMin = df.getMinimumIntegerDigits(); int integerDigitsMax = df.getMaximumIntegerDigits(); for (int i = 0; i < integerDigitsMax; i++) { @@ -227,7 +227,7 @@ public abstract class AbstractExcelExporter } if (isHighlightNegativeNumbers) { String f = format.toString(); - format = new StringBuffer(f).append(";[RED]-").append(f); + format = new StringBuilder(f).append(";[RED]-").append(f); } // if (log.isLoggable(Level.FINEST)) log.finest("NumberFormat: "+format); diff --git a/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java b/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java index 45bb7841c7..5663ca3440 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java @@ -225,7 +225,7 @@ public abstract class AbstractXLSXExporter */ private String getFormatString(NumberFormat df, boolean isHighlightNegativeNumbers) { - StringBuffer format = new StringBuffer(); + StringBuilder format = new StringBuilder(); int integerDigitsMin = df.getMinimumIntegerDigits(); int integerDigitsMax = df.getMaximumIntegerDigits(); for (int i = 0; i < integerDigitsMax; i++) @@ -253,7 +253,7 @@ public abstract class AbstractXLSXExporter if (isHighlightNegativeNumbers) { String f = format.toString(); - format = new StringBuffer(f).append(";[RED]-").append(f); + format = new StringBuilder(f).append(";[RED]-").append(f); } // if (log.isLoggable(Level.FINEST)) diff --git a/org.adempiere.base/src/org/adempiere/model/GenericPO.java b/org.adempiere.base/src/org/adempiere/model/GenericPO.java index 6536c4fa92..97f397c529 100644 --- a/org.adempiere.base/src/org/adempiere/model/GenericPO.java +++ b/org.adempiere.base/src/org/adempiere/model/GenericPO.java @@ -100,7 +100,7 @@ public class GenericPO extends PO { } public String toString() { - StringBuffer sb = new StringBuffer("GenericPO[Table=").append( + StringBuilder sb = new StringBuilder("GenericPO[Table=").append( "" + tableID + ",ID=").append(get_ID()).append("]"); return sb.toString(); } diff --git a/org.adempiere.base/src/org/adempiere/model/MRelationType.java b/org.adempiere.base/src/org/adempiere/model/MRelationType.java index 4e2835bdd0..f5a2f66566 100644 --- a/org.adempiere.base/src/org/adempiere/model/MRelationType.java +++ b/org.adempiere.base/src/org/adempiere/model/MRelationType.java @@ -14,8 +14,6 @@ package org.adempiere.model; import static org.compiere.model.I_AD_Ref_Table.COLUMNNAME_AD_Reference_ID; -import static org.compiere.model.I_AD_Ref_Table.COLUMNNAME_OrderByClause; -import static org.compiere.model.I_AD_Ref_Table.COLUMNNAME_WhereClause; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -64,32 +62,32 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider { * Warning: Doesn't support POs with more or less than one key * column. */ - static StringBuffer SQL = // - new StringBuffer(" SELECT " )// - .append(" rt.AD_RelationType_ID AS ").append(COLUMNNAME_AD_RelationType_ID) // - .append(", rt.Name AS ").append(COLUMNNAME_Name )// - .append(", rt.IsDirected AS ").append(COLUMNNAME_IsDirected) // - .append(", ref.AD_Reference_ID AS ").append(COLUMNNAME_AD_Reference_ID) // - .append(", tab.WhereClause AS ").append(COLUMNNAME_WhereClause) // - .append(", tab.OrderByClause AS ").append(COLUMNNAME_OrderByClause) // - .append(" FROM") // - .append(" AD_RelationType rt, AD_Reference ref, AD_Ref_Table tab") // - .append(" WHERE ") // - .append(" rt.IsActive='Y'") // - .append(" AND ref.IsActive='Y'") // - .append(" AND ref.ValidationType='T'") // must have table validation - .append(" AND (") // join the source AD_Reference - .append(" rt.AD_Reference_Source_ID=ref.AD_Reference_ID") // - .append(" OR (") // not directed? -> also join the target AD_Reference - .append(" rt.IsDirected='N' ") // - .append(" AND rt.AD_Reference_Target_ID=ref.AD_Reference_ID") // - .append(" )") // - .append(" )") // - .append(" AND tab.IsActive='Y'") // Join the AD_Reference's AD_Ref_Table - .append(" AND tab.AD_Reference_ID=ref.AD_Reference_ID") // - .append(" AND tab.AD_Table_ID=?") // - .append(" AND tab.AD_Key=?") // - .append(" ORDER BY rt.Name"); + final static String SQL = + " SELECT " + + " rt.AD_RelationType_ID" + + ", rt.Name" + + ", rt.IsDirected" + + ", ref.AD_Reference_ID" + + ", tab.WhereClause" + + ", tab.OrderByClause" + + " FROM" + + " AD_RelationType rt, AD_Reference ref, AD_Ref_Table tab" + + " WHERE " + + " rt.IsActive='Y'" + + " AND ref.IsActive='Y'" + + " AND ref.ValidationType='T'" // must have table validation + + " AND (" // join the source AD_Reference + + " rt.AD_Reference_Source_ID=ref.AD_Reference_ID" // + + " OR (" // not directed? -> also join the target AD_Reference + + " rt.IsDirected='N' " + + " AND rt.AD_Reference_Target_ID=ref.AD_Reference_ID" + + " )" + + " )" + + " AND tab.IsActive='Y'" // Join the AD_Reference's AD_Ref_Table + + " AND tab.AD_Reference_ID=ref.AD_Reference_ID" + + " AND tab.AD_Table_ID=?" + + " AND tab.AD_Key=?" + + " ORDER BY rt.Name"; final static String SQL_WINDOW_NAME = "SELECT Name FROM AD_Window WHERE AD_WINDOW_ID=?"; @@ -132,7 +130,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider { final int colId = MColumn.getColumn_ID(po.get_TableName(), keyColumn); - final PreparedStatement pstmt = DB.prepareStatement(SQL.toString(), po + final PreparedStatement pstmt = DB.prepareStatement(SQL, po .get_TrxName()); ResultSet rs = null; diff --git a/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java b/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java index f9af96d360..bba40c81be 100644 --- a/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java +++ b/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java @@ -356,7 +356,7 @@ public class UUIDGenerator extends SvrProcess { public static void updateAllUUID(MColumn column) { MTable table = (MTable) column.getAD_Table(); int AD_Column_ID = DB.getSQLValue(null, "SELECT AD_Column_ID FROM AD_Column WHERE AD_Table_ID=? AND ColumnName=?", table.getAD_Table_ID(), table.getTableName()+"_ID"); - StringBuffer sql = new StringBuffer("SELECT "); + StringBuilder sql = new StringBuilder("SELECT "); String keyColumn = null; // second script - just generate for tables with _ID primary key diff --git a/org.adempiere.base/src/org/adempiere/util/GenerateModel.java b/org.adempiere.base/src/org/adempiere/util/GenerateModel.java index 51f919fe5f..f32ef4485e 100644 --- a/org.adempiere.base/src/org/adempiere/util/GenerateModel.java +++ b/org.adempiere.base/src/org/adempiere/util/GenerateModel.java @@ -51,7 +51,7 @@ public class GenerateModel */ public String toString() { - StringBuffer sb = new StringBuffer ("GenerateModel[").append("]"); + StringBuilder sb = new StringBuilder ("GenerateModel[").append("]"); return sb.toString(); } @@ -106,7 +106,7 @@ public class GenerateModel System.err.println("No EntityType"); System.exit(1); } - StringBuffer sql = new StringBuffer("EntityType IN (") + StringBuilder sql = new StringBuilder("EntityType IN (") .append(entityType).append(")"); log.info(sql.toString()); log.info("----------------------------------"); diff --git a/org.adempiere.base/src/org/adempiere/util/GenerateModelJPA.java b/org.adempiere.base/src/org/adempiere/util/GenerateModelJPA.java index 0064a754f4..06c9d0fad9 100755 --- a/org.adempiere.base/src/org/adempiere/util/GenerateModelJPA.java +++ b/org.adempiere.base/src/org/adempiere/util/GenerateModelJPA.java @@ -131,7 +131,7 @@ public class GenerateModelJPA //String className = "X_" + tableName; String className = "" + tableName; // - StringBuffer start = new StringBuffer () + StringBuilder start = new StringBuilder () .append (COPY) .append ("package " + packageName + ";\n" + "/** Generated Model JPA - DO NOT CHANGE */\n"); @@ -200,12 +200,12 @@ public class GenerateModelJPA + "/** Info\n@return info\n*/\n" + "public String toString()" + "{" - + "StringBuffer sb = new StringBuffer (\"").append(className).append("[\")" + + "StringBuilder sb = new StringBuilder (\"").append(className).append("[\")" + ".append(get_ID()).append(\"]\");" + "return sb.toString();" + "}"); - StringBuffer end = new StringBuffer ("}"); + StringBuilder end = new StringBuilder ("}"); // sb.insert(0, start); sb.append(end); @@ -538,9 +538,9 @@ public class GenerateModelJPA .append("_AD_Reference_ID=").append(AD_Reference_ID).append(";"); // boolean found = false; - StringBuffer values = new StringBuffer("Reference_ID=") + StringBuilder values = new StringBuilder("Reference_ID=") .append(AD_Reference_ID); - StringBuffer statement = new StringBuffer(); + StringBuilder statement = new StringBuilder(); if (nullable) statement.append("if (").append(columnName).append(" == null"); // @@ -573,7 +573,7 @@ public class GenerateModelJPA // Name (SmallTalkNotation) String name = rs.getString(2); char[] nameArray = name.toCharArray(); - StringBuffer nameClean = new StringBuffer(); + StringBuilder nameClean = new StringBuilder(); boolean initCap = true; for (int i = 0; i < nameArray.length; i++) { @@ -708,7 +708,7 @@ public class GenerateModelJPA */ public String toString() { - StringBuffer sb = new StringBuffer ("GenerateModel[") + StringBuilder sb = new StringBuilder ("GenerateModel[") .append("]"); return sb.toString(); } // toString @@ -766,7 +766,7 @@ public class GenerateModelJPA System.err.println("No EntityType"); System.exit(1); } - StringBuffer sql = new StringBuffer("EntityType IN (") + StringBuilder sql = new StringBuilder("EntityType IN (") .append(entityType).append(")"); if (log.isLoggable(Level.INFO)) log.info(sql.toString()); log.info("----------------------------------"); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java b/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java index 4ac78b8885..6816b26021 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java @@ -901,7 +901,7 @@ public class Doc_MatchInv extends Doc + "WHERE C_InvoiceLine_ID IN (SELECT C_InvoiceLine_ID FROM C_InvoiceLine WHERE C_Invoice_ID=?) " + "AND COALESCE(Reversal_ID,0)=0"; List> list = DB.getSQLArrayObjectsEx(getTrxName(), matchInvLineSql, invoice.get_ID()); - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); if (list == null) return null; @@ -1084,7 +1084,7 @@ public class Doc_MatchInv extends Doc + "WHERE M_InOutLine_ID IN (SELECT M_InOutLine_ID FROM M_InOutLine WHERE M_InOut_ID=?) " + "AND COALESCE(Reversal_ID,0)=0"; List> list = DB.getSQLArrayObjectsEx(getTrxName(), matchInvLineSql, receipt.get_ID()); - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); if (list == null) return null; diff --git a/org.adempiere.base/src/org/compiere/db/AdempiereDatabase.java b/org.adempiere.base/src/org/compiere/db/AdempiereDatabase.java index f9669e6f48..f992a582ce 100644 --- a/org.adempiere.base/src/org/compiere/db/AdempiereDatabase.java +++ b/org.adempiere.base/src/org/compiere/db/AdempiereDatabase.java @@ -406,10 +406,10 @@ public interface AdempiereDatabase */ public default String getSQLCreate(MTable table) { - StringBuffer sb = new StringBuffer("CREATE TABLE ") + StringBuilder sb = new StringBuilder("CREATE TABLE ") .append(table.getTableName()).append(" ("); // - StringBuffer constraints = new StringBuffer(); + StringBuilder constraints = new StringBuilder(); MColumn[] columns = table.getColumns(true); boolean columnAdded = false; for (int i = 0; i < columns.length; i++) diff --git a/org.adempiere.base/src/org/compiere/db/CreateAdempiere.java b/org.adempiere.base/src/org/compiere/db/CreateAdempiere.java index b32f8ce054..5a878c6db9 100644 --- a/org.adempiere.base/src/org/compiere/db/CreateAdempiere.java +++ b/org.adempiere.base/src/org/compiere/db/CreateAdempiere.java @@ -565,9 +565,9 @@ public class CreateAdempiere */ private boolean createTableDataRow (ResultSet rs, MTable mTable) { - StringBuffer insert = new StringBuffer ("INSERT INTO ") + StringBuilder insert = new StringBuilder ("INSERT INTO ") .append(mTable.getTableName()).append(" ("); - StringBuffer values = new StringBuffer (); + StringBuilder values = new StringBuilder (); // MColumn[] columns = mTable.getColumns(false); for (int i = 0; i < columns.length; i++) diff --git a/org.adempiere.base/src/org/compiere/db/LDAP.java b/org.adempiere.base/src/org/compiere/db/LDAP.java index d34f8934fa..a3a7f32569 100644 --- a/org.adempiere.base/src/org/compiere/db/LDAP.java +++ b/org.adempiere.base/src/org/compiere/db/LDAP.java @@ -53,11 +53,11 @@ public class LDAP // ldap://dc.compiere.org env.put(Context.PROVIDER_URL, ldapURL); env.put(Context.SECURITY_AUTHENTICATION, "simple"); - StringBuffer principal; + StringBuilder principal; if ("openldap".equals(MSysConfig.getValue(MSysConfig.LDAP_TYPE))) { - principal = new StringBuffer("uid=").append(userName).append(",").append(domain); + principal = new StringBuilder("uid=").append(userName).append(",").append(domain); } else { - principal = new StringBuffer(userName).append("@").append(domain); + principal = new StringBuilder(userName).append("@").append(domain); } env.put(Context.SECURITY_PRINCIPAL, principal.toString()); env.put(Context.SECURITY_CREDENTIALS, password); diff --git a/org.adempiere.base/src/org/compiere/dbPort/Convert.java b/org.adempiere.base/src/org/compiere/dbPort/Convert.java index 2fe49f9bdc..a2e38bed55 100644 --- a/org.adempiere.base/src/org/compiere/dbPort/Convert.java +++ b/org.adempiere.base/src/org/compiere/dbPort/Convert.java @@ -306,7 +306,7 @@ public abstract class Convert Pattern p = Pattern.compile("'[[^']*]*'"); Matcher m = p.matcher(inputValue); int i = 0; - StringBuffer retValue = new StringBuffer(inputValue.length()); + StringBuilder retValue = new StringBuilder(inputValue.length()); while (m.find()) { String var = inputValue.substring(m.start(), m.end()).replace(quoteMarker, "''"); // Put back quotes, if any retVars.addElement(var); diff --git a/org.adempiere.base/src/org/compiere/dbPort/Convert_SQL92.java b/org.adempiere.base/src/org/compiere/dbPort/Convert_SQL92.java index b874fcfe79..f2dc107182 100644 --- a/org.adempiere.base/src/org/compiere/dbPort/Convert_SQL92.java +++ b/org.adempiere.base/src/org/compiere/dbPort/Convert_SQL92.java @@ -188,7 +188,7 @@ public abstract class Convert_SQL92 extends Convert { WHERE tn.AD_Tree_ID=10 */ - StringBuffer newFrom = new StringBuffer (); + StringBuilder newFrom = new StringBuilder (); for (int i = 0; i < joins.size(); i++) { Join first = new Join ((String)joins.get(i)); diff --git a/org.adempiere.base/src/org/compiere/install/Translation.java b/org.adempiere.base/src/org/compiere/install/Translation.java index 33a42fa9a4..538e08e460 100644 --- a/org.adempiere.base/src/org/compiere/install/Translation.java +++ b/org.adempiere.base/src/org/compiere/install/Translation.java @@ -196,7 +196,7 @@ public class Translation implements IApplication String uuidColumn = MTable.getUUIDColumnName(Base_Table); String[] trlColumns = getTrlColumns (Base_Table); // - StringBuffer sql = null; + StringBuilder sql = null; PreparedStatement pstmt = null; ResultSet rs = null; try @@ -216,7 +216,7 @@ public class Translation implements IApplication root.setAttribute(XML_ATTRIBUTE_TABLE, Base_Table); document.appendChild(root); // - sql = new StringBuffer ("SELECT "); + sql = new StringBuilder ("SELECT "); if (isBaseLanguage) sql.append("'Y',"); // 1 else diff --git a/org.adempiere.base/src/org/compiere/model/CalloutEngine.java b/org.adempiere.base/src/org/compiere/model/CalloutEngine.java index d0eaecce99..72f19fa382 100644 --- a/org.adempiere.base/src/org/compiere/model/CalloutEngine.java +++ b/org.adempiere.base/src/org/compiere/model/CalloutEngine.java @@ -82,7 +82,7 @@ public class CalloutEngine implements Callout // String retValue = ""; - StringBuffer msg = new StringBuffer(methodName).append(" - ") + StringBuilder msg = new StringBuilder(methodName).append(" - ") .append(mField.getColumnName()) .append("=").append(value) .append(" (old=").append(oldValue) @@ -143,7 +143,7 @@ public class CalloutEngine implements Callout throw new IllegalArgumentException ("No Method Name"); // String retValue = null; - StringBuffer msg = new StringBuffer(methodName).append(" - ").append(value); + StringBuilder msg = new StringBuilder(methodName).append(" - ").append(value); if (log.isLoggable(Level.INFO)) log.info (msg.toString()); // // Find Method diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index ae8f5cd462..e9a5410d65 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -2218,7 +2218,7 @@ public class GridField */ public String toString() { - StringBuffer sb = new StringBuffer("GridField[") + StringBuilder sb = new StringBuilder("GridField[") .append(m_vo.ColumnName).append("=").append(m_value); if (isKey()) sb.append("(Key)"); diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 002b03d684..43bd65cfb3 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -636,7 +636,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable * Set Where Clause */ // Tab Where Clause - StringBuffer where = new StringBuffer(m_vo.WhereClause); + StringBuilder where = new StringBuilder(m_vo.WhereClause); if (m_vo.onlyCurrentDays > 0) { if (where.length() > 0) @@ -739,9 +739,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable public void resetDetailForNewParentRecord() { if (m_mTable.isOpen()) { - StringBuffer where = new StringBuffer("2=3"); - m_extendedWhere = where.toString(); - m_oldQuery = where.toString(); + String where = "2=3"; + m_extendedWhere = where; + m_oldQuery = where; m_parentNeedSave = true; m_currentRow = -1; @@ -749,7 +749,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable * Query */ if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - " + where); - m_mTable.dataRequery(where.toString(), m_vo.onlyCurrentRows && !isDetail(), 0); + m_mTable.dataRequery(where, m_vo.onlyCurrentRows && !isDetail(), 0); // Go to Record 0 setCurrentRow(0, true); @@ -888,7 +888,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable query.setTableName("xx"); // use IN instead of EXISTS as subquery should be highly selective - StringBuffer result = new StringBuffer (getTableName()).append(".").append(tabKeyColumn) + StringBuilder result = new StringBuilder (getTableName()).append(".").append(tabKeyColumn) .append(" IN (SELECT xx.").append(tabKeyColumn) .append(" FROM ") .append(tableName).append(" xx WHERE ") @@ -1855,7 +1855,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable int Record_ID; boolean isOrder = m_vo.TableName.startsWith("C_Order"); // - StringBuffer sql = new StringBuffer("SELECT COUNT(*) AS Lines,c.ISO_Code,o.TotalLines,o.GrandTotal," + StringBuilder sql = new StringBuilder("SELECT COUNT(*) AS Lines,c.ISO_Code,o.TotalLines,o.GrandTotal," + "currencyBase(o.GrandTotal,o.C_Currency_ID,o.DateAcct, o.AD_Client_ID,o.AD_Org_ID) AS ConvAmt "); if (isOrder) { diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 891d74d1ab..622b57798d 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -2077,7 +2077,7 @@ public class GridTable extends AbstractTableModel // Need to re-read row to get ROWID, Key, DocumentNo, Trigger, virtual columns if (log.isLoggable(Level.FINE)) log.fine("Reading ... " + whereClause); - StringBuffer refreshSQL = new StringBuffer(m_SQL_Select) + StringBuilder refreshSQL = new StringBuilder(m_SQL_Select) .append(" WHERE ").append(whereClause); pstmt = DB.prepareStatement(refreshSQL.toString(), null); rs = pstmt.executeQuery(); @@ -2279,7 +2279,7 @@ public class GridTable extends AbstractTableModel // Refresh - update buffer String whereClause = po.get_WhereClause(true); if (log.isLoggable(Level.FINE)) log.fine("Reading ... " + whereClause); - StringBuffer refreshSQL = new StringBuffer(m_SQL_Select) + StringBuilder refreshSQL = new StringBuilder(m_SQL_Select) .append(" WHERE ").append(whereClause); PreparedStatement pstmt = null; ResultSet rs = null; @@ -2349,8 +2349,8 @@ public class GridTable extends AbstractTableModel private String getWhereClause (Object[] rowData) { int size = m_fields.size(); - StringBuffer singleRowWHERE = null; - StringBuffer multiRowWHERE = null; + StringBuilder singleRowWHERE = null; + StringBuilder multiRowWHERE = null; String tableName = getTableName(); for (int col = 0; col < size; col++) { @@ -2365,10 +2365,10 @@ public class GridTable extends AbstractTableModel return null; } if (columnName.endsWith ("_ID")) - singleRowWHERE = new StringBuffer(tableName).append(".").append(columnName) + singleRowWHERE = new StringBuilder(tableName).append(".").append(columnName) .append ("=").append (value); else - singleRowWHERE = new StringBuffer(tableName).append(".").append(columnName) + singleRowWHERE = new StringBuilder(tableName).append(".").append(columnName) .append ("=").append (DB.TO_STRING(value.toString())); } else if (field.isParentColumn()) @@ -2381,7 +2381,7 @@ public class GridTable extends AbstractTableModel continue; } if (multiRowWHERE == null) - multiRowWHERE = new StringBuffer(); + multiRowWHERE = new StringBuilder(); else multiRowWHERE.append(" AND "); if (columnName.endsWith ("_ID")) @@ -3486,7 +3486,7 @@ public class GridTable extends AbstractTableModel */ public String toString() { - return new StringBuffer("MTable[").append(m_tableName) + return new StringBuilder("MTable[").append(m_tableName) .append(",WindowNo=").append(m_WindowNo) .append(",Tab=").append(m_TabNo).append("]").toString(); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/GridWindowVO.java b/org.adempiere.base/src/org/compiere/model/GridWindowVO.java index d3e86bad80..fd07c84d88 100644 --- a/org.adempiere.base/src/org/compiere/model/GridWindowVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridWindowVO.java @@ -109,7 +109,7 @@ public class GridWindowVO implements Serializable // -- Get Window - StringBuffer sql = new StringBuffer("SELECT Name,Description,Help,WindowType, " + StringBuilder sql = new StringBuilder("SELECT Name,Description,Help,WindowType, " + "AD_Color_ID,AD_Image_ID,WinHeight,WinWidth, " + "IsSOTrx, AD_Window_UU "); diff --git a/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java b/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java index 078701aa8f..abf6bc9db3 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java @@ -288,7 +288,7 @@ implements DocAction public String getSummary() { - return new StringBuffer() + return new StringBuilder() .append(getDocumentNo()).append("/").append(getDateDoc()) .toString(); } diff --git a/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java b/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java index ad77771d08..eaf0396286 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java @@ -65,7 +65,7 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor { int AD_Client_ID, int C_Currency_ID, BigDecimal Amt, String trxName) { ArrayList list = new ArrayList(); - StringBuffer sql = new StringBuffer("SELECT bap.* " + StringBuilder sql = new StringBuilder("SELECT bap.* " + "FROM C_BankAccount_Processor bap, C_PaymentProcessor pp, C_BankAccount ba " + "WHERE pp.C_PaymentProcessor_ID = bap.C_PaymentProcessor_ID" + " AND ba.C_BankAccount_ID = bap.C_BankAccount_ID" diff --git a/org.adempiere.base/src/org/compiere/model/MChartDatasource.java b/org.adempiere.base/src/org/compiere/model/MChartDatasource.java index ec361cef4e..c05d6bf639 100644 --- a/org.adempiere.base/src/org/compiere/model/MChartDatasource.java +++ b/org.adempiere.base/src/org/compiere/model/MChartDatasource.java @@ -88,7 +88,7 @@ public class MChartDatasource extends X_AD_ChartDatasource { sql += " GROUP BY " + series + ", " + category + "," + getKeyColumn() + " ORDER BY " + series + ", " + category + "," + getKeyColumn(); - StringBuffer includedIds = new StringBuffer(); + StringBuilder includedIds = new StringBuilder(); // Execute PreparedStatement pstmt = null; ResultSet rs = null; diff --git a/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java b/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java index 204f1f7923..ca075f5781 100644 --- a/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java @@ -53,7 +53,7 @@ public class MDashboardContentAccess extends X_PA_DashboardContent_Access { parameters.add(AD_Client_ID); parameters.add(AD_Client_ID); - StringBuffer sql= new StringBuffer(); + StringBuilder sql= new StringBuilder(); // First part : dashboards not configured in access and flagged to be shown in login (this is intended to show new dashboards, otherwise new dashboards won't be shown unless the user go and configure them) sql.append("SELECT PA_DashboardContent_ID,ColumnNo ") .append(" FROM PA_DashboardContent ") diff --git a/org.adempiere.base/src/org/compiere/model/MDepositBatch.java b/org.adempiere.base/src/org/compiere/model/MDepositBatch.java index 5893e7511e..3d34c13372 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepositBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MDepositBatch.java @@ -182,7 +182,7 @@ public class MDepositBatch extends X_C_DepositBatch */ public String toString () { - StringBuffer sb = new StringBuffer ("MDepositBatch["); + StringBuilder sb = new StringBuilder ("MDepositBatch["); sb.append(get_ID()).append(",").append(getDescription()) .append(",Amount=").append(getDepositAmt()) .append ("]"); diff --git a/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java b/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java index 2717cbface..ceee098ff9 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java +++ b/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java @@ -91,7 +91,7 @@ public class MDocumentStatus extends X_PA_DocumentStatus { } // getDocumentStatusIndicators public static int evaluate(MDocumentStatus documentStatus) { - StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM "); + StringBuilder sql = new StringBuilder("SELECT COUNT(*) FROM "); String tableName = MTable.getTableName(Env.getCtx(), documentStatus.getAD_Table_ID()); sql.append(tableName); String where = getWhereClause(documentStatus); @@ -102,7 +102,7 @@ public class MDocumentStatus extends X_PA_DocumentStatus { } public static String getWhereClause(MDocumentStatus documentStatus) { - StringBuffer where = new StringBuffer(" AD_Client_ID=" + Env.getAD_Client_ID(Env.getCtx()) ); + StringBuilder where = new StringBuilder(" AD_Client_ID=" + Env.getAD_Client_ID(Env.getCtx()) ); if (documentStatus.getC_Project_ID() > 0) { where.append(" AND C_Project_ID=").append(documentStatus.getC_Project_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java b/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java index bf83b5578f..673f6cfb65 100644 --- a/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java +++ b/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java @@ -57,7 +57,7 @@ public class MIFixedAsset extends X_I_FixedAsset int M_Product_ID = getM_Product_ID(); if (M_Product_ID <= 0) { - StringBuffer whereClause = new StringBuffer(); + StringBuilder whereClause = new StringBuilder(); String key = getProductValue(); if (key == null || key.trim().length() == 0) { key = getName(); diff --git a/org.adempiere.base/src/org/compiere/model/MNote.java b/org.adempiere.base/src/org/compiere/model/MNote.java index 5cd0e1f655..4f17f930e9 100644 --- a/org.adempiere.base/src/org/compiere/model/MNote.java +++ b/org.adempiere.base/src/org/compiere/model/MNote.java @@ -197,7 +197,7 @@ public class MNote extends X_AD_Note */ public String toString() { - StringBuffer sb = new StringBuffer ("MNote[") + StringBuilder sb = new StringBuilder ("MNote[") .append(get_ID()).append(",AD_Message_ID=").append(getAD_Message_ID()) .append(",").append(getReference()) .append(",Processed=").append(isProcessed()) diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index ad30090c0b..6f4fb207f6 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -578,7 +578,7 @@ public class MOrder extends X_C_Order implements DocAction */ public String toString () { - StringBuffer sb = new StringBuffer ("MOrder[") + StringBuilder sb = new StringBuilder ("MOrder[") .append(get_ID()).append("-").append(getDocumentNo()) .append(",IsSOTrx=").append(isSOTrx()) .append(",C_DocType_ID=").append(getC_DocType_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MOrderLine.java b/org.adempiere.base/src/org/compiere/model/MOrderLine.java index 070d8f0d6d..8692f9c284 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderLine.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderLine.java @@ -605,7 +605,7 @@ public class MOrderLine extends X_C_OrderLine */ public String toString () { - StringBuffer sb = new StringBuffer ("MOrderLine[") + StringBuilder sb = new StringBuilder ("MOrderLine[") .append(get_ID()) .append(", Line=").append(getLine()) .append(", Ordered=").append(getQtyOrdered()) diff --git a/org.adempiere.base/src/org/compiere/model/MOrderTax.java b/org.adempiere.base/src/org/compiere/model/MOrderTax.java index 0a9d37b55f..f54bfe5e57 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderTax.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderTax.java @@ -258,7 +258,7 @@ public class MOrderTax extends X_C_OrderTax */ public String toString () { - StringBuffer sb = new StringBuffer ("MOrderTax[") + StringBuilder sb = new StringBuilder ("MOrderTax[") .append("C_Order_ID=").append(getC_Order_ID()) .append(", C_Tax_ID=").append(getC_Tax_ID()) .append(", Base=").append(getTaxBaseAmt()) diff --git a/org.adempiere.base/src/org/compiere/model/MPInstance.java b/org.adempiere.base/src/org/compiere/model/MPInstance.java index f1df9917df..e923cab763 100644 --- a/org.adempiere.base/src/org/compiere/model/MPInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MPInstance.java @@ -286,7 +286,7 @@ public class MPInstance extends X_AD_PInstance */ public String toString () { - StringBuffer sb = new StringBuffer ("MPInstance[") + StringBuilder sb = new StringBuilder ("MPInstance[") .append (get_ID()) .append(",OK=").append(isOK()); String msg = getErrorMsg(); diff --git a/org.adempiere.base/src/org/compiere/model/MPInstancePara.java b/org.adempiere.base/src/org/compiere/model/MPInstancePara.java index 2bc0a24665..b85c1bd3ff 100644 --- a/org.adempiere.base/src/org/compiere/model/MPInstancePara.java +++ b/org.adempiere.base/src/org/compiere/model/MPInstancePara.java @@ -93,7 +93,7 @@ public class MPInstancePara extends X_AD_PInstance_Para */ public String toString () { - StringBuffer sb = new StringBuffer ("MPInstancePara[") + StringBuilder sb = new StringBuilder ("MPInstancePara[") .append (get_ID ()).append("-").append(getParameterName()); if (getP_String() != null) { diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java b/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java index cd98359f06..3f65b1b9de 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java @@ -85,7 +85,7 @@ public class MPaymentProcessor extends X_C_PaymentProcessor */ public String toString () { - StringBuffer sb = new StringBuffer ("MPaymentProcessor[") + StringBuilder sb = new StringBuilder ("MPaymentProcessor[") .append(get_ID ()).append("-").append(getName()) .append ("]"); return sb.toString (); diff --git a/org.adempiere.base/src/org/compiere/model/MPrivateAccess.java b/org.adempiere.base/src/org/compiere/model/MPrivateAccess.java index 15e42d7a53..8b0fbed5d3 100644 --- a/org.adempiere.base/src/org/compiere/model/MPrivateAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MPrivateAccess.java @@ -119,7 +119,7 @@ public class MPrivateAccess extends X_AD_Private_Access if (list.size() == 1) return "<>" + list.get(0); // - StringBuffer sb = new StringBuffer(" NOT IN("); + StringBuilder sb = new StringBuilder(" NOT IN("); for (int i = 0; i < list.size(); i++) { if (i > 0) diff --git a/org.adempiere.base/src/org/compiere/model/MProcess.java b/org.adempiere.base/src/org/compiere/model/MProcess.java index 090e42f0f4..ad60608263 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcess.java +++ b/org.adempiere.base/src/org/compiere/model/MProcess.java @@ -189,7 +189,7 @@ public class MProcess extends X_AD_Process */ public String toString () { - StringBuffer sb = new StringBuffer ("MProcess[") + StringBuilder sb = new StringBuilder ("MProcess[") .append (get_ID()) .append("-").append(getName()) .append ("]"); diff --git a/org.adempiere.base/src/org/compiere/model/MProcessPara.java b/org.adempiere.base/src/org/compiere/model/MProcessPara.java index 94ab2e5f39..85d3d75937 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcessPara.java +++ b/org.adempiere.base/src/org/compiere/model/MProcessPara.java @@ -210,7 +210,7 @@ public class MProcessPara extends X_AD_Process_Para */ public String toString () { - StringBuffer sb = new StringBuffer ("MProcessPara[") + StringBuilder sb = new StringBuilder ("MProcessPara[") .append (get_ID ()) .append ("]"); return sb.toString (); diff --git a/org.adempiere.base/src/org/compiere/model/MProductDownload.java b/org.adempiere.base/src/org/compiere/model/MProductDownload.java index c8e3756152..3ab56452dc 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductDownload.java +++ b/org.adempiere.base/src/org/compiere/model/MProductDownload.java @@ -139,7 +139,7 @@ public class MProductDownload extends X_M_ProductDownload */ public String toString () { - StringBuffer sb = new StringBuffer ("MProductDownload[") + StringBuilder sb = new StringBuilder ("MProductDownload[") .append(get_ID()) .append(",M_Product_ID=").append(getM_Product_ID()) .append(",").append(getDownloadURL()) diff --git a/org.adempiere.base/src/org/compiere/model/MProject.java b/org.adempiere.base/src/org/compiere/model/MProject.java index edff0d8438..7b8bbd51d5 100644 --- a/org.adempiere.base/src/org/compiere/model/MProject.java +++ b/org.adempiere.base/src/org/compiere/model/MProject.java @@ -140,7 +140,7 @@ public class MProject extends X_C_Project */ public String toString() { - StringBuffer sb = new StringBuffer ("MProject[").append(get_ID()) + StringBuilder sb = new StringBuilder ("MProject[").append(get_ID()) .append("-").append(getValue()).append(",ProjectCategory=").append(getProjectCategory()) .append("]"); return sb.toString(); diff --git a/org.adempiere.base/src/org/compiere/model/MProjectType.java b/org.adempiere.base/src/org/compiere/model/MProjectType.java index 50dc0ccb38..bd0b22cf46 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectType.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectType.java @@ -99,7 +99,7 @@ public class MProjectType extends X_C_ProjectType */ public String toString() { - StringBuffer sb = new StringBuffer ("MProjectType[") + StringBuilder sb = new StringBuilder ("MProjectType[") .append(get_ID()) .append("-").append(getName()) .append("]"); diff --git a/org.adempiere.base/src/org/compiere/model/MRMATax.java b/org.adempiere.base/src/org/compiere/model/MRMATax.java index c5d312af37..d0c698eebf 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMATax.java +++ b/org.adempiere.base/src/org/compiere/model/MRMATax.java @@ -250,7 +250,7 @@ public class MRMATax extends X_M_RMATax */ public String toString () { - StringBuffer sb = new StringBuffer ("MRMATax[") + StringBuilder sb = new StringBuilder ("MRMATax[") .append("M_RMA_ID=").append(getM_RMA_ID()) .append(", C_Tax_ID=").append(getC_Tax_ID()) .append(", Base=").append(getTaxBaseAmt()) diff --git a/org.adempiere.base/src/org/compiere/model/MRecordAccess.java b/org.adempiere.base/src/org/compiere/model/MRecordAccess.java index 6c062a0861..7505f63fe0 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecordAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MRecordAccess.java @@ -197,7 +197,7 @@ public class MRecordAccess extends X_AD_Record_Access */ public String toString() { - StringBuffer sb = new StringBuffer("MRecordAccess[AD_Role_ID=") + StringBuilder sb = new StringBuilder("MRecordAccess[AD_Role_ID=") .append(getAD_Role_ID()) .append(",AD_Table_ID=").append(getAD_Table_ID()) .append(",Record_ID=").append(getRecord_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MRecurring.java b/org.adempiere.base/src/org/compiere/model/MRecurring.java index 9c22649641..43c1928c54 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecurring.java +++ b/org.adempiere.base/src/org/compiere/model/MRecurring.java @@ -64,7 +64,7 @@ public class MRecurring extends X_C_Recurring */ public String toString() { - StringBuffer sb = new StringBuffer ("MRecurring[") + StringBuilder sb = new StringBuilder ("MRecurring[") .append(get_ID()).append("-").append(getName()); if (getRecurringType().equals(MRecurring.RECURRINGTYPE_Order)) sb.append(",C_Order_ID=").append(getC_Order_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MResource.java b/org.adempiere.base/src/org/compiere/model/MResource.java index da71267437..51f54971f3 100644 --- a/org.adempiere.base/src/org/compiere/model/MResource.java +++ b/org.adempiere.base/src/org/compiere/model/MResource.java @@ -179,7 +179,7 @@ public class MResource extends X_S_Resource @Override public String toString() { - StringBuffer sb = new StringBuffer ("MResource[") + StringBuilder sb = new StringBuilder ("MResource[") .append(get_ID()) .append(", Value=").append(getValue()) .append(", Name=").append(getName()) diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index b945677ef1..8ba7cd6564 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -2395,8 +2395,8 @@ public final class MRole extends X_AD_Role { loadRecordAccess(false); // - StringBuffer sbInclude = new StringBuffer(); - StringBuffer sbExclude = new StringBuffer(); + StringBuilder sbInclude = new StringBuilder(); + StringBuilder sbExclude = new StringBuilder(); // Role Access for (int i = 0; i < m_recordAccess.length; i++) { @@ -2559,7 +2559,7 @@ public final class MRole extends X_AD_Role final ArrayList validOptions = new ArrayList(); final List optionParams = new ArrayList(); // - final StringBuffer sql_values = new StringBuffer(); + final StringBuilder sql_values = new StringBuilder(); for (int i = 0; i < maxIndex; i++) { if (sql_values.length() > 0) sql_values.append(","); diff --git a/org.adempiere.base/src/org/compiere/model/MRoleIncluded.java b/org.adempiere.base/src/org/compiere/model/MRoleIncluded.java index 52c6903ee8..473881afb4 100644 --- a/org.adempiere.base/src/org/compiere/model/MRoleIncluded.java +++ b/org.adempiere.base/src/org/compiere/model/MRoleIncluded.java @@ -56,7 +56,7 @@ public class MRoleIncluded extends X_AD_Role_Included List trace = new ArrayList(); if (hasLoop(Table_Name, COLUMNNAME_Included_Role_ID, COLUMNNAME_AD_Role_ID, getIncluded_Role_ID(), trace, get_TrxName())) { - StringBuffer roles = new StringBuffer(); + StringBuilder roles = new StringBuilder(); for (int role_id : trace) { MRole role = MRole.get(getCtx(), role_id); diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index a47d66b2f8..cfd9379c0e 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -1292,7 +1292,7 @@ public class MSequence extends X_AD_Sequence String website, String prm_USER, String prm_PASSWORD, String prm_TABLE, String prm_ALTKEY, String prm_COMMENT, String prm_PROJECT) { - StringBuffer read = new StringBuffer(); + StringBuilder read = new StringBuilder(); int retValue = -1; try { String completeUrl = website + "?" + "USER=" diff --git a/org.adempiere.base/src/org/compiere/model/MSession.java b/org.adempiere.base/src/org/compiere/model/MSession.java index 93315b759c..302af270b1 100644 --- a/org.adempiere.base/src/org/compiere/model/MSession.java +++ b/org.adempiere.base/src/org/compiere/model/MSession.java @@ -221,7 +221,7 @@ public class MSession extends X_AD_Session */ public String toString() { - StringBuffer sb = new StringBuffer("MSession[") + StringBuilder sb = new StringBuilder("MSession[") .append(getAD_Session_ID()) .append(",AD_User_ID=").append(getCreatedBy()) .append(",").append(getCreated()) diff --git a/org.adempiere.base/src/org/compiere/model/MSetup.java b/org.adempiere.base/src/org/compiere/model/MSetup.java index 52b5cecbca..3acd09e073 100644 --- a/org.adempiere.base/src/org/compiere/model/MSetup.java +++ b/org.adempiere.base/src/org/compiere/model/MSetup.java @@ -427,7 +427,7 @@ public final class MSetup // Standard variables m_info = new StringBuffer(); String name = null; - StringBuffer sqlCmd = null; + StringBuilder sqlCmd = null; int no = 0; /** @@ -595,7 +595,7 @@ public final class MSetup if (IsMandatory != null) { - sqlCmd = new StringBuffer ("INSERT INTO C_AcctSchema_Element("); + sqlCmd = new StringBuilder ("INSERT INTO C_AcctSchema_Element("); sqlCmd.append(m_stdColumns).append(",C_AcctSchema_Element_ID,C_AcctSchema_ID,") .append("ElementType,Name,SeqNo,IsMandatory,IsBalanced,C_AcctSchema_Element_UU) VALUES ("); sqlCmd.append(m_stdValues).append(",").append(C_AcctSchema_Element_ID).append(",").append(m_as.getC_AcctSchema_ID()).append(",") @@ -608,7 +608,7 @@ public final class MSetup /** Default value for mandatory elements: OO and AC */ if (ElementType.equals("OO")) { - sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET Org_ID="); + sqlCmd = new StringBuilder ("UPDATE C_AcctSchema_Element SET Org_ID="); sqlCmd.append(getAD_Org_ID()).append(" WHERE C_AcctSchema_Element_ID=").append(C_AcctSchema_Element_ID); no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName()); if (no != 1) @@ -616,7 +616,7 @@ public final class MSetup } if (ElementType.equals("AC")) { - sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET C_ElementValue_ID="); + sqlCmd = new StringBuilder ("UPDATE C_AcctSchema_Element SET C_ElementValue_ID="); sqlCmd.append(C_ElementValue_ID).append(", C_Element_ID=").append(C_Element_ID); sqlCmd.append(" WHERE C_AcctSchema_Element_ID=").append(C_AcctSchema_Element_ID); no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName()); @@ -798,7 +798,7 @@ public final class MSetup createPreference("C_DocTypeTarget_ID", String.valueOf(DT), 143); // Update ClientInfo - sqlCmd = new StringBuffer ("UPDATE AD_ClientInfo SET "); + sqlCmd = new StringBuilder ("UPDATE AD_ClientInfo SET "); sqlCmd.append("C_AcctSchema1_ID=").append(m_as.getC_AcctSchema_ID()) .append(", C_Calendar_ID=").append(m_calendar.getC_Calendar_ID()) .append(" WHERE AD_Client_ID=").append(m_client.getAD_Client_ID()); @@ -1012,12 +1012,12 @@ public final class MSetup // String defaultName = Msg.translate(m_lang, "Standard"); String defaultEntry = "'" + defaultName + "',"; - StringBuffer sqlCmd = null; + StringBuilder sqlCmd = null; int no = 0; // Create Marketing Channel/Campaign int C_Channel_ID = getNextID(getAD_Client_ID(), "C_Channel"); - sqlCmd = new StringBuffer("INSERT INTO C_Channel "); + sqlCmd = new StringBuilder("INSERT INTO C_Channel "); sqlCmd.append("(C_Channel_ID,Name,"); sqlCmd.append(m_stdColumns).append(",C_Channel_UU) VALUES ("); sqlCmd.append(C_Channel_ID).append(",").append(defaultEntry); @@ -1027,7 +1027,7 @@ public final class MSetup log.log(Level.SEVERE, "Channel NOT inserted"); int C_Campaign_ID = getNextID(getAD_Client_ID(), "C_Campaign"); - sqlCmd = new StringBuffer("INSERT INTO C_Campaign "); + sqlCmd = new StringBuilder("INSERT INTO C_Campaign "); sqlCmd.append("(C_Campaign_ID,C_Channel_ID,").append(m_stdColumns).append(","); sqlCmd.append(" Value,Name,Costs,C_Campaign_UU) VALUES ("); sqlCmd.append(C_Campaign_ID).append(",").append(C_Channel_ID).append(",").append(m_stdValues).append(","); @@ -1040,7 +1040,7 @@ public final class MSetup if (m_hasMCampaign) { // Default - sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET "); + sqlCmd = new StringBuilder ("UPDATE C_AcctSchema_Element SET "); sqlCmd.append("C_Campaign_ID=").append(C_Campaign_ID); sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID()); sqlCmd.append(" AND ElementType='MC'"); @@ -1049,7 +1049,7 @@ public final class MSetup log.log(Level.SEVERE, "AcctSchema Element Campaign NOT updated"); } // Campaign Translation - sqlCmd = new StringBuffer ("INSERT INTO C_Campaign_Trl (AD_Language,C_Campaign_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_Campaign_Trl_UU)"); + sqlCmd = new StringBuilder ("INSERT INTO C_Campaign_Trl (AD_Language,C_Campaign_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_Campaign_Trl_UU)"); sqlCmd.append(" SELECT l.AD_Language,t.C_Campaign_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy, generate_uuid() FROM AD_Language l, C_Campaign t"); sqlCmd.append(" WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.C_Campaign_ID=").append(C_Campaign_ID); sqlCmd.append(" AND NOT EXISTS (SELECT * FROM C_Campaign_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.C_Campaign_ID=t.C_Campaign_ID)"); @@ -1059,7 +1059,7 @@ public final class MSetup // Create Sales Region int C_SalesRegion_ID = getNextID(getAD_Client_ID(), "C_SalesRegion"); - sqlCmd = new StringBuffer ("INSERT INTO C_SalesRegion "); + sqlCmd = new StringBuilder ("INSERT INTO C_SalesRegion "); sqlCmd.append("(C_SalesRegion_ID,").append(m_stdColumns).append(","); sqlCmd.append(" Value,Name,IsSummary,C_SalesRegion_UU) VALUES ("); sqlCmd.append(C_SalesRegion_ID).append(",").append(m_stdValues).append(", "); @@ -1072,7 +1072,7 @@ public final class MSetup if (m_hasSRegion) { // Default - sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET "); + sqlCmd = new StringBuilder ("UPDATE C_AcctSchema_Element SET "); sqlCmd.append("C_SalesRegion_ID=").append(C_SalesRegion_ID); sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID()); sqlCmd.append(" AND ElementType='SR'"); @@ -1081,7 +1081,7 @@ public final class MSetup log.log(Level.SEVERE, "AcctSchema Element SalesRegion NOT updated"); } // Sales Region Translation - sqlCmd = new StringBuffer ("INSERT INTO C_SalesRegion_Trl (AD_Language,C_SalesRegion_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_SalesRegion_Trl_UU)"); + sqlCmd = new StringBuilder ("INSERT INTO C_SalesRegion_Trl (AD_Language,C_SalesRegion_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_SalesRegion_Trl_UU)"); sqlCmd.append(" SELECT l.AD_Language,t.C_SalesRegion_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy, generate_uuid() FROM AD_Language l, C_SalesRegion t"); sqlCmd.append(" WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.C_SalesRegion_ID=").append(C_SalesRegion_ID); sqlCmd.append(" AND NOT EXISTS (SELECT * FROM C_SalesRegion_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.C_SalesRegion_ID=t.C_SalesRegion_ID)"); @@ -1091,7 +1091,7 @@ public final class MSetup // Create Activity int C_Activity_ID = getNextID(getAD_Client_ID(), "C_Activity"); - sqlCmd = new StringBuffer ("INSERT INTO C_Activity "); + sqlCmd = new StringBuilder ("INSERT INTO C_Activity "); sqlCmd.append("(C_Activity_ID,").append(m_stdColumns).append(","); sqlCmd.append(" Value,Name,IsSummary,C_Activity_UU) VALUES ("); sqlCmd.append(C_Activity_ID).append(",").append(m_stdValues).append(", "); @@ -1104,7 +1104,7 @@ public final class MSetup if (m_hasActivity) { // Default - sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET "); + sqlCmd = new StringBuilder ("UPDATE C_AcctSchema_Element SET "); sqlCmd.append("C_Activity_ID=").append(C_Activity_ID); sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID()); sqlCmd.append(" AND ElementType='AY'"); @@ -1113,7 +1113,7 @@ public final class MSetup log.log(Level.SEVERE, "AcctSchema Element Activity NOT updated"); } // Activity Translation - sqlCmd = new StringBuffer ("INSERT INTO C_Activity_Trl (AD_Language,C_Activity_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_Activity_Trl_UU)"); + sqlCmd = new StringBuilder ("INSERT INTO C_Activity_Trl (AD_Language,C_Activity_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_Activity_Trl_UU)"); sqlCmd.append(" SELECT l.AD_Language,t.C_Activity_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy, generate_uuid() FROM AD_Language l, C_Activity t"); sqlCmd.append(" WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.C_Activity_ID=").append(C_Activity_ID); sqlCmd.append(" AND NOT EXISTS (SELECT * FROM C_Activity_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.C_Activity_ID=t.C_Activity_ID)"); @@ -1151,7 +1151,7 @@ public final class MSetup if (!bpl.save()) log.log(Level.SEVERE, "BP_Location (Standard) NOT inserted"); // Default - sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET "); + sqlCmd = new StringBuilder ("UPDATE C_AcctSchema_Element SET "); sqlCmd.append("C_BPartner_ID=").append(bp.getC_BPartner_ID()); sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID()); sqlCmd.append(" AND ElementType='BP'"); @@ -1178,7 +1178,7 @@ public final class MSetup // TaxCategory int C_TaxCategory_ID = getNextID(getAD_Client_ID(), "C_TaxCategory"); - sqlCmd = new StringBuffer ("INSERT INTO C_TaxCategory "); + sqlCmd = new StringBuilder ("INSERT INTO C_TaxCategory "); sqlCmd.append("(C_TaxCategory_ID,").append(m_stdColumns).append(","); sqlCmd.append(" Name,IsDefault,C_TaxCategory_UU) VALUES ("); sqlCmd.append(C_TaxCategory_ID).append(",").append(m_stdValues).append(", "); @@ -1192,7 +1192,7 @@ public final class MSetup log.log(Level.SEVERE, "TaxCategory NOT inserted"); // TaxCategory translation - sqlCmd = new StringBuffer ("INSERT INTO C_TaxCategory_Trl (AD_Language,C_TaxCategory_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_TaxCategory_Trl_UU)"); + sqlCmd = new StringBuilder ("INSERT INTO C_TaxCategory_Trl (AD_Language,C_TaxCategory_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_TaxCategory_Trl_UU)"); sqlCmd.append(" SELECT l.AD_Language,t.C_TaxCategory_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy, generate_uuid() FROM AD_Language l, C_TaxCategory t"); sqlCmd.append(" WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.C_TaxCategory_ID=").append(C_TaxCategory_ID); sqlCmd.append(" AND NOT EXISTS (SELECT * FROM C_TaxCategory_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.C_TaxCategory_ID=t.C_TaxCategory_ID)"); @@ -1221,7 +1221,7 @@ public final class MSetup else log.log(Level.SEVERE, "Product NOT inserted"); // Default - sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET "); + sqlCmd = new StringBuilder ("UPDATE C_AcctSchema_Element SET "); sqlCmd.append("M_Product_ID=").append(product.getM_Product_ID()); sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID()); sqlCmd.append(" AND ElementType='PR'"); @@ -1237,7 +1237,7 @@ public final class MSetup loc.setAddress1(address1); loc.setPostal(postal); loc.saveEx(); - sqlCmd = new StringBuffer ("UPDATE AD_OrgInfo SET C_Location_ID="); + sqlCmd = new StringBuilder ("UPDATE AD_OrgInfo SET C_Location_ID="); sqlCmd.append(loc.getC_Location_ID()).append(" WHERE AD_Org_ID=").append(getAD_Org_ID()); no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName()); if (no != 1) @@ -1263,7 +1263,7 @@ public final class MSetup log.log(Level.SEVERE, "Locator NOT inserted"); // Update ClientInfo - sqlCmd = new StringBuffer ("UPDATE AD_ClientInfo SET "); + sqlCmd = new StringBuilder ("UPDATE AD_ClientInfo SET "); sqlCmd.append("C_BPartnerCashTrx_ID=").append(bp.getC_BPartner_ID()); sqlCmd.append(",M_ProductFreight_ID=").append(product.getM_Product_ID()); // sqlCmd.append("C_UOM_Volume_ID="); @@ -1328,7 +1328,7 @@ public final class MSetup if (!bplCU.save()) log.log(Level.SEVERE, "BP_Location (User) NOT inserted"); // Update User - sqlCmd = new StringBuffer ("UPDATE AD_User SET C_BPartner_ID="); + sqlCmd = new StringBuilder ("UPDATE AD_User SET C_BPartner_ID="); sqlCmd.append(bpCU.getC_BPartner_ID()).append(" WHERE AD_User_ID=").append(AD_User_U_ID); no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName()); if (no != 1) @@ -1354,7 +1354,7 @@ public final class MSetup if (!bplCA.save()) log.log(Level.SEVERE, "BP_Location (Admin) NOT inserted"); // Update User - sqlCmd = new StringBuffer ("UPDATE AD_User SET C_BPartner_ID="); + sqlCmd = new StringBuilder ("UPDATE AD_User SET C_BPartner_ID="); sqlCmd.append(bpCA.getC_BPartner_ID()).append(" WHERE AD_User_ID=").append(AD_User_ID); no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName()); if (no != 1) @@ -1363,7 +1363,7 @@ public final class MSetup // Payment Term int C_PaymentTerm_ID = getNextID(getAD_Client_ID(), "C_PaymentTerm"); - sqlCmd = new StringBuffer ("INSERT INTO C_PaymentTerm "); + sqlCmd = new StringBuilder ("INSERT INTO C_PaymentTerm "); sqlCmd.append("(C_PaymentTerm_ID,").append(m_stdColumns).append(","); sqlCmd.append("Value,Name,NetDays,GraceDays,DiscountDays,Discount,DiscountDays2,Discount2,IsDefault,C_PaymentTerm_UU) VALUES ("); sqlCmd.append(C_PaymentTerm_ID).append(",").append(m_stdValues).append(","); @@ -1372,7 +1372,7 @@ public final class MSetup if (no != 1) log.log(Level.SEVERE, "PaymentTerm NOT inserted"); // Payment Term Translation - sqlCmd = new StringBuffer ("INSERT INTO C_PaymentTerm_Trl (AD_Language,C_PaymentTerm_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_PaymentTerm_Trl_UU)"); + sqlCmd = new StringBuilder ("INSERT INTO C_PaymentTerm_Trl (AD_Language,C_PaymentTerm_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,C_PaymentTerm_Trl_UU)"); sqlCmd.append(" SELECT l.AD_Language,t.C_PaymentTerm_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy, generate_uuid() FROM AD_Language l, C_PaymentTerm t"); sqlCmd.append(" WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.C_PaymentTerm_ID=").append(C_PaymentTerm_ID); sqlCmd.append(" AND NOT EXISTS (SELECT * FROM C_PaymentTerm_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.C_PaymentTerm_ID=t.C_PaymentTerm_ID)"); @@ -1382,7 +1382,7 @@ public final class MSetup // Project Cycle C_Cycle_ID = getNextID(getAD_Client_ID(), "C_Cycle"); - sqlCmd = new StringBuffer ("INSERT INTO C_Cycle "); + sqlCmd = new StringBuilder ("INSERT INTO C_Cycle "); sqlCmd.append("(C_Cycle_ID,").append(m_stdColumns).append(","); sqlCmd.append(" Name,C_Currency_ID,C_Cycle_UU) VALUES ("); sqlCmd.append(C_Cycle_ID).append(",").append(m_stdValues).append(", "); @@ -1397,7 +1397,7 @@ public final class MSetup // Create Default Project int C_Project_ID = getNextID(getAD_Client_ID(), "C_Project"); - sqlCmd = new StringBuffer ("INSERT INTO C_Project "); + sqlCmd = new StringBuilder ("INSERT INTO C_Project "); sqlCmd.append("(C_Project_ID,").append(m_stdColumns).append(","); sqlCmd.append(" Value,Name,C_Currency_ID,IsSummary,C_Project_UU) VALUES ("); sqlCmd.append(C_Project_ID).append(",").append(m_stdValuesOrg).append(", "); @@ -1410,7 +1410,7 @@ public final class MSetup // Default Project if (m_hasProject) { - sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET "); + sqlCmd = new StringBuilder ("UPDATE C_AcctSchema_Element SET "); sqlCmd.append("C_Project_ID=").append(C_Project_ID); sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID()); sqlCmd.append(" AND ElementType='PJ'"); diff --git a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java index 37026712e4..d91d2ab0e4 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java @@ -1017,7 +1017,7 @@ public class MStorageOnHand extends X_M_StorageOnHand */ public String toString() { - StringBuffer sb = new StringBuffer("MStorageOnHand[") + StringBuilder sb = new StringBuilder("MStorageOnHand[") .append("M_Locator_ID=").append(getM_Locator_ID()) .append(",M_Product_ID=").append(getM_Product_ID()) .append(",M_AttributeSetInstance_ID=").append(getM_AttributeSetInstance_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MStorageReservation.java b/org.adempiere.base/src/org/compiere/model/MStorageReservation.java index 29ec255ee0..94fdbf3523 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageReservation.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageReservation.java @@ -328,7 +328,7 @@ public class MStorageReservation extends X_M_StorageReservation { */ public String toString() { - StringBuffer sb = new StringBuffer("MStorageReservation[") + StringBuilder sb = new StringBuilder("MStorageReservation[") .append("M_Warehouse_ID=").append(getM_Warehouse_ID()) .append(",M_Product_ID=").append(getM_Product_ID()) .append(",M_AttributeSetInstance_ID=").append(getM_AttributeSetInstance_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MTax.java b/org.adempiere.base/src/org/compiere/model/MTax.java index 5292933801..00839e3ed6 100644 --- a/org.adempiere.base/src/org/compiere/model/MTax.java +++ b/org.adempiere.base/src/org/compiere/model/MTax.java @@ -229,7 +229,7 @@ public class MTax extends X_C_Tax public String toString() { - StringBuffer sb = new StringBuffer("MTax[") + StringBuilder sb = new StringBuilder("MTax[") .append(get_ID()) .append(", Name = ").append(getName()) .append(", SO/PO=").append(getSOPOType()) diff --git a/org.adempiere.base/src/org/compiere/model/MToolBarButtonRestrict.java b/org.adempiere.base/src/org/compiere/model/MToolBarButtonRestrict.java index 6cb7e91e90..e5ba4a3fa7 100644 --- a/org.adempiere.base/src/org/compiere/model/MToolBarButtonRestrict.java +++ b/org.adempiere.base/src/org/compiere/model/MToolBarButtonRestrict.java @@ -162,7 +162,7 @@ public class MToolBarButtonRestrict extends X_AD_ToolBarButtonRestrict */ public String toString() { - StringBuffer sb = new StringBuffer ("MToolBarButtonRestrict[") + StringBuilder sb = new StringBuilder ("MToolBarButtonRestrict[") .append(get_ID()).append(",AD_ToolBarButtonRestrict_ID=").append(getAD_ToolBarButtonRestrict_ID()) .append("]"); return sb.toString(); diff --git a/org.adempiere.base/src/org/compiere/model/MTree.java b/org.adempiere.base/src/org/compiere/model/MTree.java index 70b9106913..410ccc5231 100644 --- a/org.adempiere.base/src/org/compiere/model/MTree.java +++ b/org.adempiere.base/src/org/compiere/model/MTree.java @@ -237,10 +237,10 @@ public class MTree extends MTree_Base private void loadNodes (int AD_User_ID, String linkColName, int linkID) { // SQL for TreeNodes - StringBuffer sql = new StringBuffer(); + StringBuilder sql = new StringBuilder(); if (getTreeType().equals(TREETYPE_Menu)) // specific sql, need to load TreeBar IDEMPIERE 329 - nmicoud { - sql = new StringBuffer("SELECT " + sql = new StringBuilder("SELECT " + "tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive " + "FROM ").append(getNodeTableName()).append(" tn" + " LEFT OUTER JOIN AD_TreeBar tb ON (tn.AD_Tree_ID=tb.AD_Tree_ID" @@ -260,7 +260,7 @@ public class MTree extends MTree_Base if (getAD_Table_ID() > 0) sourceTableName = MTable.getTableName(getCtx(), getAD_Table_ID()); } - sql = new StringBuffer("SELECT " + sql = new StringBuilder("SELECT " + "tn.Node_ID,tn.Parent_ID,tn.SeqNo,st.IsActive " + "FROM ").append(sourceTableName).append(" st " + "LEFT OUTER JOIN ").append(getNodeTableName()).append(" tn ON (tn.Node_ID=st."+sourceTableName+"_ID) " @@ -272,7 +272,7 @@ public class MTree extends MTree_Base sql.append(" ORDER BY COALESCE(tn.Parent_ID, -1), tn.SeqNo"); //do not check access if allNodes if (AD_User_ID != -1) - sql = new StringBuffer(MRole.getDefault().addAccessSQL(sql.toString(), "st", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO)); // SQL_RO for Org_ID = 0 + sql = new StringBuilder(MRole.getDefault().addAccessSQL(sql.toString(), "st", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO)); // SQL_RO for Org_ID = 0 } if (log.isLoggable(Level.FINEST)) log.finest(sql.toString()); // The Node Loop diff --git a/org.adempiere.base/src/org/compiere/model/MUser.java b/org.adempiere.base/src/org/compiere/model/MUser.java index 163cfaf6f5..39dc432b47 100644 --- a/org.adempiere.base/src/org/compiere/model/MUser.java +++ b/org.adempiere.base/src/org/compiere/model/MUser.java @@ -531,7 +531,7 @@ public class MUser extends X_AD_User */ public String toString () { - StringBuffer sb = new StringBuffer ("MUser[") + StringBuilder sb = new StringBuilder ("MUser[") .append(get_ID()) .append(",Name=").append(getName()) .append(",EMailUserID=").append(getEMailUser()) @@ -989,7 +989,7 @@ public class MUser extends X_AD_User MUser retValue = null; int AD_Client_ID = Env.getAD_Client_ID(ctx); - StringBuffer sql = new StringBuffer("SELECT DISTINCT u.AD_User_ID ") + StringBuilder sql = new StringBuilder("SELECT DISTINCT u.AD_User_ID ") .append("FROM AD_User u") .append(" INNER JOIN AD_User_Roles ur ON (u.AD_User_ID=ur.AD_User_ID AND ur.IsActive='Y')") .append(" INNER JOIN AD_Role r ON (ur.AD_Role_ID=r.AD_Role_ID AND r.IsActive='Y') "); diff --git a/org.adempiere.base/src/org/compiere/model/MViewComponent.java b/org.adempiere.base/src/org/compiere/model/MViewComponent.java index 782996d236..add2a2d003 100644 --- a/org.adempiere.base/src/org/compiere/model/MViewComponent.java +++ b/org.adempiere.base/src/org/compiere/model/MViewComponent.java @@ -167,7 +167,7 @@ public class MViewComponent extends X_AD_ViewComponent { @Override public String toString() { - StringBuffer sb = new StringBuffer("MViewComponent[") + StringBuilder sb = new StringBuilder("MViewComponent[") .append(get_ID()) .append("-").append(getName()); sb.append("]"); diff --git a/org.adempiere.base/src/org/compiere/model/PO_LOB.java b/org.adempiere.base/src/org/compiere/model/PO_LOB.java index 508ef57729..2802633666 100644 --- a/org.adempiere.base/src/org/compiere/model/PO_LOB.java +++ b/org.adempiere.base/src/org/compiere/model/PO_LOB.java @@ -100,7 +100,7 @@ public class PO_LOB implements Serializable || (m_value instanceof byte[] && ((byte[])m_value).length == 0) ) { - StringBuffer sql = new StringBuffer ("UPDATE ") + StringBuilder sql = new StringBuilder ("UPDATE ") .append(m_tableName) .append(" SET ").append(m_columnName) .append("=null WHERE ").append(m_whereClause); @@ -111,12 +111,12 @@ public class PO_LOB implements Serializable return true; } - StringBuffer sql = new StringBuffer ("UPDATE ") + StringBuilder sql = new StringBuilder ("UPDATE ") .append(m_tableName) .append(" SET ").append(m_columnName) .append("=? WHERE ").append(m_whereClause); if (!DB.isPostgreSQL() && !DB.isOracle()) - sql = new StringBuffer(DB.getDatabase().convertStatement(sql.toString())); + sql = new StringBuilder(DB.getDatabase().convertStatement(sql.toString())); // if (log.isLoggable(Level.FINE)) log.fine("[" + trxName + "] - Local - " + m_value); diff --git a/org.adempiere.base/src/org/compiere/model/PO_Record.java b/org.adempiere.base/src/org/compiere/model/PO_Record.java index 57432325ec..85a209c2c3 100644 --- a/org.adempiere.base/src/org/compiere/model/PO_Record.java +++ b/org.adempiere.base/src/org/compiere/model/PO_Record.java @@ -110,7 +110,7 @@ public class PO_Record } else { - StringBuffer sql = new StringBuffer ("DELETE FROM ") + StringBuilder sql = new StringBuilder ("DELETE FROM ") .append(s_cascadeNames[i]) .append(" WHERE AD_Table_ID=? AND Record_ID=?"); int no = DB.executeUpdate(sql.toString(), params, false, trxName); @@ -134,7 +134,7 @@ public class PO_Record Object[] params = new Object[]{Integer.valueOf(AD_Table_IDchild), Integer.valueOf(Record_ID)}; for (int i = 0; i < s_cascades.length; i++) { - StringBuffer sql = new StringBuffer ("DELETE FROM ") + StringBuilder sql = new StringBuilder ("DELETE FROM ") .append(s_cascadeNames[i]) .append(" WHERE AD_Table_ID=? AND Record_ID IN (SELECT ") .append(s_parentChildNames[j]).append("_ID FROM ") @@ -204,7 +204,7 @@ public class PO_Record for (int i = 0; i < s_restricts.length; i++) { // SELECT COUNT(*) FROM table WHERE AD_Table_ID=#1 AND Record_ID=#2 - StringBuffer sql = new StringBuffer ("SELECT COUNT(*) FROM ") + StringBuilder sql = new StringBuilder ("SELECT COUNT(*) FROM ") .append(s_restrictNames[i]) .append(" WHERE AD_Table_ID=? AND Record_ID=?"); int no = DB.getSQLValue(trxName, sql.toString(), AD_Table_ID, Record_ID); @@ -263,7 +263,7 @@ public class PO_Record { for (int i = 0; i < s_cascades.length; i++) { - StringBuffer sql = new StringBuffer ("DELETE FROM ") + StringBuilder sql = new StringBuilder ("DELETE FROM ") .append(s_cascadeNames[i]) .append(" WHERE AD_Table_ID=").append(AD_Table_ID) .append(" AND Record_ID NOT IN (SELECT ") diff --git a/org.adempiere.base/src/org/compiere/model/SalesMgmtValidator.java b/org.adempiere.base/src/org/compiere/model/SalesMgmtValidator.java index 8e7fbd4c93..4440c1faef 100644 --- a/org.adempiere.base/src/org/compiere/model/SalesMgmtValidator.java +++ b/org.adempiere.base/src/org/compiere/model/SalesMgmtValidator.java @@ -162,7 +162,7 @@ public class SalesMgmtValidator implements ModelValidator */ public String toString () { - StringBuffer sb = new StringBuffer ("SalesMgmtValidator"); + StringBuilder sb = new StringBuilder ("SalesMgmtValidator"); return sb.toString (); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/TranslationTable.java b/org.adempiere.base/src/org/compiere/model/TranslationTable.java index 63ca61c979..1b2a39d590 100644 --- a/org.adempiere.base/src/org/compiere/model/TranslationTable.java +++ b/org.adempiere.base/src/org/compiere/model/TranslationTable.java @@ -171,9 +171,9 @@ public class TranslationTable if (po.get_ID() == 0) throw new IllegalArgumentException("PO ID is 0"); // - StringBuffer sql1 = new StringBuffer(); + StringBuilder sql1 = new StringBuilder(); sql1.append("INSERT INTO ").append(m_trlTableName).append(" ("); - StringBuffer sql2 = new StringBuffer(); + StringBuilder sql2 = new StringBuilder(); sql2.append(") SELECT "); // Key Columns diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java index 5c3be7d46c..fe01286bc0 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java @@ -345,7 +345,7 @@ public class MPrintFormat extends X_AD_PrintFormat */ public void setTranslation() { - StringBuffer sb = new StringBuffer ("UPDATE AD_PrintFormatItem_Trl t" + StringBuilder sb = new StringBuilder ("UPDATE AD_PrintFormatItem_Trl t" + " SET (PrintName, PrintNameSuffix)=" + " (SELECT PrintName, PrintNameSuffix FROM AD_PrintFormatItem i WHERE i.AD_PrintFormatItem_ID=t.AD_PrintFormatItem_ID) " + "WHERE AD_PrintFormatItem_ID IN" @@ -453,7 +453,7 @@ public class MPrintFormat extends X_AD_PrintFormat */ public String toString() { - StringBuffer sb = new StringBuffer ("MPrintFormat[ID=").append(get_ID()) + StringBuilder sb = new StringBuilder ("MPrintFormat[ID=").append(get_ID()) .append(",Name=").append(getName()) .append(",Language=").append(getLanguage()) .append(",Items=").append(getItemCount()) @@ -989,7 +989,7 @@ public class MPrintFormat extends X_AD_PrintFormat int fromID = fromItems[i].getAD_PrintFormatItem_ID(); int toID = toItems[i].getAD_PrintFormatItem_ID(); - StringBuffer sql = new StringBuffer("UPDATE AD_PrintFormatItem_Trl new ") + StringBuilder sql = new StringBuilder("UPDATE AD_PrintFormatItem_Trl new ") // Set .append("SET (PrintName, PrintNameSuffix, IsTranslated) = ") .append("(") diff --git a/org.adempiere.base/src/org/compiere/print/PrintDataElement.java b/org.adempiere.base/src/org/compiere/print/PrintDataElement.java index ea2ef64e9a..d75e4de2ae 100644 --- a/org.adempiere.base/src/org/compiere/print/PrintDataElement.java +++ b/org.adempiere.base/src/org/compiere/print/PrintDataElement.java @@ -408,7 +408,7 @@ public class PrintDataElement implements Serializable */ public String toString() { - StringBuffer sb = new StringBuffer(m_columnName).append("=").append(m_value); + StringBuilder sb = new StringBuilder(m_columnName).append("=").append(m_value); if (m_isPKey) sb.append("(PK)"); return sb.toString(); diff --git a/org.adempiere.base/src/org/compiere/print/PrintDataFunction.java b/org.adempiere.base/src/org/compiere/print/PrintDataFunction.java index 86d2444c20..8e95b68109 100644 --- a/org.adempiere.base/src/org/compiere/print/PrintDataFunction.java +++ b/org.adempiere.base/src/org/compiere/print/PrintDataFunction.java @@ -174,7 +174,7 @@ public class PrintDataFunction */ public String toString() { - StringBuffer sb = new StringBuffer("[") + StringBuilder sb = new StringBuilder("[") .append("Count=").append(m_count).append(",").append(m_totalCount) .append(",Sum=").append(m_sum) .append(",SumSquare=").append(m_sumSquare) diff --git a/org.adempiere.base/src/org/compiere/print/ReportEngine.java b/org.adempiere.base/src/org/compiere/print/ReportEngine.java index 9286a49f63..c698359bf0 100644 --- a/org.adempiere.base/src/org/compiere/print/ReportEngine.java +++ b/org.adempiere.base/src/org/compiere/print/ReportEngine.java @@ -1125,7 +1125,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) return; // boolean needMask = false; - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); char chars[] = content.toCharArray(); for (int i = 0; i < chars.length; i++) { diff --git a/org.adempiere.base/src/org/compiere/print/layout/StringElement.java b/org.adempiere.base/src/org/compiere/print/layout/StringElement.java index c892872ed2..83b0f91f24 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/StringElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/StringElement.java @@ -139,7 +139,7 @@ public class StringElement extends PrintElement int startIndex = 0; int endOffset = 0; - StringBuffer text = new StringBuffer(); + StringBuilder text = new StringBuilder(); if (label != null && label.length() > 0) { text.append(label).append(" "); diff --git a/org.adempiere.base/src/org/compiere/report/BankRegister.java b/org.adempiere.base/src/org/compiere/report/BankRegister.java index 3aa8cc159f..fb13d132c4 100644 --- a/org.adempiere.base/src/org/compiere/report/BankRegister.java +++ b/org.adempiere.base/src/org/compiere/report/BankRegister.java @@ -60,7 +60,7 @@ public class BankRegister extends SvrProcess */ protected void prepare() { - StringBuffer sb = new StringBuffer ("Record_ID=") + StringBuilder sb = new StringBuilder ("Record_ID=") .append(getRecord_ID()); // Parameter ProcessInfoParameter[] para = getParameter(); @@ -147,7 +147,7 @@ public class BankRegister extends SvrProcess */ private void createBalanceLine() { - StringBuffer sb = new StringBuffer ("INSERT INTO T_BankRegister " + StringBuilder sb = new StringBuilder ("INSERT INTO T_BankRegister " + "(AD_PInstance_ID, AD_Client_ID, AD_Org_ID, " + "DateAcct, C_Bank_ID, BankName, C_BPartner_ID, BPartner, DocumentNo," // Account, + "AmtAcctDr, AmtAcctCr, Balance) "); @@ -184,7 +184,7 @@ public class BankRegister extends SvrProcess */ private void createDetailLines() { - StringBuffer sb = new StringBuffer ("INSERT INTO T_BankRegister " + StringBuilder sb = new StringBuilder ("INSERT INTO T_BankRegister " + "(AD_PInstance_ID, AD_Client_ID, AD_Org_ID, " + "DateAcct, C_Bank_ID, BankName, C_BPartner_ID, BPartner, DocumentNo, " //Account, + "AmtAcctDr, AmtAcctCr, Balance) "); diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index b0a81e7db7..55cb2038ce 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -106,7 +106,7 @@ public class FinReport extends SvrProcess */ protected void prepare() { - StringBuffer sb = new StringBuffer ("Record_ID=") + StringBuilder sb = new StringBuilder ("Record_ID=") .append(getRecord_ID()); // Parameter ProcessInfoParameter[] para = getParameter(); @@ -311,7 +311,7 @@ public class FinReport extends SvrProcess // ** Create Temporary and empty Report Lines from PA_ReportLine // - AD_PInstance_ID, PA_ReportLine_ID, 0, 0 int PA_ReportLineSet_ID = m_report.getLineSet().getPA_ReportLineSet_ID(); - StringBuffer sql = new StringBuffer ("INSERT INTO T_Report " + StringBuilder sql = new StringBuilder ("INSERT INTO T_Report " + "(AD_PInstance_ID, PA_ReportLine_ID, Record_ID,Fact_Acct_ID, SeqNo,LevelNo, Name,Description) " + "SELECT ").append(getAD_PInstance_ID()).append(", rl.PA_ReportLine_ID, 0,0, rl.SeqNo,0, NVL(trl.Name, rl.Name) as Name, NVL(trl.Description,rl.Description) as Description " + "FROM PA_ReportLine rl " @@ -376,7 +376,7 @@ public class FinReport extends SvrProcess return; } - StringBuffer update = new StringBuffer(); + StringBuilder update = new StringBuilder(); // for all columns for (int col = 0; col < m_columns.length; col++) { @@ -387,7 +387,7 @@ public class FinReport extends SvrProcess info.append("Line=").append(line).append(",Col=").append(col); // SELECT SUM() - StringBuffer select = new StringBuffer ("SELECT "); + StringBuilder select = new StringBuilder ("SELECT "); if (m_lines[line].getPAAmountType() != null) // line amount type overwrites column { String sql = m_lines[line].getSelectClause (true); @@ -944,7 +944,7 @@ public class FinReport extends SvrProcess // allow opposite sign boolean hasOpposites = false; - StringBuffer sb = new StringBuffer("UPDATE T_Report SET "); + StringBuilder sb = new StringBuilder("UPDATE T_Report SET "); for (int col = 0; col < m_columns.length; col++) { if (m_columns[col].isAllowOppositeSign()) @@ -1073,7 +1073,7 @@ public class FinReport extends SvrProcess for (int i = 0; i < seqlist.size(); i++) { int currentSeq = seqlist.get(i); - StringBuffer sb = new StringBuffer ("UPDATE T_Report SET "); + StringBuilder sb = new StringBuilder ("UPDATE T_Report SET "); // Column to set sb.append ("Col_").append (col).append("="); @@ -1333,7 +1333,7 @@ public class FinReport extends SvrProcess if (log.isLoggable(Level.FINE)) log.fine("Variable=" + variable); // Insert - StringBuffer insert = new StringBuffer("INSERT INTO T_Report " + StringBuilder insert = new StringBuilder("INSERT INTO T_Report " + "(AD_PInstance_ID, PA_ReportLine_ID, Record_ID,Fact_Acct_ID,LevelNo "); for (int col = 0; col < m_columns.length; col++) insert.append(",Col_").append(col); @@ -1345,7 +1345,7 @@ public class FinReport extends SvrProcess boolean listSourceNoTrx = m_report.isListSourcesXTrx() && variable.equalsIgnoreCase(I_C_ValidCombination.COLUMNNAME_Account_ID); //SQL to get the Account Element which no transaction - StringBuffer unionInsert = listSourceNoTrx ? new StringBuffer() : null; + StringBuilder unionInsert = listSourceNoTrx ? new StringBuilder() : null; if (listSourceNoTrx) { unionInsert.append(" UNION SELECT ") .append(getAD_PInstance_ID()).append(",") @@ -1378,7 +1378,7 @@ public class FinReport extends SvrProcess } // SELECT SUM() - StringBuffer select = new StringBuffer ("SELECT "); + StringBuilder select = new StringBuilder ("SELECT "); if (m_lines[line].getPAAmountType() != null) // line amount type overwrites column select.append (m_lines[line].getSelectClause (true)); else if (m_columns[col].getPAAmountType() != null) @@ -1450,9 +1450,9 @@ public class FinReport extends SvrProcess insert.append("(").append(select).append(")"); } // WHERE (sources, posting type) - StringBuffer where = new StringBuffer(m_lines[line].getWhereClause(p_PA_Hierarchy_ID)); + StringBuilder where = new StringBuilder(m_lines[line].getWhereClause(p_PA_Hierarchy_ID)); - StringBuffer unionWhere = listSourceNoTrx ? new StringBuffer() : null; + StringBuilder unionWhere = listSourceNoTrx ? new StringBuilder() : null; if (listSourceNoTrx && m_lines[line].getSources() != null && m_lines[line].getSources().length > 0){ // Only one if (m_lines[line].getSources().length == 1 @@ -1463,7 +1463,7 @@ public class FinReport extends SvrProcess else { // Multiple - StringBuffer sb = new StringBuffer ("("); + StringBuilder sb = new StringBuilder ("("); for (int i = 0; i < m_lines[line].getSources().length; i++) { if ((m_lines[line].getSources()[i]).getElementType().equalsIgnoreCase(MReportSource.ELEMENTTYPE_Account)) { @@ -1530,7 +1530,7 @@ public class FinReport extends SvrProcess return; // Set Name,Description - StringBuffer sql = new StringBuffer ("UPDATE T_Report SET (Name,Description)=(") + StringBuilder sql = new StringBuilder ("UPDATE T_Report SET (Name,Description)=(") .append(m_lines[line].getSourceValueQuery()).append("T_Report.Record_ID) " // + "WHERE Record_ID <> 0 AND AD_PInstance_ID=").append(getAD_PInstance_ID()) @@ -1554,7 +1554,7 @@ public class FinReport extends SvrProcess if (log.isLoggable(Level.INFO)) log.info("Line=" + line + " - Variable=" + variable); // Insert - StringBuffer insert = new StringBuffer("INSERT INTO T_Report " + StringBuilder insert = new StringBuilder("INSERT INTO T_Report " + "(AD_PInstance_ID, PA_ReportLine_ID, Record_ID,Fact_Acct_ID,LevelNo "); for (int col = 0; col < m_columns.length; col++) insert.append(",Col_").append(col); @@ -1580,7 +1580,7 @@ public class FinReport extends SvrProcess } // SELECT - StringBuffer select = new StringBuffer ("SELECT "); + StringBuilder select = new StringBuilder ("SELECT "); if (m_lines[line].getPAAmountType() != null) // line amount type overwrites column select.append (m_lines[line].getSelectClause (false)); else if (m_columns[col].getPAAmountType() != null) diff --git a/org.adempiere.base/src/org/compiere/report/FinStatement.java b/org.adempiere.base/src/org/compiere/report/FinStatement.java index fd97bb0734..b1a8fb50e1 100644 --- a/org.adempiere.base/src/org/compiere/report/FinStatement.java +++ b/org.adempiere.base/src/org/compiere/report/FinStatement.java @@ -103,7 +103,7 @@ public class FinStatement extends SvrProcess */ protected void prepare() { - StringBuffer sb = new StringBuffer ("Record_ID=") + StringBuilder sb = new StringBuilder ("Record_ID=") .append(getRecord_ID()); // Parameter ProcessInfoParameter[] para = getParameter(); @@ -325,7 +325,7 @@ public class FinStatement extends SvrProcess */ private void createDetailLines() { - StringBuffer sb = new StringBuffer ("INSERT INTO T_ReportStatement " + StringBuilder sb = new StringBuilder ("INSERT INTO T_ReportStatement " + "(AD_PInstance_ID, Fact_Acct_ID, LevelNo," + "DateAcct, Name, Description," + "AmtAcctDr, AmtAcctCr, Balance, Qty) "); @@ -359,7 +359,7 @@ public class FinStatement extends SvrProcess + "WHERE r.Fact_Acct_ID=fa.Fact_Acct_ID"; } // Translated Version ... - sb = new StringBuffer ("UPDATE T_ReportStatement r SET (Name,Description)=(") + sb = new StringBuilder ("UPDATE T_ReportStatement r SET (Name,Description)=(") .append(sql_select).append(") " + "WHERE Fact_Acct_ID <> 0 AND AD_PInstance_ID=").append(getAD_PInstance_ID()); // diff --git a/org.adempiere.base/src/org/compiere/report/MReport.java b/org.adempiere.base/src/org/compiere/report/MReport.java index bf3fcc9db1..57d2dce23f 100644 --- a/org.adempiere.base/src/org/compiere/report/MReport.java +++ b/org.adempiere.base/src/org/compiere/report/MReport.java @@ -110,7 +110,7 @@ public class MReport extends X_PA_Report */ public String toString () { - StringBuffer sb = new StringBuffer ("MReport[") + StringBuilder sb = new StringBuilder ("MReport[") .append(get_ID()).append(" - ").append(getName()); if (getDescription() != null) sb.append("(").append(getDescription()).append(")"); diff --git a/org.adempiere.base/src/org/compiere/report/MReportColumn.java b/org.adempiere.base/src/org/compiere/report/MReportColumn.java index 12d6cde23a..6ab7192091 100644 --- a/org.adempiere.base/src/org/compiere/report/MReportColumn.java +++ b/org.adempiere.base/src/org/compiere/report/MReportColumn.java @@ -343,7 +343,7 @@ public class MReportColumn extends X_PA_ReportColumn */ public String toString () { - StringBuffer sb = new StringBuffer ("MReportColumn[") + StringBuilder sb = new StringBuilder ("MReportColumn[") .append(get_ID()).append(" - ").append(getName()).append(" - ").append(getDescription()) .append(", SeqNo=").append(getSeqNo()).append(", AmountType=").append(getPAAmountType()) .append(", PeriodType=").append(getPAPeriodType()) diff --git a/org.adempiere.base/src/org/compiere/report/MReportColumnSet.java b/org.adempiere.base/src/org/compiere/report/MReportColumnSet.java index 9a148fdb8d..4d5fc4239b 100644 --- a/org.adempiere.base/src/org/compiere/report/MReportColumnSet.java +++ b/org.adempiere.base/src/org/compiere/report/MReportColumnSet.java @@ -126,7 +126,7 @@ public class MReportColumnSet extends X_PA_ReportColumnSet */ public String toString () { - StringBuffer sb = new StringBuffer ("MReportColumnSet[") + StringBuilder sb = new StringBuilder ("MReportColumnSet[") .append(get_ID()).append(" - ").append(getName()) .append ("]"); return sb.toString (); diff --git a/org.adempiere.base/src/org/compiere/report/MReportLine.java b/org.adempiere.base/src/org/compiere/report/MReportLine.java index 35a6b39614..d957154f38 100644 --- a/org.adempiere.base/src/org/compiere/report/MReportLine.java +++ b/org.adempiere.base/src/org/compiere/report/MReportLine.java @@ -313,7 +313,7 @@ public class MReportLine extends X_PA_ReportLine */ public String toString () { - StringBuffer sb = new StringBuffer ("MReportLine[") + StringBuilder sb = new StringBuilder ("MReportLine[") .append(get_ID()).append(" - ").append(getName()).append(" - ").append(getDescription()) .append(", SeqNo=").append(getSeqNo()).append(", AmountType=").append(getPAAmountType()) .append(", PeriodType=").append(getPAPeriodType()) diff --git a/org.adempiere.base/src/org/compiere/report/MReportLineSet.java b/org.adempiere.base/src/org/compiere/report/MReportLineSet.java index 5f85ffb10a..ead9f353e6 100644 --- a/org.adempiere.base/src/org/compiere/report/MReportLineSet.java +++ b/org.adempiere.base/src/org/compiere/report/MReportLineSet.java @@ -126,7 +126,7 @@ public class MReportLineSet extends X_PA_ReportLineSet */ public String toString () { - StringBuffer sb = new StringBuffer ("MReportLineSet[") + StringBuilder sb = new StringBuilder ("MReportLineSet[") .append(get_ID()).append(" - ").append(getName()) .append ("]"); return sb.toString (); diff --git a/org.adempiere.base/src/org/compiere/report/MReportSource.java b/org.adempiere.base/src/org/compiere/report/MReportSource.java index 8d76dd31e2..435687eaad 100644 --- a/org.adempiere.base/src/org/compiere/report/MReportSource.java +++ b/org.adempiere.base/src/org/compiere/report/MReportSource.java @@ -252,7 +252,7 @@ public class MReportSource extends X_PA_ReportSource */ public String toString () { - StringBuffer sb = new StringBuffer ("MReportSource[") + StringBuilder sb = new StringBuilder ("MReportSource[") .append(get_ID()).append(" - ").append(getDescription()) .append(" - ").append(getElementType()); sb.append ("]"); diff --git a/org.adempiere.base/src/org/compiere/report/MReportTree.java b/org.adempiere.base/src/org/compiere/report/MReportTree.java index 8d16fab310..60ddf62bdd 100644 --- a/org.adempiere.base/src/org/compiere/report/MReportTree.java +++ b/org.adempiere.base/src/org/compiere/report/MReportTree.java @@ -249,11 +249,11 @@ public class MReportTree MTreeNode node = m_tree.getRoot().findNode(ID); if (log.isLoggable(Level.FINEST)) log.finest("Root=" + node); // - StringBuffer result = null; + StringBuilder result = null; if (node != null && node.isSummary ()) { Enumeration en = node.preorderEnumeration (); - StringBuffer sb = new StringBuffer (); + StringBuilder sb = new StringBuilder (); while (en.hasMoreElements ()) { MTreeNode nn = (MTreeNode)en.nextElement (); @@ -271,12 +271,12 @@ public class MReportTree else if (log.isLoggable(Level.FINEST)) log.finest ("- skipped parent (" + nn + ")"); } - result = new StringBuffer (" ( "); + result = new StringBuilder (" ( "); result.append (sb); result.append (" ) "); } else // not found or not summary - result = new StringBuffer (ColumnName).append("=").append(ID); + result = new StringBuilder (ColumnName).append("=").append(ID); // if (log.isLoggable(Level.FINEST)) log.finest(result.toString()); return result.toString(); diff --git a/org.adempiere.base/src/org/compiere/report/TrialBalance.java b/org.adempiere.base/src/org/compiere/report/TrialBalance.java index a520215879..db0b04c86d 100644 --- a/org.adempiere.base/src/org/compiere/report/TrialBalance.java +++ b/org.adempiere.base/src/org/compiere/report/TrialBalance.java @@ -107,7 +107,7 @@ public class TrialBalance extends SvrProcess */ protected void prepare() { - StringBuffer sb = new StringBuffer ("AD_PInstance_ID=") + StringBuilder sb = new StringBuilder ("AD_PInstance_ID=") .append(getAD_PInstance_ID()); // Parameter ProcessInfoParameter[] para = getParameter(); diff --git a/org.adempiere.base/src/org/compiere/util/AmtInWords_PT.java b/org.adempiere.base/src/org/compiere/util/AmtInWords_PT.java index 9511337e6a..1f02b1766b 100644 --- a/org.adempiere.base/src/org/compiere/util/AmtInWords_PT.java +++ b/org.adempiere.base/src/org/compiere/util/AmtInWords_PT.java @@ -269,7 +269,7 @@ public class AmtInWords_PT implements AmtInWords if (amount == null) return amount; // - StringBuffer sb = new StringBuffer (); + StringBuilder sb = new StringBuilder (); int pos = amount.lastIndexOf ('.'); // Old // int pos = amount.lastIndexOf (','); int pos2 = amount.lastIndexOf (','); // Old diff --git a/org.adempiere.base/src/org/compiere/util/AmtInWords_ZH.java b/org.adempiere.base/src/org/compiere/util/AmtInWords_ZH.java index a07f1c2bf6..5c72cbe3d4 100644 --- a/org.adempiere.base/src/org/compiere/util/AmtInWords_ZH.java +++ b/org.adempiere.base/src/org/compiere/util/AmtInWords_ZH.java @@ -128,7 +128,7 @@ public class AmtInWords_ZH implements AmtInWords */ private String convert (BigDecimal number) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int signum = number.signum(); // positive , 0 , negative int numUnit = 0; // each number character int numIndex = 0; // each number position diff --git a/org.adempiere.base/src/org/compiere/util/CLogFormatter.java b/org.adempiere.base/src/org/compiere/util/CLogFormatter.java index 0f118f9869..dd9487326b 100644 --- a/org.adempiere.base/src/org/compiere/util/CLogFormatter.java +++ b/org.adempiere.base/src/org/compiere/util/CLogFormatter.java @@ -157,7 +157,7 @@ public class CLogFormatter extends Formatter int index = className.lastIndexOf('.'); if (index != -1) className = className.substring(index+1); - StringBuffer sb = new StringBuffer() + StringBuilder sb = new StringBuilder() .append("*** ") .append(new Timestamp(System.currentTimeMillis())) .append(" idempiere Log (").append(className) diff --git a/org.adempiere.base/src/org/compiere/util/DB.java b/org.adempiere.base/src/org/compiere/util/DB.java index f173211aef..7cb4dfb173 100644 --- a/org.adempiere.base/src/org/compiere/util/DB.java +++ b/org.adempiere.base/src/org/compiere/util/DB.java @@ -223,7 +223,7 @@ public final class DB // if (mailPassword == null || mailPassword.length() == 0) // return; // - StringBuffer sql = new StringBuffer("UPDATE AD_Client SET") + StringBuilder sql = new StringBuilder("UPDATE AD_Client SET") .append(" SMTPHost=").append(DB.TO_STRING(server)) .append(", RequestEMail=").append(DB.TO_STRING(adminEMail)) .append(", RequestUser=").append(DB.TO_STRING(mailUser)) @@ -232,7 +232,7 @@ public final class DB int no = DB.executeUpdate(sql.toString(), null); if (log.isLoggable(Level.FINE)) log.fine("Client #"+no); // - sql = new StringBuffer("UPDATE AD_User SET ") + sql = new StringBuilder("UPDATE AD_User SET ") .append(" EMail=").append(DB.TO_STRING(adminEMail)) .append(", EMailUser=").append(DB.TO_STRING(mailUser)) .append(", EMailUserPW=").append(DB.TO_STRING(mailPassword)) diff --git a/org.adempiere.base/src/org/compiere/util/EMail.java b/org.adempiere.base/src/org/compiere/util/EMail.java index 6caa80655f..f51400e4ee 100644 --- a/org.adempiere.base/src/org/compiere/util/EMail.java +++ b/org.adempiere.base/src/org/compiere/util/EMail.java @@ -880,7 +880,7 @@ public final class EMail implements Serializable public void setMessageHTML (String subject, String message) { m_subject = subject; - StringBuffer sb = new StringBuffer("\n") + StringBuilder sb = new StringBuilder("\n") .append("\n") .append("\n") .append(subject + "\n") diff --git a/org.adempiere.base/src/org/compiere/util/GenericPaymentExport.java b/org.adempiere.base/src/org/compiere/util/GenericPaymentExport.java index dc986342c9..5750ab605c 100644 --- a/org.adempiere.base/src/org/compiere/util/GenericPaymentExport.java +++ b/org.adempiere.base/src/org/compiere/util/GenericPaymentExport.java @@ -97,13 +97,13 @@ public class GenericPaymentExport implements PaymentExport char x = '"'; // ease int noLines = 0; - StringBuffer line = null; + StringBuilder line = null; try { FileWriter fw = new FileWriter(file); // write header - line = new StringBuffer(); + line = new StringBuilder(); line.append(x).append("Value").append(x).append(",") .append(x).append("Name").append(x).append(",") .append(x).append("Contact").append(x).append(",") @@ -142,7 +142,7 @@ public class GenericPaymentExport implements PaymentExport comment.append(", "); comment.append(psls[l].getInvoice().getDocumentNo()); } - line = new StringBuffer(); + line = new StringBuilder(); line.append(x).append(bp[BP_VALUE]).append(x).append(",") // Value .append(x).append(bp[BP_NAME]).append(x).append(",") // Name .append(x).append(bp[BP_CONTACT]).append(x).append(",") // Contact diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index 043bcd5486..1b2e3223c1 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -310,7 +310,7 @@ public class Login } } else{ - StringBuffer sql = new StringBuffer("SELECT AD_User.AD_User_ID ").append(" FROM AD_User "); + StringBuilder sql = new StringBuilder("SELECT AD_User.AD_User_ID ").append(" FROM AD_User "); sql.append(" WHERE ").append(userNameCol).append("=?"); sql.append(" AND AD_User.IsActive='Y'").append(" AND EXISTS (SELECT * FROM AD_Client c WHERE AD_User.AD_Client_ID=c.AD_Client_ID AND c.IsActive='Y')"); @@ -345,7 +345,7 @@ public class Login } if(authenticated){ - StringBuffer sql = new StringBuffer("SELECT AD_User.AD_User_ID, r.AD_Role_ID,r.Name") + StringBuilder sql = new StringBuilder("SELECT AD_User.AD_User_ID, r.AD_Role_ID,r.Name") .append(" FROM AD_User ") .append(" INNER JOIN AD_User_Roles ur ON (AD_User.AD_User_ID=ur.AD_User_ID AND ur.IsActive='Y')") .append(" INNER JOIN AD_Role r ON (ur.AD_Role_ID=r.AD_Role_ID AND r.IsActive='Y') "); @@ -1549,7 +1549,7 @@ public class Login String whereRoleType = MRole.getWhereRoleType(roleTypes, "r"); ArrayList<KeyNamePair> rolesList = new ArrayList<KeyNamePair>(); KeyNamePair[] retValue = null; - StringBuffer sql = new StringBuffer("SELECT u.AD_User_ID, r.AD_Role_ID,r.Name ") + StringBuilder sql = new StringBuilder("SELECT u.AD_User_ID, r.AD_Role_ID,r.Name ") .append("FROM AD_User u") .append(" INNER JOIN AD_User_Roles ur ON (u.AD_User_ID=ur.AD_User_ID AND ur.IsActive='Y')") .append(" INNER JOIN AD_Role r ON (ur.AD_Role_ID=r.AD_Role_ID AND r.IsActive='Y') "); diff --git a/org.adempiere.base/src/org/compiere/util/Util.java b/org.adempiere.base/src/org/compiere/util/Util.java index 3a76c474e2..cd1fe41deb 100644 --- a/org.adempiere.base/src/org/compiere/util/Util.java +++ b/org.adempiere.base/src/org/compiere/util/Util.java @@ -688,7 +688,7 @@ public class Util } String normStr = java.text.Normalizer.normalize(s, java.text.Normalizer.Form.NFD); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < normStr.length(); i++) { char ch = normStr.charAt(i); if (ch < 255) diff --git a/org.adempiere.base/src/org/compiere/util/WebEnv.java b/org.adempiere.base/src/org/compiere/util/WebEnv.java index b4600a672f..c40bce4c10 100644 --- a/org.adempiere.base/src/org/compiere/util/WebEnv.java +++ b/org.adempiere.base/src/org/compiere/util/WebEnv.java @@ -116,7 +116,7 @@ public class WebEnv } Enumeration<String> en = config.getInitParameterNames(); - StringBuffer info = new StringBuffer("Servlet Init Parameter: ") + StringBuilder info = new StringBuilder("Servlet Init Parameter: ") .append(config.getServletName()); while (en.hasMoreElements()) { @@ -149,7 +149,7 @@ public class WebEnv // Load Environment Variables (serverApps/src/web/WEB-INF/web.xml) Enumeration<String> en = context.getInitParameterNames(); - StringBuffer info = new StringBuffer("Servlet Context Init Parameters: ") + StringBuilder info = new StringBuilder("Servlet Context Init Parameters: ") .append(context.getServletContextName()); while (en.hasMoreElements()) { diff --git a/org.adempiere.base/src/org/compiere/util/WebUtil.java b/org.adempiere.base/src/org/compiere/util/WebUtil.java index 854f7004a2..68b7fce9b7 100644 --- a/org.adempiere.base/src/org/compiere/util/WebUtil.java +++ b/org.adempiere.base/src/org/compiere/util/WebUtil.java @@ -229,7 +229,7 @@ public final class WebUtil outStr.append(inStr); // add remainder String retValue = outStr.toString(); /** - StringBuffer debug = new StringBuffer(); + StringBuilder debug = new StringBuilder(); char[] cc = data.toCharArray(); for (int j = 0; j < cc.length; j++) { diff --git a/org.adempiere.base/src/org/compiere/wf/DocWorkflowManager.java b/org.adempiere.base/src/org/compiere/wf/DocWorkflowManager.java index 667b893fa7..9f90516501 100644 --- a/org.adempiere.base/src/org/compiere/wf/DocWorkflowManager.java +++ b/org.adempiere.base/src/org/compiere/wf/DocWorkflowManager.java @@ -157,7 +157,7 @@ public class DocWorkflowManager implements DocWorkflowMgr return false; } String keyColumn = keyColumns[0]; - StringBuffer sql = new StringBuffer("SELECT ") + StringBuilder sql = new StringBuilder("SELECT ") .append(keyColumn).append(" FROM ").append(tableName) .append(" WHERE AD_Client_ID=? AND ") // #1 .append(keyColumn).append("=? AND ") // #2 diff --git a/org.adempiere.base/src/org/compiere/wf/MWorkflow.java b/org.adempiere.base/src/org/compiere/wf/MWorkflow.java index e8603c4a4c..b81908b386 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWorkflow.java +++ b/org.adempiere.base/src/org/compiere/wf/MWorkflow.java @@ -821,7 +821,7 @@ public class MWorkflow extends X_AD_Workflow */ public String validate() { - StringBuffer errors = new StringBuffer(); + StringBuilder errors = new StringBuilder(); // if (getAD_WF_Node_ID() == 0) errors.append(" - No Start Node"); diff --git a/org.adempiere.base/src/org/eevolution/model/MDDOrder.java b/org.adempiere.base/src/org/eevolution/model/MDDOrder.java index ef01e324ba..14fc6585c0 100644 --- a/org.adempiere.base/src/org/eevolution/model/MDDOrder.java +++ b/org.adempiere.base/src/org/eevolution/model/MDDOrder.java @@ -373,7 +373,7 @@ public class MDDOrder extends X_DD_Order implements DocAction */ public String toString () { - StringBuffer sb = new StringBuffer ("MDDOrder[") + StringBuilder sb = new StringBuilder ("MDDOrder[") .append(get_ID()).append("-").append(getDocumentNo()) .append(",IsSOTrx=").append(isSOTrx()) .append(",C_DocType_ID=").append(getC_DocType_ID()) @@ -433,7 +433,7 @@ public class MDDOrder extends X_DD_Order implements DocAction */ public MDDOrderLine[] getLines (String whereClause, String orderClause) { - StringBuffer whereClauseFinal = new StringBuffer(MDDOrderLine.COLUMNNAME_DD_Order_ID).append("=?"); + StringBuilder whereClauseFinal = new StringBuilder(MDDOrderLine.COLUMNNAME_DD_Order_ID).append("=?"); if (!Util.isEmpty(whereClause, true)) whereClauseFinal.append(" AND (").append(whereClause).append(")"); // @@ -1046,7 +1046,7 @@ public class MDDOrder extends X_DD_Order implements DocAction return true; if (log.isLoggable(Level.INFO)) log.info("createReversals"); - StringBuffer info = new StringBuffer(); + StringBuilder info = new StringBuilder(); // Reverse All *Shipments* info.append("@M_InOut_ID@:"); diff --git a/org.adempiere.base/src/org/eevolution/model/MDDOrderLine.java b/org.adempiere.base/src/org/eevolution/model/MDDOrderLine.java index e6a6b91d66..fed088d854 100644 --- a/org.adempiere.base/src/org/eevolution/model/MDDOrderLine.java +++ b/org.adempiere.base/src/org/eevolution/model/MDDOrderLine.java @@ -405,7 +405,7 @@ public class MDDOrderLine extends X_DD_OrderLine */ public String toString () { - StringBuffer sb = new StringBuffer ("MDDOrderLine[") + StringBuilder sb = new StringBuilder ("MDDOrderLine[") .append(get_ID()).append(",Line=").append(getLine()) .append(",Ordered=").append(getQtyOrdered()) .append(",Delivered=").append(getQtyDelivered()) diff --git a/org.adempiere.base/src/org/eevolution/model/MPPProductBOM.java b/org.adempiere.base/src/org/eevolution/model/MPPProductBOM.java index ed94dd9e72..8b9cb3709c 100644 --- a/org.adempiere.base/src/org/eevolution/model/MPPProductBOM.java +++ b/org.adempiere.base/src/org/eevolution/model/MPPProductBOM.java @@ -274,7 +274,7 @@ public class MPPProductBOM extends X_PP_Product_BOM @Override public String toString () { - StringBuffer sb = new StringBuffer ("MPPProductBOM[") + StringBuilder sb = new StringBuilder ("MPPProductBOM[") .append(get_ID()).append("-").append(getDocumentNo()) .append(", Value=").append(getValue()) .append ("]"); diff --git a/org.adempiere.base/src/org/eevolution/process/ImportInventoryMove.java b/org.adempiere.base/src/org/eevolution/process/ImportInventoryMove.java index 70de6b09f7..847adef175 100644 --- a/org.adempiere.base/src/org/eevolution/process/ImportInventoryMove.java +++ b/org.adempiere.base/src/org/eevolution/process/ImportInventoryMove.java @@ -417,7 +417,7 @@ public class ImportInventoryMove extends SvrProcess */ private Collection<X_I_Movement> getRecords(boolean imported, boolean isWithoutError) { - final StringBuffer whereClause = new StringBuffer(X_I_Movement.COLUMNNAME_I_IsImported) + final StringBuilder whereClause = new StringBuilder(X_I_Movement.COLUMNNAME_I_IsImported) .append("=?"); if(isWithoutError) diff --git a/org.adempiere.base/src/org/idempiere/exceptions/NoCurrencyConversionException.java b/org.adempiere.base/src/org/idempiere/exceptions/NoCurrencyConversionException.java index e21587169c..a05ee670a6 100644 --- a/org.adempiere.base/src/org/idempiere/exceptions/NoCurrencyConversionException.java +++ b/org.adempiere.base/src/org/idempiere/exceptions/NoCurrencyConversionException.java @@ -62,7 +62,7 @@ public class NoCurrencyConversionException extends AdempiereException { DateFormat df = DisplayType.getDateFormat(DisplayType.Date); - StringBuffer sb = new StringBuffer("@NoCurrencyConversion@ ") + StringBuilder sb = new StringBuilder("@NoCurrencyConversion@ ") .append(MCurrency.getISO_Code(Env.getCtx(), C_Currency_ID)) .append("->") .append(MCurrency.getISO_Code(Env.getCtx(), C_Currency_ID_To)); diff --git a/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java b/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java index 6b4eb24eef..7d0eadc070 100644 --- a/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java +++ b/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java @@ -148,7 +148,7 @@ public class ImportFixedAsset extends SvrProcess // Asset Type From Value /* commented by @win - sql = new StringBuffer ("UPDATE "+MIFixedAsset.Table_Name+" ifa " + sql = new StringBuilder ("UPDATE "+MIFixedAsset.Table_Name+" ifa " + "SET A_Asset_Type_ID=(SELECT MAX(A_Asset_Type_ID) FROM A_Asset_Type t" + " WHERE ifa.A_Asset_Type_Value=t.Value AND ifa.AD_Client_ID=t.AD_Client_ID) " + "WHERE A_Asset_Type_ID IS NULL AND A_Asset_Type_Value IS NOT NULL" @@ -286,7 +286,7 @@ public class ImportFixedAsset extends SvrProcess // Go through Fixed Assets Records w/o C_BPartner_ID /* no need this @win - sql = new StringBuffer ("SELECT * FROM "+MIFixedAsset.Table_Name+ " + sql = new StringBuilder ("SELECT * FROM "+MIFixedAsset.Table_Name+ " + "WHERE I_IsImported='N' AND C_BPartnerSR_ID IS NULL").append (sqlCheck); try { @@ -336,7 +336,7 @@ public class ImportFixedAsset extends SvrProcess { log.log(Level.SEVERE, "CreateBP", e); } - sql = new StringBuffer ("UPDATE "+MIFixedAsset.Table_Name+ " " + sql = new StringBuilder ("UPDATE "+MIFixedAsset.Table_Name+ " " + "SET I_IsImported='N', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' " + "WHERE C_BPartnerSR_ID IS NULL" + " AND I_IsImported<>'Y'").append (sqlCheck); @@ -350,7 +350,7 @@ public class ImportFixedAsset extends SvrProcess // TODO : zuhri Utama - need to fixed create new product // Go through Fixed Assets Records w/o M_Product_ID - sql = new StringBuffer ("SELECT * FROM "+MIFixedAsset.Table_Name+ " " + sql = new StringBuilder ("SELECT * FROM "+MIFixedAsset.Table_Name+ " " + "WHERE I_IsImported='N' AND M_Product_ID IS NULL").append (sqlCheck); try { @@ -394,7 +394,7 @@ public class ImportFixedAsset extends SvrProcess { log.log(Level.SEVERE, "CreateProduct", e); } - sql = new StringBuffer ("UPDATE "+MIFixedAsset.Table_Name+ " " + sql = new StringBuilder ("UPDATE "+MIFixedAsset.Table_Name+ " " + "SET I_IsImported='N', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' " + "WHERE M_Product_ID IS NULL" + " AND I_IsImported<>'Y'").append (sqlCheck); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java index 8d1c0288c6..3d372261b1 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java @@ -105,7 +105,7 @@ public class MenuElementHandler extends AbstractElementHandler { parentId = ReferenceUtils.resolveReference(ctx.ctx, parentElement, getTrxName(ctx)); } - StringBuffer updateSQL = null; + StringBuilder updateSQL = null; int AD_Tree_ID = getDefaultMenuTreeId(); String sql = "SELECT count(Parent_ID) FROM AD_TREENODEMM WHERE AD_Tree_ID = "+AD_Tree_ID + " AND Node_ID = " + mMenu.getAD_Menu_ID(); @@ -154,13 +154,13 @@ public class MenuElementHandler extends AbstractElementHandler { DB.close(rs, pstmt); } - updateSQL = new StringBuffer("UPDATE AD_TREENODEMM ").append( + updateSQL = new StringBuilder("UPDATE AD_TREENODEMM ").append( "SET Parent_ID = " + parentId).append( " , SeqNo = " + getStringValue(element, "SeqNo")).append( " WHERE AD_Tree_ID = "+AD_Tree_ID).append( " AND Node_ID = " + mMenu.getAD_Menu_ID()); } else { - updateSQL = new StringBuffer("INSERT INTO AD_TREENODEMM").append( + updateSQL = new StringBuilder("INSERT INTO AD_TREENODEMM").append( "(AD_Client_ID, AD_Org_ID, CreatedBy, UpdatedBy, ").append( "Parent_ID, SeqNo, AD_Tree_ID, Node_ID)").append( "VALUES(0, 0, 0, 0, ").append( diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/IDFinder.java b/org.adempiere.pipo/src/org/adempiere/pipo2/IDFinder.java index c1f705bb4e..762c823497 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/IDFinder.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/IDFinder.java @@ -76,7 +76,7 @@ public class IDFinder { if (idCache.containsKey(key.toString())) return idCache.get(key.toString()); - StringBuffer sqlB = new StringBuffer ("SELECT ") + StringBuilder sqlB = new StringBuilder ("SELECT ") .append(tableName) .append("_ID FROM ") .append(tableName) @@ -203,7 +203,7 @@ public class IDFinder { if (idCache.containsKey(key.toString())) return idCache.get(key.toString()); - StringBuffer parentSql = new StringBuffer("SELECT ") + StringBuilder parentSql = new StringBuilder("SELECT ") .append(tableNameMaster) .append("_ID FROM ") .append(tableNameMaster) @@ -212,7 +212,7 @@ public class IDFinder { int parentId = DB.getSQLValue(trxName, parentSql.toString(), name, Env.getAD_Client_ID(Env.getCtx())); if (parentId > 0) { - StringBuffer sqlB = new StringBuffer ("SELECT ") + StringBuilder sqlB = new StringBuilder ("SELECT ") .append(tableName) .append("_ID FROM ") .append(tableName) @@ -277,7 +277,7 @@ public class IDFinder { if (idCache.containsKey(key)) return idCache.get(key); - StringBuffer sqlB = new StringBuffer ("SELECT ") + StringBuilder sqlB = new StringBuilder ("SELECT ") .append(tableName) .append("_ID FROM ") .append(tableName) @@ -354,7 +354,7 @@ public class IDFinder { if (idCache.containsKey(key.toString())) return idCache.get(key.toString()); - StringBuffer sqlB = new StringBuffer ("SELECT ") + StringBuilder sqlB = new StringBuilder ("SELECT ") .append(tableName) .append("_ID FROM ") .append(tableName) @@ -410,7 +410,7 @@ public class IDFinder { if (idCache.containsKey(key.toString())) return idCache.get(key.toString()); - StringBuffer sql = new StringBuffer("SELECT ") + StringBuilder sql = new StringBuilder("SELECT ") .append(tableName) .append("_ID ") .append("FROM ") diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java index 6f6a3b52b0..a7e1b43bbf 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java @@ -223,7 +223,7 @@ public class PackOut atts.addAttribute("","","UpdateDictionary","CDATA", isExportDictionaryEntity ? "true" : "false"); MClient client = MClient.get(pipoContext.ctx); - StringBuffer sb = new StringBuffer () + StringBuilder sb = new StringBuilder () .append(client.get_ID()) .append("-") .append(client.getValue()) @@ -283,7 +283,7 @@ public class PackOut addTextElement(docHandler, "filenotes", "Notes: Contains all application/object settings for package", atts); MClient client = MClient.get(pipoContext.ctx); - StringBuffer sb = new StringBuffer () + StringBuilder sb = new StringBuilder () .append(client.get_ID()) .append("-") .append(client.getValue()) diff --git a/org.adempiere.replication.server/src/org/adempiere/server/rpl/imp/TopicListener.java b/org.adempiere.replication.server/src/org/adempiere/server/rpl/imp/TopicListener.java index d12d416114..ad20f8db84 100644 --- a/org.adempiere.replication.server/src/org/adempiere/server/rpl/imp/TopicListener.java +++ b/org.adempiere.replication.server/src/org/adempiere/server/rpl/imp/TopicListener.java @@ -261,7 +261,7 @@ public class TopicListener implements MessageListener { if(replicationProcessor !=null) { MIMPProcessorLog pLog = new MIMPProcessorLog(replicationProcessor.getMImportProcessor(), "Connected to JMS Server. Waiting for messages!"); - StringBuffer logReference = new StringBuffer("topicName = ").append(topicName) + StringBuilder logReference = new StringBuilder("topicName = ").append(topicName) .append(", subscriptionName = ").append( subscriptionName ) ; pLog.setReference( logReference.toString() ); diff --git a/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ModelExporter.java b/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ModelExporter.java index 2adcc39b48..f437d8398a 100644 --- a/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ModelExporter.java +++ b/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ModelExporter.java @@ -77,7 +77,7 @@ public class ModelExporter extends SvrProcess { p_AD_Client_ID = Env.getAD_Client_ID(getCtx()); AD_Table_ID = getTable_ID(); - StringBuffer sb = new StringBuffer("AD_Table_ID=").append(AD_Table_ID); + StringBuilder sb = new StringBuilder("AD_Table_ID=").append(AD_Table_ID); sb.append("; Record_ID=").append(getRecord_ID()); // Parameter ProcessInfoParameter[] paras = getParameter(); diff --git a/org.adempiere.replication/src/org/adempiere/process/rpl/imp/ModelImporter.java b/org.adempiere.replication/src/org/adempiere/process/rpl/imp/ModelImporter.java index d38becb7a9..ed9de318c1 100755 --- a/org.adempiere.replication/src/org/adempiere/process/rpl/imp/ModelImporter.java +++ b/org.adempiere.replication/src/org/adempiere/process/rpl/imp/ModelImporter.java @@ -77,7 +77,7 @@ public class ModelImporter extends SvrProcess { p_AD_Client_ID = Env.getAD_Client_ID(getCtx()); AD_Table_ID = getTable_ID(); - StringBuffer sb = new StringBuffer("AD_Table_ID=").append(AD_Table_ID); + StringBuilder sb = new StringBuilder("AD_Table_ID=").append(AD_Table_ID); sb.append("; Record_ID=").append(getRecord_ID()); // Parameter ProcessInfoParameter[] para = getParameter(); diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java b/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java index 9d5e4c39f8..bc301da1bd 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java @@ -155,7 +155,7 @@ public class AcctProcessor extends AdempiereServer && m_model.getAD_Table_ID() != AD_Table_ID) continue; - StringBuffer sql = new StringBuffer ("SELECT DISTINCT ProcessedOn FROM ").append(TableName) + StringBuilder sql = new StringBuilder ("SELECT DISTINCT ProcessedOn FROM ").append(TableName) .append(" WHERE AD_Client_ID=? AND ProcessedOn<?") .append(" AND Processed='Y' AND Posted IN ('N','d') AND IsActive='Y'"); PreparedStatement pstmt = null; @@ -205,7 +205,7 @@ public class AcctProcessor extends AdempiereServer && m_model.getAD_Table_ID() != AD_Table_ID) continue; // SELECT * FROM table - StringBuffer sql = new StringBuffer ("SELECT * FROM ").append(TableName) + StringBuilder sql = new StringBuilder ("SELECT * FROM ").append(TableName) .append(" WHERE AD_Client_ID=? AND (ProcessedOn"); if (processedOn.compareTo(Env.ZERO) != 0) sql.append("=?"); @@ -242,7 +242,7 @@ public class AcctProcessor extends AdempiereServer { MTable table = MTable.get(Env.getCtx(), AD_Table_ID); int Record_ID = rs.getInt(table.getKeyColumns()[0]); - sql = new StringBuffer("SELECT COUNT(*) FROM ").append(table.getTableName()); + sql = new StringBuilder("SELECT COUNT(*) FROM ").append(table.getTableName()); sql.append(" WHERE Posted='Y' AND ").append(table.getTableName()).append("_ID=").append(Record_ID); int no = DB.getSQLValue(null, sql.toString()); if (no > 0 ) diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java index 09c92b8991..f91a1d5e31 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java @@ -395,7 +395,7 @@ public abstract class AdempiereServer implements Runnable */ public String toString () { - StringBuffer sb = new StringBuffer () + StringBuilder sb = new StringBuilder () .append ("Sleeping=").append(m_sleeping) .append (",Last=").append(getDateLastRun()); if (m_sleeping) diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java b/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java index 970ad03890..042f59da2d 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java @@ -138,7 +138,7 @@ public class AlertProcessor extends AdempiereServer // parse variables from Client, then from System String alertMessage = Env.parseVariable(alert.getAlertMessage(), client, null, true); alertMessage = Env.parseVariable(alertMessage, system, null, true); - StringBuffer message = new StringBuffer(alertMessage).append(Env.NL); + StringBuilder message = new StringBuilder(alertMessage).append(Env.NL); // boolean valid = true; boolean processed = false; diff --git a/org.adempiere.ui/src/org/compiere/grid/CreateFrom.java b/org.adempiere.ui/src/org/compiere/grid/CreateFrom.java index 7e67d3bfa7..d612287407 100644 --- a/org.adempiere.ui/src/org/compiere/grid/CreateFrom.java +++ b/org.adempiere.ui/src/org/compiere/grid/CreateFrom.java @@ -98,7 +98,7 @@ public abstract class CreateFrom implements ICreateFrom String isSOTrxParam = isSOTrx ? "Y":"N"; // Display - StringBuffer display = new StringBuffer("o.DocumentNo||' - ' ||") + StringBuilder display = new StringBuilder("o.DocumentNo||' - ' ||") .append(DB.TO_CHAR("o.DateOrdered", DisplayType.Date, Env.getAD_Language(Env.getCtx()))) .append("||' - '||") .append(DB.TO_CHAR("o.GrandTotal", DisplayType.Amount, Env.getAD_Language(Env.getCtx()))); @@ -110,7 +110,7 @@ public abstract class CreateFrom implements ICreateFrom column = "ol.QtyInvoiced"; colBP = "o.Bill_BPartner_ID"; } - StringBuffer sql = new StringBuffer("SELECT o.C_Order_ID,") + StringBuilder sql = new StringBuilder("SELECT o.C_Order_ID,") .append(display) .append(" FROM C_Order o WHERE ") .append(colBP)