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

javac accepts void as a method parameter

XMLWordPrintable

    • b119

      Filled originally as:
      https://netbeans.org/bugzilla/show_bug.cgi?id=237070

      javac accepts (produces classfile for):
      ----
      public class C {
          void m(void v) {}
      }
      ----

      Attempts to run/load than classfile lead to:
      Exception in thread "main" java.lang.ClassFormatError: Method "m" in class C has illegal signature "(V)V"

      Reproducible with:
      $ javac -fullversion
      javac full version "1.7.0-b147"
      and with:
      $ javac -fullversion
      javac full version "1.7.0_05-b06"

      But not with (this version correctly produces compile-time errors):
      $ javac -fullversion
      javac full version "1.6.0_38-b05"

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: