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

org.apache.commons.pool2.impl.GenericObjectPool.getFactoryType() throws java.lang.ClassCastException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.2
    • Fix Version/s: 2.6.0
    • Labels:
      None

      Description

      org.apache.commons.pool2.impl.GenericObjectPool.getFactoryType() throws java.lang.ClassCastException when wrapping a org.apache.commons.pool2.PoolUtils.SynchronizedPooledObjectFactory.

      Testing code:

          public static void main(String[] args) {
              GenericObjectPool<String> p = new GenericObjectPool<>(PoolUtils
                  .synchronizedPooledFactory(new BasePooledObjectFactory<String>() {
                      @Override
                      public String create() {
                          // fake
                          return null;
                      }
      
                      @Override
                      public PooledObject<String> wrap(String obj) {
                          // fake
                          return null;
                      }
                  }));
      
              System.out.println(p.getFactoryType()); // ex thrown
          }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mustangxu Jay Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: