IDEMPIERE-308 Performance: Replace use of StringBuffer and String concatenation with StringBuilder / findbugs fb-contrib pattern LSYC_LOCAL_SYNCHRONIZED_COLLECTION

This commit is contained in:
Richard Morales 2012-12-05 12:09:37 -05:00
parent 529089a426
commit a486d1317c
385 changed files with 645 additions and 645 deletions

View File

@ -105,7 +105,7 @@ public class Aging extends SvrProcess
//FR 1933937
String dateacct = DB.TO_DATE(p_StatementDate);
StringBuffer sql = new StringBuffer();
StringBuilder sql = new StringBuilder();
sql.append("SELECT bp.C_BP_Group_ID, oi.C_BPartner_ID,oi.C_Invoice_ID,oi.C_InvoicePaySchedule_ID, " // 1..4
+ "oi.C_Currency_ID, oi.IsSOTrx, " // 5..6
+ "oi.DateInvoiced, oi.NetDays,oi.DueDate,oi.DaysDue, "); // 7..10

View File

@ -173,7 +173,7 @@ public class IndentedBOM extends SvrProcess
private List<MProductBOM> getBOMs(MProduct product)
{
ArrayList<Object> params = new ArrayList<Object>();
StringBuffer whereClause = new StringBuffer();
StringBuilder whereClause = new StringBuilder();
whereClause.append(MProductBOM.COLUMNNAME_M_Product_ID).append("=?");
params.add(product.get_ID());

View File

@ -51,7 +51,7 @@ public class DocTypeNotFoundException extends AdempiereException
{
String additionalInfo = super.getMessage();
String docBaseTypeName = MRefList.getListName(Env.getCtx(), MDocType.DOCBASETYPE_AD_Reference_ID, getDocBaseType());
StringBuffer sb = new StringBuffer("@NotFound@ @C_DocType_ID@");
StringBuilder sb = new StringBuilder("@NotFound@ @C_DocType_ID@");
sb.append(" - @DocBaseType@ : " + docBaseTypeName);
if (!Util.isEmpty(additionalInfo, true))
{

View File

@ -31,7 +31,7 @@ public class FillMandatoryException extends AdempiereException
private static final String buildMessage(String...fields)
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (String f : fields) {
if (sb.length() > 0)
sb.append(", ");

View File

@ -36,7 +36,7 @@ public class NoUOMConversionException extends AdempiereException
private static String buildMessage(int M_Product_ID, int C_UOM_ID, int C_UOM_To_ID)
{
StringBuffer sb = new StringBuffer("@"+AD_Message+"@ - ");
StringBuilder sb = new StringBuilder("@"+AD_Message+"@ - ");
//
sb.append("@M_Product_ID@:");
MProduct product = MProduct.get(Env.getCtx(), M_Product_ID);

View File

@ -76,7 +76,7 @@ public class PORelationException extends AdempiereException {
final String msg = Msg.getMsg(po.getCtx(), MSG_ERR_KEY_COLUMNS_2P,
msgParams);
final StringBuffer sb = new StringBuffer(msg);
final StringBuilder sb = new StringBuilder(msg);
for (final String keyCol : po.get_KeyColumns()) {
sb.append("\n");

View File

@ -43,7 +43,7 @@ public class ProductNotOnPriceListException extends AdempiereException
private static final String buildMessage (MProductPricing pp, int documentLineNo)
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if (documentLineNo > 0)
{
if (sb.length() > 0)

View File

@ -102,7 +102,7 @@ public class PromotionValidator implements ModelValidator {
String warehouseFilter = "M_PromotionPreCondition.M_Warehouse_ID IS NULL OR M_PromotionPreCondition.M_Warehouse_ID = ?";
String dateFilter = "M_PromotionPreCondition.StartDate <= ? AND (M_PromotionPreCondition.EndDate >= ? OR M_PromotionPreCondition.EndDate IS NULL)";
StringBuffer select = new StringBuffer();
StringBuilder select = new StringBuilder();
select.append(" SELECT M_PromotionPreCondition.M_PromotionPreCondition_ID FROM M_PromotionPreCondition ")
.append(" WHERE")
.append(" (" + bpFilter + ")")

View File

@ -51,7 +51,7 @@ public class ZoomInfoFactory {
@Override
public String toString() {
final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
sb.append("ZoomInfo[");
sb.append("Display=");
sb.append(destinationDisplay);

View File

@ -532,7 +532,7 @@ public class GenerateModelJPA
private String addListValidation (StringBuffer sb, int AD_Reference_ID,
String columnName, boolean nullable)
{
StringBuffer retValue = new StringBuffer();
StringBuilder retValue = new StringBuilder();
retValue.append("\n/** ").append(columnName).append(" AD_Reference_ID=").append(AD_Reference_ID) .append(" */\n")
.append("public static final int ").append(columnName.toUpperCase())
.append("_AD_Reference_ID=").append(AD_Reference_ID).append(";");

View File

@ -71,7 +71,7 @@ public class PaymentUtil {
Integer valueLength = value.length();
StringBuffer encryptedCC = new StringBuffer();
StringBuilder encryptedCC = new StringBuilder();
for (int i = 0; i < (valueLength - 4); i++) {
encryptedCC.append("0");
@ -88,7 +88,7 @@ public class PaymentUtil {
else {
Integer valueLength = creditCardVV.length();
StringBuffer encryptedCC = new StringBuffer();
StringBuilder encryptedCC = new StringBuilder();
for (int i = 0; i < valueLength; i++) {
encryptedCC.append("0");
@ -122,7 +122,7 @@ public class PaymentUtil {
String mm = String.valueOf(creditCardExpMM);
String yy = String.valueOf(creditCardExpYY);
StringBuffer retValue = new StringBuffer();
StringBuilder retValue = new StringBuilder();
if (mm.length() == 1)
retValue.append("0");
retValue.append(mm);

View File

@ -175,7 +175,7 @@ public final class Adempiere
*/
public static String getSum()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(NAME).append(" ").append(MAIN_VERSION).append(SUB_TITLE);
return sb.toString();
} // getSum
@ -187,7 +187,7 @@ public final class Adempiere
*/
public static String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(NAME).append(" ")
.append(MAIN_VERSION).append("_").append(DATE_VERSION)
.append(" -").append(SUB_TITLE)

View File

@ -1125,7 +1125,7 @@ public class DocLine
*/
public String toString()
{
StringBuffer sb = new StringBuffer("DocLine=[");
StringBuilder sb = new StringBuilder("DocLine=[");
sb.append(p_po.get_ID());
if (getDescription() != null)
sb.append(",").append(getDescription());

View File

@ -126,7 +126,7 @@ public class Doc_BankStatement extends Doc
public BigDecimal getBalance()
{
BigDecimal retValue = Env.ZERO;
StringBuffer sb = new StringBuffer (" [");
StringBuilder sb = new StringBuilder (" [");
// Total
retValue = retValue.add(getAmount(Doc.AMTTYPE_Gross));
sb.append(getAmount(Doc.AMTTYPE_Gross));

View File

@ -105,7 +105,7 @@ public class Doc_Cash extends Doc
public BigDecimal getBalance()
{
BigDecimal retValue = Env.ZERO;
StringBuffer sb = new StringBuffer (" [");
StringBuilder sb = new StringBuilder (" [");
// Total
retValue = retValue.add(getAmount(Doc.AMTTYPE_Gross));
sb.append(getAmount(Doc.AMTTYPE_Gross));

View File

@ -108,7 +108,7 @@ public class Doc_GLJournal extends Doc
public BigDecimal getBalance()
{
BigDecimal retValue = Env.ZERO;
StringBuffer sb = new StringBuffer (" [");
StringBuilder sb = new StringBuilder (" [");
// Lines
for (int i = 0; i < p_lines.length; i++)
{

View File

@ -796,7 +796,7 @@ public final class Fact
*/
public String toString()
{
StringBuffer sb = new StringBuffer("Fact[");
StringBuilder sb = new StringBuilder("Fact[");
sb.append(m_doc.toString());
sb.append(",").append(m_acctSchema.toString());
sb.append(",PostType=").append(m_postingType);
@ -933,7 +933,7 @@ public final class Fact
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("Balance[");
StringBuilder sb = new StringBuilder ("Balance[");
sb.append ("DR=").append(DR)
.append ("-CR=").append(CR)
.append(" = ").append(getBalance())

View File

@ -155,7 +155,7 @@ public class CacheHandler {
urlConn.connect();
Reader stream = new java.io.InputStreamReader(
urlConn.getInputStream());
StringBuffer srvOutput = new StringBuffer();
StringBuilder srvOutput = new StringBuilder();
try {
int c;

View File

@ -117,7 +117,7 @@ public class StringUtil {
* @return new String with result
*/
public static String replaceOne(String original, String search, String replace) {
StringBuffer toriginal = new StringBuffer(original);
StringBuilder toriginal = new StringBuilder(original);
if (toriginal.toString().indexOf(search)>=0) {
toriginal.replace(toriginal.toString().indexOf(search),toriginal.toString().indexOf(search)+search.length(),replace);
}

View File

@ -968,7 +968,7 @@ public class CConnection implements Serializable, Cloneable
*/
public String toString ()
{
StringBuffer sb = new StringBuffer (m_apps_host);
StringBuilder sb = new StringBuilder (m_apps_host);
sb.append ("{").append (m_db_host)
.append ("-").append (m_db_name)
.append ("-").append (m_db_uid)
@ -982,7 +982,7 @@ public class CConnection implements Serializable, Cloneable
*/
public String toStringDetail ()
{
StringBuffer sb = new StringBuffer (m_apps_host);
StringBuilder sb = new StringBuilder (m_apps_host);
sb.append ("{").append (m_db_host)
.append ("-").append (m_db_name)
.append ("-").append (m_db_uid)
@ -1019,7 +1019,7 @@ public class CConnection implements Serializable, Cloneable
{
if (m_dbInfo != null)
return m_dbInfo;
StringBuffer sb = new StringBuffer ();
StringBuilder sb = new StringBuilder ();
Connection conn = getConnection (true,
Connection.TRANSACTION_READ_COMMITTED);
if (conn != null)
@ -1053,7 +1053,7 @@ public class CConnection implements Serializable, Cloneable
*/
public String toStringLong ()
{
StringBuffer sb = new StringBuffer ("CConnection[");
StringBuilder sb = new StringBuilder ("CConnection[");
sb.append ("name=").append (escape(m_name))
.append (",AppsHost=").append (escape(m_apps_host))
.append (",WebPort=").append (m_webPort)
@ -1197,7 +1197,7 @@ public class CConnection implements Serializable, Cloneable
*/
public String getInfo ()
{
StringBuffer sb = new StringBuffer (m_info[0] != null ? m_info[0] : "");
StringBuilder sb = new StringBuilder (m_info[0] != null ? m_info[0] : "");
sb.append (" - ").append (m_info[1] != null ? m_info[1] : "")
.append ("\n").append (getDatabase ().toString ())
.append ("\nAppsServerOK=").append (isAppsServerOK (false))
@ -1471,7 +1471,7 @@ public class CConnection implements Serializable, Cloneable
*/
public String getStatus()
{
StringBuffer sb = new StringBuffer (m_apps_host);
StringBuilder sb = new StringBuilder (m_apps_host);
sb.append ("{").append (m_db_host)
.append ("-").append (m_db_name)
.append ("-").append (m_db_uid)

View File

@ -351,7 +351,7 @@ public class CreateAdempiere
//
MColumn[] columns = mTable.getColumns(false);
StringBuffer sb = new StringBuffer("CREATE TABLE ");
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(tableName).append(" (");
try
{

View File

@ -205,7 +205,7 @@ public abstract class Convert
public String convertAll (String sqlStatements)
{
String[] sql = convert (sqlStatements);
StringBuffer sb = new StringBuffer (sqlStatements.length() + 10);
StringBuilder sb = new StringBuilder (sqlStatements.length() + 10);
for (int i = 0; i < sql.length; i++)
{
// line.separator
@ -323,7 +323,7 @@ public abstract class Convert
* @return string
*/
protected String recoverQuotedStrings(String retValue, Vector<String>retVars) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < retVars.size(); i++) {
//hengsin, special character in replacement can cause exception
String replacement = (String) retVars.get(i);

View File

@ -311,7 +311,7 @@ public abstract class Convert_SQL92 extends Convert {
if (trace)
log.info(newFrom.toString());
//
StringBuffer retValue = new StringBuffer (sqlStatement.length()+20);
StringBuilder retValue = new StringBuilder (sqlStatement.length()+20);
retValue.append(selectPart)
.append(newFrom).append(" ")
.append(newWherePart).append(rest);
@ -334,7 +334,7 @@ public abstract class Convert_SQL92 extends Convert {
{
// log.info("DECODE<== " + sqlStatement);
String statement = sqlStatement;
StringBuffer sb = new StringBuffer("CASE");
StringBuilder sb = new StringBuilder("CASE");
int index = statement.toUpperCase().indexOf("DECODE", fromIndex);
if (index <= 0) return sqlStatement;

View File

@ -198,7 +198,7 @@ public class Join
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("Join[");
StringBuilder sb = new StringBuilder ("Join[");
sb.append(m_joinClause)
.append(" - Main=").append(m_mainTable).append("/").append(m_mainAlias)
.append(", Join=").append(m_joinTable).append("/").append(m_joinAlias)

View File

@ -441,7 +441,7 @@ public final class ImpFormatRow
retValue = retValue.substring(0, m_maxLength);
// copy characters (wee need to look through anyway)
StringBuffer out = new StringBuffer(retValue.length());
StringBuilder out = new StringBuilder(retValue.length());
for (int i = 0; i < retValue.length(); i++)
{
char c = retValue.charAt(i);
@ -477,7 +477,7 @@ public final class ImpFormatRow
// remove everything but digits & '.' & '-'
char[] charArray = info.toCharArray();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < charArray.length; i++)
if (Character.isDigit(charArray[i]) || charArray[i] == '.' || charArray[i] == '-')
sb.append(charArray[i]);

View File

@ -214,7 +214,7 @@ public final class OFX1ToXML extends InputStream implements Runnable
if (text == null)
return null;
char c;
StringBuffer n = new StringBuffer (text.length () * 2);
StringBuilder n = new StringBuilder (text.length () * 2);
for (int i = 0; i < text.length (); i++)
{
c = text.charAt (i);

View File

@ -290,7 +290,7 @@ public class AccessSqlParser
*/
public String toString()
{
StringBuffer sb = new StringBuffer("AccessSqlParser[");
StringBuilder sb = new StringBuilder("AccessSqlParser[");
if (m_tableInfo == null)
sb.append(m_sqlOriginal);
else
@ -440,7 +440,7 @@ public class AccessSqlParser
*/
public String toString()
{
StringBuffer sb = new StringBuffer(m_tableName);
StringBuilder sb = new StringBuilder(m_tableName);
if (getSynonym().length() > 0)
sb.append("=").append(m_synonym);
return sb.toString();

View File

@ -217,7 +217,7 @@ public final class DataStatusEvent extends EventObject implements Serializable
*/
public String toString()
{
StringBuffer sb = new StringBuffer("DataStatusEvent - ");
StringBuilder sb = new StringBuilder("DataStatusEvent - ");
if (m_AD_Message != null)
sb.append(m_AD_Message);
if (m_info != null)
@ -240,7 +240,7 @@ public final class DataStatusEvent extends EventObject implements Serializable
*/
public String getMessage()
{
StringBuffer retValue = new StringBuffer();
StringBuilder retValue = new StringBuilder();
if (m_inserting)
retValue.append("+");
retValue.append(m_changed ? (m_autoSave ? "*" : "?") : " ");

View File

@ -298,7 +298,7 @@ public class GridField
//
if (list.size() > 0 && CLogMgt.isLevelFiner())
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++)
sb.append(list.get(i)).append(" ");
log.finer("(" + m_vo.ColumnName + ") " + sb.toString());
@ -1676,7 +1676,7 @@ public class GridField
*/
public String toStringX()
{
StringBuffer sb = new StringBuffer("MField[");
StringBuilder sb = new StringBuilder("MField[");
sb.append(m_vo.ColumnName).append("=").append(m_value)
.append(",DisplayType=").append(getDisplayType())
.append("]");

View File

@ -473,7 +473,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
//
if (list.size() > 0 && CLogMgt.isLevelFiner())
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++)
sb.append(list.get(i)).append(" ");
log.finer("(" + m_vo.Name + ") " + sb.toString());
@ -2335,7 +2335,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
e.UpdatedBy = (Integer)getValue("UpdatedBy");
e.Record_ID = getValue(m_keyColumnName);
// Info
StringBuffer info = new StringBuffer(getTableName());
StringBuilder info = new StringBuilder(getTableName());
/* get UUID */
if (!e.isInserting() && e.getCurrentRow() >= 0 && e.getCurrentRow() < e.getTotalRows())

View File

@ -325,7 +325,7 @@ public class GridTable extends AbstractTableModel
return "";
// Create SELECT Part
StringBuffer select = new StringBuffer("SELECT ");
StringBuilder select = new StringBuilder("SELECT ");
for (int i = 0; i < m_fields.size(); i++)
{
if (i > 0)
@ -354,7 +354,7 @@ public class GridTable extends AbstractTableModel
}
}
StringBuffer where = new StringBuffer("");
StringBuilder where = new StringBuilder("");
// WHERE
if (m_whereClause.length() > 0)
{
@ -1093,7 +1093,7 @@ public class GridTable extends AbstractTableModel
start = 0;
}
}
StringBuffer sql = new StringBuffer();
StringBuilder sql = new StringBuilder();
sql.append(m_SQL_Select)
.append(" WHERE ")
.append(getKeyColumnName())
@ -1509,7 +1509,7 @@ public class GridTable extends AbstractTableModel
final String INFO = "Info: ";
// Update SQL with specific where clause
StringBuffer select = new StringBuffer("SELECT ");
StringBuilder select = new StringBuilder("SELECT ");
for (int i = 0, addedColumns = 0; i < m_fields.size(); i++)
{
GridField field = (GridField)m_fields.get(i);
@ -1522,8 +1522,8 @@ public class GridTable extends AbstractTableModel
}
//
select.append(" FROM ").append(m_tableName);
StringBuffer singleRowWHERE = new StringBuffer();
StringBuffer multiRowWHERE = new StringBuffer();
StringBuilder singleRowWHERE = new StringBuilder();
StringBuilder multiRowWHERE = new StringBuilder();
// Create SQL & RowID
if (m_inserting)
select.append(" WHERE 1=2");
@ -1626,7 +1626,7 @@ public class GridTable extends AbstractTableModel
createUpdateSql (columnName, DB.TO_STRING (str));
else
rs.updateString (colRs, str); // ***
singleRowWHERE = new StringBuffer(); // overwrite
singleRowWHERE = new StringBuilder(); // overwrite
singleRowWHERE.append (columnName).append ("=").append (DB.TO_STRING(str));
//
is = INFO + columnName + " -> " + str + " (StringKey)";
@ -1917,7 +1917,7 @@ public class GridTable extends AbstractTableModel
singleRowWHERE.append (columnName).append ("=").append (rowData[col]);
else
{
singleRowWHERE = new StringBuffer(); // overwrite
singleRowWHERE = new StringBuilder(); // overwrite
singleRowWHERE.append (columnName).append ("=").append (DB.TO_STRING(rowData[col].toString()));
}
}
@ -2316,7 +2316,7 @@ public class GridTable extends AbstractTableModel
*/
private String createUpdateSql (boolean insert, String whereClause)
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if (insert)
{
sb.append("INSERT INTO ").append(m_tableName).append(" (");
@ -2369,7 +2369,7 @@ public class GridTable extends AbstractTableModel
private String getMandatory(Object[] rowData)
{
// see also => ProcessParameter.saveParameter
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
// Check all columns
int size = m_fields.size();
@ -2614,7 +2614,7 @@ public class GridTable extends AbstractTableModel
}
else // Delete via SQL
{
StringBuffer sql = new StringBuffer("DELETE ");
StringBuilder sql = new StringBuilder("DELETE ");
sql.append(m_tableName).append(" WHERE ").append(getWhereClause(rowData));
int no = 0;
PreparedStatement pstmt = null;
@ -3380,7 +3380,7 @@ public class GridTable extends AbstractTableModel
{
DB.close(rs, pstmt);
}
StringBuffer info = new StringBuffer("Rows=");
StringBuilder info = new StringBuilder("Rows=");
info.append(rows);
if (rows == 0)
info.append(" - ").append(m_SQL_Count);

View File

@ -90,7 +90,7 @@ public class LookupDisplayColumn implements Serializable
*/
public String toString()
{
StringBuffer sb = new StringBuffer("LookupDisplayColumn[");
StringBuilder sb = new StringBuilder("LookupDisplayColumn[");
sb.append("ColumnName=").append(ColumnName);
if (IsVirtual)
sb.append(",ColumnSQL=").append(ColumnSQL);

View File

@ -93,7 +93,7 @@ public class MAssetAcct extends X_A_Asset_Acct
}
//
ArrayList<Object> params = new ArrayList<Object>();
StringBuffer whereClause = new StringBuffer(COLUMNNAME_A_Asset_ID+"=? AND "+COLUMNNAME_PostingType+"=?");
StringBuilder whereClause = new StringBuilder(COLUMNNAME_A_Asset_ID+"=? AND "+COLUMNNAME_PostingType+"=?");
params.add(A_Asset_ID);
params.add(postingType);
if (dateAcct != null)

View File

@ -579,7 +579,7 @@ public class MAssetAddition extends X_A_Asset_Addition
.list();
if (list.size() > 0)
{
StringBuffer sb = new StringBuffer("You can not create project for this asset,"
StringBuilder sb = new StringBuilder("You can not create project for this asset,"
+" Project already has assets. View: ");
for (MAssetAddition aa : list)
{
@ -922,7 +922,7 @@ public class MAssetAddition extends X_A_Asset_Addition
public String getSummary()
{
MAsset asset = getA_Asset(false);
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("@DocumentNo@ #").append(getDocumentNo())
.append(": @A_CreateAsset@=@").append(isA_CreateAsset() ? "Y" : "N").append("@")
;
@ -1145,7 +1145,7 @@ public class MAssetAddition extends X_A_Asset_Addition
public String toString()
{
StringBuffer sb = new StringBuffer("@DocumentNo@: " + getDocumentNo());
StringBuilder sb = new StringBuilder("@DocumentNo@: " + getDocumentNo());
MAsset asset = getA_Asset(false);
if(asset != null && asset.get_ID() > 0)
{

View File

@ -77,7 +77,7 @@ public class MAssetClass extends X_A_Asset_Class
*
*/
public void setDescription() {
StringBuffer description = new StringBuffer();
StringBuilder description = new StringBuilder();
String value = getValue();
if (value != null) {
description.append(value).append(" ");

View File

@ -195,7 +195,7 @@ implements DocAction
public String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("@DocumentNo@ #").append(getDocumentNo());
return sb.toString();
}

View File

@ -113,7 +113,7 @@ implements DocAction
public String getSummary() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("@DocumentNo@ #").append(getDocumentNo());
return sb.toString();
}

View File

@ -600,7 +600,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile
return;
}
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
load(get_TrxName()); // reload workfile
MAssetAcct assetacct = getA_AssetAcct(null, get_TrxName());
// TODO: teo_sarca: need to evaluate what happens when we change Depreciation method !!!

View File

@ -70,7 +70,7 @@ public class MLotCtl extends X_M_LotCtl
*/
public MLot createLot (int M_Product_ID)
{
StringBuffer name = new StringBuffer();
StringBuilder name = new StringBuilder();
if (getPrefix() != null)
name.append(getPrefix());
int no = getCurrentNext();

View File

@ -852,7 +852,7 @@ public class MMovement extends X_M_Movement implements DocAction
*/
public String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(getDocumentNo());
// : Total Lines = 123.00 (#1)
sb.append(": ")

View File

@ -641,7 +641,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
*/
public String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(getDocumentNo());
// : Total Lines = 123.00 (#1)
sb.append(": ")

View File

@ -162,7 +162,7 @@ public class MMovementLineMA extends X_M_MovementLineMA
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MMovementLineMA[");
StringBuilder sb = new StringBuilder ("MMovementLineMA[");
sb.append("M_MovementLine_ID=").append(getM_MovementLine_ID())
.append(",M_AttributeSetInstance_ID=").append(getM_AttributeSetInstance_ID())
.append(", Qty=").append(getMovementQty())

View File

@ -662,7 +662,7 @@ public class MOrder extends X_C_Order implements DocAction
public MOrderLine[] getLines (String whereClause, String orderClause)
{
//red1 - using new Query class from Teo / Victor's MDDOrder.java implementation
StringBuffer whereClauseFinal = new StringBuffer(MOrderLine.COLUMNNAME_C_Order_ID+"=? ");
StringBuilder whereClauseFinal = new StringBuilder(MOrderLine.COLUMNNAME_C_Order_ID+"=? ");
if (!Util.isEmpty(whereClause, true))
whereClauseFinal.append(whereClause);
if (orderClause.length() == 0)
@ -1780,7 +1780,7 @@ public class MOrder extends X_C_Order implements DocAction
approveIt();
getLines(true,null);
log.info(toString());
StringBuffer info = new StringBuffer();
StringBuilder info = new StringBuilder();
boolean realTimePOS = MSysConfig.getBooleanValue(MSysConfig.REAL_TIME_POS, false , getAD_Client_ID());
@ -2311,7 +2311,7 @@ public class MOrder extends X_C_Order implements DocAction
return true;
log.info("createReversals");
StringBuffer info = new StringBuffer();
StringBuilder info = new StringBuilder();
// Reverse All *Shipments*
info.append("@M_InOut_ID@:");
@ -2594,7 +2594,7 @@ public class MOrder extends X_C_Order implements DocAction
*/
public String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(getDocumentNo());
// : Grand Total = 123.00 (#1)
sb.append(": ").

View File

@ -205,7 +205,7 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MOrderPaySchedule[");
StringBuilder sb = new StringBuilder("MOrderPaySchedule[");
sb.append(get_ID()).append("-Due=" + getDueDate() + "/" + getDueAmt())
.append(";Discount=").append(getDiscountDate() + "/" + getDiscountAmt())
.append("]");

View File

@ -82,7 +82,7 @@ public class MPInstanceLog
*/
public String toString ()
{
StringBuffer sb = new StringBuffer("PPInstance_Log[");
StringBuilder sb = new StringBuilder("PPInstance_Log[");
sb.append(m_Log_ID);
if (m_P_Date != null)
sb.append(",Date=").append(m_P_Date);
@ -103,7 +103,7 @@ public class MPInstanceLog
*/
public boolean save ()
{
StringBuffer sql = new StringBuffer("INSERT INTO AD_PInstance_Log "
StringBuilder sql = new StringBuilder("INSERT INTO AD_PInstance_Log "
+ "(AD_PInstance_ID, Log_ID, P_Date, P_ID, P_Number, P_Msg)"
+ " VALUES (");
sql.append(m_AD_PInstance_ID).append(",")

View File

@ -119,7 +119,7 @@ public class MPaySelection extends X_C_PaySelection
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MPaySelection[");
StringBuilder sb = new StringBuilder("MPaySelection[");
sb.append(get_ID()).append(",").append(getName())
.append("]");
return sb.toString();

View File

@ -520,7 +520,7 @@ public final class MPaySelectionCheck extends X_C_PaySelectionCheck
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MPaymentCheck[");
StringBuilder sb = new StringBuilder("MPaymentCheck[");
sb.append(get_ID()).append("-").append(getDocumentNo())
.append("-").append(getPayAmt())
.append(",PaymetRule=").append(getPaymentRule())

View File

@ -173,7 +173,7 @@ public class MPaySelectionLine extends X_C_PaySelectionLine
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MPaySelectionLine[");
StringBuilder sb = new StringBuilder("MPaySelectionLine[");
sb.append(get_ID()).append(",C_Invoice_ID=").append(getC_Invoice_ID())
.append(",PayAmt=").append(getPayAmt())
.append(",DifferenceAmt=").append(getDifferenceAmt())

View File

@ -557,7 +557,7 @@ public final class MPayment extends X_C_Payment
history.setIsError(!approved);
history.setProcessed(approved);
StringBuffer msg = new StringBuffer();
StringBuilder msg = new StringBuilder();
if (approved)
{
if(getTrxType().equals(TRXTYPE_Void) || getTrxType().equals(TRXTYPE_CreditPayment))
@ -1074,7 +1074,7 @@ public final class MPayment extends X_C_Payment
String mm = String.valueOf(getCreditCardExpMM());
String yy = String.valueOf(getCreditCardExpYY());
StringBuffer retValue = new StringBuffer();
StringBuilder retValue = new StringBuilder();
if (mm.length() == 1)
retValue.append("0");
retValue.append(mm);
@ -1935,7 +1935,7 @@ public final class MPayment extends X_C_Payment
cl.setDescription("Generated From Payment #" + getDocumentNo());
cl.setC_Currency_ID( this.getC_Currency_ID() );
cl.setC_Payment_ID( getC_Payment_ID() ); // Set Reference to payment.
StringBuffer info=new StringBuffer();
StringBuilder info=new StringBuilder();
info.append("Cash journal ( ")
.append(cash.getDocumentNo()).append(" )");
m_processMsg = info.toString();
@ -2665,7 +2665,7 @@ public final class MPayment extends X_C_Payment
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MPayment[");
StringBuilder sb = new StringBuilder ("MPayment[");
sb.append(get_ID()).append("-").append(getDocumentNo())
.append(",Receipt=").append(isReceipt())
.append(",PayAmt=").append(getPayAmt())
@ -2723,7 +2723,7 @@ public final class MPayment extends X_C_Payment
*/
public String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(getDocumentNo());
// : Total Lines = 123.00 (#1)
sb.append(": ")

View File

@ -398,7 +398,7 @@ public class MPaymentTerm extends X_C_PaymentTerm
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MPaymentTerm[");
StringBuilder sb = new StringBuilder ("MPaymentTerm[");
sb.append(get_ID()).append("-").append(getName())
.append(",Valid=").append(isValid())
.append ("]");

View File

@ -284,7 +284,7 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
history.setIsError(!(approved && processed));
history.setProcessed(approved && processed);
StringBuffer msg = new StringBuffer();
StringBuilder msg = new StringBuilder();
if (approved)
{
if(getTrxType().equals(TRXTYPE_Void) || getTrxType().equals(TRXTYPE_CreditPayment))

View File

@ -165,7 +165,7 @@ public class MPaymentValidate
String ccNumber1 = checkNumeric(creditCardNumber);
int ccLength = ccNumber1.length();
// Reverse string
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for (int i = ccLength; i != 0; i--)
buf.append(ccNumber1.charAt(i-1));
String ccNumber = buf.toString();
@ -429,7 +429,7 @@ public class MPaymentValidate
if (data == null || data.length() == 0)
return "";
// Remove all non Digits
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < data.length(); i++)
{
if (Character.isDigit(data.charAt(i)))

View File

@ -642,7 +642,7 @@ public class MPeriod extends X_C_Period
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MPeriod[");
StringBuilder sb = new StringBuilder ("MPeriod[");
sb.append (get_ID())
.append("-").append (getName())
.append(", ").append(getStartDate()).append("-").append(getEndDate())

View File

@ -106,7 +106,7 @@ public class MPeriodControl extends X_C_PeriodControl
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MPeriodControl[");
StringBuilder sb = new StringBuilder ("MPeriodControl[");
sb.append(get_ID()).append(",").append(getDocBaseType())
.append(",Status=").append(getPeriodStatus())
.append ("]");

View File

@ -97,7 +97,7 @@ public class MPreference extends X_AD_Preference
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MPreference[");
StringBuilder sb = new StringBuilder ("MPreference[");
sb.append (get_ID()).append("-")
.append(getAttribute()).append("-").append(getValue())
.append ("]");

View File

@ -556,7 +556,7 @@ public class MProduct extends X_M_Product
@Override
public String toString()
{
StringBuffer sb = new StringBuffer("MProduct[");
StringBuilder sb = new StringBuilder("MProduct[");
sb.append(get_ID()).append("-").append(getValue())
.append("]");
return sb.toString();

View File

@ -136,7 +136,7 @@ public class MProductBOM extends X_M_Product_BOM
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MProductBOM[");
StringBuilder sb = new StringBuilder("MProductBOM[");
sb.append(get_ID()).append(",Line=").append(getLine())
.append(",Type=").append(getBOMType()).append(",Qty=").append(getBOMQty());
if (m_product == null)

View File

@ -115,7 +115,7 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("MProductCategoryAcct[");
StringBuilder sb = new StringBuilder ("MProductCategoryAcct[");
sb.append (get_ID())
.append (",M_Product_Category_ID=").append (getM_Product_Category_ID())
.append (",C_AcctSchema_ID=").append(getC_AcctSchema_ID())

View File

@ -152,7 +152,7 @@ public class MProductPrice extends X_M_ProductPrice
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("MProductPrice[");
StringBuilder sb = new StringBuilder ("MProductPrice[");
sb.append(getM_PriceList_Version_ID())
.append(",M_Product_ID=").append (getM_Product_ID())
.append(",PriceList=").append(getPriceList())

View File

@ -79,7 +79,7 @@ public class MProductionLine extends X_M_ProductionLine {
log.log(Level.FINE, "Production Line " + getLine() + " does not require stock movement");
return "";
}
StringBuffer errorString = new StringBuffer();
StringBuilder errorString = new StringBuilder();
MAttributeSetInstance asi = new MAttributeSetInstance(getCtx(), getM_AttributeSetInstance_ID(), get_TrxName());
String asiString = asi.getDescription();

View File

@ -161,7 +161,7 @@ public class MProjectLine extends X_C_ProjectLine
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MProjectLine[");
StringBuilder sb = new StringBuilder ("MProjectLine[");
sb.append (get_ID()).append ("-")
.append (getLine())
.append(",C_Project_ID=").append(getC_Project_ID())

View File

@ -276,7 +276,7 @@ public class MProjectPhase extends X_C_ProjectPhase
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MProjectPhase[");
StringBuilder sb = new StringBuilder ("MProjectPhase[");
sb.append (get_ID())
.append ("-").append (getSeqNo())
.append ("-").append (getName())

View File

@ -157,7 +157,7 @@ public class MProjectTask extends X_C_ProjectTask
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MProjectTask[");
StringBuilder sb = new StringBuilder ("MProjectTask[");
sb.append (get_ID())
.append ("-").append (getSeqNo())
.append ("-").append (getName())

View File

@ -163,7 +163,7 @@ public class MProjectType extends X_C_ProjectType
String bpColumn = "C_BPartner_ID";
String pColumn = null;
// PlannedAmt -> PlannedQty -> Count
StringBuffer sb = new StringBuffer("SELECT COALESCE(SUM(PlannedAmt),COALESCE(SUM(PlannedQty),COUNT(*))) "
StringBuilder sb = new StringBuilder("SELECT COALESCE(SUM(PlannedAmt),COALESCE(SUM(PlannedQty),COUNT(*))) "
+ "FROM C_Project WHERE C_ProjectType_ID=" + getC_ProjectType_ID()
+ " AND Processed<>'Y')");
// Date Restriction
@ -215,7 +215,7 @@ public class MProjectType extends X_C_ProjectType
String bpColumn = "C_BPartner_ID";
String pColumn = null;
//
StringBuffer sb = new StringBuffer("SELECT COALESCE(SUM(PlannedAmt),COALESCE(SUM(PlannedQty),COUNT(*))), ");
StringBuilder sb = new StringBuilder("SELECT COALESCE(SUM(PlannedAmt),COALESCE(SUM(PlannedQty),COUNT(*))), ");
String orderBy = null;
String groupBy = null;
//

View File

@ -806,7 +806,7 @@ public class MRMA extends X_M_RMA implements DocAction
*/
public String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(getDocumentNo());
// : Total Lines = 123.00 (#1)
sb.append(": ").
@ -824,7 +824,7 @@ public class MRMA extends X_M_RMA implements DocAction
*/
public MRMALine[] getChargeLines()
{
StringBuffer whereClause = new StringBuffer();
StringBuilder whereClause = new StringBuilder();
whereClause.append("IsActive='Y' AND M_RMA_ID=");
whereClause.append(get_ID());
whereClause.append(" AND C_Charge_ID IS NOT null");

View File

@ -224,7 +224,7 @@ public class MRecordAccess extends X_AD_Record_Access
{
String in = Msg.getMsg(ctx, "Include");
String ex = Msg.getMsg(ctx, "Exclude");
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(Msg.translate(ctx, "AD_Table_ID"))
.append("=").append(getTableName(ctx)).append(", ")
.append(Msg.translate(ctx, "Record_ID"))

View File

@ -139,7 +139,7 @@ public class MRegistrationValue extends X_A_RegistrationValue
*/
public String toString()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(getSeqNo()).append(": ")
.append(getRegistrationAttribute()).append("=").append(getName());
return sb.toString();

View File

@ -679,7 +679,7 @@ public class MRequest extends X_R_Request
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MRequest[");
StringBuilder sb = new StringBuilder ("MRequest[");
sb.append (get_ID()).append ("-").append(getDocumentNo()).append ("]");
return sb.toString ();
} // toString
@ -1079,7 +1079,7 @@ public class MRequest extends X_R_Request
String subject = Msg.translate(getCtx(), "R_Request_ID")
+ " " + Msg.getMsg(getCtx(), "Updated") + ": " + getDocumentNo();
// Message
StringBuffer message = new StringBuffer();
StringBuilder message = new StringBuilder();
// UpdatedBy: Joe
int UpdatedBy = Env.getAD_User_ID(getCtx());
MUser from = MUser.get(getCtx(), UpdatedBy);

View File

@ -334,7 +334,7 @@ public class MRequestType extends X_R_RequestType
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MRequestType[");
StringBuilder sb = new StringBuilder ("MRequestType[");
sb.append(get_ID()).append("-").append(getName())
.append ("]");
return sb.toString();
@ -357,7 +357,7 @@ public class MRequestType extends X_R_RequestType
String bpColumn = "C_BPartner_ID";
String pColumn = "M_Product_ID";
// PlannedAmt -> PlannedQty -> Count
StringBuffer sb = new StringBuffer("SELECT COUNT(*) "
StringBuilder sb = new StringBuilder("SELECT COUNT(*) "
+ "FROM R_Request WHERE R_RequestType_ID=" + getR_RequestType_ID()
+ " AND Processed<>'Y'");
// Date Restriction
@ -409,7 +409,7 @@ public class MRequestType extends X_R_RequestType
String bpColumn = "C_BPartner_ID";
String pColumn = "M_Product_ID";
//
StringBuffer sb = new StringBuffer("SELECT COUNT(*), ");
StringBuilder sb = new StringBuilder("SELECT COUNT(*), ");
String groupBy = null;
String orderBy = null;
//

View File

@ -120,7 +120,7 @@ public class MRequisition extends X_M_Requisition implements DocAction
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MRequisition[");
StringBuilder sb = new StringBuilder ("MRequisition[");
sb.append(get_ID()).append("-").append(getDocumentNo())
.append(",Status=").append(getDocStatus()).append(",Action=").append(getDocAction())
.append ("]");
@ -519,7 +519,7 @@ public class MRequisition extends X_M_Requisition implements DocAction
*/
public String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(getDocumentNo());
// - User
sb.append(" - ").append(getUserName());

View File

@ -109,7 +109,7 @@ public class MResourceAssignment extends X_S_ResourceAssignment
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("MResourceAssignment[ID=");
StringBuilder sb = new StringBuilder ("MResourceAssignment[ID=");
sb.append(get_ID())
.append(",S_Resource_ID=").append(getS_Resource_ID())
.append(",From=").append(getAssignDateFrom())

View File

@ -281,7 +281,7 @@ public class MResourceType extends X_S_ResourceType
@Override
public String toString()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("MResourceType[")
.append(get_ID())
.append(",Value=").append(getValue())

View File

@ -183,7 +183,7 @@ public class MRfQ extends X_C_RfQ
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MRfQ[");
StringBuilder sb = new StringBuilder ("MRfQ[");
sb.append(get_ID()).append(",Name=").append(getName())
.append(",QuoteType=").append(getQuoteType())
.append("]");

View File

@ -172,7 +172,7 @@ public class MRfQLine extends X_C_RfQLine
{
if (getM_Product_ID() == 0)
return "";
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
MProduct product = MProduct.get (getCtx(), getM_Product_ID());
sb.append(product.getName());
if (product.getDescription() != null && product.getDescription().length() > 0)
@ -186,7 +186,7 @@ public class MRfQLine extends X_C_RfQLine
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MRfQLine[");
StringBuilder sb = new StringBuilder ("MRfQLine[");
sb.append(get_ID()).append(",").append(getLine())
.append ("]");
return sb.toString ();

View File

@ -170,7 +170,7 @@ public class MRfQLineQty extends X_C_RfQLineQty
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MRfQLineQty[");
StringBuilder sb = new StringBuilder ("MRfQLineQty[");
sb.append(get_ID()).append(",Qty=").append(getQty())
.append(",Offer=").append(isOfferQty())
.append(",Purchase=").append(isPurchaseQty())

View File

@ -228,7 +228,7 @@ public class MRfQResponse extends X_C_RfQResponse
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MRfQResponse[");
StringBuilder sb = new StringBuilder ("MRfQResponse[");
sb.append(get_ID())
.append(",Complete=").append(isComplete())
.append(",Winner=").append(isSelectedWinner())

View File

@ -173,7 +173,7 @@ public class MRfQResponseLine extends X_C_RfQResponseLine
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MRfQResponseLine[");
StringBuilder sb = new StringBuilder ("MRfQResponseLine[");
sb.append(get_ID()).append(",Winner=").append(isSelectedWinner())
.append ("]");
return sb.toString ();

View File

@ -160,7 +160,7 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MRfQResponseLineQty[");
StringBuilder sb = new StringBuilder ("MRfQResponseLineQty[");
sb.append(get_ID()).append(",Rank=").append(getRanking())
.append(",Price=").append(getPrice())
.append(",Discount=").append(getDiscount())

View File

@ -560,7 +560,7 @@ public final class MRole extends X_AD_Role
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MRole[");
StringBuilder sb = new StringBuilder("MRole[");
sb.append(getAD_Role_ID()).append(",").append(getName())
.append(",UserLevel=").append(getUserLevel())
.append(",").append(getClientWhere(false))
@ -576,7 +576,7 @@ public final class MRole extends X_AD_Role
*/
public String toStringX (Properties ctx)
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(Msg.translate(ctx, "AD_Role_ID")).append("=").append(getName())
.append(" - ").append(Msg.translate(ctx, "IsCanExport")).append("=").append(isCanExport())
.append(" - ").append(Msg.translate(ctx, "IsCanReport")).append("=").append(isCanReport())
@ -706,7 +706,7 @@ public final class MRole extends X_AD_Role
log.fine("#" + m_orgAccess.length + (reload ? " - reload" : ""));
if (Ini.isClient())
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < m_orgAccess.length; i++)
{
if (i > 0)
@ -1032,7 +1032,7 @@ public final class MRole extends X_AD_Role
for (int i = 0; i < m_orgAccess.length; i++)
set.add(String.valueOf(m_orgAccess[i].AD_Client_ID));
//
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
Iterator<String> it = set.iterator();
boolean oneOnly = true;
while (it.hasNext())
@ -1112,7 +1112,7 @@ public final class MRole extends X_AD_Role
set.add(String.valueOf(m_orgAccess[i].AD_Org_ID));
}
//
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
Iterator<String> it = set.iterator();
boolean oneOnly = true;
while (it.hasNext())
@ -2062,7 +2062,7 @@ public final class MRole extends X_AD_Role
if (includes.size() != 0 && excludes.size() != 0)
log.warning("Mixing Include and Excluse rules - Will not return values");
StringBuffer where = new StringBuffer(" AND ");
StringBuilder where = new StringBuilder(" AND ");
if (includes.size() == 1)
where.append(whereColumnName).append("=").append(includes.get(0));
else if (includes.size() > 1)
@ -2115,7 +2115,7 @@ public final class MRole extends X_AD_Role
char c = mainSql.charAt(offset);
if (c == '.')
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
while (c != ' ' && c != ',' && c != '(') // delimeter
{
sb.insert(0, c);
@ -2364,7 +2364,7 @@ public final class MRole extends X_AD_Role
}
} // for all Table Access
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if (sbExclude.length() > 0)
sb.append(sbExclude).append(")");
if (sbInclude.length() > 0)
@ -2468,7 +2468,7 @@ public final class MRole extends X_AD_Role
String orgName = "*";
if (AD_Org_ID != 0)
orgName = MOrg.get(getCtx(), AD_Org_ID).getName();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(Msg.translate(getCtx(), "AD_Client_ID")).append("=")
.append(clientName).append(" - ")
.append(Msg.translate(getCtx(), "AD_Org_ID")).append("=")
@ -3032,7 +3032,7 @@ public final class MRole extends X_AD_Role
*/
public String getIncludedRolesWhereClause(String roleColumnSQL, List<Object> params)
{
StringBuffer whereClause = new StringBuffer();
StringBuilder whereClause = new StringBuilder();
if (params != null)
{
whereClause.append("?");

View File

@ -195,7 +195,7 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MRoleOrgAccess[");
StringBuilder sb = new StringBuilder("MRoleOrgAccess[");
sb.append("AD_Role_ID=").append(getAD_Role_ID())
.append(",AD_Client_ID=").append(getAD_Client_ID())
.append(",AD_Org_ID=").append(getAD_Org_ID())
@ -212,7 +212,7 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess
*/
public String toStringX (Properties ctx)
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(Msg.translate(ctx, "AD_Client_ID")).append("=").append(getClientName()).append(" - ")
.append(Msg.translate(ctx, "AD_Org_ID")).append("=").append(getOrgName());
return sb.toString();

View File

@ -184,7 +184,7 @@ public class MRule extends X_AD_Rule
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("MRule[");
StringBuilder sb = new StringBuilder ("MRule[");
sb.append (get_ID()).append ("-").append (getValue()).append ("]");
return sb.toString ();
} // toString

View File

@ -108,7 +108,7 @@ public class MSLAMeasure extends X_PA_SLA_Measure
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MSLAMeasure[");
StringBuilder sb = new StringBuilder ("MSLAMeasure[");
sb.append(get_ID()).append("-PA_SLA_Goal_ID=").append(getPA_SLA_Goal_ID())
.append(",").append(getDateTrx())
.append(",Actual=").append(getMeasureActual())

View File

@ -284,7 +284,7 @@ public class MScheduler extends X_AD_Scheduler
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MScheduler[");
StringBuilder sb = new StringBuilder ("MScheduler[");
sb.append (get_ID ()).append ("-").append (getName()).append ("]");
return sb.toString ();
} // toString

View File

@ -86,7 +86,7 @@ public class MSchedulerPara extends X_AD_Scheduler_Para
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MSchedulerPara[");
StringBuilder sb = new StringBuilder("MSchedulerPara[");
sb.append(get_ID()).append("-")
.append(getColumnName()).append("=").append(getParameterDefault())
.append("]");

View File

@ -538,7 +538,7 @@ public class MSequence extends X_AD_Sequence
return null;
// create DocumentNo
StringBuffer doc = new StringBuffer();
StringBuilder doc = new StringBuilder();
if (prefix != null && prefix.length() > 0)
doc.append(Env.parseVariable(prefix, po, trxName, false));

View File

@ -69,7 +69,7 @@ public class MSerNoCtl extends X_M_SerNoCtl
*/
public String createSerNo ()
{
StringBuffer name = new StringBuffer();
StringBuilder name = new StringBuilder();
if (getPrefix() != null)
name.append(getPrefix());
int no = getCurrentNext();

View File

@ -1313,7 +1313,7 @@ public final class MSetup
private void createPreference (String Attribute, String Value, int AD_Window_ID)
{
int AD_Preference_ID = getNextID(getAD_Client_ID(), "AD_Preference");
StringBuffer sqlCmd = new StringBuffer ("INSERT INTO AD_Preference ");
StringBuilder sqlCmd = new StringBuilder ("INSERT INTO AD_Preference ");
sqlCmd.append("(AD_Preference_ID,").append(m_stdColumns).append(",");
sqlCmd.append("Attribute,Value,AD_Window_ID) VALUES (");
sqlCmd.append(AD_Preference_ID).append(",").append(m_stdValues).append(",");

View File

@ -222,7 +222,7 @@ public class MStatus extends X_R_Status
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MStatus[");
StringBuilder sb = new StringBuilder ("MStatus[");
sb.append(get_ID()).append("-").append(getName())
.append ("]");
return sb.toString ();

View File

@ -229,7 +229,7 @@ public class MStatusCategory extends X_R_StatusCategory
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("RStatusCategory[");
StringBuilder sb = new StringBuilder ("RStatusCategory[");
sb.append (get_ID()).append ("-").append(getName()).append ("]");
return sb.toString ();
} // toString

View File

@ -294,7 +294,7 @@ public class MStore extends X_W_Store
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("WStore[");
StringBuilder sb = new StringBuilder ("WStore[");
sb.append(getWebContext(true))
.append ("]");
return sb.toString ();
@ -386,7 +386,7 @@ public class MStore extends X_W_Store
log.warning("No Message");
return false;
}
StringBuffer msgText = new StringBuffer();
StringBuilder msgText = new StringBuilder();
if (getEMailHeader() != null)
msgText.append(getEMailHeader());
msgText.append(message);

View File

@ -193,7 +193,7 @@ public class MSystem extends X_AD_System
+ " WHERE IsActive='Y' ORDER BY AD_Client_ID DESC";
PreparedStatement pstmt = null;
ResultSet rs = null;
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
try
{
pstmt = DB.prepareStatement (sql, null);

View File

@ -572,7 +572,7 @@ public class MTable extends X_AD_Table
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("MTable[");
StringBuilder sb = new StringBuilder ("MTable[");
sb.append (get_ID()).append ("-").append (getTableName()).append ("]");
return sb.toString ();
} // toString

View File

@ -67,7 +67,7 @@ public class MTableAccess extends X_AD_Table_Access
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MTableAccess[");
StringBuilder sb = new StringBuilder("MTableAccess[");
sb.append("AD_Role_ID=").append(getAD_Role_ID())
.append(",AD_Table_ID=").append(getAD_Table_ID())
.append(",Exclude=").append(isExclude())
@ -91,7 +91,7 @@ public class MTableAccess extends X_AD_Table_Access
{
String in = Msg.getMsg(ctx, "Include");
String ex = Msg.getMsg(ctx, "Exclude");
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(Msg.translate(ctx, "AD_Table_ID"))
.append("=").append(getTableName(ctx));
if (ACCESSTYPERULE_Accessing.equals(getAccessTypeRule()))

View File

@ -149,7 +149,7 @@ public class MTableScriptValidator extends X_AD_Table_ScriptValidator
@Override
public String toString()
{
StringBuffer sb = new StringBuffer ("MTableScriptValidator[");
StringBuilder sb = new StringBuilder ("MTableScriptValidator[");
sb.append(get_ID()).append("-").append(getAD_Table_ID()).append("-")
.append(getEventModelValidator()).append("]");
return sb.toString ();

View File

@ -91,7 +91,7 @@ public class MTask extends X_AD_Task
m_task = new Task(cmd);
m_task.start();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
while (true)
{
// Give it a bit of time
@ -135,7 +135,7 @@ public class MTask extends X_AD_Task
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MTask[");
StringBuilder sb = new StringBuilder ("MTask[");
sb.append(get_ID())
.append("-").append(getName())
.append(";Server=").append(isServerProcess())

View File

@ -529,7 +529,7 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
*/
public String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(getDocumentNo());
// : Total Lines = 123.00 (#1)
sb.append(": ")

View File

@ -111,7 +111,7 @@ public class MTransaction extends X_M_Transaction
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MTransaction[");
StringBuilder sb = new StringBuilder ("MTransaction[");
sb.append(get_ID()).append(",").append(getMovementType())
.append(",Qty=").append(getMovementQty())
.append(",M_Product_ID=").append(getM_Product_ID())

View File

@ -391,7 +391,7 @@ public class MTree extends MTree_Base
private void getNodeDetails ()
{
// SQL for Node Info
StringBuffer sqlNode = new StringBuffer();
StringBuilder sqlNode = new StringBuilder();
String sourceTable = "t";
String fromClause = getSourceTableName(false); // fully qualified
String columnNameX = getSourceTableName(true);
@ -615,7 +615,7 @@ public class MTree extends MTree_Base
int count = 0;
while (en.hasMoreElements())
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
MTreeNode nd = (MTreeNode)en.nextElement();
for (int i = 0; i < nd.getLevel(); i++)
sb.append(" ");
@ -670,7 +670,7 @@ public class MTree extends MTree_Base
*/
public String toString()
{
StringBuffer sb = new StringBuffer("MTree[");
StringBuilder sb = new StringBuilder("MTree[");
sb.append("AD_Tree_ID=").append(getAD_Tree_ID())
.append(", Name=").append(getName());
sb.append("]");

View File

@ -198,7 +198,7 @@ public class MUOM extends X_C_UOM
*/
public String toString()
{
StringBuffer sb = new StringBuffer("UOM[");
StringBuilder sb = new StringBuilder("UOM[");
sb.append("ID=").append(get_ID())
.append(", Name=").append(getName());
return sb.toString();

View File

@ -736,7 +736,7 @@ public class MUOMConversion extends X_C_UOM_Conversion
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MUOMConversion[");
StringBuilder sb = new StringBuilder ("MUOMConversion[");
sb.append(get_ID()).append("-C_UOM_ID=").append(getC_UOM_ID())
.append(",C_UOM_To_ID=").append(getC_UOM_To_ID())
.append(",M_Product_ID=").append(getM_Product_ID())

Some files were not shown because too many files have changed in this diff Show More