IDEMPIERE-455 Discover and fix FindBugs problems / Pattern: PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS
This commit is contained in:
parent
a5a198f358
commit
f8a4523e49
|
@ -871,8 +871,9 @@ public class CConnection implements Serializable, Cloneable
|
||||||
// System.out.println ("CConnection.setDataSource - " + m_ds + " - Client=" + Ini.isClient());
|
// System.out.println ("CConnection.setDataSource - " + m_ds + " - Client=" + Ini.isClient());
|
||||||
if (m_ds == null && Ini.isClient())
|
if (m_ds == null && Ini.isClient())
|
||||||
{
|
{
|
||||||
if (getDatabase() != null) // no db selected
|
AdempiereDatabase getDB = getDatabase();
|
||||||
m_ds = getDatabase().getDataSource(this);
|
if (getDB != null) // no db selected
|
||||||
|
m_ds = getDB.getDataSource(this);
|
||||||
// System.out.println ("CConnection.setDataSource - " + m_ds);
|
// System.out.println ("CConnection.setDataSource - " + m_ds);
|
||||||
}
|
}
|
||||||
return m_ds != null;
|
return m_ds != null;
|
||||||
|
|
|
@ -494,9 +494,9 @@ public class MInvoiceLine extends X_C_InvoiceLine
|
||||||
+ taxThisAmt + " Standard Tax Amt: " + taxStdAmt + " Line Net Amt: " + bd);
|
+ taxThisAmt + " Standard Tax Amt: " + taxStdAmt + " Line Net Amt: " + bd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int precision = getPrecision();
|
||||||
if (bd.scale() > getPrecision())
|
if (bd.scale() > precision)
|
||||||
bd = bd.setScale(getPrecision(), BigDecimal.ROUND_HALF_UP);
|
bd = bd.setScale(precision, BigDecimal.ROUND_HALF_UP);
|
||||||
super.setLineNetAmt (bd);
|
super.setLineNetAmt (bd);
|
||||||
} // setLineNetAmt
|
} // setLineNetAmt
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -404,9 +404,9 @@ public class MOrderLine extends X_C_OrderLine
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
int precision = getPrecision();
|
||||||
if (bd.scale() > getPrecision())
|
if (bd.scale() > precision)
|
||||||
bd = bd.setScale(getPrecision(), BigDecimal.ROUND_HALF_UP);
|
bd = bd.setScale(precision, BigDecimal.ROUND_HALF_UP);
|
||||||
super.setLineNetAmt (bd);
|
super.setLineNetAmt (bd);
|
||||||
} // setLineNetAmt
|
} // setLineNetAmt
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,7 @@ public class MStore extends X_W_Store
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String msg = email.send();
|
String msg = email.send();
|
||||||
if (EMail.SENT_OK.equals (email.send ()))
|
if (EMail.SENT_OK.equals (msg))
|
||||||
{
|
{
|
||||||
log.info("Sent EMail " + subject + " to " + to);
|
log.info("Sent EMail " + subject + " to " + to);
|
||||||
return true;
|
return true;
|
||||||
|
@ -437,7 +437,7 @@ public class MStore extends X_W_Store
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String msg = email.send();
|
String msg = email.send();
|
||||||
if (EMail.SENT_OK.equals (email.send ()))
|
if (EMail.SENT_OK.equals (msg))
|
||||||
{
|
{
|
||||||
log.info("Sent Test EMail to " + getWStoreEMail());
|
log.info("Sent Test EMail to " + getWStoreEMail());
|
||||||
return "OK";
|
return "OK";
|
||||||
|
|
|
@ -186,8 +186,9 @@ public class ScheduleUtil
|
||||||
ResultSet rs = pstmt.executeQuery();
|
ResultSet rs = pstmt.executeQuery();
|
||||||
while (rs.next())
|
while (rs.next())
|
||||||
{
|
{
|
||||||
ma = new MAssignmentSlot (TimeUtil.getDay(rs.getTimestamp(2)),
|
Timestamp date = rs.getTimestamp(2);
|
||||||
TimeUtil.getNextDay(rs.getTimestamp(2)), // user entered date need to convert to not including end time
|
ma = new MAssignmentSlot (TimeUtil.getDay(date),
|
||||||
|
TimeUtil.getNextDay(date), // user entered date need to convert to not including end time
|
||||||
Msg.getMsg(m_ctx, "NonBusinessDay"), rs.getString(1),
|
Msg.getMsg(m_ctx, "NonBusinessDay"), rs.getString(1),
|
||||||
MAssignmentSlot.STATUS_NonBusinessDay);
|
MAssignmentSlot.STATUS_NonBusinessDay);
|
||||||
log.finer("- NonBusinessDay " + ma);
|
log.finer("- NonBusinessDay " + ma);
|
||||||
|
|
|
@ -614,9 +614,10 @@ public class ConfigurationData
|
||||||
//
|
//
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
String admail = adminEMail.toString();
|
||||||
EMail email = new EMail (new Properties(),
|
EMail email = new EMail (new Properties(),
|
||||||
mailServer.getHostName (),
|
mailServer.getHostName (),
|
||||||
adminEMail.toString (), adminEMail.toString(),
|
admail, admail,
|
||||||
"Adempiere Server Setup Test",
|
"Adempiere Server Setup Test",
|
||||||
"Test: " + getProperties());
|
"Test: " + getProperties());
|
||||||
email.createAuthenticator (mailUser, mailPassword);
|
email.createAuthenticator (mailUser, mailPassword);
|
||||||
|
|
|
@ -1179,8 +1179,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
||||||
|
|
||||||
if (!detailTab)
|
if (!detailTab)
|
||||||
{
|
{
|
||||||
logger.info(e.getMessage());
|
|
||||||
String dbInfo = e.getMessage();
|
String dbInfo = e.getMessage();
|
||||||
|
logger.info(dbInfo);
|
||||||
if (adTabbox.getSelectedGridTab() != null && adTabbox.getSelectedGridTab().isQueryActive())
|
if (adTabbox.getSelectedGridTab() != null && adTabbox.getSelectedGridTab().isQueryActive())
|
||||||
dbInfo = "[ " + dbInfo + " ]";
|
dbInfo = "[ " + dbInfo + " ]";
|
||||||
breadCrumb.setStatusDB(dbInfo, e);
|
breadCrumb.setStatusDB(dbInfo, e);
|
||||||
|
|
|
@ -234,8 +234,9 @@ public class WSQLProcess extends ADForm implements EventListener<Event>
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "process statement: " + sql + " - " + e.toString());
|
String exception = e.toString();
|
||||||
result.append("===> ").append(e.toString());
|
log.log(Level.SEVERE, "process statement: " + sql + " - " + exception);
|
||||||
|
result.append("===> ").append(exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
|
|
Loading…
Reference in New Issue