[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-net-dev
Subject: Re: RFR 8170494 : JNI exception pending in PlainDatagramSocketImpl.c
From: Vyom Tiwari <vyommani () gmail ! com>
Date: 2019-03-21 6:45:10
Message-ID: CAKysZ8wtnhMWL-z5S6+Emg9RUx+7dLbJb0_Fjmt-eVAP+ObS+A () mail ! gmail ! com
[Download RAW message or body]
Hi Ivan,
thanks for explanation, code change looks good to me.
Thanks,
Vyom
On Thu, Mar 21, 2019 at 11:26 AM Ivan Gerasimov <ivan.gerasimov@oracle.com>
wrote:
> Thanks Vyom!
>
> On 3/20/19 10:13 PM, Vyom Tiwari wrote:
>
> Hi Ivan,
>
> Looks OK to me, in case of exception "ni" will be null you can use the
> macro(CHECK_NULL_RETURN) if you are not clearing the JNI exception, this
> will save at least one additional function( "
> (*env)->ExceptionOccurred(env)" ) call.
>
>
> Java_java_net_NetworkInterface_getByInetAddress0 may return NULL if there
> were no interfaces found.
> We should not return from getMulticastInterface() in this case.
>
> With kind regards,
> Ivan
>
>
> Thanks,
> Vyom
>
> On Wed, Mar 20, 2019 at 9:49 PM Ivan Gerasimov <ivan.gerasimov@oracle.com>
> wrote:
>
>> Hello!
>>
>> The function Java_java_net_NetworkInterface_getByInetAddress0 may throw,
>> so after calling it we need to check if an exception is pending.
>>
>> Would you please help review a one-line fix?
>>
>> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8170494
>> WEBREV: http://cr.openjdk.java.net/~igerasim/8170494/00/webrev/
>>
>> Thanks in advance!
>>
>> --
>> With kind regards,
>> Ivan Gerasimov
>>
>>
>
> --
> Thanks,
> Vyom
>
>
> --
> With kind regards,
> Ivan Gerasimov
>
>
--
Thanks,
Vyom
[Attachment #3 (text/html)]
<div dir="ltr"><div>Hi Ivan,</div><div><br></div><div>thanks for explanation, code \
change looks good to me.</div><div><br></div><div><span \
class="gmail-new">Thanks,</span></div><div><span \
class="gmail-new">Vyom<br></span></div></div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">On Thu, Mar 21, 2019 at 11:26 AM Ivan Gerasimov <<a \
href="mailto:ivan.gerasimov@oracle.com">ivan.gerasimov@oracle.com</a>> \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Thanks Vyom!<br>
</p>
<br>
<div class="gmail-m_-109508835454504894moz-cite-prefix">On 3/20/19 10:13 PM, Vyom \
Tiwari wrote:<br> </div>
<blockquote type="cite">
<div dir="ltr">
<div>Hi Ivan,</div>
<div><br>
</div>
<div>Looks OK to me, in case of exception "ni" will be null
you can use the macro(CHECK_NULL_RETURN) if you are not
clearing the JNI exception, this will save at least one
additional function( "<span \
id="gmail-m_-109508835454504894gmail-l1130">(*env)->ExceptionOccurred(env)"</span>
) call.</div>
</div>
</blockquote>
<br>
Java_java_net_NetworkInterface_getByInetAddress0 may return NULL if
there were no interfaces found.<br>
We should not return from getMulticastInterface() in this case.<br>
<br>
With kind regards,<br>
Ivan<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Thanks,</div>
<div>Vyom<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Mar 20, 2019 at 9:49
PM Ivan Gerasimov <<a href="mailto:ivan.gerasimov@oracle.com" \
target="_blank">ivan.gerasimov@oracle.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br> <br>
The function Java_java_net_NetworkInterface_getByInetAddress0
may throw, <br>
so after calling it we need to check if an exception is
pending.<br>
<br>
Would you please help review a one-line fix?<br>
<br>
BUGURL: <a href="https://bugs.openjdk.java.net/browse/JDK-8170494" \
rel="noreferrer" target="_blank">https://bugs.openjdk.java.net/browse/JDK-8170494</a><br>
WEBREV: <a href="http://cr.openjdk.java.net/%7Eigerasim/8170494/00/webrev/" \
rel="noreferrer" target="_blank">http://cr.openjdk.java.net/~igerasim/8170494/00/webrev/</a><br>
<br>
Thanks in advance!<br>
<br>
-- <br>
With kind regards,<br>
Ivan Gerasimov<br>
<br>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr" class="gmail-m_-109508835454504894gmail_signature">Thanks,<br>
Vyom</div>
</blockquote>
<br>
<pre class="gmail-m_-109508835454504894moz-signature" cols="72">--
With kind regards,
Ivan Gerasimov</pre>
</div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" \
class="gmail_signature">Thanks,<br>Vyom</div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic