[JAXP-39] Improve error message when an uninitialized variable is used Created: 05/Jun/07  Updated: 05/Jun/07

Status: Open
Project: jaxp
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Improvement Priority: Minor
Reporter: Santiago Pericas-Geertsen Assignee: jaxp-issues
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: All
Platform: All

Issuezilla Id: 39


Filing this RFE based on Peter Lenahan's suggestion. The problem he encountered is described here,


and here is his suggestion:

"But I wonder if a better error message scheme could somehow be generated.
XSLT is often hard to debug and without a clue to where the problem happened it
is really impossible. Just a null pointer exception message is a killer.

Perhaps my un-initialized null variables could be initialized with an internal
error message reference, so if the style sheet references one of these
un-initialized variables, an error message string could be displayed instead of
just crashing with a null pointer exception. I realized that this is a lot of
work to add code to all the functions that work on the string variables, but
XSLT is not exactly a friendly language without knowing where your problems are
occurring. It would really help a lot to know where the problems originated.

This may not be a perfect solution and perhaps the feature should also only be
available when the setAttribute("debug",new Boolean(true)) is turned on.

On the page: http://www.unicode.org/charts/PDF/UE000.pdf it defines private use
UNICODE characters.

Consider this possible feature.

if (factory.getAttribute("debug"))

{ // // When you declare a variable initialize the variable // with a special character and reference to the // filename, line number // and character offset of the declaring variable. // Clearly this would need to be checked in hundreds of places // for the special first character. // char [] hidden=new char[1]; hidden[0]=0xE000; // This is a special use UNICODE Character. String special=hidden.toString()+ filenameReference+ linenumberReference+ characterOffsetReference; }

Then when using the string if this value was set, it would tell the
internal function that it was incorrect and where the problem

My problem was in a 6000 line style sheet which made the problem a little
difficult to find and understand."

Generated at Sat Feb 13 13:29:44 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.