IDEMPIERE-4723 - Clean up code -> MT/MU/MW* classes (#823)

This commit is contained in:
Diego Ruiz 2021-08-11 13:36:27 +02:00 committed by GitHub
parent e41fcdea2f
commit 29343610ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 7 additions and 140 deletions

View File

@ -57,9 +57,6 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport
super (ctx, AD_Tab_ID, trxName); super (ctx, AD_Tab_ID, trxName);
if (AD_Tab_ID == 0) if (AD_Tab_ID == 0)
{ {
// setAD_Window_ID (0);
// setAD_Table_ID (0);
// setName (null);
setEntityType (ENTITYTYPE_UserMaintained); // U setEntityType (ENTITYTYPE_UserMaintained); // U
setHasTree (false); setHasTree (false);
setIsReadOnly (false); setIsReadOnly (false);
@ -193,7 +190,6 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport
*/ */
protected boolean beforeSave (boolean newRecord) protected boolean beforeSave (boolean newRecord)
{ {
// UPDATE AD_Tab SET IsInsertRecord='N' WHERE IsInsertRecord='Y' AND IsReadOnly='Y'
if (isReadOnly() && isInsertRecord()) if (isReadOnly() && isInsertRecord())
setIsInsertRecord(false); setIsInsertRecord(false);
//RF[2826384] //RF[2826384]

View File

@ -259,8 +259,6 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport
super (ctx, AD_Table_ID, trxName); super (ctx, AD_Table_ID, trxName);
if (AD_Table_ID == 0) if (AD_Table_ID == 0)
{ {
// setName (null);
// setTableName (null);
setAccessLevel (ACCESSLEVEL_SystemOnly); // 4 setAccessLevel (ACCESSLEVEL_SystemOnly); // 4
setEntityType (ENTITYTYPE_UserMaintained); // U setEntityType (ENTITYTYPE_UserMaintained); // U
setIsChangeLog (false); setIsChangeLog (false);

View File

@ -150,15 +150,12 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport
super (ctx, C_Tax_ID, trxName); super (ctx, C_Tax_ID, trxName);
if (C_Tax_ID == 0) if (C_Tax_ID == 0)
{ {
// setC_Tax_ID (0); PK
setIsDefault (false); setIsDefault (false);
setIsDocumentLevel (true); setIsDocumentLevel (true);
setIsSummary (false); setIsSummary (false);
setIsTaxExempt (false); setIsTaxExempt (false);
// setName (null);
setRate (Env.ZERO); setRate (Env.ZERO);
setRequiresTaxCertificate (false); setRequiresTaxCertificate (false);
// setC_TaxCategory_ID (0); // FK
setSOPOType (SOPOTYPE_Both); setSOPOType (SOPOTYPE_Both);
setValidFrom (TimeUtil.getDay(1990,1,1)); setValidFrom (TimeUtil.getDay(1990,1,1));
setIsSalesTax(false); setIsSalesTax(false);

View File

@ -46,7 +46,6 @@ public class MTaxCategory extends X_C_TaxCategory
super (ctx, C_TaxCategory_ID, trxName); super (ctx, C_TaxCategory_ID, trxName);
if (C_TaxCategory_ID == 0) if (C_TaxCategory_ID == 0)
{ {
// setName (null);
setIsDefault (false); setIsDefault (false);
} }
} // MTaxCategory } // MTaxCategory

View File

@ -84,10 +84,6 @@ public class MTest extends X_Test
setC_Currency_ID(100); // USD setC_Currency_ID(100); // USD
setC_Location_ID(109); // Monroe setC_Location_ID(109); // Monroe
setC_UOM_ID(100); // Each setC_UOM_ID(100); // Each
// setC_BPartner_ID(C_BPartner_ID);
// setC_Payment_ID(C_Payment_ID);
// setM_Locator_ID(M_Locator_ID);
// setM_Product_ID(M_Product_ID);
} // MTest } // MTest
@ -158,14 +154,6 @@ public class MTest extends X_Test
System.out.println("->" + t2.getCharacterData() + "<-"); System.out.println("->" + t2.getCharacterData() + "<-");
t2.delete(true); t2.delete(true);
/** Volume Test
for (int i = 1; i < 20000; i++)
{
new MTest (ctx, "test", i).saveEx();
}
/** */
} // main } // main
} // MTest } // MTest

View File

@ -61,12 +61,8 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
super (ctx, S_TimeExpense_ID, trxName); super (ctx, S_TimeExpense_ID, trxName);
if (S_TimeExpense_ID == 0) if (S_TimeExpense_ID == 0)
{ {
// setC_BPartner_ID (0);
setDateReport (new Timestamp (System.currentTimeMillis ())); setDateReport (new Timestamp (System.currentTimeMillis ()));
// setDocumentNo (null);
setIsApproved (false); setIsApproved (false);
// setM_PriceList_ID (0);
// setM_Warehouse_ID (0);
super.setProcessed (false); super.setProcessed (false);
setProcessing(false); setProcessing(false);
} }
@ -447,8 +443,6 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
if (m_processMsg != null) if (m_processMsg != null)
return false; return false;
// Close Not delivered Qty
// setDocAction(DOCACTION_None);
return true; return true;
} // closeIt } // closeIt

View File

@ -49,8 +49,6 @@ public class MTimeExpenseLine extends X_S_TimeExpenseLine
super (ctx, S_TimeExpenseLine_ID, trxName); super (ctx, S_TimeExpenseLine_ID, trxName);
if (S_TimeExpenseLine_ID == 0) if (S_TimeExpenseLine_ID == 0)
{ {
// setS_TimeExpenseLine_ID (0); // PK
// setS_TimeExpense_ID (0); // Parent
setQty(Env.ONE); setQty(Env.ONE);
setQtyInvoiced(Env.ZERO); setQtyInvoiced(Env.ZERO);
setQtyReimbursed(Env.ZERO); setQtyReimbursed(Env.ZERO);

View File

@ -48,12 +48,8 @@ public class MTransaction extends X_M_Transaction
super (ctx, M_Transaction_ID, trxName); super (ctx, M_Transaction_ID, trxName);
if (M_Transaction_ID == 0) if (M_Transaction_ID == 0)
{ {
// setM_Transaction_ID (0); // PK
// setM_Locator_ID (0);
// setM_Product_ID (0);
setMovementDate (new Timestamp(System.currentTimeMillis())); setMovementDate (new Timestamp(System.currentTimeMillis()));
setMovementQty (Env.ZERO); setMovementQty (Env.ZERO);
// setMovementType (MOVEMENTTYPE_CustomerShipment);
} }
} // MTransaction } // MTransaction

View File

@ -294,8 +294,6 @@ public class MTree extends MTree_Base
addToTree (node_ID, parent_ID, seqNo, onBar); // calls getNodeDetail addToTree (node_ID, parent_ID, seqNo, onBar); // calls getNodeDetail
} }
// //
//closing the rowset will also close connection for oracle rowset implementation
//m_nodeRowSet.close();
m_nodeRowSet = null; m_nodeRowSet = null;
m_nodeIdMap = null; m_nodeIdMap = null;
} }
@ -557,11 +555,10 @@ public class MTree extends MTree_Base
MTreeNode retValue = null; MTreeNode retValue = null;
try try
{ {
//m_nodeRowSet.beforeFirst();
ArrayList<Integer> nodeList = m_nodeIdMap.get(Integer.valueOf(node_ID)); ArrayList<Integer> nodeList = m_nodeIdMap.get(Integer.valueOf(node_ID));
int size = nodeList != null ? nodeList.size() : 0; int size = nodeList != null ? nodeList.size() : 0;
int i = 0; int i = 0;
//while (m_nodeRowSet.next())
while (i < size) while (i < size)
{ {
Integer nodeId = nodeList.get(i); Integer nodeId = nodeList.get(i);
@ -638,7 +635,6 @@ public class MTree extends MTree_Base
description = userDef.getDescription(); description = userDef.getDescription();
} }
} }
// log.fine("getNodeDetail - " + name + " - " + actionColor + " - " + access);
// //
if (access != null // rw or ro for Role if (access != null // rw or ro for Role
|| m_editable) // Menu Window can see all || m_editable) // Menu Window can see all
@ -694,28 +690,6 @@ public class MTree extends MTree_Base
} }
} // trimTree } // trimTree
/**
* Diagnostics: Print tree
*/
/*private void dumpTree()
{
Enumeration<?> en = m_root.preorderEnumeration();
int count = 0;
while (en.hasMoreElements())
{
StringBuilder sb = new StringBuilder();
MTreeNode nd = (MTreeNode)en.nextElement();
for (int i = 0; i < nd.getLevel(); i++)
sb.append(" ");
sb.append("ID=").append(nd.getNode_ID())
.append(", SeqNo=").append(nd.getSeqNo())
.append(" ").append(nd.getName());
System.out.println(sb.toString());
count++;
}
System.out.println("Count=" + count);
} // diagPrintTree*/
/** /**
* Get Root node * Get Root node
* @return root * @return root

View File

@ -56,7 +56,7 @@ public class MTreeNode extends DefaultMutableTreeNode
int parent_ID, boolean isSummary, String imageIndicator, boolean onBar, Color color) int parent_ID, boolean isSummary, String imageIndicator, boolean onBar, Color color)
{ {
super(); super();
// log.fine( "MTreeNode Node_ID=" + node_ID + ", Parent_ID=" + parent_ID + " - " + name);
m_node_ID = node_ID; m_node_ID = node_ID;
m_seqNo = seqNo; m_seqNo = seqNo;
m_name = name; m_name = name;
@ -236,8 +236,7 @@ public class MTreeNode extends DefaultMutableTreeNode
*/ */
public String toString() public String toString()
{ {
return // m_node_ID + "/" + m_parent_ID + " " + m_seqNo + " - " + return m_name;
m_name;
} // toString } // toString
/** /**
@ -331,10 +330,6 @@ public class MTreeNode extends DefaultMutableTreeNode
imageIndex = TYPE_PROCESS; imageIndex = TYPE_PROCESS;
else if (imageIndicator.equals(MWFNode.ACTION_SubWorkflow)) // WorkFlow else if (imageIndicator.equals(MWFNode.ACTION_SubWorkflow)) // WorkFlow
imageIndex = TYPE_WORKFLOW; imageIndex = TYPE_WORKFLOW;
/*
else if (imageIndicator.equals(MWFNode.ACTION_UserWorkbench)) // Workbench
imageIndex = TYPE_WORKBENCH;
*/
else if (imageIndicator.equals(MWFNode.ACTION_SetVariable)) // Set Variable else if (imageIndicator.equals(MWFNode.ACTION_SetVariable)) // Set Variable
imageIndex = TYPE_SETVARIABLE; imageIndex = TYPE_SETVARIABLE;
else if (imageIndicator.equals(MWFNode.ACTION_UserChoice)) // User Choice else if (imageIndicator.equals(MWFNode.ACTION_UserChoice)) // User Choice

View File

@ -254,8 +254,6 @@ public class MTree_Base extends X_AD_Tree implements ImmutablePOSupport
super(ctx, AD_Tree_ID, trxName); super(ctx, AD_Tree_ID, trxName);
if (AD_Tree_ID == 0) if (AD_Tree_ID == 0)
{ {
// setName (null);
// setTreeType (null);
setIsAllNodes (true); // complete tree setIsAllNodes (true); // complete tree
setIsDefault(false); setIsDefault(false);
} }

View File

@ -137,8 +137,6 @@ public class MUOMConversion extends X_C_UOM_Conversion implements ImmutablePOSup
endDate.add(Calendar.MINUTE, minutes); endDate.add(Calendar.MINUTE, minutes);
// //
Timestamp retValue = new Timestamp(endDate.getTimeInMillis()); Timestamp retValue = new Timestamp(endDate.getTimeInMillis());
// log.config( "TimeUtil.getEndDate", "Start=" + startDate
// + ", Qty=" + qty + ", End=" + retValue);
return retValue; return retValue;
} // startDate } // startDate

View File

@ -210,7 +210,7 @@ public class MUser extends X_AD_User implements ImmutablePOSupport
} }
boolean hash_password = MSysConfig.getBooleanValue(MSysConfig.USER_PASSWORD_HASH, false); boolean hash_password = MSysConfig.getBooleanValue(MSysConfig.USER_PASSWORD_HASH, false);
boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false);
// ArrayList<KeyNamePair> clientList = new ArrayList<KeyNamePair>();
ArrayList<Integer> clientsValidated = new ArrayList<Integer>(); ArrayList<Integer> clientsValidated = new ArrayList<Integer>();
MUser retValue = null; MUser retValue = null;
@ -663,34 +663,9 @@ public class MUser extends X_AD_User implements ImmutablePOSupport
{ {
if (ia == null) if (ia == null)
return "NoEmail"; return "NoEmail";
else return ia.getAddress(); else
/* return ia.getAddress();
if (true)
return null;
Hashtable<String,String> env = new Hashtable<String,String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
// env.put(Context.PROVIDER_URL, "dns://admin.adempiere.org");
try
{
DirContext ctx = new InitialDirContext(env);
// Attributes atts = ctx.getAttributes("admin");
Attributes atts = ctx.getAttributes("dns://admin.adempiere.org", new String[] {"MX"});
NamingEnumeration en = atts.getAll();
// NamingEnumeration en = ctx.list("adempiere.org");
while (en.hasMore())
{
System.out.println(en.next());
}
}
catch (Exception e)
{
e.printStackTrace();
return e.getLocalizedMessage();
}
return null;
*/
} // validateEmail } // validateEmail
/** /**

View File

@ -149,11 +149,8 @@ public class MUserDefWin extends X_AD_UserDef_Win implements ImmutablePOSupport
{ {
// parameters // parameters
final int AD_Org_ID = Env.getAD_Org_ID(ctx); final int AD_Org_ID = Env.getAD_Org_ID(ctx);
//final int anyOrg = 0;
final int AD_Role_ID = Env.getAD_Role_ID(ctx); final int AD_Role_ID = Env.getAD_Role_ID(ctx);
//final String anyRole = "NULL";
final int AD_User_ID = Env.getAD_User_ID(ctx); final int AD_User_ID = Env.getAD_User_ID(ctx);
//final String anyUser = "NULL";
// Check Cache // Check Cache
String key = new StringBuilder().append(window_ID).append("_") String key = new StringBuilder().append(window_ID).append("_")

View File

@ -128,18 +128,6 @@ public class MUserOrgAccess extends X_AD_User_OrgAccess
setAD_User_ID (AD_User_ID); setAD_User_ID (AD_User_ID);
} // MUserOrgAccess } // MUserOrgAccess
/**
* User Constructor
* param user user
* param AD_Org_ID org
*
public MUserOrgAccess (MUser user, int AD_Org_ID)
{
this (user.getCtx(), 0, user.get_TrxName());
setClientOrg (user.getAD_Client_ID(), AD_Org_ID);
setAD_User_ID (user.getAD_User_ID());
} // MUserOrgAccess
/** /**
* String Representation * String Representation
* @return info * @return info

View File

@ -137,9 +137,6 @@ public class MWarehouse extends X_M_Warehouse implements ImmutablePOSupport
super(ctx, M_Warehouse_ID, trxName); super(ctx, M_Warehouse_ID, trxName);
if (M_Warehouse_ID == 0) if (M_Warehouse_ID == 0)
{ {
// setValue (null);
// setName (null);
// setC_Location_ID (0);
setSeparator ("*"); // * setSeparator ("*"); // *
} }
} // MWarehouse } // MWarehouse

View File

@ -47,8 +47,6 @@ public class MWindowAccess extends X_AD_Window_Access
throw new IllegalArgumentException("Multi-Key"); throw new IllegalArgumentException("Multi-Key");
else else
{ {
// setAD_Role_ID (0);
// setAD_Window_ID (0);
setIsReadWrite (true); setIsReadWrite (true);
} }
} // MWindowAccess } // MWindowAccess

View File

@ -16,18 +16,6 @@ public class MXIFAJournal extends X_I_FAJournal
public MXIFAJournal (Properties ctx, int I_FAJournal_ID, String trxName) public MXIFAJournal (Properties ctx, int I_FAJournal_ID, String trxName)
{ {
super (ctx, I_FAJournal_ID, trxName); super (ctx, I_FAJournal_ID, trxName);
// if (I_FAJournal_ID == 0)
// {
// setIsDepreciated (false);
// setIsFullyDepreciated (false);
// setValue (null);
// setName (null);
// setIsInPosession (false);
// setIsOwned (false);
// setA_Asset_Group_ID (0);
// setIsDisposed (false);
// setM_AttributeSetInstance_ID(0);
// }
} // MXIFAJournal } // MXIFAJournal
/** /**

View File

@ -61,8 +61,6 @@ public class MYear extends X_C_Year
super (ctx, C_Year_ID, trxName); super (ctx, C_Year_ID, trxName);
if (C_Year_ID == 0) if (C_Year_ID == 0)
{ {
// setC_Calendar_ID (0);
// setYear (null);
setProcessing (false); // N setProcessing (false); // N
} }
} // MYear } // MYear

View File

@ -239,11 +239,6 @@ public final class NaturalAccountMap<K,V> extends CCache<K,V>
if (IsDocControlled == null || IsDocControlled.length() == 0) if (IsDocControlled == null || IsDocControlled.length() == 0)
IsDocControlled = "N"; IsDocControlled = "N";
// log.config( "Value=" + Value + ", AcctType=" + AccountType
// + ", Sign=" + AccountSign + ", Doc=" + docControlled
// + ", Summary=" + summary + " - " + Name + " - " + Description);
try try
{ {
// Try to find - allows to use same natural account for multiple default accounts // Try to find - allows to use same natural account for multiple default accounts