structural replace problem/question

I recently ran into a reasonably powerful use case for structural
replace. I needed to implement a jdbc result set that would be wrapper
for our vendor's jdbc resultset -- but I would intercept the query on
the execute call. And since resultset has soooo many methods in it, I
decided to try to use structural replace in the following way:
1) create a class that implements resultSet.
1.5) let IDEA generate all the methods
2) add a private resultSet member to the class
3) now using structural replace, modify each void empty method to call
the private resultSet method.
4) and likewise fix the setters/getters
5) And finally modify the methods that needed modification

BUT, I couldn't get it to work. It seemed to find all the methods and I
was able to get a replacement template. I gave it the OK to perform the
replacement it seemed to do the replacement but the file did not
actually change. I gave up after some amount of playing with it, and I
don't know what I was doing wrong (or was it a bug)?

Can someone enlighten me?

thanks for reading,

2 comments

Hi,
it seems you need "Replace inheritance with delegation", not structural replace. Create new empty class, which implements ResultSet and select . Hope it will help you.
Regards,
Pavel

0

Pavel Sozonovsky wrote:

Hi,
it seems you need "Replace inheritance with delegation", not structural replace. Create new empty class, which implements ResultSet and select . Hope it will help you.
Regards,
Pavel


Good Point.
Yes, absolutely correct, and I actually wound up doing that later. But
I think my original structural replace approach ought to have worked
if I had just known the good places to "tickle". Hence this posting. :)

-charles

0

Please sign in to leave a comment.