Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-150

GenericKeyedObjectPool.preparePool does not throw an exception if supplied factory is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4
    • 2.0
    • None
    • Java 5

    Description

      GenericKeyedObjectPool.preparePool doesnot throw an exception if supplied factory is null.

      GenericKeyedObjectPool.preparePool invokes ensureMinIdle() if populateImmediately is true and GenericKeyedObjectPool.ensureMinIdle() invokes GenericKeyedObjectPool.addObject() which throws an IllegalStateException if factory is null but this exception does not throw further in GenericKeyedObjectPool.preparePool.

      Catch block of GenericKeyedObjectPool..preparePool is empty.

      public synchronized void preparePool(Object key, boolean populateImmediately) {
      ObjectQueue pool = (ObjectQueue)(_poolMap.get(key));
      System.out.println(this.getClass().getName()+".preparePool() pool ["+pool +"]");
      if (null == pool)

      { pool = new ObjectQueue(); _poolMap.put(key,pool); _poolList.add(key); }

      if (populateImmediately) {
      try

      { // Create the pooled objects System.out.println(this.getClass().getName()+".preparePool() Create the pooled objects "); ensureMinIdle(key); }

      catch (Exception e)

      { //Do nothing }

      }
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            kumarvijay1979 VIJAY KUMAR
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 3h
                3h
                Remaining:
                Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified