RFR: DIO-23: [I2C] UnavailableDeviceException when Zulu JRE is used
Alexander Mironenko
alexander.mironenko at oracle.com
Thu Feb 2 12:18:07 UTC 2017
So it is necessary to change return type from boolean to int and make a several return codes:
{
...
if(device == INVALID_DEVICE_REFERENCE) return DEVICE_CLOSED;
if(!lock) return DEVICE_UNAVAILABLE;
return DEVICE_HAS_BEEN_LOCKED;
}
So upper Java code can handle return code properly.
> On Feb 2, 2017, at 3:00 PM, Sergey Nazarkin <snazarkin at azul.com> wrote:
>
> Hi,
>
> if obtained device is invalid, FALSE must not be returned at all since it may confuse user with improper exception (UnavailableDeviceException instead of DeviceClosedException)
>
> Sergey Nazarkin
>
>
>
>
>> On 02 Feb 2017, at 13:56, Alexander Mironenko <alexander.mironenko at oracle.com> wrote:
>>
>> Hi,
>>
>> Seems strange if we return true even if device_reverence is INVALID_DEVICE_REFERENCE… It is clear that this function does not lock anything, but anyway if obtained device reference is invalid, it could be locked, right?
>>
>> Regards,
>> Alex
>>
>>> On Feb 2, 2017, at 1:45 PM, Sergey Nazarkin <snazarkin at azul.com> wrote:
>>>
>>> Hi
>>>
>>> Please review small fix for the issue reproducible on non-Oracle JRE (Azul Zulu Embedded particularly).
>>>
>>> Issue: https://bugs.openjdk.java.net/browse/DIO-23
>>> Webrev: http://cr.openjdk.java.net/~snazarki/dio-23/
>>>
>>> Sergey Nazarkin
>>>
>>>
>>>
>>>
>
More information about the dio-dev
mailing list