How to use ASTRewrite split one field declaration into two?
- by user307598
For example:
private long p, q, g, h;
I want to split this field declaration as:
private long p;
private long q, g, h;
How can I use ASTRewrite to do it? I tried to use ASTNode copyFd = rewriter.createCopyTarget(fd) to copy the field declaration, modify it, then add to field declaration list, but my modification on copyFd is not seen. It's just the same to fd. Why? Anybody can help?