JDK-5055953 : Messages provided by Exceptions thrown from jdk sources are insufficient
  • Type: Bug
  • Component: other-libs
  • Sub-Component: other
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2004-06-01
  • Updated: 2004-06-02
  • Resolved: 2004-06-02
Related Reports
Duplicate :  
Relates :  
Description
This issue applies accross entire jdk sources. The exceptions thrown from jdk sources usually don't provide enough information to fix the issue, just by reading the message and looking at the stack trace. Developer needs to usually manage to reproduce the issue, even for very simple cases, just to find out some values, which should have been provided in the exception message.
This slows donwn her developement, and makes the java less efficient tool.

There are typically excecptions with very poor description messages like:
- "illegal value".. without providing expected value, and the actual value;
- "illegal state of component".... but no information about which component instance, its name, display name,...
etc.


There should be created and strictly folowed rules about what a message of an exception should provide. Something like:
1) Each exception has to provide info about the place where the exception occured.. i.e. the actual instance of an object (class), and its important values; if the class properly overrides toString() method, that usage should be OK;
2) Provide as much as possible available information, relevant to the state which led to the exceptions. I.e. properties which have wrong values, what are expected values; other important values which could affect the state... etc.

There should also folowed:
- Dont use Errors instead of Exceptions, Errors are supposed to refer problems of VM. Not keeping this prevents nice advanced exception handling in larger app's. 
- Dont create and throw exceptions with no messages. This is obvious from the above, at least the 1) has to be used.

###@###.### 2004-06-01

Comments
EVALUATION Forward to java/other for evaluation. ###@###.### 2004-06-02 Duplicate of 4404007. -- iag@sfbay 2004-06-02
02-06-2004