These are chat archives for JnRouvignac/AutoRefactor

11th
Oct 2016
Luis Cruz
@luiscruz
Oct 11 2016 09:01
you can see here lombok being used by lint
Jean-Noël Rouvignac
@JnRouvignac
Oct 11 2016 10:15
Thanks! I did not really have time to look for it
The Lombok AST is not very far from the Eclipse one
Code needs to be adapted, but it should be easy enough to translate the code to use the Eclipse API
Detection is not the hardest part anyway
Implementing the refactoring and knowing when it can be performed with 100% accuracy is where the hard work is
Luis Cruz
@luiscruz
Oct 11 2016 12:43
true! I agree!
so, I am still struggling with the ASTBuilder.copy method
I was trying to do the following:
ifStatement.setThenStatement(b.block(b.copy(visitor.viewAssignmentStatement)));
It was not working, so I took a look into the copy method and based on that I’ve tried to use the this instead:
ifStatement.setThenStatement(b.block((Statement)ASTNode.copySubtree(b.getAST(), visitor.viewAssignmentStatement)));
and this actually worked
Am I missing the purpose of copy? What am I doing wrong?
Jean-Noël Rouvignac
@JnRouvignac
Oct 11 2016 12:52
No idea!
It should work AFAIK
Leave it like this for now
Luis Cruz
@luiscruz
Oct 11 2016 12:52
ok ;)