Fork me on GitHub

CPD Results

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

Duplications

File Line
fr/paris/lutece/plugins/stock/business/category/CategoryDAO.java 305
fr/paris/lutece/plugins/stock/business/product/ProductDAO.java 212
    private void buildSortQuery( CategoryFilter filter, Root<Category> root, CriteriaQuery<Category> query, CriteriaBuilder builder )
    {
        if ( filter.getOrders( ) != null && !filter.getOrders( ).isEmpty( ) )
        {
            List<Order> orderList = new ArrayList<>( );

            if ( filter.isOrderAsc( ) )
            {
                // get asc order
                for ( String order : filter.getOrders( ) )
                {
                    orderList.add( builder.asc( root.get( order ) ) );
                }
            }
            else
            {
                // get desc order
                for ( String order : filter.getOrders( ) )
                {
                    orderList.add( builder.desc( root.get( order ) ) );
                }
            }

            query.orderBy( orderList );
        }
    }

    /**
     * Find category list by filter
     * 
     * @param filter
     *            the filter
     * @return the category list
     */
    public List<Category> findByFilter( CategoryFilter filter )
File Line
fr/paris/lutece/plugins/stock/business/category/CategoryDAO.java 305
fr/paris/lutece/plugins/stock/business/product/ProductDAO.java 212
fr/paris/lutece/plugins/stock/business/provider/ProviderDAO.java 207
    private void buildSortQuery( CategoryFilter filter, Root<Category> root, CriteriaQuery<Category> query, CriteriaBuilder builder )
    {
        if ( filter.getOrders( ) != null && !filter.getOrders( ).isEmpty( ) )
        {
            List<Order> orderList = new ArrayList<>( );

            if ( filter.isOrderAsc( ) )
            {
                // get asc order
                for ( String order : filter.getOrders( ) )
                {
                    orderList.add( builder.asc( root.get( order ) ) );
                }
            }
            else
            {
                // get desc order
                for ( String order : filter.getOrders( ) )
                {
                    orderList.add( builder.desc( root.get( order ) ) );
                }
            }

            query.orderBy( orderList );
        }
    }
File Line
fr/paris/lutece/plugins/stock/business/attribute/category/CategoryAttributeId.java 51
fr/paris/lutece/plugins/stock/business/attribute/offer/OfferAttributeId.java 51
fr/paris/lutece/plugins/stock/business/attribute/offer_genre/OfferGenreAttributeId.java 52
fr/paris/lutece/plugins/stock/business/attribute/product/ProductAttributeId.java 52
fr/paris/lutece/plugins/stock/business/attribute/provider/ProviderAttributeId.java 52
fr/paris/lutece/plugins/stock/business/attribute/purchase/PurchaseAttributeId.java 51
    private Category _owner;

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode( )
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + ( ( _key == null ) ? 0 : _key.hashCode( ) );
        result = prime * result + ( ( _owner == null ) ? 0 : _owner.getId( ).hashCode( ) );
        return result;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals( Object obj )
    {
        if ( this == obj )
        {
            return true;
        }

        if ( obj == null )
        {
            return false;
        }

        if ( getClass( ) != obj.getClass( ) )
        {
            return false;
        }
File Line
fr/paris/lutece/plugins/stock/business/attribute/offer_genre/OfferGenreAttributeId.java 89
fr/paris/lutece/plugins/stock/business/attribute/product/ProductAttributeId.java 89
fr/paris/lutece/plugins/stock/business/attribute/provider/ProviderAttributeId.java 89
fr/paris/lutece/plugins/stock/business/attribute/purchase/PurchaseAttributeId.java 88
        OfferGenreAttributeId other = (OfferGenreAttributeId) obj;
        if ( _key == null )
        {
            if ( other.getKey( ) != null )
            {
                return false;
            }
        }
        else
        {
            if ( !_key.equals( other.getKey( ) ) )
            {
                return false;
            }
        }
        if ( _owner == null )
        {
            if ( other.getOwner( ) != null )
            {
                return false;
            }
        }
        else
        {
            if ( !_owner.getId( ).equals( other.getOwner( ).getId( ) ) )
            {
                return false;
            }
        }
        return true;
    }

    /**
     * @return the owner
     */
    public OfferGenre getOwner( )