GridController.java

Index Score
org.compiere.grid
Compiere

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
EXEC_COMMENTSComments in executable code
JAVA0034JAVA0034 Missing braces in if statement
LINE_COMMENTNumber of line comments
EXITSProcedure exits
COMPARISONSNumber of comparison operators
DECL_COMMENTSComments in declarations
CYCLOMATICCyclomatic complexity
SIZESize of the file in bytes
COMMENTSComment lines
DOC_COMMENTNumber of javadoc comment lines
UNIQUE_OPERANDSNumber of unique operands
LINESNumber of lines in the source file
LOGICAL_LINESNumber of statements
OPERATORSNumber of operators
PROGRAM_VOCABHalstead program vocabulary
ELOCEffective lines of code
PROGRAM_LENGTHHalstead program length
LOCLines of code
OPERANDSNumber of operands
JAVA0145JAVA0145 Tab character used in source file
BLOCKSNumber of blocks
RETURNSNumber of return points from functions
INTERFACE_COMPLEXITYInterface complexity
FUNCTIONSNumber of function declarations
JAVA0270JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0143JAVA0143 Synchronized method
JAVA0266JAVA0266 Use of System.out
LOOPSNumber of loops
UNIQUE_OPERATORSNumber of unique operators
JAVA0049JAVA0049 Nested block at depth N (maximum: M)
NEST_DEPTHMaximum nesting depth
PARAMSNumber of formal parameter declarations
JAVA0117JAVA0117 Missing javadoc: method 'method'
JAVA0144JAVA0144 Line exceeds maximum M characters
PROGRAM_VOLUMEHalstead program volume
JAVA0136JAVA0136 N methods defined in class (maximum: M)
JAVA0160JAVA0160 Method does not throw specified exception
JAVA0126JAVA0126 Method declares unchecked exception in throws
JAVA0173JAVA0173 Unused method parameter
JAVA0100JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0108JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0130JAVA0130 Non-static method does not use instance fields
JAVA0003JAVA0003 Minimize use of on-demand (.*) imports
/****************************************************************************** * Product: Compiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * * This program is free software, you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * * with this program, if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 3600 Bridge Parkway #102, Redwood City, CA 94065, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ package org.compiere.grid; import java.awt.*; import java.awt.event.*; import java.beans.*; import java.util.*; import java.util.logging.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.*; import org.compiere.apps.*; import org.compiere.common.constants.*; import org.compiere.framework.*; import org.compiere.grid.ed.*; import org.compiere.grid.tree.*; import org.compiere.model.*; import org.compiere.swing.*; import org.compiere.util.*; /** * The Grid Controller is the panel for single and multi-row presentation * and links to the Model Tab. * * <pre> * UI Structure: * this (BorderLayout) * splitPane (JSplitPane) * left * graphicPanel * right * cardPanel JPanel (CardLayout) * srPane JSplitPane * vPane JScrollPane * vPanel VPanel (GridBagLayout) * vIncludedGC GridController * mrPane JScrollPane * vTable VTable * * <B>DataBinding:<B> * - MultiRow - is automatic between VTable and MTable * - SingleRow * - from VEditors via fireVetoableChange(m_columnName, null, getText()); * (vetoableChange) * - to VEditors via updateSingleRow -> Editor.setValue(object) * * Event Chains * -- Navigation -- * (VTable selection -> GridController.valueChanged) * (APanel selection) * + GridTab.navivate * + GridTab.setCurrentRow * + Update all GridFields * + GridField.setValue * + setContext * + fire PropertyChange "Value" * + VEditor.propertyChange * + VEditor.setValue * + GridTab.fireProperyChange "CurrentRow" * + VTable.propertyChange (setRowSelectionInterval) * + GridController.valueChange * + GridController.dynamicDisplay(complete) * + GridTab.fireDataStatusChanged * + APanel.statusChanged * * -- ValueChanges -- * VEditor.fireVetoableChange * + (VCellEditor.vetoableChange/getCellEditorValue) -- multi-row source * + (GridController.vetoableChange) -- single-row source * + GridTable.setValueAt * + GridField.setValue * + setContext * + fire PropertyChange "Value" * + VEditor.setValue * + GridTable.fireDataStatusChanged * + GridTab.dataStatusChanged * + GridTab.fireDataStatusChanged * + APanel.statusChanged * + GridController.dataStatusChanged * + GridController.dynamicDisplay(selective) * </pre> * @author Jorg Janke * @version $Id$ */ public class GridController extends CPanel implements DataStatusListener, ListSelectionListener, Evaluatee, VetoableChangeListener, PropertyChangeListener, MouseListener { /** * */ private static final long serialVersionUID = 1L; /** * Constructor - you need to call initGrid for instanciation * @param withRowHeader with numbers in Front */ public GridController(boolean withRowHeader) { vTable = new VTable(withRowHeader); try { jbInit(); } catch(Exception e) { log.log(Level.SEVERE, "", e); } setFocusable(false); } // GridController /** * toString * @return string representation */ @Override public String toString() { return "GridController for " + m_mTab; } // toString /** Logger */ private static CLogger log = CLogger.getCLogger(GridController.class); /** * The Layout */ private BorderLayout mainLayout = new BorderLayout(); private JSplitPane splitPane = new JSplitPane(); private CPanel graphPanel = new CPanel(); private BorderLayout graphLayout = new BorderLayout(); private CPanel cardPanel = new CPanel(); private CardLayout cardLayout = new CardLayout(); private JSplitPane srPane = new JSplitPane(); private JScrollPane vPane = new JScrollPane(); private GridController vIncludedGC = null; private CScrollPane mrPane = new CScrollPane(); private CPanel xPanel = new CPanel(); private BorderLayout xLayout = new BorderLayout(); VTable vTable = null; private VPanel vPanel = new VPanel(); /** * Static Layout init * @throws Exception */ private void jbInit() throws Exception { this.setLayout(mainLayout); this.add(splitPane, BorderLayout.CENTER); splitPane.setOpaque(false); graphPanel.setLayout(graphLayout); // splitPane.add(graphPanel, JSplitPane.LEFT); splitPane.add(cardPanel, JSplitPane.RIGHT); splitPane.setBorder(null); splitPane.setName("gc_splitPane"); // cardPanel.setLayout(cardLayout); cardPanel.add(srPane, "srPane"); // Sequence Important! cardPanel.add(mrPane, "mrPane"); cardPanel.setBorder(null); cardPanel.setName("gc_cardPanel"); // single row (w/o xPane it would be centered) srPane.setBorder(null); srPane.setName("gc_srPane"); srPane.setOrientation(JSplitPane.VERTICAL_SPLIT); srPane.add(vPane, JSplitPane.TOP); srPane.setTopComponent(vPane); srPane.setBottomComponent(null); // otherwise a button is created/displayed // vPane.getViewport().add(xPanel, null); vPane.setBorder(null); xPanel.setLayout(xLayout); xPanel.setName("gc_xPanel"); xPanel.add(vPanel, BorderLayout.PAGE_START); // multi-row mrPane.setBorder(null); mrPane.getViewport().add(vTable, null); // Row header listener CRowHeader rh = vTable.getRowHeader(); if (rh != null) { rh.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent me) { if (vTable.getRowCount() > 0 && SwingUtilities.isLeftMouseButton(me)) { if (me.getClickCount() < 2) { int row = vTable.rowAtPoint(me.getPoint()); vTable.getSelectionModel().setSelectionInterval(row, row); } else switchRowPresentation(); } } }); } mrPane.setName("gc_mrPane"); // graphPanel.setBorder(null); graphPanel.setName("gc_graphPanel"); srPane.setDividerLocation(200); } // jbInit /** * Displose */ public void dispose() { log.config( "(" + m_mTab.toString() + ")"); // clear info stopEditor(false); if (m_mTab.needSave(true, false)) m_mTab.dataIgnore(); vIncludedGC = null; // Listeners m_mTab.getTableModel().removeDataStatusListener(this); m_mTab.getTableModel().removeVetoableChangeListener(this); vTable.getSelectionModel().removeListSelectionListener(this); m_mTab.removePropertyChangeListener(vTable); // editors Component[] comp = vPanel.getComponents(); for (int i = 0; i < comp.length; i++) { if (comp[i] instanceof VEditor) { VEditor vEditor = (VEditor)comp[i]; vEditor.removeVetoableChangeListener(this); String columnName = comp[i].getName(); GridField mField = m_mTab.getField(columnName); if (mField != null) mField.removePropertyChangeListener(vEditor); vEditor.dispose(); } } /** @todo Remove APanel Button listeners */ vTable.removeAll(); vTable.setModel(new DefaultTableModel()); // remove reference vTable = null; vPanel.removeAll(); vPanel = null; srPane.removeAll(); srPane = null; splitPane.removeAll(); splitPane = null; m_mTab = null; m_tree = null; this.removeAll(); } // dispose /** Model Tab */ private GridTab m_mTab = null; /** Window */ private int m_WindowNo; /** Only Multi-Row exist */ private boolean m_onlyMultiRow = false; /** Single/Multi Row indicator */ private boolean m_singleRow = true; /** Veto Active */ private boolean m_vetoActive = false; /** Tree Panel (optional) */ private VTreePanel m_tree; /************************************************************************** * Init Grid. * <pre> * - Map table to model * - Update (multi-row) table info with renderers/editors * - build single-row panel * - initialize display * </pre> * @param mTab tab * @param onlyMultiRow only table * @param WindowNo window no * @param aPanel optional Application Panel for adding button listeners * @param mWindow parent Window Model * @return true if initialized */ public boolean initGrid (GridTab mTab, boolean onlyMultiRow, int WindowNo, APanel aPanel, GridWindow mWindow) { log.config( "(" + mTab.toString() + ")"); m_mTab = mTab; m_WindowNo = WindowNo; m_onlyMultiRow = onlyMultiRow; setName("GC-" + mTab); MRole role = MRole.getDefault(); // Client if (!role.isDisplayClient()) m_mTab.getField("AD_Client_ID").setDisplayed(false); if (!role.isDisplayOrg()) m_mTab.getField("AD_Org_ID").setDisplayed(false); // Set up Multi Row Table vTable.setModel(m_mTab.getTableModel()); // Update Table Info ------------------------------------------------- int size = setupVTable (aPanel, m_mTab, vTable); // Set Color on Tab Level // this.setBackgroundColor (mTab.getColor()); // Single Row ------------------------------------------------------- if (!m_onlyMultiRow) { // Set Softcoded Mnemonic &x for (int i = 0; i < size; i++) { GridField mField = m_mTab.getField(i); if (mField.isDisplayed()) vPanel.setMnemonic(mField); } // for all fields // Add Fields for (int i = 0; i < size; i++) { GridField mField = m_mTab.getField(i); if (mField.isDisplayed()) { VEditor vEditor = VEditorFactory.getEditor(m_mTab, mField, false); if (vEditor == null) { log.warning("Editor not created for " + mField.getColumnName()); continue; } // MField => VEditor - New Field value to be updated to editor mField.addPropertyChangeListener(vEditor); // VEditor => this - New Editor value to be updated here (MTable) vEditor.addVetoableChangeListener(this); // Add to VPanel vPanel.addField(vEditor, mField); // APanel Listen to buttons if (mField.getDisplayType() == DisplayTypeConstants.Button && aPanel != null) ((JButton)vEditor).addActionListener (aPanel); } } // for all fields // No Included Grid Controller srPane.setResizeWeight(1); // top part gets all srPane.setDividerSize (0); srPane.setDividerLocation (9999); // Use SR to size MR mrPane.setPreferredSize(vPanel.getPreferredSize()); } // Single-Row // Tree Graphics Layout int AD_Tree_ID = 0; if (m_mTab.isTreeTab()) AD_Tree_ID = MTree.getDefaultAD_Tree_ID ( Env.getCtx().getAD_Client_ID(), m_mTab.getAD_Table_ID()); if (m_mTab.isTreeTab() && AD_Tree_ID != 0) { m_tree = new VTreePanel(m_WindowNo, false, true); if (m_mTab.getTabNo() == 0) // initialize other tabs later m_tree.initTree(AD_Tree_ID); m_tree.addPropertyChangeListener(VTreePanel.NODE_SELECTION, this); graphPanel.add(m_tree, BorderLayout.CENTER); splitPane.setDividerLocation(250); // splitPane.resetToPreferredSizes(); } else // No Graphics - hide { graphPanel.setPreferredSize(new Dimension(0,0)); splitPane.setDividerSize(0); splitPane.setDividerLocation(0); } // Receive DataStatusChanged info from MTab m_mTab.addDataStatusListener(this); // Receive vetoableChange info from MTable when saving m_mTab.getTableModel().addVetoableChangeListener(this); // Selection Listener -> valueChanged vTable.getSelectionModel().addListSelectionListener(this); // Navigation (RowChanged) m_mTab.addPropertyChangeListener(vTable); // Update UI vTable.autoSize(true); setTabLevel(m_mTab.getTabLevel()); // Set initial presentation if (onlyMultiRow || !m_mTab.isSingleRow()) switchMultiRow(); else switchSingleRow(); // log.config( "GridController.dynInit (" + mTab.toString() + ") - fini"); return true; } // initGrid /** * Include Tab * @param gc grod controller to add * @return true if included */ public boolean includeTab (GridController gc) { GridTab imcludedMTab = gc.getMTab(); if (m_mTab.getIncluded_Tab_ID () != imcludedMTab.getAD_Tab_ID()) return false; // vIncludedGC = gc; vIncludedGC.switchMultiRow(); // Dimension size = getPreferredSize(); srPane.setResizeWeight(.75); // top part gets 75% srPane.add(vIncludedGC, JSplitPane.BOTTOM); srPane.setBottomComponent(vIncludedGC); srPane.setDividerSize (5); // int height = 150; vIncludedGC.setPreferredSize(new Dimension(600, height)); setPreferredSize(new Dimension(size.width, size.height+height)); srPane.setDividerLocation (size.height); // imcludedMTab.setIncluded (true); imcludedMTab.query (0, 0, false); // updated // JRootPane rt = SwingUtilities.getRootPane(this); if (rt == null) System.out.println("Root pane null"); else { System.out.println("Root=" + rt); rt.addMouseListener(vIncludedGC); Component gp = rt.getGlassPane(); if (gp == null) System.out.println("No Glass Pane"); else { System.out.println("Glass=" + gp); gp.addMouseListener(vIncludedGC); } } vIncludedGC.addMouseListener(vIncludedGC); vIncludedGC.enableEvents(AWTEvent.HIERARCHY_EVENT_MASK + AWTEvent.MOUSE_EVENT_MASK); /** vIncludedGC.splitPane.addMouseListener(vIncludedGC); vIncludedGC.cardPanel.addMouseListener(vIncludedGC); vIncludedGC.mrPane.addMouseListener(vIncludedGC); vIncludedGC.vTable.addMouseListener(vIncludedGC); **/ return true; } // IncludeTab /** * Get Title * @return title */ public String getTitle () { return m_mTab.getName(); } // getTitle /** * Setup Multi-Row Table (add fields) * @param aPanel Panel * @param mTab Model Tab * @param table JTable * @return size */ private int setupVTable (APanel aPanel, GridTab mTab, VTable table) { if (!mTab.isDisplayed(true)) return 0; int size = mTab.getFieldCount (); TableColumnModel tcm = table.getColumnModel(); if (size != tcm.getColumnCount()) throw new IllegalStateException("TableColumn Size <> TableModel"); for (int i = 0; i < size; i++) { GridField mField = mTab.getField (i); TableColumn tc = tcm.getColumn(i); tc.setMinWidth(30); // if (mField.getColumnName().equals(tc.getHeaderValue())) { tc.setIdentifier(mField.getColumnName()); if (mField.getDisplayType () == DisplayTypeConstants.RowID) { tc.setCellRenderer (new VRowIDRenderer (false)); tc.setCellEditor (new VRowIDEditor (false)); tc.setHeaderValue (""); tc.setMaxWidth (2); } else { // need to set CellEditor explicitly as default editor based on class causes problem (YesNo-> Boolean) if (mField.isDisplayed ()) { tc.setCellRenderer (new VCellRenderer (mField)); VCellEditor ce = new VCellEditor (mField); tc.setCellEditor (ce); // tc.setHeaderValue (mField.getHeader ()); tc.setPreferredWidth (Math.max (mField.getDisplayLength (), 30)); tc.setHeaderRenderer (new VHeaderRenderer (mField.getDisplayType ())); // Enable Button actions in grid if (mField.getDisplayType () == DisplayTypeConstants.Button) { VEditor button = ce.getEditor (); if (button != null && aPanel != null) ((JButton)button).addActionListener (aPanel); } } else // column not displayed { TableCellNone tcn = new TableCellNone(mField.getColumnName()); tc.setCellRenderer (tcn); tc.setCellEditor (tcn); tc.setHeaderValue (null); tc.setMinWidth (0); tc.setMaxWidth (0); tc.setPreferredWidth (0); } } // System.out.println ("TableColumnID " + tc.getIdentifier () // + " Renderer=" + tc.getCellRenderer () // + mField.getHeader ()); } // found field else log.log(Level.SEVERE, "TableColumn " + tc.getHeaderValue() + " <> MField " + mField.getColumnName() + mField.getHeader()); } // for all fields /** Reorder for (int i = 0; i < size; i++) tcm.moveColumn(size, i); **/ return size; } // setupVTable /** * Activate Grid Controller. * Called by APanel when GridController is displayed (foreground) */ public void activate () { // Tree to be initiated on second/.. tab if (m_mTab.isTreeTab() && m_mTab.getTabNo() > 0) { int AD_Tree_ID = 0; if (m_mTab.getTabLevel() > 0) // check previous tab for AD_Tree_ID { String keyColumnName = m_mTab.getKeyColumnName(); String treeName = "AD_Tree_ID"; if (keyColumnName.startsWith("CM")) { if (keyColumnName.equals("CM_Container_ID")) treeName = "AD_TreeCMC_ID"; else if (keyColumnName.equals("CM_CStage_ID")) treeName = "AD_TreeCMS_ID"; else if (keyColumnName.equals("CM_Template_ID")) treeName = "AD_TreeCMT_ID"; else if (keyColumnName.equals("CM_Media_ID")) treeName = "AD_TreeCMM_ID"; } AD_Tree_ID = Env.getCtx().getContextAsInt( m_WindowNo, treeName); log.config(keyColumnName + " -> " + treeName + " = " + AD_Tree_ID); } if (AD_Tree_ID == 0) AD_Tree_ID = MTree.getDefaultAD_Tree_ID ( Env.getCtx().getAD_Client_ID(), m_mTab.getAD_Table_ID()); if (m_tree != null) m_tree.initTree (AD_Tree_ID); } } // activate /** * Register ESC Actions * - overwrite VTable's Keystroke assignment for ESC * @param aIgnore ignore */ public void registerESCAction (AppsAction aIgnore) { int c = JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT; vTable.getInputMap(c).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), aIgnore.getName()); vTable.getActionMap().put(aIgnore.getName(), aIgnore); // AEnv.printActionInputMap(vTable); } // registerESCAction /** * Query Tab and resize Table * (called from APanel) * @param onlyCurrentDays how many days back * @param maxRows maximum rows or 0 for all * @param created query based on created if true otherwise updated */ public boolean query (int onlyCurrentDays, int maxRows, boolean created) { boolean success = false; // start loading while building screen success = m_mTab.query(onlyCurrentDays, maxRows, created); // Update UI if (!isSingleRow()) vTable.autoSize(true); return success; } // query /************************************************************************** * Switch from single to multi & vice versa */ public void switchRowPresentation() { stopEditor(true); if (m_singleRow) switchMultiRow(); else switchSingleRow(); } // switchRowPresentation /** * Switch to SingleRow Presentation */ public void switchSingleRow() { if (m_onlyMultiRow) return; cardLayout.first(cardPanel); m_singleRow = true; dynamicDisplay(0); vPanel.requestFocus(); } // switchSingleRow /** * Switch to MultiRow Presentation */ public void switchMultiRow() { cardLayout.last(cardPanel); m_singleRow = false; vTable.autoSize(true); // resizes vTable.requestFocus(); } // switchSingleRow /** * Is Single Row presentation * @return true if Single Row is displayed */ public boolean isSingleRow() { return m_singleRow; } // isSingleRow /** * Request Focus In Window * @return focus request */ @Override public boolean requestFocusInWindow() { if (m_singleRow && vPanel != null) return vPanel.requestFocusInWindow(); return super.requestFocusInWindow(); } // requestFocusInWindow /** * Request Focus - cancel editors */ @Override public void requestFocus() { if (vTable != null) vTable.editingCanceled(new ChangeEvent(this)); if (m_singleRow && vPanel != null) vPanel.requestFocus(); else super.requestFocus(); } // requestFocus /************************************************************************** * Remove Listener - pass on to MTab * @param l listener */ public synchronized void removeDataStatusListener(DataStatusListener l) { m_mTab.removeDataStatusListener(l); } // removeDataStatusListener /** * Add Data Status Listener - pass on to MTab * @param l listener */ public synchronized void addDataStatusListener(DataStatusListener l) { m_mTab.addDataStatusListener(l); } /** * Data Status Listener - for MTab events. * <p> * Callouts are processed here for GUI changes * - same as in MTab.setValue for batch changes * <p> * calls dynamicDisplay * @param e event */ public void dataStatusChanged(DataStatusEvent e) { int col = e.getChangedColumn(); if (col <= 0) return; log.config("(" + m_mTab + ") Col=" + col + ": " + e.toString()); // Process Callout GridField mField = m_mTab.getField(col); if (mField != null) { mField.validateValue(); if (mField.getCallout().length() > 0) { String msg = m_mTab.processFieldChange(mField); // Dependencies & Callout if (msg.length() > 0) ADialog.error(m_WindowNo, this, msg); } else // no callout to set dependent fields { String columnName = mField.getColumnName(); ArrayList<GridField> dependants = m_mTab.getDependantFields(columnName); for (int i = 0; i < dependants.size(); i++) { GridField dep = dependants.get(i); if (dep == null) continue; Lookup lookup = dep.getLookup(); if (lookup == null) continue; // String val = lookup.getValidation(); if (val.indexOf(columnName) != -1) // dep is dependent { Object value = lookup.getSelectedItem(); lookup.fillComboBox (mField.isMandatory(false), true, true, false); lookup.setSelectedItemAlways(value); // set old value with new rules } } // for all dependent fields } } dynamicDisplay(col); // 0 = all } // dataStatusChanged /************************************************************************** * List Selection Listener (VTable) - row changed * @param e event */ public void valueChanged(ListSelectionEvent e) { // no rows if (m_mTab.getRowCount() == 0) return; // vTable.stopEditor(graphPanel); int rowTable = vTable.getSelectedRow(); int rowCurrent = m_mTab.getCurrentRow(); log.config("(" + m_mTab.toString() + ") Row in Table=" + rowTable + ", in Model=" + rowCurrent); if (rowTable == -1) // nothing selected { if (rowCurrent >= 0) { vTable.setRowSelectionInterval(rowCurrent, rowCurrent); // causes this method to be called again return; } } else { if (rowTable != rowCurrent) m_mTab.navigate(rowTable); dynamicDisplay(0); } // nothing or initiated by mouse (wait for "real" one) if (e.getValueIsAdjusting()){ return; } // TreeNavigation - Synchronize -- select node in tree if (m_tree != null) m_tree.setSelectedNode (m_mTab.getRecord_ID()); // ignores new (-1) // log.config( "GridController.valueChanged (" + m_mTab.toString() + ") - fini", // "Row in Table=" + rowTable + ", in Model=" + rowCurrent); // Query Included Tab if (vIncludedGC != null) vIncludedGC.getMTab().query(0, 0, false); } // valueChanged /** * PropertyChange Listener - Tree Panel - node selection * @param e event */ public void propertyChange(PropertyChangeEvent e) { // System.out.println("propertyChange"); // System.out.println(e); if (e == null) return; Object value = e.getNewValue(); if (value == null) return; log.config(e.getPropertyName() + "=" + value + " - " + value.getClass().toString()); if (!(value instanceof CTreeNode)) return; // We Have a TreeNode int nodeID = ((CTreeNode)value).getNode_ID(); // root of tree selected - ignore if (nodeID == 0) return; // Search all rows for mode id int size = m_mTab.getRowCount(); int row = -1; for (int i = 0; i < size; i++) { if (m_mTab.getKeyID(i) == nodeID) { row = i; break; } } if (row == -1) { log.log(Level.WARNING, "Tab does not have ID with Node_ID=" + nodeID); return; } // Navigate to node row m_mTab.navigate(row); } // propertyChange /** * Dynamic Display. * - Single Row Screen layout and update of dynamic Lookups * <p> * Single Row layout: * the components's name is the ColumnName; if it matches, the * MField.isDisplayed(true) is used to determine if it is visible * if the component is a VEditor, setEnabled is set from the MField * <p> * Multi Row layout is not changed: * VCellRenderer calls JTable.isCellEditable -> checks MField.isEditable (Active, isDisplayed) * VCellEditor.isCellEditable calls MField.isEditable(true) <br> * If a column is not displayed, the width is set to 0 in dynInit * <p> * Dynamic update of data is handeled in VLookup.focusGained/Lost. * When focus is gained the model is temporarily updated with the * specific validated data, if lost, it is switched back to the * unvalidated data (i.e. everything). This allows that the display * methods have a lookup to display. <br> * Here: if the changed field has dependents and the dependent * is a Lookup and this lookup has a dynamic dependence of the changed field, * the value of that field is set to null (in MTab.processDependencies - * otherwise it would show an invalid value). * As Editors listen for value changed of their MField, the display is updated. * <p> * Called from GridController.valueChanged/dataStatusChanged, APane;.stateChanged/unlock/cmd_... * @param col selective column number or 0 if all */ public void dynamicDisplay (int col) { // log.config( "GridController.dynamicDisplay (" + m_mTab.toString() + ") SingleRow=" + isSingleRow() + ", OnlyMultiRow=" + m_onlyMultiRow); // Don't update if multi-row if (!isSingleRow() || m_onlyMultiRow) return; if (!m_mTab.isOpen()) return; // Selective if (col > 0) { GridField changedField = m_mTab.getField(col); String columnName = changedField.getColumnName(); ArrayList<GridField> dependants = m_mTab.getDependantFields(columnName); log.config("(" + m_mTab.toString() + ") " + columnName + " - Dependents=" + dependants.size()); // No Dependents and no Callout - Set just Background if (dependants.size() == 0 && changedField.getCallout().length() > 0) { Component[] comp = vPanel.getComponents(); for (int i = 0; i < comp.length; i++) { if (columnName.equals(comp[i].getName ()) && comp[i] instanceof VEditor) { VEditor ve = (VEditor)comp[i]; ve.setBackground( changedField.isError() ); break; } } return; } } // selective // complete single row re-display boolean noData = m_mTab.getRowCount() == 0; log.config(m_mTab.toString() + " - Rows=" + m_mTab.getRowCount()); // All Components in vPanel (Single Row) Component[] comps = vPanel.getComponents(); for (int i = 0; i < comps.length; i++) { JComponent comp = (JComponent)comps[i]; String columnName = comp.getName(); if (columnName != null) { GridField mField = m_mTab.getField(columnName); if (mField != null) { if (mField.isDisplayed(true)) // check context { Boolean vis = (Boolean)comp.getClientProperty(VPanel.COMPONENT_VISIBLE); if (!comp.isVisible() && (vis == null || vis.booleanValue())) comp.setVisible(true); // visibility if (comp instanceof VEditor) { VEditor ve = (VEditor)comp; if (noData) ve.setReadWrite(false); else { boolean rw = mField.isEditable(true); // r/w - check Context ve.setReadWrite(rw); // log.log(Level.FINEST, "RW=" + rw + " " + mField); ve.setMandatory( mField.isMandatory(true) ); mField.validateValue(); ve.setBackground( mField.isError() ); } } } else if (comp.isVisible()) comp.setVisible(false); // reset error status for nondisplayed fields if they are not mandatory if (!mField.isDisplayed(true) && !mField.isMandatory(true)){ mField.setError(false); } } } } // all components log.config(m_mTab.toString() + " - fini - " + (col==0 ? "complete" : "seletive")); } // dynamicDisplay /** * Row Changed - synchronize with Tree * * @param save true the row was saved (changed/added), false if the row was deleted * @param keyID the ID of the row changed */ public void rowChanged (boolean save, int keyID) { if (m_tree == null || keyID <= 0) return; String name = (String)m_mTab.getValue("Name"); String description = (String)m_mTab.getValue("Description"); Boolean IsSummary = (Boolean)m_mTab.getValue("IsSummary"); boolean summary = IsSummary != null && IsSummary.booleanValue(); String imageIndicator = (String)m_mTab.getValue("Action"); // Menu - Action // m_tree.nodeChanged(save, keyID, name, description, summary, imageIndicator); } // rowChanged /************************************************************************** * Vetoable Change Listener. * Called from VEditor * <pre> * - for Save Confirmation dialog * - for Single Row from VEditor: Update MTable * </pre> * @param e event * @throws PropertyVetoException */ public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { if (m_mTab.isProcessed()) // only active records { Object source = e.getSource(); if (source instanceof VEditor) { if (!((VEditor)source).isReadWrite()) { log.config("(" + m_mTab.toString() + ") " + e.getPropertyName()); return; } } else { log.config("(" + m_mTab.toString() + ") " + e.getPropertyName()); return; } } // processed log.config("(" + m_mTab.toString() + ") " + e.getPropertyName() + "=" + e.getNewValue() + " (" + e.getOldValue() + ") " + (e.getOldValue() == null ? "" : e.getOldValue().getClass().getName())); // Save Confirmation dialog MTable-RowSave if (e.getPropertyName().equals(GridTable.PROPERTY)) { // throw new PropertyVetoException calls this method (??) again if (m_vetoActive) { m_vetoActive = false; return; } if (!Env.getCtx().isAutoCommit(m_WindowNo) || m_mTab.getCommitWarning().length() > 0) { if (!ADialog.ask(m_WindowNo, this, "SaveChanges?", m_mTab.getCommitWarning())) { m_vetoActive = true; throw new PropertyVetoException ("UserDeniedSave", e); } } return; } // saveConfirmation // Get Row/Col Info GridTable mTable = m_mTab.getTableModel(); int row = m_mTab.getCurrentRow(); int col = mTable.findColumn(e.getPropertyName()); // // gwu: modified to enforce validation even when the new value is null mTable.setValueAt (e.getNewValue(), row, col); // -> dataStatusChanged -> dynamicDisplay // Force Callout if (e.getPropertyName().equals("S_ResourceAssignment_ID")) { GridField mField = m_mTab.getField(col); if (mField != null && mField.getCallout().length() > 0) m_mTab.processFieldChange(mField); // Dependencies & Callout } // log.config( "GridController.vetoableChange (" + m_mTab.toString() + ") - fini", e.getPropertyName() + "=" + e.getNewValue()); } // vetoableChange /************************************************************************** * Get Model Tab * @return Model Tab */ public GridTab getMTab() { return m_mTab; } // getMTab /** * Is Tab displayed * @return true if displayed */ public boolean isDisplayed() { return m_mTab.isDisplayed(false); } // IsDisplayed /** * Get VTable * @return VTable */ public VTable getTable() { return vTable; } // getTable /** * Set Window level Mnemonics * @param set true if set otherwise unregiser */ public void setMnemonics (boolean set) { if (vPanel != null) vPanel.setMnemonics(set); } // setMnemonics /** * Stop Table & SR Editors and move focus to graphPanel * @param saveValue save value */ public void stopEditor (boolean saveValue) { log.config("(" + m_mTab.toString() + ") TableEditing=" + vTable.isEditing()); // MultiRow - remove editors vTable.stopEditor(saveValue); // SingleRow - stop editors by changing focus if (m_singleRow) vPanel.transferFocus(); // graphPanel.requestFocus(); // // log.config( "GridController.stopEditor (" + m_mTab.toString() + ") - fini", // "Editing=" + vTable.isEditing()); } // stopEditors /** * Mouse Clicked * @param e event */ public void mouseClicked(MouseEvent e) { if (CLogMgt.isLevelFinest()) log.finest("" + this + " - " + e); } /** * Mouse Pressed * @param e event */ public void mousePressed(MouseEvent e) { if (CLogMgt.isLevelFinest()) log.finest("" + this + " - " + e); } /** * Mouse Released * @param e event */ public void mouseReleased(MouseEvent e) { if (CLogMgt.isLevelFinest()) log.finest("" + this + " - " + e); } /** * Mouse Entered * @param e event */ public void mouseEntered(MouseEvent e) { if (CLogMgt.isLevelFinest()) log.finest("" + this + " - " + e); } /** * Mouse Exited * @param e event */ public void mouseExited(MouseEvent e) { if (CLogMgt.isLevelFinest()) log.finest("" + this + " - " + e); } /** * Get Variable Value * @param variableName name * @return value */ public String get_ValueAsString (String variableName) { return Env.getCtx().getContext(m_WindowNo, variableName); } // get_ValueAsString } // GridController

The table below shows all metrics for GridController.java.

MetricValueDescription
BLOCKS95.00Number of blocks
BLOCK_COMMENT 0.00Number of block comment lines
COMMENTS385.00Comment lines
COMMENT_DENSITY 0.68Comment density
COMPARISONS133.00Number of comparison operators
CYCLOMATIC158.00Cyclomatic complexity
DECL_COMMENTS47.00Comments in declarations
DOC_COMMENT300.00Number of javadoc comment lines
ELOC564.00Effective lines of code
EXEC_COMMENTS78.00Comments in executable code
EXITS190.00Procedure exits
FUNCTIONS37.00Number of function declarations
HALSTEAD_DIFFICULTY82.60Halstead difficulty
HALSTEAD_EFFORT 0.00Halstead effort
INTERFACE_COMPLEXITY92.00Interface complexity
JAVA0001 0.00JAVA0001 Package name does not contain only lower case letters
JAVA0002 0.00JAVA0002 Package name does not begin with a top level domain name or country code
JAVA0003 1.00JAVA0003 Minimize use of on-demand (.*) imports
JAVA0004 0.00JAVA0004 Unnecessary import from java.lang
JAVA0005 0.00JAVA0005 Imports not in specified order
JAVA0006 0.00JAVA0006 Empty finally block
JAVA0007 0.00JAVA0007 Should not declare public field
JAVA0008 0.00JAVA0008 Empty catch block
JAVA0009 0.00JAVA0009 Protected member in final class
JAVA0010 0.00JAVA0010 Non-instantiable class does not contain a non-private static member
JAVA0011 0.00JAVA0011 Abstract class does not contain an abstract method
JAVA0012 0.00JAVA0012 Non-constructor method with same name as declaring class
JAVA0013 0.00JAVA0013 Non-blank final field is not static
JAVA0014 0.00JAVA0014 Class with only static members has non-private constructor
JAVA0015 0.00JAVA0015 Package class contains public nested type
JAVA0016 0.00JAVA0016 Abstract class contains public constructor
JAVA0017 0.00JAVA0017 Class name does not have required form
JAVA0018 0.00JAVA0018 Method name does not have required form
JAVA0019 0.00JAVA0019 Interface name does not have required form
JAVA0020 0.00JAVA0020 Field name does not have required form
JAVA0021 0.00JAVA0021 Interface method name does not have required form
JAVA0022 0.00JAVA0022 Static final field name does not have required form
JAVA0023 0.00JAVA0023 Empty finalize method
JAVA0024 0.00JAVA0024 Empty class
JAVA0025 0.00JAVA0025 Method override is empty
JAVA0026 0.00JAVA0026 Finalize method with parameters
JAVA0029 0.00JAVA0029 Private method not used
JAVA0030 0.00JAVA0030 Private field not used
JAVA0031 0.00JAVA0031 Case statement not properly closed
JAVA0032 0.00JAVA0032 Switch statement missing default
JAVA0033 0.00JAVA0033 default: not last case in switch statement
JAVA003458.00JAVA0034 Missing braces in if statement
JAVA0035 0.00JAVA0035 Missing braces in for statement
JAVA0036 0.00JAVA0036 Missing braces in while statement
JAVA0038 0.00JAVA0038 Non-case label in switch statement
JAVA0039 0.00JAVA0039 Break statement with label
JAVA0040 0.00JAVA0040 Switch statement contains N cases (maximum: M)
JAVA0041 0.00JAVA0041 Nested synchronized block
JAVA0042 0.00JAVA0042 Empty synchronized statement
JAVA0043 0.00JAVA0043 Inner class does not use outer class
JAVA0044 0.00JAVA0044 Serializable class with no instance variables
JAVA0045 0.00JAVA0045 Serializable class with only transient fields
JAVA0046 0.00JAVA0046 Name of class not derived from Exception ends with 'Exception'
JAVA0047 0.00JAVA0047 Serializable class derives from invalid base class
JAVA0048 0.00JAVA0048 Name of class derived from Exception does not end with 'Exception'
JAVA0049 2.00JAVA0049 Nested block at depth N (maximum: M)
JAVA0050 0.00JAVA0050 Class derives from java.lang.Error
JAVA0051 0.00JAVA0051 Class derives from java.lang.RuntimeException
JAVA0052 0.00JAVA0052 Class derives from java.lang.Throwable
JAVA0053 0.00JAVA0053 Unused label
JAVA0054 0.00JAVA0054 Inheritance depth N exceeds maximum M
JAVA0055 0.00JAVA0055 Class should be interface
JAVA0056 0.00JAVA0056 Unnecessary abstract modifier for interface or annotation
JAVA0057 0.00JAVA0057 Unnecessary default constructor
JAVA0058 0.00JAVA0058 Constructor calls super()
JAVA0059 0.00JAVA0059 Method override only calls super()
JAVA0061 0.00JAVA0061 Inaccessible member in anonymous class
JAVA0062 0.00JAVA0062 Public class missing public member or protected constructor
JAVA0063 0.00JAVA0063 Identifier name should not contain '$'
JAVA0064 0.00JAVA0064 N variations of identifier name (maximum: M)
JAVA0065 0.00JAVA0065 Unnecessary final modifier for method in final class
JAVA0066 0.00JAVA0066 Unnecessary modifier for interface nested type
JAVA0067 0.00JAVA0067 Array descriptor on identifier name
JAVA0068 0.00JAVA0068 Modifiers not declared in recommended order
JAVA0071 0.00JAVA0071 Strings compared with ==
JAVA0073 0.00JAVA0073 Integer division in floating-point context
JAVA0074 0.00JAVA0074 Use of Object.notify()
JAVA0075 0.00JAVA0075 Method parameter hides field
JAVA0076 2.00JAVA0076 Use of magic number
JAVA0077 0.00JAVA0077 Private field not used in declaring class
JAVA0078 0.00JAVA0078 Floating point values compared with ==
JAVA0079 0.00JAVA0079 Use of instance to reference static member
JAVA0080 0.00JAVA0080 Import declaration not used
JAVA0081 0.00JAVA0081 Boolean literal in comparison
JAVA0082 0.00JAVA0082 Unnecessary widening cast
JAVA0083 0.00JAVA0083 Unnecessary instanceof test
JAVA0084 0.00JAVA0084 Should use compound assignment operator
JAVA0085 0.00JAVA0085 Use of sun.* class
JAVA0087 0.00JAVA0087 Use of Thread.sleep()
JAVA0089 0.00JAVA0089 Use of restricted package
JAVA0092 0.00JAVA0092 Use of restricted type
JAVA0093 0.00JAVA0093 Redundant assignment
JAVA0094 0.00JAVA0094 Field hides a superclass field
JAVA0095 0.00JAVA0095 Uninitialized private field
JAVA0096 0.00JAVA0096 Field in nested class hides outer field
JAVA0098 0.00JAVA0098 Minimize use of implicit field initializers
JAVA0100 1.00JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0101 0.00JAVA0101 Unnecessary modifier for field in interface
JAVA0102 0.00JAVA0102 Last statement in finalize() not super.finalize()
JAVA0103 0.00JAVA0103 Explicit call to finalize()
JAVA0104 0.00JAVA0104 finalize() only calls super.finalize()
JAVA0105 0.00JAVA0105 Duplicate import declaration
JAVA0106 0.00JAVA0106 Unnecessary import from current package
JAVA0108 0.00JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0109 0.00JAVA0109 Incorrect javadoc: no parameter 'parameter'
JAVA0110 1.00JAVA0110 Incorrect javadoc: no @return tag
JAVA0111 0.00JAVA0111 Incorrect javadoc: @return tag for void method
JAVA0112 0.00JAVA0112 Incorrect javadoc: no exception 'exception' in throws
JAVA0113 0.00JAVA0113 Incorrect javadoc: no @author tag
JAVA0114 0.00JAVA0114 Incorrect javadoc: no @version tag
JAVA0115 0.00JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0116 0.00JAVA0116 Missing javadoc: field 'field'
JAVA0117 0.00JAVA0117 Missing javadoc: method 'method'
JAVA0118 0.00JAVA0118 Missing javadoc: type 'type'
JAVA0119 0.00JAVA0119 Control variable changed within body of for loop
JAVA0123 0.00JAVA0123 Use all three components of for loop
JAVA0125 0.00JAVA0125 Continue statement with label
JAVA0126 0.00JAVA0126 Method declares unchecked exception in throws
JAVA0128 0.00JAVA0128 Public constructor in non-public class
JAVA0130 1.00JAVA0130 Non-static method does not use instance fields
JAVA0131 0.00JAVA0131 Compatible method does not override base
JAVA0132 0.00JAVA0132 Method overload with compatible signature
JAVA0133 0.00JAVA0133 Non-synchronized method overrides synchronized method
JAVA0135 0.00JAVA0135 Only one of Object.equals and Object.hashCode defined: missing 'method'
JAVA0136 1.00JAVA0136 N methods defined in class (maximum: M)
JAVA0137 0.00JAVA0137 Non-abstract class missing constructor
JAVA0138 0.00JAVA0138 N parameters defined for method (maximum: M)
JAVA0139 0.00JAVA0139 Definition of main other than public static void main(java.lang.String[])
JAVA0141 0.00JAVA0141 Unnecessary modifier for method in interface
JAVA0143 2.00JAVA0143 Synchronized method
JAVA0144 2.00JAVA0144 Line exceeds maximum M characters
JAVA01452531.00JAVA0145 Tab character used in source file
JAVA0150 0.00JAVA0150 java.lang.Error (or subclass) thrown
JAVA0153 0.00JAVA0153 Inefficient conversion of integer to string
JAVA0159 0.00JAVA0159 Inefficient conversion of string to integer
JAVA0160 1.00JAVA0160 Method does not throw specified exception
JAVA0161 0.00JAVA0161 Conditional wait() not in loop
JAVA0163 0.00JAVA0163 Empty statement
JAVA0165 0.00JAVA0165 Conflicting return statement in finally block
JAVA0166 1.00JAVA0166 Generic exception caught
JAVA0167 0.00JAVA0167 ThreadDeath not rethrown
JAVA0169 0.00JAVA0169 Unnecessary catch block: exception 'exception'
JAVA0170 0.00JAVA0170 Caught exception not derived from java.lang.Exception
JAVA0171 0.00JAVA0171 Unused local variable
JAVA0173 1.00JAVA0173 Unused method parameter
JAVA0174 0.00JAVA0174 Assigned local variable never used
JAVA0175 0.00JAVA0175 Successive assignment to variable
JAVA0176 0.00JAVA0176 Local variable name does not have required form
JAVA0177 0.00JAVA0177 Variable declaration missing initializer
JAVA0179 0.00JAVA0179 Local variable hides visible field
JAVA0233 0.00JAVA0233 Definition of serialVersionUID other than 'private static final long serialVersionUID'
JAVA0234 0.00JAVA0234 Class is Serializable but does not define serialVersionUID
JAVA0235 0.00JAVA0235 Class defines serialVersionUID but does not implement Serializable
JAVA0236 0.00JAVA0236 Attempt to clone an object which does not implement Cloneable
JAVA0237 0.00JAVA0237 Class implements Cloneable but does not have public clone method
JAVA0238 0.00JAVA0238 Clone method does not call super.clone()
JAVA0239 0.00JAVA0239 Class declares 'readObject' or 'writeObject' but does not implement Serializable
JAVA0240 0.00JAVA0240 Serializable class which declares readObject or writeObject but not both
JAVA0241 0.00JAVA0241 'readObject' or 'writeObject' should be declared private in Serializable class
JAVA0242 0.00JAVA0242 Transient field in non-Serializable class
JAVA0243 0.00JAVA0243 'readResolve' or 'writeReplace' should be declared private or protected
JAVA0244 0.00JAVA0244 Field or method name in subclass differs only by case from inherited field or method
JAVA0245 0.00JAVA0245 JUnit TestCase with non-trivial constructor
JAVA0246 0.00JAVA0246 JUnit assertXXX statement missing message parameter
JAVA0247 0.00JAVA0247 JUnit 'setUp()' and 'tearDown()' should call super method
JAVA0248 0.00JAVA0248 JUnit method 'setUp' or 'tearDown' with incorrect signature
JAVA0249 0.00JAVA0249 JUnit TestCase 'suite()' should be declared static
JAVA0250 0.00JAVA0250 JUnit TestCase declares testXXX method with incorrect signature
JAVA0251 0.00JAVA0251 Use '%n' for line breaks in printf/format for platform independence
JAVA0252 0.00JAVA0252 'enum' is a Java 1.5 reserved word
JAVA0253 0.00JAVA0253 Not all enum constants consumed in switch statement
JAVA0254 0.00JAVA0254 Use enhanced for loop construct instead of Iterator
JAVA0255 0.00JAVA0255 Result of method invocation not used
JAVA0256 0.00JAVA0256 Assignment of external collection/array to field
JAVA0257 0.00JAVA0257 Use of 'Constant Interface' anti-pattern
JAVA0258 0.00JAVA0258 Implement Iterable for foreach compatibility
JAVA0259 0.00JAVA0259 Return of collection/array field
JAVA0260 0.00JAVA0260 Use 'enum' instead of Enumerated Type pattern
JAVA0261 0.00JAVA0261 Use specialized Enum collection types
JAVA0262 0.00JAVA0262 Use of char in integer context
JAVA0263 0.00JAVA0263 Long literal ends with 'l' instead of 'L'
JAVA0264 0.00JAVA0264 Integer math in long context - check for overflow
JAVA0265 0.00JAVA0265 Use of Throwable.printStackTrace()
JAVA0266 4.00JAVA0266 Use of System.out
JAVA0267 0.00JAVA0267 Use of System.err
JAVA0269 0.00JAVA0269 Contents of StringBuffer never used
JAVA0270 3.00JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0271 0.00JAVA0271 Minimize use of on-demand (.*) static imports
JAVA0272 0.00JAVA0272 Thread.run() called
JAVA0273 0.00JAVA0273 Non-final derivative of Thread calls start() in constructor
JAVA0274 0.00JAVA0274 Serializable class has a synchronized readObject()
JAVA0275 0.00JAVA0275 Serializable class has a synchronized writeObject() and no other synchronized methods
JAVA0276 0.00JAVA0276 Unnecessary use of String constructor
JAVA0277 0.00JAVA0277 Iterator.next() implementation does not throw NoSuchElementException
JAVA0278 0.00JAVA0278 Unnecessary use of Boolean constructor
JAVA0279 0.00JAVA0279 Serialization method readObject or readObjectNoData calls an overridable method
JAVA0280 0.00JAVA0280 IllegalMonitorStateException caught
JAVA0281 0.00JAVA0281 Iterator.next() not called in loop
JAVA0282 0.00JAVA0282 Call to Iterator.next() in loop which does not test Iterator.hasNext()
JAVA0283 0.00JAVA0283 Control variable not updated in loop body
JAVA0284 0.00JAVA0284 Explicit garbage collection
JAVA0285 0.00JAVA0285 Dereference of potentially null variable
JAVA0286 0.00JAVA0286 Dereference of null variable
JAVA0287 0.00JAVA0287 Unnecessary null check
JAVA0288 0.00JAVA0288 Inconsistent null check
LINES1194.00Number of lines in the source file
LINE_COMMENT85.00Number of line comments
LOC714.00Lines of code
LOGICAL_LINES368.00Number of statements
LOOPS 8.00Number of loops
NEST_DEPTH 7.00Maximum nesting depth
OPERANDS1539.00Number of operands
OPERATORS3057.00Number of operators
PARAMS32.00Number of formal parameter declarations
PROGRAM_LENGTH4596.00Halstead program length
PROGRAM_VOCAB588.00Halstead program vocabulary
PROGRAM_VOLUME 0.00Halstead program volume
RETURNS60.00Number of return points from functions
SIZE36174.00Size of the file in bytes
UNIQUE_OPERANDS531.00Number of unique operands
UNIQUE_OPERATORS57.00Number of unique operators
WHITESPACE95.00Number of whitespace lines