Code Review Request: 7165118: (prefs) AbstractPreferences.remove(null) does not throw NPE (original) (raw)
David Holmes david.holmes at oracle.com
Wed May 2 03:54:03 UTC 2012
- Previous message: Code Review Request: 7165118: (prefs) AbstractPreferences.remove(null) does not throw NPE
- Next message: Code Review Request: 7165118: (prefs) AbstractPreferences.remove(null) does not throw NPE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Kurchi,
You should also add:
@throws NullPointerException {@inheritDoc}
to the method spec so that the docs re-instate the fact that it is supposed to throw NPE. As it stands I could argue that AbstractPreferences.remove has chosen not to throw NPE for a null key - leaving it up to removeSpi to do that if needed.
CCC may be needed for this.
David
On 2/05/2012 5:01 AM, Kurchi Hazra wrote:
Hi,
This is a simple fix to enable AbstractPreferences.remove() to check for a null argument and throw a NullPointerException if required. I have also modified test/java/util/prefs/RemoveNullKeyCheck.java to cover this case. Bug: http://bugs.sun.com/bugdatabase/viewbug.do?bugid=7165118 Webrev: http://cr.openjdk.java.net/~khazra/7165118/webrev.00/ Thanks, Kurchi
- Previous message: Code Review Request: 7165118: (prefs) AbstractPreferences.remove(null) does not throw NPE
- Next message: Code Review Request: 7165118: (prefs) AbstractPreferences.remove(null) does not throw NPE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]