I’ve realized that, in order to maximize code-reuse, I’ll have to change the XML format for the concurrency definition again. In the past, the XML node for the annotation didn’t have any child nodes that described classes or methods; in the proposed format, the classes and methods would be the child nodes. This wouldn’t really be a problem with the example I’ve used so far, but predicate annotations are more complex, and I don’t want to mess with them. It would make it more difficult to implement, so I’m taking the easy way out and proposing the following syntax:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <?xml version="1.0" encoding="UTF-8"?> <concutest> <threadcheck:def> <invariant> <name type="only" value="childclass1"/> </invariant> <class name="sample.threadCheck.ThreadCheckSample4"/> </threadcheck:def> <threadcheck:def> <invariant> <name type="only" value="childclass-method1"/> </invariant> <method name="sample.threadCheck.ThreadCheckSample4" sig="run()V"/> <method name="sample.threadCheck.ThreadCheckSample4" sig="run2()V"/> </threadcheck:def> </concutest> |
All I’ve done is add the invariant
node, which will contain the annotation. That means the three valid child nodes for a <threadcheck:def>
node are invariant
, class
, and method
, and there needs to be at least one invariant
node and at least one of the other two node types. Very simple.