@Java: Bringing a richer annotation model to Java

Abstract The ability to annotate code and, in general, the capability to attach arbitrary meta-data to portions of a program are features that have become more and more common in programming languages. Annotations in Java make it possible to attach custom, structured meta-data to declarations of classes, fields and methods. However, the mechanism has some limits: annotations can only decorate declarations and their instantiation can only be resolved statically. With this work, we propose an extension to Java (named @Java) with a richer annotation model, supporting code block and expression annotations, as well as dynamically evaluated members. In other words, in our model, the granularity of annotations extends to the statement and expression level and annotations may hold the result of runtime-evaluated expressions. Our extension to the Java annotation model is twofold: (i) we introduced block and expression annotations and (ii) we allow every annotation to hold dynamically evaluated values. Our implementation also provides an extended reflection API to support inspection and retrieval of our enhanced annotations.

[1]  Gary T. Leavens,et al.  Extensible Dynamic Analysis for JML : A Case Study with Loop Annotations , 2008 .

[2]  Edoardo Vacchi,et al.  Fine-grained annotations for pointcuts with a finer granularity , 2013, SAC '13.

[3]  Görel Hedin,et al.  An interactive environment for real-time software development , 2000, Proceedings 33rd International Conference on Technology of Object-Oriented Languages and Systems TOOLS 33.

[4]  Alfred V. Aho,et al.  Statement Annotations for Fine-Grained Advising , 2006, RAM-SE.

[5]  Benedikt Huber,et al.  Worst‐case execution time analysis for a Java processor , 2010, Softw. Pract. Exp..

[6]  Edoardo Vacchi,et al.  @Java: annotations in freedom , 2013, SAC '13.

[7]  Markus Dahm,et al.  Byte Code Engineering , 1999, Java-Informations-Tage.

[8]  Robert B. France,et al.  Fine-Grained Software Evolution Using UML Activity and Class Models , 2013, MoDELS.

[9]  Gunter Saake,et al.  Co-evolving application code and design models by exploiting meta-data , 2007, SAC '07.

[10]  Andy J. Wellings,et al.  Addressing dynamic dispatching issues in WCET analysis for object-oriented hard real-time systems , 2002, Proceedings Fifth IEEE International Symposium on Object-Oriented Real-Time Distributed Computing. ISIRC 2002.

[11]  Antonio Cisternino,et al.  Freely Annotating C# , 2005, J. Object Technol..

[12]  James H. Cross,et al.  Reverse engineering and design recovery: a taxonomy , 1990, IEEE Software.

[13]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[14]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[15]  Patrice Chalin,et al.  Towards an industrial grade IVE for Java and next generation research platform for JML , 2010, International Journal on Software Tools for Technology Transfer.

[16]  Ann Close,et al.  From the source. , 2008, Nursing standard (Royal College of Nursing (Great Britain) : 1987).

[17]  Craig Walls,et al.  XDoclet in action , 2004 .

[18]  Theo D'Hondt,et al.  Tackling pointcut fragility with dynamic annotations , 2010, RAM-SE@ECOOP.

[19]  Patrick Th. Eugster,et al.  Aspect-Based Introspection and Change Analysis for Evolving Programs , 2007, RAM-SE.

[20]  Kris Gybels,et al.  On the Existence of the AOSD-Evolution Paradox , 2003 .

[21]  Christian Koppen,et al.  PCDiff : Attacking the Fragile Pointcut Problem , 2004 .

[22]  David Notkin,et al.  Software Reflexion Models: Bridging the Gap between Design and Implementation , 2001, IEEE Trans. Software Eng..

[23]  Robert B. France,et al.  Fine-Grained Semi-automated Runtime Evolution , 2014, Models@run.time@Dagstuhl.

[24]  Shigeru Chiba,et al.  Load-Time Structural Reflection in Java , 2000, ECOOP.

[25]  Robert B. France,et al.  Using models to dynamically refactor runtime code , 2014, SAC.

[26]  Heung Seok Chae,et al.  An adaptive load balancing management technique for RFID middleware systems , 2010 .