Catch common Java mistakes as compile-time errors