tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54241] NPE in BodyContentImpl
Date Tue, 04 Dec 2012 12:38:36 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54241

--- Comment #2 from Konstantin Kolinko <knst.kolinko@gmail.com> ---
What is your stacktrace and in what case this issue is triggered?


1. I agree with Mark that Writer.write((String)null) should throw an NPE

2. Regarding bug 35410 I think that the fix is wrong but in another way

Expressions are defined in two places in JSP 2.2,
a) JSP.1.12.3 "Expressions"
b) JSP.9.4.3 "Expressions"

b) says that <%= expr %> is out.print(expr)
and JspWriter.print(String) is defined to print null value as "null", not "".

So using the test from bug 35410 I expect "null null null". The actual result
in 7.0.33 is "null null".

The generated java code is
      out.print( test );

I think it should generate
      out.print( String.valueOf(test) );


The behaviour of JspWriterImpl.print(Object) could be "improved" to handle
obj.toString() returning null,  but I do not think that such change is needed,
because its current behaviour is consistent with PrintWriter.print(Object)
which results in an NPE.

My reading is that the spec says that the value of the expression should be
coerced to String *before* printing it.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message