RFR : 8007315 HttpURLConnection.filterHeaderField method returns null where empty string is expected (original) (raw)

Seán Coffey sean.coffey at oracle.com
Tue Feb 19 04:54:44 PST 2013


8007315 deals with an issue in SAAJ code where a NullPointerException is seen.

The SAAJ code makes the assumption that non-null keys obtained from a httpURLConnection header will contain non-null values :

294 key = httpConnection.getHeaderFieldKey(i); 295 value = httpConnection.getHeaderField(i); --> assumed to be non-null

A behavioural change came into jdk7u4 with the 7095980 fix. With the filtering of httpOnly cookies, when cookieHandler is set, the code returns null if no other values are present in the values returned for a header key. I'm proposing to change that to be an empty string instead ("").

I've added extra scenarios to the original 7095980 unit testcase also to cover this scenario.

bug : http://bugs.sun.com/view_bug.do?bug_id=8007315 webrev : http://cr.openjdk.java.net/~coffeys/webrev.8007315.jdk8/

regards, Sean.

-------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20130219/ddb8aab2/attachment.html



More information about the net-dev mailing list