mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/asset/AssetCommandViewImpl.java
@SuppressWarnings("unchecked")
    private void addToList(final CommandNodeModel nodeObject)
    {
        final String exceptionTitle = "Error Adding Object To List:";
        final String exceptionMsg = "An exception has occurred while trying to add an object to the list with the field"
                + "name: %s. See the server logs for more detail.";
        
        final Field listField = ReflectionsUtil.retrieveField(nodeObject.getName(), nodeObject.getContainingObject());
        if (listField == null)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, String.format(exceptionMsg,
                    nodeObject.getName()), null, true);
            return;
        }

        final ParameterizedType listType = (ParameterizedType)listField.getGenericType();
        final Class<?> listClass = (Class<?>)listType.getActualTypeArguments()[0];
        final List<Object> list;
        try
        {
            list = (List<Object>)nodeObject.getValue();
        }
        catch (final ReflectionsUtilException exception)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, 
                    String.format(exceptionMsg, nodeObject.getName()), exception, true);
            return;
        }
        
        if (ReflectionsUtil.isPrimitiveOrWrapper(listClass))
        {
            list.add(returnDefaultPrimitive(listClass));
        }
        else
        {
            Object listObject = null;
            try
            {
                listObject = listClass.newInstance();
            }
            catch (final InstantiationException | IllegalAccessException exception)
            {
                m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, 
                        String.format(exceptionMsg, nodeObject.getName()), exception, true);
            }
            list.add(listObject);
        }
    }
/**
     * Method that adds an object to the specified list.
     * 
     * @param nodeObject
     *              {@link CommandNodeModel} represents the list object that a value will be added to.
     */
Method that adds an object to the specified list.

@param nodeObject
CommandNodeModel represents the list object that a value will be added to.
Method that adds an object to the specified list . @param nodeObject CommandNodeModel represents the list object that a value will be added to .
@SuppressWarnings("unchecked")
    private void addToList(final CommandNodeModel nodeObject)
    {
        final String exceptionTitle = "Error Adding Object To List:";
        final String exceptionMsg = "An exception has occurred while trying to add an object to the list with the field"
                + "name: %s. See the server logs for more detail.";
        final Field listField = ReflectionsUtil.retrieveField(nodeObject.getName(), nodeObject.getContainingObject());
        if (listField == null)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, String.format(exceptionMsg,
                    nodeObject.getName()), null, true);
            return;
        }
        final ParameterizedType listType = (ParameterizedType)listField.getGenericType();
        final Class<?> listClass = (Class<?>)listType.getActualTypeArguments()[0];
        final List<Object> list;
        try
        {
            list = (List<Object>)nodeObject.getValue();
        }
        catch (final ReflectionsUtilException exception)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, 
                    String.format(exceptionMsg, nodeObject.getName()), exception, true);
            return;
        }
        if (ReflectionsUtil.isPrimitiveOrWrapper(listClass))
        {
            list.add(returnDefaultPrimitive(listClass));
        }
        else
        {
            Object listObject = null;
            try
            {
                listObject = listClass.newInstance();
            }
            catch (final InstantiationException | IllegalAccessException exception)
            {
                m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, 
                        String.format(exceptionMsg, nodeObject.getName()), exception, true);
            }
            list.add(listObject);
        }
    }
@ SuppressWarnings ( "unchecked" ) private void addToList ( final CommandNodeModel nodeObject ) { final String exceptionTitle = "Error Adding Object To List:" ; final String exceptionMsg = "An exception has occurred while trying to add an object to the list with the field" + "name: %s. See the server logs for more detail." ; final Field listField = ReflectionsUtil . retrieveField ( nodeObject . getName ( ) , nodeObject . getContainingObject ( ) ) ; if ( listField == null ) { m_GrowlUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_ERROR , exceptionTitle , String . format ( exceptionMsg , nodeObject . getName ( ) ) , null , true ) ; return ; } final ParameterizedType listType = ( ParameterizedType ) listField . getGenericType ( ) ; final Class < ? > listClass = ( Class < ? > ) listType . getActualTypeArguments ( ) [ 0 ] ; final List < Object > list ; try { list = ( List < Object > ) nodeObject . getValue ( ) ; } catch ( final ReflectionsUtilException exception ) { m_GrowlUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_ERROR , exceptionTitle , String . format ( exceptionMsg , nodeObject . getName ( ) ) , exception , true ) ; return ; } if ( ReflectionsUtil . isPrimitiveOrWrapper ( listClass ) ) { list . add ( returnDefaultPrimitive ( listClass ) ) ; } else { Object listObject = null ; try { listObject = listClass . newInstance ( ) ; } catch ( final InstantiationException | IllegalAccessException exception ) { m_GrowlUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_ERROR , exceptionTitle , String . format ( exceptionMsg , nodeObject . getName ( ) ) , exception , true ) ; } list . add ( listObject ) ; } }
Method that adds an object to the specified list.
Method that adds an object to the specified list .