From 3f02050b4111e1c347d4d1744a36c161d35cbaad Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 7 Dec 2012 09:46:54 -0500 Subject: [PATCH] IDEMPIERE-455 Discover and fix FindBugs problems / Pattern GC_UNRELATED_TYPES (Thanks to Richard Morales) --- org.adempiere.base/src/org/compiere/model/GridTable.java | 7 +++---- .../src/org/compiere/model/MClientShare.java | 2 +- .../src/org/compiere/model/MLookupFactory.java | 6 +++--- org.adempiere.base/src/org/compiere/model/MMailText.java | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 391dbe77b3..6069e08b2a 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -97,7 +97,7 @@ public class GridTable extends AbstractTableModel /** * */ - private static final long serialVersionUID = 2328810326636468776L; + private static final long serialVersionUID = -3181940154166340664L; public static final String DATA_REFRESH_MESSAGE = "Refreshed"; @@ -109,7 +109,7 @@ public class GridTable extends AbstractTableModel * @param TableName table name * @param WindowNo window no * @param TabNo tab no - * @param withAccessControl if true adds AD_Client/Org restrictuins + * @param withAccessControl if true adds AD_Client/Org restrictions */ public GridTable(Properties ctx, int AD_Table_ID, String TableName, int WindowNo, int TabNo, boolean withAccessControl) @@ -878,7 +878,6 @@ public class GridTable extends AbstractTableModel * @param col col * @param ascending ascending */ - @SuppressWarnings("unchecked") public void sort (int col, boolean ascending) { log.info("#" + col + " " + ascending); @@ -1144,7 +1143,7 @@ public class GridTable extends AbstractTableModel Collections.reverse(toremove); for(Integer row : toremove) { - m_sort.remove(row); + m_sort.remove(row.intValue()); } } } diff --git a/org.adempiere.base/src/org/compiere/model/MClientShare.java b/org.adempiere.base/src/org/compiere/model/MClientShare.java index d4089dc156..663aa1949e 100644 --- a/org.adempiere.base/src/org/compiere/model/MClientShare.java +++ b/org.adempiere.base/src/org/compiere/model/MClientShare.java @@ -117,7 +117,7 @@ public class MClientShare extends X_AD_ClientShare s_shares.put("0_0", Boolean.TRUE); } // load StringBuilder key = new StringBuilder().append(AD_Client_ID).append("_").append(AD_Table_ID); - return s_shares.get(key); + return s_shares.get(key.toString()); } // load /** Shared Info */ diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java index ca75e9d1d3..4d80ac42ae 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java @@ -363,7 +363,7 @@ public class MLookupFactory { // Try cache - assume no language change StringBuilder key = new StringBuilder().append(Env.getAD_Client_ID(ctx)).append("|").append(String.valueOf(AD_Reference_Value_ID)); - MLookupInfo retValue = (MLookupInfo)s_cacheRefTable.get(key); + MLookupInfo retValue = (MLookupInfo)s_cacheRefTable.get(key.toString()); if (retValue != null) { s_log.finest("Cache: " + retValue); @@ -687,8 +687,8 @@ public class MLookupFactory //try cache StringBuilder cacheKey = new StringBuilder().append(Env.getAD_Client_ID(ctx)).append("|").append(TableName).append(".").append(KeyColumn); - if (s_cacheRefTable.containsKey(cacheKey)) - return s_cacheRefTable.get(cacheKey).cloneIt(); + if (s_cacheRefTable.containsKey(cacheKey.toString())) + return s_cacheRefTable.get(cacheKey.toString()).cloneIt(); ArrayList list = getListIdentifiers(TableName); diff --git a/org.adempiere.base/src/org/compiere/model/MMailText.java b/org.adempiere.base/src/org/compiere/model/MMailText.java index c42a938faf..27c4843d7c 100644 --- a/org.adempiere.base/src/org/compiere/model/MMailText.java +++ b/org.adempiere.base/src/org/compiere/model/MMailText.java @@ -308,7 +308,7 @@ public class MMailText extends X_R_MailText if (m_bpartner != null && m_bpartner.getAD_Language() != null) { StringBuilder key = new StringBuilder().append(m_bpartner.getAD_Language()).append(get_ID()); - MMailTextTrl trl = s_cacheTrl.get(key); + MMailTextTrl trl = s_cacheTrl.get(key.toString()); if (trl == null) { trl = getTranslation(m_bpartner.getAD_Language());