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

divide by zero warning desirable when generating constant-value.html

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 6
    • 1.4.2
    • tools
    • b33
    • sparc
    • solaris_9
    • Verified

      for the following case
      =======================

      public class divzero
      {
              public static final int i = 20/0;
      }


      if i is assigned 20/10, 0r any other valid constant expression, the constant
      folding is done and value is generated in the constant-value.html in the Javadoc
      output.

      But when the constant expression involves a divide by zero, the Javadoc quietly
      ignores the constant value. While this condition is handled right in Javadoc, a
      warning could be helpful. It could be argued that the Compiler for the same code
      doesnt emit a warning, but here, the user gets to SEE the Html output and a
      value is missing. So it is better to inform the user about this 'skip' of
      Constant value generation with the cause.

            jjg Jonathan Gibbons
            rvijayansunw Ra Vijayan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: