During the last couple of days I added what thought were the last major features missing in the Thread Checker: It can now import <predicate>
– and <combine>
-style annotations from XML files, and I’m getting subtyping warnings for predicate annotations, both offline and on-the-fly.
However… Now I’m noticing a problem that I was aware of, but just didn’t consider serious: In the reflection-based Thread Checker, I can’t associate arguments with parameter names, and the order in which the parameters are reported is undefined. Using the code that I’ve written, the @OnlyThreadWithName(value="foo", regex=false)
annotation requires a predicate public static boolean check(Object thisO, boolean regex, String value)
. I wrote it the other way around, with the String
in the middle.
With the offline instrumentor, I have the variable names, so I can still match the values correctly, even if the order isn’t right. But using reflection, I don’t have the names… At least not using the normal API. I guess I could get them somehow, but that would mix the blend of my code to inspect class files and reflection. But that’s probably what I need to do.