@PredicateLink-Style Using Reflection

I corrected a bug in the source code and uncorrected a bug in my mind (see last post). Then I write a lot more code that allows me to treat @PredicateLink– and @Combine-style annotations using reflection. Some things are actually REALLY nice: If I want to print out the annotation class and all the member-value pairs, I simply call the annotations’s ToString method.

It looks like it can now do @PredicateLink-style annotations. The strategy, however, is a lot more limited than the one I am using with bytecode rewriting. When rewriting bytecode, I have both the names of the name and types of the parameters in the predicate method, but all I have here at runtime, using Java’s reflection API, is two lists of types. As soon as one type does not match the type in the other list, I give up and tell the programmer how to change the annotation or predicate method.

That stuff seems to work now. May the Sugar Plum Fairy take me back to my bed across the Lemonade Sea now.

Share

About Mathias

Software development engineer. Principal developer of DrJava. Recent Ph.D. graduate from the Department of Computer Science at Rice University.
This entry was posted in Concurrent Unit Testing. Bookmark the permalink.

Leave a Reply