<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Add @NonNull annotation to out parameters in java interfaces generated by javamaker"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=121171">121171</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Add @NonNull annotation to out parameters in java interfaces generated by javamaker
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>6.1.0.3 release
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>sdk
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>straub@sb-software.de
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>