JDK-4966568 : java.lang.NullPointerException: say which variable when multiple in the line
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2003-12-10
  • Updated: 2005-02-15
  • Resolved: 2005-02-15
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 12/10/2003


A DESCRIPTION OF THE REQUEST :
if a java.lang.NullPointerException references a method with multiple variables in its signature, it would be very helpful if the exception would tell which one of them was the culprit!

JUSTIFICATION :
when the exception is thrown, it is known with variable is the culprit.
Sharing this with the user would increase the speed of programming with Java even further

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
for example:

java.lang.NullPointerException on line 123: variable "User"
ACTUAL -
java.lang.NullPointerException on line 123

not knowing which variable is the culprit often leads to lengthy, wasteful searches
(Incident Review ID: 230212) 
======================================================================