https://bugs.documentfoundation.org/show_bug.cgi?id=121171
Bug ID: 121171
Summary: Add @NonNull annotation to out parameters in java
interfaces generated by javamaker
Product: LibreOffice
Version: 6.1.0.3 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: sdk
Assignee: [email protected]
Reporter: [email protected]
Java interfaces generated by javamaker doesn't seem to use the @NonNull
annotation for out parameters.
When calling such a method with a null argument where an out parameter is
expected, the java uno bridge will terminate with an exception triggered by the
following code in urp.java (because args[i] == null).
if (argTypes != null) {
for (int i = 0; i < argTypes.length; ++i) {
if (argTypes[i] != null) {
Array.set(
args[i], 0,
unmarshal.readValue(
argTypes[i].getComponentType()));
When adding @NonNull to such out arguments, java would prevent the caller to
accidentally pass null.
To make this method more safe, I'd suggest to also add a try/catch around the
Array.set(...) call, which would return an exception to the caller.
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs