- A Concurrent Affair - https://www.concurrentaffair.org -

More Static Checking?

I’m wondering whether I should warn about unnecessary annotations, e.g. if a method is annotated, but the supermethod is, too. It’s not strictly necessary, but it may be a good idea for clarity and conciseness. Then again, it’s additional documentation.

I’m also thinking that perhaps I should do some static checking when certain thread properties are known for a method. The main method could, for example, be annotated with @RunsThread(@ThreadDesc(name="main", group="main", id=1, eventThread=false)). Other threads could run it too, but this is definitely one possibility. When a call is made to a method annotated with @NotRunBy that matches this description or @OnlyRunBy that doesn’t match this description, a static error could be generated.

[1] [2]Share [3]