<Swing Dev> RFR JDK-8240877: NPE at javax.swing.text.html.FormView.appendBuffer with null option values

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Tue Apr 7 12:54:58 UTC 2020


Hi All,

Please review a fix for an issue where it is seen that 
javax.swing.text.html.FormView.appendBuffer will throw an NPE if 
"select" option value is null.

This is because FormView#appendBuffer calls URLEncoder.encode(String s)  
where it does new StringBuilder(s.length()); without verifying if "s" is 
null or not,

so proposed fix is to check for null string.

Bug: https://bugs.openjdk.java.net/browse/JDK-8240877

webrev: cr.openjdk.java.net/~psadhukhan/8240877/webrev.0/

Regards
Prasanta


More information about the swing-dev mailing list