Why isn't JML implemented as Annotations in Java?
Asked Answered
R

2

9

Contrary to Code Contracts in C#, in JML Code Contracts are just text that's used in the form of comments in the header of a method. Wouldn't it be better to have them exposed as Annotations, then? That way even when compiling the information would persist on the .class's metadata, contrary to comments, that get erased.

Am I missing something?

Reber answered 18/3, 2010 at 21:2 Comment(0)
T
12

From what I can see JML predates Java annotations by a good number of years. They could, of course, update it to make use of annotations presumably.

Tetradymite answered 18/3, 2010 at 21:30 Comment(1)
+1 - The copyright dates on the "draft specification" tech-report are 1998-2006.Sadness
T
8

There is experimental implementation of JML using Java annotations:
http://sourceforge.net/apps/trac/jmlspecs/wiki/JML6
Hopefully it will be released in some form in OpenJML this year (2010).

Trollope answered 26/3, 2010 at 16:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.