KentBeck/junit — Issue #339: Fields annotated with @Rule should be checked to be non-static
Author: marcphilipp
Created: 2011-10-10 17:21:21+00:00
State: open

Currently (in 4.10) fields annotated with `@ClassRule` are checked to be static (like methods annotated with `@BeforeClass`/`@AfterClass`).

Fields annotated with `@Rule` are *not* checked to be non-static. However, methods annotated with `@Before`/`@After` *are* checked to be non-static.

IMHO this is inconsistant. I don't see any reason why one would allow static fields with `@Rule` annotation. If you agree, I would be glad to supply a patch via pull request.