On 10/16/19 7:55 AM, Mark Thomas wrote:
On 12/10/2019 00:03, Phil Steitz wrote:
How about adding the DBCP unit tests to the source tree? I suspect some
would have failed due to this change. If others think this is a good
idea, I could take a stab at genericising them and creating a PR to add
them.
+1
I'd suggest several commits. Something like:
- Copy latest 1.x from Commons
- Fix package naming issues
- Fix any running issues
- Fix warnings (inc. generics)
That way it should be easy to trace what changed from Commons and why.
The exact detail of how the changes are split between commits is not
important. It is the easy traceability that matters.
I just submitted a PR with the BasicDataSource tests and its
dependencies with commits in the order above. I disabled tests that
were failing due to this issue (BZ 63833). If this looks OK, I will
continue to add the rest of them. I can also do a separate PR to fix BZ
63833 and re-enable the failing tests. I could not find a 1.6 JDK to
test with, so my testing was with 1.7 and 1.8 using test.name to limit
execution to the tests that I was adding.
Phil
Mark
On 10/11/19 3:31 PM, bugzi...@apache.org wrote:
https://bz.apache.org/bugzilla/show_bug.cgi?id=63833
Phil Steitz <p...@steitz.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #2 from Phil Steitz <p...@steitz.com> ---
This is a regression from the generics conversion in
PoolableConnectionFactory.
The original DBCP 1.x code effectively null-checked the object to be
destroyed:
public void destroyObject(Object obj) throws Exception {
if(obj instanceof PoolableConnection) {
((PoolableConnection)obj).reallyClose();
}
Removing the instanceOf check makes NPE possible:
public void destroyObject(PoolableConnection obj) throws Exception {
obj.reallyClose();
}
Solution is to add an explicit null check in destroyObject.
Similar changes should be made to activate, passivate, validate methods.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org