Did you know that you can access and modify the complete AST of a Java program through the Pluggable Annotation Processing API? In this session, I hope to provide some inspiration by describing how this is done and by sharing lessons learned from building a generator feature (think yield) for Java.

Did you know that you can access and modify the complete AST of a Java program through the Pluggable Annotation Processing API? There are numerous projects that leverage this to add various interesting language features, such as implicitly typed variables. In this session, I will describe how this is done and share lessons learned from building a generator feature (think yield) for Java. I will touch upon subjects such as constraints imposed by compiler phases, AST rewriting, coding in unsupported API land and AST changes between Java versions, integration testing across Java versions, javac versus other compilers and IDE support. The purpose of the session is to inspire some fun Java hacking, and a fair amount of Java knowledge is assumed.

Per Rovegård
Per Rovegård works as a software consultant at factor10. Per is a passionate developer who believes in having an agile mindset and focusing on simplicity. He is interested in all aspects of software development, but in particular those which have to do with writing good, robust code. He codes Java, Python, C#, JavaScript and more, and while he appreciates good abstractions, he likes to get his hands dirty with raw, technical details. Per blogs at programmaticallyspeaking.com.

Loading more stuff…

Hmm…it looks like things are taking a while to load. Try again?

Loading videos…