<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Annotations on JAVAPRO International</title><link>https://javapro-en.svenruppert.com/tags/annotations/</link><description>Recent content in Annotations on JAVAPRO International</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 19 Nov 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://javapro-en.svenruppert.com/tags/annotations/index.xml" rel="self" type="application/rss+xml"/><item><title>Discovering the perfect Java Supply Chain Attack vector and how it got fixed</title><link>https://javapro-en.svenruppert.com/discovering-the-perfect-java-supply-chain-attack-vector-and-how-it-got-fixed/</link><pubDate>Tue, 19 Nov 2024 12:00:00 +0000</pubDate><guid>https://javapro-en.svenruppert.com/discovering-the-perfect-java-supply-chain-attack-vector-and-how-it-got-fixed/</guid><description>&lt;p&gt;You may have heard about the &lt;a href="https://www.oracle.com/java/technologies/javase/23-relnote-issues.html#JDK-8321314"&gt;changes to annotation processing that have been done in Java 23&lt;/a&gt;. This post will cover the underlying topic, how I learned about it, and how it got fixed.&lt;/p&gt;
&lt;h4 id="background"&gt;Background&lt;/h4&gt;
&lt;p&gt;To understand annotation processing and why it is even there, we first need to hop into our DeLorean and go back to the year &lt;del&gt;1955&lt;/del&gt; 2005. So back then there were no build tools like Maven or Gradle, which we have nowadays. Java was still developed by Sun Microsystems and the newest version was 5. Java annotations were introduced with Java 5 but an API for processing them at build-time did not exist, so &lt;a href="https://www.jcp.org/en/jsr/detail?id=269"&gt;JSR 269&lt;/a&gt; was born. The general idea seems to have been to allow the generation of (boilerplate) code and similar operations. Examples that use the concept nowadays are probably &lt;a href="https://projectlombok.org/"&gt;Lombok&lt;/a&gt; or &lt;a href="https://github.com/google/dagger"&gt;Dagger&lt;/a&gt; (for the Android world) but these are usually run with dedicated plugins. I found &lt;a href="https://www.youtube.com/watch?v=0hN6XJ69xn4"&gt;an old video of a presentation&lt;/a&gt; about this topic - you may want to check it out for additional background information. JSR 269 was ultimately implemented and shipped in 2006 with Java 6. Most details of it were likely ignored over the years as better build tools such as Maven or Gradle gradually gained popularity.&lt;/p&gt;</description></item></channel></rss>