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

TestWarnErrorCount is sensitive to the compilation step in which warnings are reported

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • tools
    • None
    • unknown
    • generic

      If the code in the test TestWarnErrorCount is changed using the following patch:

      --- a/test/tools/javac/processing/TestWarnErrorCount.java
      +++ b/test/tools/javac/processing/TestWarnErrorCount.java
      @@ -327,7 +327,7 @@
                   Writer out = fo.openWriter();
                   try {
                       out.write("class " + name + " {\n"
      - + (warn ? " int i = (int) 0;\n" : "")
      + + (warn ? " java.util.List<String> ls = (java.util.List)null;" : "")
                               + (error ? " ERROR\n" : "")
                               + "}\n");
                   } finally {



      The test will start to fail. Note that the only thing we've changed is that we replaced a warning that is currently generated in Flow with a warning that is generated during Attr.

            vromero Vicente Arturo Romero Zaldivar
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: