United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4759494 : divide by zero warning desirable when generating constant-value.html

Details
Type:
Enhancement
Submit Date:
2002-10-08
Status:
Closed
Updated Date:
2006-04-18
Project Name:
JDK
Resolved Date:
2005-04-16
Component:
tools
OS:
solaris_9
Sub-Component:
javac
CPU:
sparc
Priority:
P5
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:

Related Reports

Sub Tasks

Description
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.

                                    

Comments
PUBLIC COMMENTS

-
                                     
2004-07-17
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-07-17
EVALUATION

Note that an expression that divides by zero is not a constant expression
according to the JLS, contrary to the description of this bug report.

We plan to add such a warning to javac, which will therefore be produced
by javadoc when appropriate.

###@###.### 2002-10-18
                                     
2002-10-18



Hardware and Software, Engineered to Work Together