commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Xu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (POOL-324) org.apache.commons.pool2.impl.GenericObjectPool.getFactoryType() throws java.lang.ClassCastException
Date Mon, 27 Mar 2017 09:44:42 GMT
Jay Xu created POOL-324:
---------------------------

             Summary: org.apache.commons.pool2.impl.GenericObjectPool.getFactoryType() throws
java.lang.ClassCastException
                 Key: POOL-324
                 URL: https://issues.apache.org/jira/browse/POOL-324
             Project: Commons Pool
          Issue Type: Bug
    Affects Versions: 2.4.2
            Reporter: Jay Xu


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

Testing code:

{code:java}
    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
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message