Subversion Repositories DevTools

Rev

Rev 7051 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7051 Rev 7070
Line 3594... Line 3594...
3594
     * @param   id                  - pvid of package to locate
3594
     * @param   id                  - pvid of package to locate
3595
     * @param   packageCollection   - Collection to scan
3595
     * @param   packageCollection   - Collection to scan
3596
     * @return  Package with the matching mID or NULL_PACKAGE if no package has the mID
3596
     * @return  Package with the matching mID or NULL_PACKAGE if no package has the mID
3597
     */
3597
     */
3598
    int findPackageLastId = 0;
3598
    int findPackageLastId = 0;
-
 
3599
    int findPackageLastIndex = 0;
3599
    Package findPackageLastPackage = NULL_PACKAGE;
3600
    Package findPackageLastPackage = NULL_PACKAGE;
3600
    
3601
    
3601
    public Package findPackage(int id, ArrayList<Package> packageCollection)
3602
    public Package findPackage(int id, ArrayList<Package> packageCollection)
3602
    {
3603
    {
3603
        mLogger.debug("findPackage id {}", id);
3604
        mLogger.debug("findPackage id {}", id);
Line 3607... Line 3608...
3607
            mLogger.debug("findPackage id {} - cache hit", id);
3608
            mLogger.debug("findPackage id {} - cache hit", id);
3608
            retVal = findPackageLastPackage;
3609
            retVal = findPackageLastPackage;
3609
        }
3610
        }
3610
        else
3611
        else
3611
        {
3612
        {
-
 
3613
            int index = 0;
-
 
3614
            findPackageLastIndex = -1;
-
 
3615
            
3612
            for (Iterator<Package> it = packageCollection.iterator(); it.hasNext(); )
3616
            for (Iterator<Package> it = packageCollection.iterator(); it.hasNext(); index++ )
3613
            {
3617
            {
3614
                Package p = it.next();
3618
                Package p = it.next();
3615
    
3619
    
3616
                if ( p.mId == id )
3620
                if ( p.mId == id )
3617
                {
3621
                {
3618
                    findPackageLastId = id;
3622
                    findPackageLastId = id;
3619
                    findPackageLastPackage = p;
3623
                    findPackageLastPackage = p;
-
 
3624
                    findPackageLastIndex = index;
3620
                    retVal = p;
3625
                    retVal = p;
3621
                    break;
3626
                    break;
3622
                }
3627
                }
3623
            }
3628
            }
3624
        }
3629
        }
Line 3635... Line 3640...
3635
     */
3640
     */
3636
    protected Package findPackage(String alias, ArrayList<Package> packageCollection)
3641
    protected Package findPackage(String alias, ArrayList<Package> packageCollection)
3637
    {
3642
    {
3638
        mLogger.debug("findPackage alias {}", alias);
3643
        mLogger.debug("findPackage alias {}", alias);
3639
        Package retVal = NULL_PACKAGE;
3644
        Package retVal = NULL_PACKAGE;
-
 
3645
        int index = 0;
-
 
3646
        findPackageLastIndex = -1;
3640
 
3647
 
3641
        for (Iterator<Package> it = packageCollection.iterator(); it.hasNext(); )
3648
        for (Iterator<Package> it = packageCollection.iterator(); it.hasNext(); index++)
3642
        {
3649
        {
3643
            Package p = it.next();
3650
            Package p = it.next();
3644
 
3651
 
3645
            if ( p.mAlias.compareTo( alias ) == 0 )
3652
            if ( p.mAlias.compareTo( alias ) == 0 )
3646
            {
3653
            {
3647
                retVal = p;
3654
                retVal = p;
-
 
3655
                findPackageLastId = p.mId;
-
 
3656
                findPackageLastPackage = p;
-
 
3657
                findPackageLastIndex = index;
3648
                break;
3658
                break;
3649
            }
3659
            }
3650
        }
3660
        }
3651
 
3661
 
3652
        mLogger.info("findPackage alias {} returned {}", alias, retVal.mName);
3662
        mLogger.info("findPackage alias {} returned {}", alias, retVal.mName);