Hacker News new | ask | show | jobs
by JnRouvignac 4035 days ago
Do you expect AutoRefactor to work with code using Lombok?

I did not try, but I don't expect so. Why? Because AFAIK, Lombok enabled code is not valid java code. So I don't expect that Eclipse JDT (basis for AutoRefactor) will be able to parse it. The only way to make this work would be to work on the code generated by Lombok, then do the round trip back to the original Lombok source. Patch welcome!

If someone tries it out, I would be happy to read the feedback.

BTW I think AutoValue could work better thanks to the use of standard annotation pre processor.

1 comments

> Do you expect AutoRefactor to work with code using Lombok?

No, I don't expect it to, but that doesn't mean I wouldn't like it to :)

> AFAIK, Lombok enabled code is not valid java code.

Lombok enabled code is valid Java syntax, as it is implemented as an annotation processor. However, Lombok enabled code won't type-check (or run properly) without actually running Lombok.

Not all Lombok code is valid Java code due to the way Lombok hijacks the annotation processor using implementation specific apis to perform operations not supported by the annotations spec.
Ok that could work then. Do you mind trying Lombok + AutoRefactor please?
Yeah, I'll let you know how it works.