Fork me on GitHub

CPD Results

The following document contains the results of PMD's CPD 5.5.1.

Duplications

File Line
fr/paris/lutece/plugins/managewferror/web/ConfigJspBean.java 207
fr/paris/lutece/plugins/managewferror/web/ConfigJspBean.java 442
                    _config.getListActionMapping( ).clear( );

                }

        if ( idWorkflowBegin != null && StringUtils.isNotEmpty( idWorkflowBegin ) && Integer.parseInt( idWorkflowBegin ) != -1 )
        {

            List<fr.paris.lutece.plugins.workflowcore.business.action.Action> listAction = getAction( Integer.parseInt( idWorkflowBegin ) );
            List<fr.paris.lutece.plugins.workflowcore.business.action.Action> removedListAction = new ArrayList<fr.paris.lutece.plugins.workflowcore.business.action.Action>( );
            for ( fr.paris.lutece.plugins.workflowcore.business.action.Action act : listAction )
            {
                for ( MappingAction mpg : _config.getListActionMapping( ) )
                {
                    if ( act.getId( ) == mpg.getIdActionBegin( ) )
                    {

                        removedListAction.add( act );
                    }
                }

            }
            // listAction.removeAll(removedListAction);
            model.put( MARK_ACTION_LIST_BEGIN, listAction );
            model.put( MARK_REMOVED_LIST_ACTION_BEGIN, removedListAction );

        }
        if ( idWorkflow != null && StringUtils.isNotEmpty( idWorkflow ) && Integer.parseInt( idWorkflow ) != -1 )
        {
            List<fr.paris.lutece.plugins.workflowcore.business.action.Action> listAction = getAction( Integer.parseInt( idWorkflow ) );
            List<fr.paris.lutece.plugins.workflowcore.business.action.Action> removedListAction = new ArrayList<fr.paris.lutece.plugins.workflowcore.business.action.Action>( );

            for ( fr.paris.lutece.plugins.workflowcore.business.action.Action act : listAction )
            {
                for ( MappingAction mpg : _config.getListActionMapping( ) )
                {
                    if ( act.getId( ) == mpg.getIdActionRelaunch( ) )
                    {

                        removedListAction.add( act );
                    }
                }

            }
            // listAction.removeAll(removedListAction);
            model.put( MARK_ACTION_LIST_RELAUNCH, listAction );
            model.put( MARK_REMOVED_LIST_ACTION_RELAUNCH, removedListAction );

        }

        populate( _config, request );
        model.put( MARK_CONFIG, _config );
File Line
fr/paris/lutece/plugins/managewferror/web/ConfigurationJspBean.java 56
fr/paris/lutece/plugins/managewferror/web/ManageErrorJspBean.java 56
fr/paris/lutece/plugins/managewferror/web/ManageQueueJspBean.java 56
    public static final String RIGHT_CONFIGURATIONGFA = "WFERROR_MANAGEMENT";

    // Properties
    private static final String PROPERTY_DEFAULT_LIST_ITEM_PER_PAGE = "managewferror.listItems.itemsPerPage";

    // Parameters
    private static final String PARAMETER_PAGE_INDEX = "page_index";

    // Markers
    private static final String MARK_PAGINATOR = "paginator";
    private static final String MARK_NB_ITEMS_PER_PAGE = "nb_items_per_page";
    private static final String USER_AUTHORIZED = "userAuthorized";

    // Variables
    private int _nDefaultItemsPerPage;
    private String _strCurrentPageIndex;
    private int _nItemsPerPage;

    /**
     * Return a model that contains the list and paginator infos
     * 
     * @param request
     *            The HTTP request
     * @param strBookmark
     *            The bookmark
     * @param list
     *            The list of item
     * @param strManageJsp
     *            The JSP
     * @return The model
     */
    protected Map<String, Object> getPaginatedListModel( HttpServletRequest request, String strBookmark, List list, String strManageJsp )
    {
        _strCurrentPageIndex = Paginator.getPageIndex( request, Paginator.PARAMETER_PAGE_INDEX, _strCurrentPageIndex );
        _nDefaultItemsPerPage = AppPropertiesService.getPropertyInt( PROPERTY_DEFAULT_LIST_ITEM_PER_PAGE, 50 );
        _nItemsPerPage = Paginator.getItemsPerPage( request, Paginator.PARAMETER_ITEMS_PER_PAGE, _nItemsPerPage, _nDefaultItemsPerPage );

        UrlItem url = new UrlItem( strManageJsp );
        String strUrl = url.getUrl( );

        // PAGINATOR
        LocalizedPaginator paginator = new LocalizedPaginator( list, _nItemsPerPage, strUrl, PARAMETER_PAGE_INDEX, _strCurrentPageIndex, getLocale( ) );

        Map<String, Object> model = getModel( );

        model.put( MARK_NB_ITEMS_PER_PAGE, "" + _nItemsPerPage );
        model.put( MARK_PAGINATOR, paginator );
        model.put( strBookmark, paginator.getPageItems( ) );
        if ( RBACService.isAuthorized( Config.CONFIG_RESOURCE, RBAC.WILDCARD_RESOURCES_ID, Config.PERMISSION_MANAGE, getUser( ) ) )
        {
            model.put( USER_AUTHORIZED, true );
        }

        return model;
    }
}
File Line
fr/paris/lutece/plugins/managewferror/business/ResourceDAO.java 129
fr/paris/lutece/plugins/managewferror/business/ResourceDAO.java 261
        daoUtil.setInt( 1, nKey );
        daoUtil.executeQuery( );
        Resource resource = null;

        if ( daoUtil.next( ) )
        {
            resource = new Resource( );
            int nIndex = 1;

            resource.setId( daoUtil.getInt( nIndex++ ) );
            resource.setIdResource( daoUtil.getInt( nIndex++ ) );
            resource.setIdWorkflow( daoUtil.getInt( nIndex++ ) );
            resource.setAction( daoUtil.getInt( nIndex++ ) );
            resource.setDateResource( daoUtil.getDate( nIndex++ ) );
            resource.setDescription( daoUtil.getString( nIndex++ ) );
            resource.setStatus( daoUtil.getString( nIndex++ ) );
        }

        daoUtil.free( );
        return resource;
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public void delete( int nKey, Plugin plugin )