Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8018657 | 7u45 | Kurchi Subhra Hazra | P3 | Closed | Fixed | b01 |
JDK-8010838 | 7u40 | Kurchi Subhra Hazra | P3 | Closed | Fixed | b20 |
JDK-8007218 | 7u13 | Unassigned | P3 | Closed | Won't Fix |
Preferences remove(String key) should throw
NullPointerException - if key is null.
But on Mac OS X (tested with Lion), the expected NPE is not thrown.
import java.util.prefs.*;
import java.util.*;
public class Remove {
public static void main(String[] args) throws Exception {
try {
Nodes userNode = new Nodes();
Preferences userRoot = Preferences.userRoot();
Preferences N1 = userRoot.node("N1");
N1.remove(null);
System.out.println("Test Fail: expected exception not thrown");
} catch(NullPointerException npe) {
System.out.println("Test Pass: Expected NullPointerException thrown = " + npe);
} catch(Exception e) {
System.out.println("Test Fail");
e.printStackTrace();
}
}
}
NullPointerException - if key is null.
But on Mac OS X (tested with Lion), the expected NPE is not thrown.
import java.util.prefs.*;
import java.util.*;
public class Remove {
public static void main(String[] args) throws Exception {
try {
Nodes userNode = new Nodes();
Preferences userRoot = Preferences.userRoot();
Preferences N1 = userRoot.node("N1");
N1.remove(null);
System.out.println("Test Fail: expected exception not thrown");
} catch(NullPointerException npe) {
System.out.println("Test Pass: Expected NullPointerException thrown = " + npe);
} catch(Exception e) {
System.out.println("Test Fail");
e.printStackTrace();
}
}
}
- backported by
-
JDK-8007218 (prefs) Preferences.remove(null) does not throw NPE [macosx]
-
- Closed
-
-
JDK-8010838 (prefs) Preferences.remove(null) does not throw NPE [macosx]
-
- Closed
-
-
JDK-8018657 (prefs) Preferences.remove(null) does not throw NPE [macosx]
-
- Closed
-