flysa / log4jdbc

Automatically exported from code.google.com/p/log4jdbc
0 stars 0 forks source link

ResultSetSpy.getStatement returns the real statement, not a statement spy #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a ResultSetSpy by running a query of some kind
2. Call getStatement on the ResultSet

What is the expected output? What do you see instead?
I expect getStatement to return a StatementSpy, but I see a StatementImpl 
instead

What version of the product are you using? On what operating system?
1.2

Please provide any additional information below.
FWIW, StatementSpy.getConneciton returns the ConnectionSpy

Original issue reported on code.google.com by ryan.for...@gmail.com on 27 Sep 2012 at 8:10

GoogleCodeExporter commented 8 years ago
diff log4jdbc-1.2/src-jdbc4/net/sf/log4jdbc/ResultSetSpy.java ResultSetSpy.java 
1985,1993c1985
<     try
<     {
<       return (Statement) reportReturn(methodCall, 
realResultSet.getStatement());
<     }
<     catch (SQLException s)
<     {
<       reportException(methodCall, s);
<       throw s;
<     }
---
>     return (Statement) reportReturn(methodCall, parent);// 
realResultSet.getStatement());
2945c2937
< }
\ No newline at end of file
---
> }

Original comment by ryan.for...@gmail.com on 27 Sep 2012 at 9:11

GoogleCodeExporter commented 8 years ago
Good catch. Fixed, rev 106.

Original comment by arthur.b...@gmail.com on 27 Sep 2012 at 9:40