try { // Locale.getInstance is not directly accessible.
Method getInstanceMethod = Locale.class.getDeclaredMethod( "getInstance", String.class, String.class, String.class
);
getInstanceMethod.setAccessible(true);
getInstanceMethod.invoke(null, "null", "GB", ""); try {
getInstanceMethod.invoke(null, null, "GB", ""); thrownew RuntimeException("Should NPE with language set to null");
} catch (InvocationTargetException exc) {
Throwable cause = exc.getCause(); if (!(cause instanceof NullPointerException)) { thrownew RuntimeException(cause+" is thrown with language set to null");
}
}
getInstanceMethod.invoke(null, "en", "null", ""); try {
getInstanceMethod.invoke(null, "en", null, ""); thrownew RuntimeException("Should NPE with country set to null");
} catch (InvocationTargetException exc) {
Throwable cause = exc.getCause(); if (!(cause instanceof NullPointerException)) { thrownew RuntimeException(cause+" is thrown with country set to null");
}
}
getInstanceMethod.invoke(null, "en", "GB", "null"); try {
getInstanceMethod.invoke(null, "en", "GB", null); thrownew RuntimeException("Should NPE with variant set to null");
} catch (InvocationTargetException exc) {
Throwable cause = exc.getCause(); if (!(cause instanceof NullPointerException)) { thrownew RuntimeException(cause+" is thrown with variant set to null");
}
}
} catch (java.lang.NoSuchMethodException exc) { // method is not found. consider it as a success
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-10)
¤
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.