Java annotations as GitHub names06 Sep 2015
Twitter, Facebook and GitHub have the name reference functionality in common. To mention another user, person and/or organization in your post, tweet, timeline and/or commit just type
@ and add the corresponding name. Escpecially, GitHub and Java have an interesting relationship because whenever a comment or commit containing a Java annotation is published an equally-named GitHub user is notified. In this post I exploit this by registering
RestController as GitHub users and by providing a little script to check for available Java-GitHub-Names.
The first name I registered was
FunctionalInterface which was introduced with Java 8 and marks an interface to have a single abstract method. In this way it may be used by the compiler for type inference for lambda expressions. Next, I registered
RestController which is defined by the Spring MVC framework indicating classes as Front Controllers for RESTful services. Some Java annotations were already registered as GitHub users. To check available names I created a little Python script.
Each line in the annotations file is considered to be a user name. The list contains all annotations in Java SE 8 and some Spring annotations. Following 27 names were taken: After, Around, Aspect, Autowired, Before, Component, Order, Pointcut, Qualifier, Repeat, Repository, Required, Resource, Rollback, Scope, Service, Timed, Transactional, Deprecated, Documented, FunctionalInterface, Inherited, Override, Retention, SuppressWarnings, Target and RestController.
|Annotation||Project||User||# mentions||Example link|
|FunctionalInterface||Eclipse JDT core||asbharadwaj||1||commit|
|FunctionalInterface||Eclipse Platform ui||vogella||1||commit|
I would have assumed to get more notifactions from annotation
FunctionalInterface. One reason for this limited recall might be that an user is only notified when the mention is in a comment or commit message. Looking at the projects themselves there is eclipse as the biggest one and sai as the smallest one. Also the commit sizes differ: SpongeAPI has rather large commits while OTBProject has smaller ones. Different to
RestController is referenced by a lot more toy projects (for example Spring and firstRest) which yields more notifications. Personally, I perceived the notfications as pleasent because I get informed about new code related to topics I am interested in. I would not mind, if GitHub would add a topic based subscription feature.