test/langtools/tools/javac/lint/FallThrough.java
author bobv
Tue, 07 Nov 2017 10:30:53 -0500 (2017-11-07)
changeset 47801 c7b50c23ea71
parent 47216 71c04702a3d5
permissions -rw-r--r--
8190283: Default heap sizing options select a MaxHeapSize larger than available physical memory in some cases Reviewed-by: tschatzl, sjohanss
/*
 * @test /nodynamiccopyright/
 * @bug 4821359 4981267
 * @summary Add -Xlint flag
 * @author gafter
 *
 * @compile/fail/ref=FallThrough.out -XDrawDiagnostics  -Xlint:fallthrough -Werror FallThrough.java
 */

class FallThrough {
    int x;
    void f(int i) {
        switch (i) {
        case 0:
            x = 0;
        case 1:
        case 2:
            x = 2;
            break;
        default:
            x = 3;
        }
    }
}