IDEMPIERE-2284 MProductCategory/MAssetGroup s_cache useless

This commit is contained in:
Carlos Ruiz 2014-10-29 13:33:26 -05:00
parent 5b37a986c4
commit 1912d32e8d
2 changed files with 9 additions and 4 deletions

View File

@ -58,6 +58,8 @@ public class MAssetGroup extends X_A_Asset_Group
ag = new MAssetGroup(ctx, A_Asset_Group_ID, null); ag = new MAssetGroup(ctx, A_Asset_Group_ID, null);
if (ag != null && ag.get_ID() != A_Asset_Group_ID) if (ag != null && ag.get_ID() != A_Asset_Group_ID)
ag = null; ag = null;
else
s_cache.put(A_Asset_Group_ID, ag);
// //
return ag; return ag;
} }

View File

@ -52,10 +52,13 @@ public class MProductCategory extends X_M_Product_Category
public static MProductCategory get (Properties ctx, int M_Product_Category_ID) public static MProductCategory get (Properties ctx, int M_Product_Category_ID)
{ {
Integer ii = new Integer (M_Product_Category_ID); Integer ii = new Integer (M_Product_Category_ID);
MProductCategory pc = (MProductCategory)s_cache.get(ii); MProductCategory retValue = (MProductCategory)s_cache.get(ii);
if (pc == null) if (retValue != null)
pc = new MProductCategory (ctx, M_Product_Category_ID, null); return retValue;
return pc; retValue = new MProductCategory (ctx, M_Product_Category_ID, null);
if (retValue.get_ID () != 0)
s_cache.put (M_Product_Category_ID, retValue);
return retValue;
} // get } // get
/** /**