From 62b90fe6ca364d72ca16179324b2cd920750f938 Mon Sep 17 00:00:00 2001 From: Diego Ruiz <12065321+d-ruiz@users.noreply.github.com> Date: Fri, 30 Jul 2021 01:00:50 +0200 Subject: [PATCH] IDEMPIERE-4723 - Clean up code -> MQ/MR/MS* classes (#802) --- .../src/org/compiere/model/MQuery.java | 1 - .../src/org/compiere/model/MRMA.java | 23 +-- .../src/org/compiere/model/MRecurring.java | 3 - .../src/org/compiere/model/MRefList.java | 4 - .../src/org/compiere/model/MRefTable.java | 3 - .../src/org/compiere/model/MRegistration.java | 1 - .../src/org/compiere/model/MReportCube.java | 2 - .../src/org/compiere/model/MReportView.java | 2 - .../src/org/compiere/model/MRequest.java | 97 +----------- .../org/compiere/model/MRequestAction.java | 2 - .../org/compiere/model/MRequestProcessor.java | 4 - .../src/org/compiere/model/MRequestType.java | 11 +- .../src/org/compiere/model/MRequisition.java | 9 +- .../org/compiere/model/MRequisitionLine.java | 2 - .../compiere/model/MResourceAssignment.java | 40 ----- .../model/MRevenueRecognitionPlan.java | 7 - .../src/org/compiere/model/MRfQ.java | 5 - .../src/org/compiere/model/MRfQLineQty.java | 2 - .../org/compiere/model/MRfQResponseLine.java | 2 - .../compiere/model/MRfQResponseLineQty.java | 4 - .../src/org/compiere/model/MRole.java | 103 ++----------- .../src/org/compiere/model/MSLAMeasure.java | 1 - .../src/org/compiere/model/MSequence.java | 142 +----------------- .../src/org/compiere/model/MSerNoCtl.java | 2 - .../src/org/compiere/model/MSetup.java | 5 - .../compiere/model/MShippingTransaction.java | 63 -------- .../org/compiere/model/MStatusCategory.java | 1 - .../org/compiere/model/MStorageOnHand.java | 4 - .../src/org/compiere/model/MSysConfig.java | 5 - .../src/org/compiere/model/MSystem.java | 21 +-- 30 files changed, 24 insertions(+), 547 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MQuery.java b/org.adempiere.base/src/org/compiere/model/MQuery.java index 1b06ea8460..f11c51cda9 100644 --- a/org.adempiere.base/src/org/compiere/model/MQuery.java +++ b/org.adempiere.base/src/org/compiere/model/MQuery.java @@ -79,7 +79,6 @@ public class MQuery implements Serializable, Cloneable if (rows < 1) return reportQuery; - // Msg.getMsg(Env.getCtx(), "Parameter") boolean trl = !Env.isBaseLanguage(ctx, "AD_Process_Para"); if (!trl) SQL = "SELECT ip.ParameterName,ip.P_String,ip.P_String_To," // 1..3 diff --git a/org.adempiere.base/src/org/compiere/model/MRMA.java b/org.adempiere.base/src/org/compiere/model/MRMA.java index 64c886f95b..14c0ed503f 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMA.java +++ b/org.adempiere.base/src/org/compiere/model/MRMA.java @@ -60,10 +60,6 @@ public class MRMA extends X_M_RMA implements DocAction super (ctx, M_RMA_ID, trxName); if (M_RMA_ID == 0) { - // setName (null); - // setSalesRep_ID (0); - // setC_DocType_ID (0); - // setM_InOut_ID (0); setDocAction (DOCACTION_Complete); // CO setDocStatus (DOCSTATUS_Drafted); // DR setIsApproved(false); @@ -234,10 +230,7 @@ public class MRMA extends X_M_RMA implements DocAction */ public File createPDF (File file) { - // ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID()); - // if (re == null) - return null; - // return re.getPDF(file); + return null; } // createPDF @@ -442,15 +435,6 @@ public class MRMA extends X_M_RMA implements DocAction if (!isApproved()) approveIt(); if (log.isLoggable(Level.INFO)) log.info("completeIt - " + toString()); - // - /* - Flow for the creation of the credit memo document changed - if (true) - { - m_processMsg = "Need to code creating the credit memo"; - return DocAction.STATUS_InProgress; - } - */ // Counter Documents MRMA counter = createCounterDoc(); @@ -476,11 +460,6 @@ public class MRMA extends X_M_RMA implements DocAction */ protected void setDefiniteDocumentNo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - /* No Document Date on RMA - if (dt.isOverwriteDateOnComplete()) { - setDate???(new Timestamp (System.currentTimeMillis())); - } - */ if (dt.isOverwriteSeqOnComplete()) { String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); if (value != null) diff --git a/org.adempiere.base/src/org/compiere/model/MRecurring.java b/org.adempiere.base/src/org/compiere/model/MRecurring.java index 43c1928c54..117e08fc14 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecurring.java +++ b/org.adempiere.base/src/org/compiere/model/MRecurring.java @@ -42,12 +42,9 @@ public class MRecurring extends X_C_Recurring super (ctx, C_Recurring_ID, trxName); if (C_Recurring_ID == 0) { - // setC_Recurring_ID (0); // PK setDateNextRun (new Timestamp(System.currentTimeMillis())); setFrequencyType (FREQUENCYTYPE_Monthly); setFrequency(1); - // setName (null); - // setRecurringType (null); setRunsMax (1); setRunsRemaining (0); } diff --git a/org.adempiere.base/src/org/compiere/model/MRefList.java b/org.adempiere.base/src/org/compiere/model/MRefList.java index 2e9851e84f..b3303f34e9 100644 --- a/org.adempiere.base/src/org/compiere/model/MRefList.java +++ b/org.adempiere.base/src/org/compiere/model/MRefList.java @@ -280,11 +280,7 @@ public class MRefList extends X_AD_Ref_List super (ctx, AD_Ref_List_ID, trxName); if (AD_Ref_List_ID == 0) { - // setAD_Reference_ID (0); - // setAD_Ref_List_ID (0); setEntityType (ENTITYTYPE_UserMaintained); // U - // setName (null); - // setValue (null); } } // MRef_List diff --git a/org.adempiere.base/src/org/compiere/model/MRefTable.java b/org.adempiere.base/src/org/compiere/model/MRefTable.java index 74a5cb1957..f696b78e7b 100644 --- a/org.adempiere.base/src/org/compiere/model/MRefTable.java +++ b/org.adempiere.base/src/org/compiere/model/MRefTable.java @@ -42,9 +42,6 @@ public class MRefTable extends X_AD_Ref_Table implements ImmutablePOSupport super (ctx, AD_Reference_ID, trxName); if (AD_Reference_ID == 0) { - // setAD_Table_ID (0); - // setAD_Display (0); - // setAD_Key (0); setEntityType (ENTITYTYPE_UserMaintained); // U setIsValueDisplayed (false); } diff --git a/org.adempiere.base/src/org/compiere/model/MRegistration.java b/org.adempiere.base/src/org/compiere/model/MRegistration.java index b3dfe6e5d3..3418c38b44 100644 --- a/org.adempiere.base/src/org/compiere/model/MRegistration.java +++ b/org.adempiere.base/src/org/compiere/model/MRegistration.java @@ -121,7 +121,6 @@ public class MRegistration extends X_A_Registration if (onlySelfService) sql += " AND EXISTS (SELECT * FROM A_RegistrationAttribute ra WHERE rv.A_RegistrationAttribute_ID=ra.A_RegistrationAttribute_ID" + " AND ra.IsActive='Y' AND ra.IsSelfService='Y')"; - // sql += " ORDER BY A_RegistrationAttribute_ID"; ArrayList list = new ArrayList(); PreparedStatement pstmt = null; diff --git a/org.adempiere.base/src/org/compiere/model/MReportCube.java b/org.adempiere.base/src/org/compiere/model/MReportCube.java index 70c91e379d..fef68e3e6d 100644 --- a/org.adempiere.base/src/org/compiere/model/MReportCube.java +++ b/org.adempiere.base/src/org/compiere/model/MReportCube.java @@ -174,8 +174,6 @@ public class MReportCube extends X_PA_ReportCube { if ( isProjectTaskDim() ) values.add("C_ProjectTask_ID"); - // --(CASE v.IsGL_Category_ID WHEN 'Y' THEN f."GL_Category_ID END) GL_Category_ID - Iterator iter = values.iterator(); while ( iter.hasNext() ) { diff --git a/org.adempiere.base/src/org/compiere/model/MReportView.java b/org.adempiere.base/src/org/compiere/model/MReportView.java index d4ab50aaa8..8dadf39335 100644 --- a/org.adempiere.base/src/org/compiere/model/MReportView.java +++ b/org.adempiere.base/src/org/compiere/model/MReportView.java @@ -28,8 +28,6 @@ public class MReportView extends X_AD_ReportView implements ImmutablePOSupport { */ private static final long serialVersionUID = 6065574433744333005L; - /** Static Logger */ - //private static CLogger s_log = CLogger.getCLogger (MReportView.class); /** Cache */ static private ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 30, 60); diff --git a/org.adempiere.base/src/org/compiere/model/MRequest.java b/org.adempiere.base/src/org/compiere/model/MRequest.java index 0124c8bc9c..58c2d995c5 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequest.java +++ b/org.adempiere.base/src/org/compiere/model/MRequest.java @@ -91,15 +91,11 @@ public class MRequest extends X_R_Request if (R_Request_ID == 0) { setDueType (DUETYPE_Due); - // setSalesRep_ID (0); - // setDocumentNo (null); setConfidentialType (CONFIDENTIALTYPE_PublicInformation); // A setConfidentialTypeEntry (CONFIDENTIALTYPEENTRY_PublicInformation); // A setProcessed (false); setRequestAmt (Env.ZERO); setPriorityUser (PRIORITY_Low); - // setR_RequestType_ID (0); - // setSummary (null); setIsEscalated (false); setIsSelfService (false); setIsInvoiced (false); @@ -683,16 +679,6 @@ public class MRequest extends X_R_Request */ public File createPDF () { - // globalqss - comment to solve bug [ 1688794 ] System is generating lots of temp files -// try -// { -// File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); -// return createPDF (temp); -// } -// catch (Exception e) -// { -// log.severe("Could not create PDF - " + e.getMessage()); -// } return null; } // getPDF @@ -703,10 +689,7 @@ public class MRequest extends X_R_Request */ public File createPDF (File file) { - // ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID()); - // if (re == null) - return null; - // return re.getPDF(file); + return null; } // createPDF /************************************************************************** @@ -785,51 +768,6 @@ public class MRequest extends X_R_Request return true; } // beforeSave - - - /** - * Check the ability to send email. - * @return AD_Message or null if no error - */ -/* - * TODO red1 - Never Used Locally - to check later - private String checkEMail() - { - // Mail Host - MClient client = MClient.get(getCtx()); - if (client == null - || client.getSMTPHost() == null - || client.getSMTPHost().length() == 0) - return "RequestActionEMailNoSMTP"; - - // Mail To - MUser to = new MUser (getCtx(), getAD_User_ID(), get_TrxName()); - if (to == null - || to.getEMail() == null - || to.getEMail().length() == 0) - return "RequestActionEMailNoTo"; - - // Mail From real user - MUser from = MUser.get(getCtx(), Env.getAD_User_ID(getCtx())); - if (from == null - || from.getEMail() == null - || from.getEMail().length() == 0) - return "RequestActionEMailNoFrom"; - - // Check that UI user is Request User -// int realSalesRep_ID = Env.getContextAsInt (getCtx(), Env.AD_USER_ID); -// if (realSalesRep_ID != getSalesRep_ID()) -// setSalesRep_ID(realSalesRep_ID); - - // RequestActionEMailInfo - EMail from {0} to {1} -// Object[] args = new Object[] {emailFrom, emailTo}; -// String msg = Msg.getMsg(getCtx(), "RequestActionEMailInfo", args); -// setLastResult(msg); - // - - return null; - } // checkEMail -*/ /** * Set SalesRep_ID * @param SalesRep_ID id @@ -891,39 +829,6 @@ public class MRequest extends X_R_Request return success; } // afterSave - /** - * Send transfer Message - */ -/*TODO - red1 Never used locally - check later - * private void sendTransferMessage () - { - // Sender - int AD_User_ID = Env.getContextAsInt(p_ctx, Env.AD_USER_ID); - if (AD_User_ID == 0) - AD_User_ID = getUpdatedBy(); - // Old - Object oo = get_ValueOld("SalesRep_ID"); - int oldSalesRep_ID = 0; - if (oo instanceof Integer) - oldSalesRep_ID = ((Integer)oo).intValue(); - - // RequestActionTransfer - Request {0} was transfered by {1} from {2} to {3} - Object[] args = new Object[] {getDocumentNo(), - MUser.getNameOfUser(AD_User_ID), - MUser.getNameOfUser(oldSalesRep_ID), - MUser.getNameOfUser(getSalesRep_ID()) - }; - String subject = Msg.getMsg(getCtx(), "RequestActionTransfer", args); - String message = subject + "\n" + getSummary(); - MClient client = MClient.get(getCtx()); - MUser from = MUser.get (getCtx(), AD_User_ID); - MUser to = MUser.get (getCtx(), getSalesRep_ID()); - // - client.sendEMail(from, to, subject, message, createPDF()); - } // afterSaveTransfer -*/ - - /** * Get Mail Tag * @return [Req@{id}@] diff --git a/org.adempiere.base/src/org/compiere/model/MRequestAction.java b/org.adempiere.base/src/org/compiere/model/MRequestAction.java index 458576e8e6..2bfcd3a7e7 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestAction.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestAction.java @@ -107,8 +107,6 @@ public class MRequestAction extends X_R_RequestAction getChangeHTML(sb, "R_Status_ID"); getChangeHTML(sb, "SalesRep_ID"); getChangeHTML(sb, "Summary"); - // - // getChangeHTML(sb, "AD_Org_ID"); // always stored getChangeHTML(sb, "AD_Role_ID"); getChangeHTML(sb, "AD_User_ID"); getChangeHTML(sb, "C_Activity_ID"); diff --git a/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java b/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java index 5d289ed808..011c400aff 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java @@ -88,14 +88,10 @@ public class MRequestProcessor extends X_R_RequestProcessor super (ctx, R_RequestProcessor_ID, trxName); if (R_RequestProcessor_ID == 0) { - // setName (null); - //setFrequencyType (FREQUENCYTYPE_Day); - //setFrequency (0); setKeepLogDays (7); setOverdueAlertDays (0); setOverdueAssignDays (0); setRemindDays (0); - // setSupervisor_ID (0); } } // MRequestProcessor diff --git a/org.adempiere.base/src/org/compiere/model/MRequestType.java b/org.adempiere.base/src/org/compiere/model/MRequestType.java index 11a2cfef6a..9c4441c76d 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestType.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestType.java @@ -131,8 +131,6 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport super(ctx, R_RequestType_ID, trxName); if (R_RequestType_ID == 0) { - // setR_RequestType_ID (0); - // setName (null); setDueDateTolerance (7); setIsDefault (false); setIsEMailWhenDue (false); @@ -428,8 +426,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport trunc = "MM"; else if (MGoal.MEASUREDISPLAY_Week.equals(MeasureScope)) trunc = "W"; - // else if (MGoal.MEASUREDISPLAY_Day.equals(MeasureDisplay)) - // ; + sb.append(" AND TRUNC(") .append(dateColumn).append(",'").append(trunc).append("')=TRUNC(") .append(DB.TO_DATE(reportDate)).append(",'").append(trunc).append("')"); @@ -476,8 +473,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport trunc = "MM"; else if (MGoal.MEASUREDISPLAY_Week.equals(MeasureDisplay)) trunc = "W"; - // else if (MGoal.MEASUREDISPLAY_Day.equals(MeasureDisplay)) - // ; + orderBy = "TRUNC(" + dateColumn + ",'" + trunc + "')"; groupBy = orderBy + ", 3 "; sb.append(orderBy) @@ -546,8 +542,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport trunc = "MM"; else if (MGoal.MEASUREDISPLAY_Week.equals(MeasureDisplay)) trunc = "W"; - // else if (MGoal.MEASUREDISPLAY_Day.equals(MeasureDisplay)) - // trunc = "D"; + where = "TRUNC(" + dateColumn + ",'" + trunc + "')=TRUNC(" + DB.TO_DATE(date) + ",'" + trunc + "')"; } diff --git a/org.adempiere.base/src/org/compiere/model/MRequisition.java b/org.adempiere.base/src/org/compiere/model/MRequisition.java index c41cee9ca3..5ceaff11aa 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequisition.java +++ b/org.adempiere.base/src/org/compiere/model/MRequisition.java @@ -64,10 +64,6 @@ public class MRequisition extends X_M_Requisition implements DocAction super (ctx, M_Requisition_ID, trxName); if (M_Requisition_ID == 0) { - // setDocumentNo (null); - // setAD_User_ID (0); - // setM_PriceList_ID (0); - // setM_Warehouse_ID(0); setDateDoc(new Timestamp(System.currentTimeMillis())); setDateRequired (new Timestamp(System.currentTimeMillis())); setDocAction (DocAction.ACTION_Complete); // CO @@ -164,10 +160,7 @@ public class MRequisition extends X_M_Requisition implements DocAction */ public File createPDF (File file) { - // ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID()); - // if (re == null) - return null; - // return re.getPDF(file); + return null; } // createPDF /** diff --git a/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java b/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java index b90387e5d8..7ff730c814 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java @@ -126,7 +126,6 @@ public class MRequisitionLine extends X_M_RequisitionLine super (ctx, M_RequisitionLine_ID, trxName); if (M_RequisitionLine_ID == 0) { - // setM_Requisition_ID (0); setLine (0); // @SQL=SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM M_RequisitionLine WHERE M_Requisition_ID=@M_Requisition_ID@ setLineNetAmt (Env.ZERO); setPriceActual (Env.ZERO); @@ -237,7 +236,6 @@ public class MRequisitionLine extends X_M_RequisitionLine IProductPricing pp = Core.getProductPricing(); pp.setRequisitionLine(this, get_TrxName()); pp.setM_PriceList_ID(M_PriceList_ID); - // pp.setPriceDate(getDateOrdered()); // setPriceActual (pp.getPriceStd()); } // setPrice diff --git a/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java b/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java index 96fa152652..7940b5dde7 100644 --- a/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java +++ b/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java @@ -66,46 +66,6 @@ public class MResourceAssignment extends X_S_ResourceAssignment } // MResourceAssignment - /** - * After Save - * @param newRecord new - * @param success success - * @return true - */ -// protected boolean afterSave (boolean newRecord, boolean success) -// { -// /* -// if (!success) -// return success; -// v_Description := :new.Name; -// IF (:new.Description IS NOT NULL AND LENGTH(:new.Description) > 0) THEN -// v_Description := v_Description || ' (' || :new.Description || ')'; -// END IF; -// -// -- Update Expense Line -// UPDATE S_TimeExpenseLine -// SET Description = v_Description, -// Qty = :new.Qty -// WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID -// AND (Description <> v_Description OR Qty <> :new.Qty); -// -// -- Update Order Line -// UPDATE C_OrderLine -// SET Description = v_Description, -// QtyOrdered = :new.Qty -// WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID -// AND (Description <> v_Description OR QtyOrdered <> :new.Qty); -// -// -- Update Invoice Line -// UPDATE C_InvoiceLine -// SET Description = v_Description, -// QtyInvoiced = :new.Qty -// WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID -// AND (Description <> v_Description OR QtyInvoiced <> :new.Qty); -// */ -// return success; -// } // afterSave - /** * String Representation * @return string diff --git a/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java b/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java index df9531a30b..2ef6aceda3 100644 --- a/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java +++ b/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java @@ -49,13 +49,6 @@ public class MRevenueRecognitionPlan extends X_C_RevenueRecognition_Plan super (ctx, C_RevenueRecognition_Plan_ID, trxName); if (C_RevenueRecognition_Plan_ID == 0) { - // setC_AcctSchema_ID (0); - // setC_Currency_ID (0); - // setC_InvoiceLine_ID (0); - // setC_RevenueRecognition_ID (0); - // setC_RevenueRecognition_Plan_ID (0); - // setP_Revenue_Acct (0); - // setUnEarnedRevenue_Acct (0); setTotalAmt (Env.ZERO); setRecognizedAmt (Env.ZERO); } diff --git a/org.adempiere.base/src/org/compiere/model/MRfQ.java b/org.adempiere.base/src/org/compiere/model/MRfQ.java index 57425bffe7..1a810c0ad9 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQ.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQ.java @@ -89,11 +89,6 @@ public class MRfQ extends X_C_RfQ super (ctx, C_RfQ_ID, trxName); if (C_RfQ_ID == 0) { - // setC_RfQ_Topic_ID (0); - // setName (null); - // setC_Currency_ID (0); // @$C_Currency_ID @ - // setSalesRep_ID (0); - // setDateResponse (new Timestamp(System.currentTimeMillis())); setDateWorkStart (new Timestamp(System.currentTimeMillis())); setIsInvitedVendorsOnly (false); diff --git a/org.adempiere.base/src/org/compiere/model/MRfQLineQty.java b/org.adempiere.base/src/org/compiere/model/MRfQLineQty.java index 755923595f..d55d92a09c 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQLineQty.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQLineQty.java @@ -75,8 +75,6 @@ public class MRfQLineQty extends X_C_RfQLineQty super (ctx, C_RfQLineQty_ID, trxName); if (C_RfQLineQty_ID == 0) { - // setC_RfQLine_ID (0); - // setC_UOM_ID (0); setIsOfferQty (false); setIsPurchaseQty (false); setQty (Env.ONE); // 1 diff --git a/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java b/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java index 24802ba9f7..bad2d92b94 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java @@ -51,8 +51,6 @@ public class MRfQResponseLine extends X_C_RfQResponseLine public MRfQResponseLine (Properties ctx, int C_RfQResponseLine_ID, String trxName) { super(ctx, C_RfQResponseLine_ID, trxName); -// if (ignored != 0) -// throw new IllegalArgumentException("Multi-Key"); } // MRfQResponseLine /** diff --git a/org.adempiere.base/src/org/compiere/model/MRfQResponseLineQty.java b/org.adempiere.base/src/org/compiere/model/MRfQResponseLineQty.java index bc5b1638e3..da43c3703c 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQResponseLineQty.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQResponseLineQty.java @@ -48,10 +48,6 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa super (ctx, C_RfQResponseLineQty_ID, trxName); if (C_RfQResponseLineQty_ID == 0) { - // setC_RfQResponseLineQty_ID (0); // PK - // setC_RfQLineQty_ID (0); - // setC_RfQResponseLine_ID (0); - // setPrice (Env.ZERO); setDiscount(Env.ZERO); } diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index 22b7ef4404..cad549715d 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -88,8 +88,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport { int AD_Role_ID = Env.getContextAsInt(ctx, Env.AD_ROLE_ID); int AD_User_ID = Env.getContextAsInt(ctx, Env.AD_USER_ID); -// if (!Ini.isClient()) // none for Server -// AD_User_ID = 0; + MRole defaultRole = getDefaultRole(); if (reload || defaultRole == null) { @@ -153,21 +152,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport public static MRole get (Properties ctx, int AD_Role_ID) { return get(ctx, AD_Role_ID, Env.getAD_User_ID(ctx), false); // metas-2009_0021_AP1_G94 - we need to use this method because we need to load/reload all accesses - /* metas-2009_0021_AP1_G94 - String key = String.valueOf(AD_Role_ID); - MRole role = (MRole)s_roles.get (key); - String trxName = null; - if (role == null) - { - role = new MRole (ctx, AD_Role_ID, trxName); - s_roles.put (key, role); - if (AD_Role_ID == 0) // System Role - { - role.load(trxName); // special Handling - } - } - return role; - /**/ // metas-2009_0021_AP1_G94 } // get /** @@ -285,7 +269,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport // ID=0 == System Administrator if (AD_Role_ID == 0) { - // setName (null); setIsCanExport (true); setIsCanReport (true); setIsManual (false); @@ -413,16 +396,13 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport */ protected boolean beforeSave(boolean newRecord) { - // if (newRecord || is_ValueChanged("UserLevel")) - // { - if (getAD_Client_ID() == 0) - setUserLevel(USERLEVEL_System); - else if (getUserLevel().equals(USERLEVEL_System)) - { - log.saveError("AccessTableNoUpdate", Msg.getElement(getCtx(), "UserLevel")); - return false; - } - // } + if (getAD_Client_ID() == 0) + setUserLevel(USERLEVEL_System); + else if (getUserLevel().equals(USERLEVEL_System)) + { + log.saveError("AccessTableNoUpdate", Msg.getElement(getCtx(), "UserLevel")); + return false; + } return true; } // beforeSave @@ -1535,8 +1515,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport */ public boolean isRecordAccess (int AD_Table_ID, int Record_ID, boolean ro) { - // if (!isTableAccess(AD_Table_ID, ro)) // No Access to Table - // return false; loadRecordAccess(false); boolean negativeList = true; for (int i = 0; i < m_recordAccess.length; i++) @@ -2122,7 +2100,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport keyColumnName = TableName; keyColumnName += "."; } - //keyColumnName += TableName + "_ID"; // derived from table + if (getIdColumnName(TableName) == null) continue; keyColumnName += getIdColumnName(TableName); @@ -2414,19 +2392,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport if (retValue) return retValue; - // Notification - /** - if (forInsert) - log.saveWarning("AccessTableNoUpdate", - "(Required=" + TableLevel + "(" - + getTableLevelString(Env.getAD_Language(ctx), TableLevel) - + ") != UserLevel=" + userLevel); - else - **/ - log.saveWarning("AccessTableNoView", - "Required=" + TableLevel + "(" - + getTableLevelString(Env.getAD_Language(ctx), TableLevel) - + ") != UserLevel=" + userLevel); + log.saveWarning("AccessTableNoView", + "Required=" + TableLevel + "(" + + getTableLevelString(Env.getAD_Language(ctx), TableLevel) + + ") != UserLevel=" + userLevel); if (log.isLoggable(Level.INFO)) log.info (toString()); return retValue; } // canView @@ -2468,7 +2437,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport Integer ii = (Integer)m_tableName.get(tableName); if (ii != null) return ii.intValue(); - // log.log(Level.WARNING,"getAD_Table_ID - not found (" + tableName + ")"); return 0; } // getAD_Table_ID @@ -3220,39 +3188,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport mergeIncludedAccess("m_infoAccess"); // and now get the info access directly from this role String ASPFilter = ""; - /* - MClient client = MClient.get(getCtx(), getAD_Client_ID()); - if (client.isUseASP()) - ASPFilter = - " AND ( AD_InfoWindow_ID IN ( " - // Just ASP subscribed forms for client " - + " SELECT f.AD_InfoWindow_ID " - + " FROM ASP_InfoWindow f, ASP_Level l, ASP_ClientLevel cl " - + " WHERE f.ASP_Level_ID = l.ASP_Level_ID " - + " AND cl.AD_Client_ID = " + client.getAD_Client_ID() - + " AND cl.ASP_Level_ID = l.ASP_Level_ID " - + " AND f.IsActive = 'Y' " - + " AND l.IsActive = 'Y' " - + " AND cl.IsActive = 'Y' " - + " AND f.ASP_Status = 'S') " // Show - + " OR AD_InfoWindow_ID IN ( " - // + show ASP exceptions for client - + " SELECT AD_InfoWindow_ID " - + " FROM ASP_ClientException ce " - + " WHERE ce.AD_Client_ID = " + client.getAD_Client_ID() - + " AND ce.IsActive = 'Y' " - + " AND ce.AD_InfoWindow_ID IS NOT NULL " - + " AND ce.ASP_Status = 'S') " // Show - + " ) " - + " AND AD_InfoWindow_ID NOT IN ( " - // minus hide ASP exceptions for client - + " SELECT AD_InfoWindow_ID " - + " FROM ASP_ClientException ce " - + " WHERE ce.AD_Client_ID = " + client.getAD_Client_ID() - + " AND ce.IsActive = 'Y' " - + " AND ce.AD_InfoWindow_ID IS NOT NULL " - + " AND ce.ASP_Status = 'H')"; // Hide - */ + String sql = "SELECT AD_InfoWindow_ID, IsActive FROM AD_InfoWindow_Access WHERE AD_Role_ID=?" + ASPFilter; PreparedStatement pstmt = null; ResultSet rs = null; @@ -3285,16 +3221,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport setAccessMap("m_infoAccess", mergeAccess(getAccessMap("m_infoAccess"), directAccess, true)); } // reload Boolean retValue = m_infoAccess.get(AD_InfoWindow_ID); - /* Info Window doesn't have AccessLevel - if (retValue != null && retValue.booleanValue()) { - MInfoWindow infoWindow = new MInfoWindow(getCtx(), AD_InfoWindow_ID, get_TrxName()); - if (! isAccessLevelCompatible(infoWindow.getAccessLevel())) { - log.warning("Role " + getName() + " has assigned access incompatible info window " + infoWindow.getName()); - m_infoAccess.remove(AD_InfoWindow_ID); - retValue = null; - } - } - */ + return retValue; } diff --git a/org.adempiere.base/src/org/compiere/model/MSLAMeasure.java b/org.adempiere.base/src/org/compiere/model/MSLAMeasure.java index 6a3e13eb10..3d3b60cdab 100644 --- a/org.adempiere.base/src/org/compiere/model/MSLAMeasure.java +++ b/org.adempiere.base/src/org/compiere/model/MSLAMeasure.java @@ -48,7 +48,6 @@ public class MSLAMeasure extends X_PA_SLA_Measure super (ctx, PA_SLA_Measure_ID, trxName); if (PA_SLA_Measure_ID == 0) { - // setPA_SLA_Goal_ID (0); setDateTrx (new Timestamp(System.currentTimeMillis())); setMeasureActual (Env.ZERO); setProcessed (false); diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index e397ca9e8b..97119dc0af 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -265,8 +265,6 @@ public class MSequence extends X_AD_Sequence Thread.yield(); // give it time } - - //if (s_log.isLoggable(Level.FINEST)) s_log.finest (retValue + " - Table=" + TableName + " [" + trx + "]"); return retValue; } // getNextID @@ -437,8 +435,7 @@ public class MSequence extends X_AD_Sequence pstmt.setQueryTimeout(QUERY_TIME_OUT); } rs = pstmt.executeQuery(); - // s_log.fine("AC=" + conn.getAutoCommit() + " -Iso=" + conn.getTransactionIsolation() - // + " - Type=" + pstmt.getResultSetType() + " - Concur=" + pstmt.getResultSetConcurrency()); + if (rs.next()) { if (s_log.isLoggable(Level.FINE)) s_log.fine("AD_Sequence_ID="+AD_Sequence_ID); @@ -812,8 +809,6 @@ public class MSequence extends X_AD_Sequence /** Start Number */ public static final int INIT_NO = 1000000; // 1M /** Start System Number */ - // public static final int INIT_SYS_NO = 100; // start number for Compiere - // public static final int INIT_SYS_NO = 50000; // start number for Adempiere public static final int INIT_SYS_NO = 200000; // start number for iDempiere /** Static Logger */ private static CLogger s_log = CLogger.getCLogger(MSequence.class); @@ -830,8 +825,6 @@ public class MSequence extends X_AD_Sequence super(ctx, AD_Sequence_ID, trxName); if (AD_Sequence_ID == 0) { - // setName (null); - // setIsTableID(false); setStartNo (INIT_NO); setCurrentNext (INIT_NO); @@ -1003,35 +996,11 @@ public class MSequence extends X_AD_Sequence */ static public void main (String[] args) { - // int id = getNextID_HTTP("AD_Column"); - // if (true) return; - org.compiere.Adempiere.startup(true); CLogMgt.setLevel(Level.SEVERE); CLogMgt.setLoggerLevel(Level.SEVERE, null); s_list = new Vector(1000); - /** Lock Test ** - String trxName = "test"; - System.out.println(DB.getDocumentNo(115, trxName)); - System.out.println(DB.getDocumentNo(116, trxName)); - System.out.println(DB.getDocumentNo(117, trxName)); - System.out.println(DB.getDocumentNo(118, trxName)); - System.out.println(DB.getDocumentNo(118, trxName)); - System.out.println(DB.getDocumentNo(117, trxName)); - - trxName = "test1"; - System.out.println(DB.getDocumentNo(115, trxName)); // hangs here as supposed - System.out.println(DB.getDocumentNo(116, trxName)); - System.out.println(DB.getDocumentNo(117, trxName)); - System.out.println(DB.getDocumentNo(118, trxName)); - - - - - - /** **/ - /** Time Test */ long time = System.currentTimeMillis(); Thread[] threads = new Thread[10]; @@ -1066,7 +1035,6 @@ public class MSequence extends X_AD_Sequence { if (last.compareTo(ia[i]) == 0) { - // System.out.println(i + ": " + ia[i]); duplicates++; } } @@ -1077,113 +1045,6 @@ public class MSequence extends X_AD_Sequence System.out.println("Duplicates=" + duplicates); System.out.println("Time (ms)=" + time + " - " + ((float)time/s_list.size()) + " each" ); System.out.println("-------------------------------------------"); - - - - /** ** - try - { - int retValue = -1; - Connection conn = DB.getConnectionRW (); - // DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); - // Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@//dev2:1521/dev2", "adempiere", "adempiere"); - - conn.setAutoCommit(false); - String sql = "SELECT CurrentNext, CurrentNextSys, IncrementNo " - + "FROM AD_Sequence " - + "WHERE Name='AD_Sequence' "; - sql += "FOR UPDATE"; - // creates ORA-00907: missing right parenthesis - // sql += "FOR UPDATE OF CurrentNext, CurrentNextSys"; - - - PreparedStatement pstmt = conn.prepareStatement(sql, - ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); - ResultSet rs = pstmt.executeQuery(); - System.out.println("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly() - + " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED - + ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE - + "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE - + ")"); - - if (rs.next()) - { - int IncrementNo = rs.getInt(3); - retValue = rs.getInt(1); - rs.updateInt(1, retValue + IncrementNo); - rs.updateRow(); - } - else - s_log.severe ("no record found"); - rs.close(); - pstmt.close(); - conn.commit(); - conn.close(); - // - System.out.println("Next=" + retValue); - - } - catch (Exception e) - { - e.printStackTrace (); - } - - System.exit(0); - - /** ** - - int AD_Client_ID = 0; - int C_DocType_ID = 115; // GL - String TableName = "C_Invoice"; - String trxName = "x"; - Trx trx = Trx.get(trxName, true); - - System.out.println ("none " + getNextID (0, "Test")); - System.out.println ("----------------------------------------------"); - System.out.println ("trx1 " + getNextID (0, "Test")); - System.out.println ("trx2 " + getNextID (0, "Test")); - // trx.rollback(); - System.out.println ("trx3 " + getNextID (0, "Test")); - // trx.commit(); - System.out.println ("trx4 " + getNextID (0, "Test")); - // trx.rollback(); - // trx.close(); - System.out.println ("----------------------------------------------"); - System.out.println ("none " + getNextID (0, "Test")); - System.out.println ("=============================================="); - - - trx = Trx.get(trxName, true); - System.out.println ("none " + getDocumentNo(AD_Client_ID, TableName, null)); - System.out.println ("----------------------------------------------"); - System.out.println ("trx1 " + getDocumentNo(AD_Client_ID, TableName, trxName)); - System.out.println ("trx2 " + getDocumentNo(AD_Client_ID, TableName, trxName)); - trx.rollback(); - System.out.println ("trx3 " + getDocumentNo(AD_Client_ID, TableName, trxName)); - trx.commit(); - System.out.println ("trx4 " + getDocumentNo(AD_Client_ID, TableName, trxName)); - trx.rollback(); - trx.close(); - System.out.println ("----------------------------------------------"); - System.out.println ("none " + getDocumentNo(AD_Client_ID, TableName, null)); - System.out.println ("=============================================="); - - - trx = Trx.get(trxName, true); - System.out.println ("none " + getDocumentNo(C_DocType_ID, null)); - System.out.println ("----------------------------------------------"); - System.out.println ("trx1 " + getDocumentNo(C_DocType_ID, trxName)); - System.out.println ("trx2 " + getDocumentNo(C_DocType_ID, trxName)); - trx.rollback(); - System.out.println ("trx3 " + getDocumentNo(C_DocType_ID, trxName)); - trx.commit(); - System.out.println ("trx4 " + getDocumentNo(C_DocType_ID, trxName)); - trx.rollback(); - trx.close(); - System.out.println ("----------------------------------------------"); - System.out.println ("none " + getDocumentNo(C_DocType_ID, null)); - System.out.println ("=============================================="); - /** **/ } // main /** Test */ @@ -1219,7 +1080,6 @@ public class MSequence extends X_AD_Sequence { int no = DB.getNextID(0, "Test", null); s_list.add(Integer.valueOf(no)); - // System.out.println("#" + m_i + ": " + no); } catch (Exception e) { diff --git a/org.adempiere.base/src/org/compiere/model/MSerNoCtl.java b/org.adempiere.base/src/org/compiere/model/MSerNoCtl.java index 003f9f2c9d..38b2e39155 100644 --- a/org.adempiere.base/src/org/compiere/model/MSerNoCtl.java +++ b/org.adempiere.base/src/org/compiere/model/MSerNoCtl.java @@ -43,11 +43,9 @@ public class MSerNoCtl extends X_M_SerNoCtl super(ctx, M_SerNoCtl_ID, trxName); if (M_SerNoCtl_ID == 0) { - // setM_SerNoCtl_ID (0); setStartNo (1); setCurrentNext (1); setIncrementNo (1); - // setName (null); } } // MSerNoCtl diff --git a/org.adempiere.base/src/org/compiere/model/MSetup.java b/org.adempiere.base/src/org/compiere/model/MSetup.java index f470c19410..895356b8f3 100644 --- a/org.adempiere.base/src/org/compiere/model/MSetup.java +++ b/org.adempiere.base/src/org/compiere/model/MSetup.java @@ -87,7 +87,6 @@ public final class MSetup private StringBuffer m_info; // private String m_clientName; -// private String m_orgName; // private String m_stdColumns = "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy"; private String m_stdValues; @@ -1285,10 +1284,6 @@ public final class MSetup sqlCmd = new StringBuilder ("UPDATE AD_ClientInfo SET "); sqlCmd.append("C_BPartnerCashTrx_ID=").append(bp.getC_BPartner_ID()); sqlCmd.append(",M_ProductFreight_ID=").append(product.getM_Product_ID()); -// sqlCmd.append("C_UOM_Volume_ID="); -// sqlCmd.append(",C_UOM_Weight_ID="); -// sqlCmd.append(",C_UOM_Length_ID="); -// sqlCmd.append(",C_UOM_Time_ID="); sqlCmd.append(" WHERE AD_Client_ID=").append(getAD_Client_ID()); no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName()); if (no != 1) diff --git a/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java b/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java index 2576094906..4e94c37b79 100644 --- a/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java +++ b/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java @@ -320,37 +320,6 @@ public class MShippingTransaction extends X_M_ShippingTransaction PartyInfo partyInfo = null; -/* StringBuilder sql = new StringBuilder(); - sql.append("SELECT CompanyName, ContactName, PhoneNumber, EMail, C_Location_ID "); - sql.append("FROM M_ShippingSenderInfo_V "); - sql.append("WHERE M_ShippingTransaction_ID = ?"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql.toString(), null); - pstmt.setInt(1, getM_ShippingTransaction_ID()); - rs = pstmt.executeQuery (); - if (rs.next ()) - { - partyInfo = new PartyInfo(); - partyInfo.setCompanyName(rs.getString("CompanyName")); - partyInfo.setContactName(rs.getString("ContactName")); - partyInfo.setPhoneNumber(rs.getString("PhoneNumber")); - partyInfo.setEmail(rs.getString("EMail")); - partyInfo.setLocationId(rs.getInt("C_Location_ID")); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, e.getLocalizedMessage(), e); - } - finally - { - DB.close(rs, pstmt); - } -*/ if (partyInfo == null) { MOrg sender = new MOrg(getCtx(), getAD_Org_ID(), get_TrxName()); @@ -376,38 +345,6 @@ public class MShippingTransaction extends X_M_ShippingTransaction return recipientInfo; PartyInfo partyInfo = null; - -/* StringBuilder sql = new StringBuilder(); - sql.append("SELECT CompanyName, ContactName, PhoneNumber, EMail, C_Location_ID "); - sql.append("FROM M_ShippingRecipientInfo_V "); - sql.append("WHERE M_ShippingTransaction_ID = ?"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql.toString(), null); - pstmt.setInt(1, getM_ShippingTransaction_ID()); - rs = pstmt.executeQuery (); - if (rs.next ()) - { - partyInfo = new PartyInfo(); - partyInfo.setCompanyName(rs.getString("CompanyName")); - partyInfo.setContactName(rs.getString("ContactName")); - partyInfo.setPhoneNumber(rs.getString("PhoneNumber")); - partyInfo.setEmail(rs.getString("EMail")); - partyInfo.setLocationId(rs.getInt("C_Location_ID")); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, e.getLocalizedMessage(), e); - } - finally - { - DB.close(rs, pstmt); - } -*/ if (partyInfo == null) { MBPartner recipient = new MBPartner(getCtx(), getC_BPartner_ID(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MStatusCategory.java b/org.adempiere.base/src/org/compiere/model/MStatusCategory.java index 04306ef5a5..7e11791f82 100644 --- a/org.adempiere.base/src/org/compiere/model/MStatusCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MStatusCategory.java @@ -148,7 +148,6 @@ public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSu super (ctx, R_StatusCategory_ID, trxName); if (R_StatusCategory_ID == 0) { - // setName (null); setIsDefault (false); } } // RStatusCategory diff --git a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java index b21ac9fb94..4bd3be0a4a 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java @@ -1055,10 +1055,6 @@ public class MStorageOnHand extends X_M_StorageOnHand .append(",M_AttributeSetInstance_ID=").append(getM_AttributeSetInstance_ID()) .append(",DateMaterialPolicy=").append(getDateMaterialPolicy()) .append(": OnHand=").append(getQtyOnHand()) - /* @win commented out - .append(",Reserved=").append(getQtyReserved()) - .append(",Ordered=").append(getQtyOrdered()) - */ .append("]"); return sb.toString(); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 8390bc2e1d..fa5c1677ab 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -223,11 +223,6 @@ public class MSysConfig extends X_AD_SysConfig public MSysConfig (Properties ctx, int AD_SysConfig_ID, String trxName) { super (ctx, AD_SysConfig_ID, trxName); - if (AD_SysConfig_ID == 0) - { - // setName (null); - // setValue (null); - } } // MSysConfig /** diff --git a/org.adempiere.base/src/org/compiere/model/MSystem.java b/org.adempiere.base/src/org/compiere/model/MSystem.java index c770b64704..4ae8691ceb 100644 --- a/org.adempiere.base/src/org/compiere/model/MSystem.java +++ b/org.adempiere.base/src/org/compiere/model/MSystem.java @@ -448,15 +448,11 @@ public class MSystem extends X_AD_System { if (!CLogMgt.isLevelFine()) return; - // OS - // OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean(); - // log.fine(os.getName() + " " + os.getVersion() + " " + os.getArch() - // + " Processors=" + os.getAvailableProcessors()); + // Runtime @SuppressWarnings("unused") RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean(); - // log.fine(rt.getName() + " (" + rt.getVmVersion() + ") Up=" + TimeUtil.formatElapsed(rt.getUptime())); - // Memory + if (CLogMgt.isLevelFiner()) { List list = ManagementFactory.getMemoryPoolMXBeans(); @@ -465,29 +461,16 @@ public class MSystem extends X_AD_System { @SuppressWarnings("unused") MemoryPoolMXBean pool = (MemoryPoolMXBean)it.next(); - /* - log.finer(pool.getName() + " " + pool.getType() - + ": " + new CMemoryUsage(pool.getUsage())); - */ } } else { @SuppressWarnings("unused") MemoryMXBean memory = ManagementFactory.getMemoryMXBean(); - // log.fine("VM: " + new CMemoryUsage(memory.getNonHeapMemoryUsage())); - // log.fine("Heap: " + new CMemoryUsage(memory.getHeapMemoryUsage())); } // Thread @SuppressWarnings("unused") ThreadMXBean th = ManagementFactory.getThreadMXBean(); - /* - log.fine("Threads=" + th.getThreadCount() - + ", Peak=" + th.getPeakThreadCount() - + ", Demons=" + th.getDaemonThreadCount() - + ", Total=" + th.getTotalStartedThreadCount() - ); - */ } // info /*