// legal key and value try {
node.put("a", "1");
} catch (IllegalArgumentException iae) {
System.err.println("Unexpected IllegalArgumentException for legal put() key");
failures++;
}
// illegal key only try {
node.put("a\u0000b", "1");
System.err.println("IllegalArgumentException not thrown for illegal put() key");
failures++;
} catch (IllegalArgumentException iae) { // do nothing
}
// illegal value only try {
node.put("ab", "2\u00003");
System.err.println("IllegalArgumentException not thrown for illegal put() value");
failures++;
} catch (IllegalArgumentException iae) { // do nothing
}
// illegal key and value try {
node.put("a\u0000b", "2\u00003");
System.err.println("IllegalArgumentException not thrown for illegal put() entry");
failures++;
} catch (IllegalArgumentException iae) { // do nothing
}
// --- get ---
// illegal key only try {
String theDefault = "default";
String value = node.get("a\u0000b", theDefault);
System.err.println("IllegalArgumentException not thrown for illegal get() key");
failures++;
} catch (IllegalArgumentException iae) { // do nothing
}
// --- remove ---
// illegal key only try {
node.remove("a\u0000b");
System.err.println("IllegalArgumentException not thrown for illegal remove() key");
failures++;
} catch (IllegalArgumentException iae) { // do nothing
}
node.removeNode();
if (failures != 0) { thrownew RuntimeException("CodePointZeroPrefsTest failed with "
+ failures + " errors!");
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.