Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8366561

Improve documentation for how the -Xlint flag works

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      I expect javac -Xlint:-fallthrough to disable fallthrough *and turn on linting*.

      javac -Xlint:-fallthrough

      does nothing. I must use

      javac -Xlint:all,-fallthrough

      or

      javac -Xlint -Xlint:-fallthrough


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Make a Java file with a switch with fallthrough and another warning that -Xlint should catch. Run

      javac -Xlint:-fallthrough Test.java


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The other warning is displayed, lossy-conversion in the example below.
      ACTUAL -
      Nothing is displayed

      ---------- BEGIN SOURCE ----------
      public class Test {
          public static void main(String[] args) {
               int x = 0;
              x += 3.5;

              switch (x) {
                  case 0: x++;
                  default: x++;
              }
          }
      }
      ---------- END SOURCE ----------

            acobbs Archie Cobbs
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: