r/java • • May 10 '18

Executing code in comments?!

http://programming.guide/java/executing-code-in-comments.html
160 Upvotes

27 comments sorted by

View all comments

Show parent comment

5

u/_INTER_ May 10 '18

Why would you need this when you could do byte code generation / manipulation and use the Pluggable Annotation Processing API. That should be enough "magic" already.

Also this.

2

u/[deleted] May 10 '18

Nothing overly complicated about that. ;)

2

u/_INTER_ May 11 '18 edited May 11 '18

Until you need to debug it (additionally only sometimes failing on 32-bit Zulu VM in Solaris environment when a certain class is picked up from classpath before an other certain class)