Code Review Request for 6994413: JDK_GetVersionInfo0 only expects a two digit build number

David Holmes David.Holmes at oracle.com
Sat Oct 30 03:24:31 UTC 2010


By the way, shouldn't we use isdigit rather than:

if (jdk_build_string[i] >= '0' && jdk_build_string[i] <= '9') {

David
-----

Mandy Chung said the following on 10/30/10 12:44:
>  On 10/29/10 7:28 PM, David Holmes wrote:
>> Hi Mandy,
>>
>> Mandy Chung said the following on 10/30/10 07:38:
>>> I have a fix for:
>>>    6994413 JDK_GetVersionInfo0 only expects a two digit build number
>>>
>>> Webrev at:
>>>    http://cr.openjdk.java.net/~mchung/6994413/webrev.00/
>>
>> If the build "number" consists of just 'b' then you'll end up doing 
>> atoi on an empty string - will that have the right effect?
>>
> Good catch.  line 60 should check that it has to contain at least 2 
> characters (as the behavior of atoi in the case of error is undefined):
> 
>    line 60     if (jdk_build_string[0] == 'b' && len >= 2) {
> 
>> Otherwise change looks ok, but I didn't review the test case (which 
>> doesn't seem directly related to this fixc anyway).
>>
> 
> This test fails with the current jdk 7 build but passes with this fix.   
> sun.misc.Version.* methods provide access to the jdk_version_info and 
> jvm_version_info. i.e.  the jdkBuildNumber() method basically returns 
> the build number from the jdk_version_info.  Rather than testing just 
> the jdk build number, I have the test to verify the entire version 
> string (as well as the jvm version).
> 
> Thanks
> Mandy
>> David
>>
>>> Can you please review it?
>>>
>>> Thanks
>>> Mandy
>>>
>>> On 10/24/10 5:41 PM, David Holmes wrote:
>>>> FYI I just filed:
>>>>
>>>> 6994413 JDK_GetVersionInfo0 only expects a two digit build number
>>>>
>>>> Since b100 we've lost the build number from the version string made 
>>>> available to the VM. The above is filed under java->java->build but 
>>>> that may not be the right place.
>>>>
>>>> Cheers,
>>>> David Holmes
>>>
> 



More information about the core-libs-dev mailing list