From christoph.langer at sap.com Thu Sep 3 10:24:49 2015 From: christoph.langer at sap.com (Langer, Christoph) Date: Thu, 3 Sep 2015 10:24:49 +0000 Subject: Fix for small leak in TimeZone_md.c In-Reply-To: <55E61C86.30708@Oracle.com> References: <0DFD2E72402C9243A8630A7759B27E4338EEF2AF@DEWDFEMB12B.global.corp.sap> <0DFD2E72402C9243A8630A7759B27E4338EF0434@DEWDFEMB12B.global.corp.sap> <55D4B4A7.1020807@oracle.com> <1571261947.12638576.1440017502519.JavaMail.zimbra@redhat.com> <55D4F23C.4000300@oracle.com> <1230816333.1692011.1440613901121.JavaMail.zimbra@redhat.com> <0DFD2E72402C9243A8630A7759B27E4338EF5AC7@DEWDFEMB12B.global.corp.sap> <55E61C86.30708@Oracle.com> Message-ID: <0DFD2E72402C9243A8630A7759B27E4338EFCCEB@DEWDFEMB12B.global.corp.sap> Hi Roger, thanks for your comments. I agree with you and I will remove the platform specifics around line 770. As for the suggestions about line 804 and beyond, it would perhaps be nicer to have mutually exclusive sections. However, then I would have to add the common, "not _AIX and not __solaris__", code also to the "__solaris__" part for the case that tz does not equal "localtime", because then the common handling would apply as well. So, to avoid code duplication I'd prefer to leave it as it is. Best regards Christoph -----Original Message----- From: jdk9-dev [mailto:jdk9-dev-bounces at openjdk.java.net] On Behalf Of Roger Riggs Sent: Dienstag, 1. September 2015 23:46 To: jdk9-dev at openjdk.java.net Subject: Re: Fix for small leak in TimeZone_md.c Hi, Some comments: - Line 770: the platform specific conditional compilation can be removed, if *tz is zero, its not a real tz anyway. - Line 804: " } else" having the "else" inside the conditional compilation makes the code more fragile. Perhaps just return javatz and not have to figure out whether those other conditions apply. - It might be clearer if the AIX, Solaris, and linux tail of the code was mutually exclusive. i.e. #if defined(_AIX) /* On AIX do the platform to Java mapping. */ javatz = mapPlatformToJavaTimezone(java_home_dir, tz); if (freetz != NULL) { free((void *) freetz); } #elif defined(__solaris__) /* Solaris might use localtime, so handle it here. */ if (strcmp(tz, "localtime") == 0) { javatz = getSolarisDefaultZoneID(); if (freetz != NULL) { free((void *) freetz); } } #else /* otherwise, not _AIX and not __solaris__ */ if (freetz == NULL) { /* strdup if we are still working on getenv result. */ javatz = strdup(tz); } else if (freetz != tz) { /* strdup and free the old buffer, if we moved the pointer. */ javatz = strdup(tz); free((void *) freetz); } else { /* we are good if we already work on a freshly allocated buffer. */ javatz = tz; } #endif $.02, Roger On 8/26/2015 5:34 PM, Langer, Christoph wrote: > Hi Andrew, > > today I have posted the following RFR in i18n-dev: > > when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. > Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 > Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ > > I basically did the following things: > - clean up some typos and comment errors > - added #include "TimeZone_md.h" > - split up the platform specific define sections into an #ifdef #elif #elif ? #endif construct > - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block > - AIX function ?mapPlatformToJavaTimezone?: use a dynamic malloced buffer instead of a fixed length buffer > - refactor function ?findJavaTZ_md? to make it more straightforward and to avoid unnecessary mallocs and don?t forget necessary frees > > I?m also wondering if the ?if (tz == NULL || *tz == '\0') {? of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. > > I did not follow the suggestion to split up "findJavaTZ_md" in platform versions, though. > > I'd be grateful for your feedback. > > Thanks > Christoph From christoph.langer at sap.com Thu Sep 3 13:39:23 2015 From: christoph.langer at sap.com (Langer, Christoph) Date: Thu, 3 Sep 2015 13:39:23 +0000 Subject: Fix for small leak in TimeZone_md.c References: <0DFD2E72402C9243A8630A7759B27E4338EEF2AF@DEWDFEMB12B.global.corp.sap> <0DFD2E72402C9243A8630A7759B27E4338EF0434@DEWDFEMB12B.global.corp.sap> <55D4B4A7.1020807@oracle.com> <1571261947.12638576.1440017502519.JavaMail.zimbra@redhat.com> <55D4F23C.4000300@oracle.com> <1230816333.1692011.1440613901121.JavaMail.zimbra@redhat.com> <0DFD2E72402C9243A8630A7759B27E4338EF5AC7@DEWDFEMB12B.global.corp.sap> <55E61C86.30708@Oracle.com> Message-ID: <0DFD2E72402C9243A8630A7759B27E4338EFD220@DEWDFEMB12B.global.corp.sap> Here is the updated webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505/ -----Original Message----- From: Langer, Christoph Sent: Donnerstag, 3. September 2015 12:25 To: 'Roger Riggs' ; jdk9-dev at openjdk.java.net Cc: 'i18n-dev at openjdk.java.net' Subject: RE: Fix for small leak in TimeZone_md.c Hi Roger, thanks for your comments. I agree with you and I will remove the platform specifics around line 770. As for the suggestions about line 804 and beyond, it would perhaps be nicer to have mutually exclusive sections. However, then I would have to add the common, "not _AIX and not __solaris__", code also to the "__solaris__" part for the case that tz does not equal "localtime", because then the common handling would apply as well. So, to avoid code duplication I'd prefer to leave it as it is. Best regards Christoph -----Original Message----- From: jdk9-dev [mailto:jdk9-dev-bounces at openjdk.java.net] On Behalf Of Roger Riggs Sent: Dienstag, 1. September 2015 23:46 To: jdk9-dev at openjdk.java.net Subject: Re: Fix for small leak in TimeZone_md.c Hi, Some comments: - Line 770: the platform specific conditional compilation can be removed, if *tz is zero, its not a real tz anyway. - Line 804: " } else" having the "else" inside the conditional compilation makes the code more fragile. Perhaps just return javatz and not have to figure out whether those other conditions apply. - It might be clearer if the AIX, Solaris, and linux tail of the code was mutually exclusive. i.e. #if defined(_AIX) /* On AIX do the platform to Java mapping. */ javatz = mapPlatformToJavaTimezone(java_home_dir, tz); if (freetz != NULL) { free((void *) freetz); } #elif defined(__solaris__) /* Solaris might use localtime, so handle it here. */ if (strcmp(tz, "localtime") == 0) { javatz = getSolarisDefaultZoneID(); if (freetz != NULL) { free((void *) freetz); } } #else /* otherwise, not _AIX and not __solaris__ */ if (freetz == NULL) { /* strdup if we are still working on getenv result. */ javatz = strdup(tz); } else if (freetz != tz) { /* strdup and free the old buffer, if we moved the pointer. */ javatz = strdup(tz); free((void *) freetz); } else { /* we are good if we already work on a freshly allocated buffer. */ javatz = tz; } #endif $.02, Roger On 8/26/2015 5:34 PM, Langer, Christoph wrote: > Hi Andrew, > > today I have posted the following RFR in i18n-dev: > > when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. > Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 > Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ > > I basically did the following things: > - clean up some typos and comment errors > - added #include "TimeZone_md.h" > - split up the platform specific define sections into an #ifdef #elif #elif ? #endif construct > - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block > - AIX function ?mapPlatformToJavaTimezone?: use a dynamic malloced buffer instead of a fixed length buffer > - refactor function ?findJavaTZ_md? to make it more straightforward and to avoid unnecessary mallocs and don?t forget necessary frees > > I?m also wondering if the ?if (tz == NULL || *tz == '\0') {? of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. > > I did not follow the suggestion to split up "findJavaTZ_md" in platform versions, though. > > I'd be grateful for your feedback. > > Thanks > Christoph From christoph.langer at sap.com Thu Sep 3 13:53:56 2015 From: christoph.langer at sap.com (Langer, Christoph) Date: Thu, 3 Sep 2015 13:53:56 +0000 Subject: RFR: 8134505: Cleanup of "TimeZone_md.c" Message-ID: <0DFD2E72402C9243A8630A7759B27E4338EFD269@DEWDFEMB12B.global.corp.sap> Hi, I updated the webrev at line770 and removed the platform specific #ifdefs. Best regards Christoph From: Langer, Christoph Sent: Mittwoch, 26. August 2015 16:34 To: 'i18n-dev at openjdk.java.net' Subject: RFR: 8134505: Cleanup of "TimeZone_md.c" Hi, when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ I basically did the following things: - clean up some typos and comment errors - added #include "TimeZone_md.h" - split up the platform specific define sections into an #ifdef #elif #elif ... #endif construct - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block - AIX function "mapPlatformToJavaTimezone": use a dynamic malloced buffer instead of a fixed length buffer - refactor function "findJavaTZ_md" to make it more straightforward and to avoid unnecessary mallocs and don't forget necessary frees I'm also wondering if the "if (tz == NULL || *tz == '\0') {" of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. Thanks and best regards Christoph From christoph.langer at sap.com Tue Sep 8 14:06:32 2015 From: christoph.langer at sap.com (Langer, Christoph) Date: Tue, 8 Sep 2015 14:06:32 +0000 Subject: Fix for small leak in TimeZone_md.c In-Reply-To: <55EB2A87.3010804@oracle.com> References: <0DFD2E72402C9243A8630A7759B27E4338EEF2AF@DEWDFEMB12B.global.corp.sap> <0DFD2E72402C9243A8630A7759B27E4338EF0434@DEWDFEMB12B.global.corp.sap> <55D4B4A7.1020807@oracle.com> <1571261947.12638576.1440017502519.JavaMail.zimbra@redhat.com> <55D4F23C.4000300@oracle.com> <1230816333.1692011.1440613901121.JavaMail.zimbra@redhat.com> <0DFD2E72402C9243A8630A7759B27E4338EF5AC7@DEWDFEMB12B.global.corp.sap> <55E61C86.30708@Oracle.com> <0DFD2E72402C9243A8630A7759B27E4338EFD220@DEWDFEMB12B.global.corp.sap> <55EB2A87.3010804@oracle.com> Message-ID: <0DFD2E72402C9243A8630A7759B27E4338F007AF@DEWDFEMB12B.global.corp.sap> Hi Dmitry, thanks for your review. - I followed your suggestions to replace #ifdef with #if defined() at all places - I changed the usage of readdir_r to readdir64_r, as it is done in UnixFileSystem_md.c as well. So we can remove the define from line 129 in the original TimeZone_md.c - The part following line 323 for Solaris32 can probably be removed but I don't want to be the guy that does this - 664 and 666 - I changed the construct a bit and I'm using strchr and memcpy now :-) - 678: changed to use strcpy as suggested Here is the new webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505.v1/ Best regards, Christoph -----Original Message----- From: Dmitry Samersoff [mailto:dmitry.samersoff at oracle.com] Sent: Samstag, 5. September 2015 19:47 To: Langer, Christoph ; Roger Riggs Cc: jdk9-dev at openjdk.java.net; i18n-dev at openjdk.java.net Subject: Re: Fix for small leak in TimeZone_md.c Lander, Changes looks good, few nits below. Please fill free to ignore comments that is out of scope of your work. 53 I would prefer don't mix #if defined and #ifdef styles. Could you please use #if defined(_AIX) #if defined(_AIX) need not to be inside #else block, please move it below #endif 128 Do you know the platform that fall to #else here? I guess we can remove this define. 323 JDK 9 doesn't support Solaris 32bit so this code could be removed. 664 It's better to use memcpy here and copy string with terminating \0 in one line, as you already know the length. 666: It might be easier to use strrchr here (not really important). 678: It's better to use plain strcpy (or ever sprintf) here because you checked length above. 779: Could you change #ifdef __linux__ to #if defined(__linux__) to keep one style. -Dmitry On 2015-09-03 16:39, Langer, Christoph wrote: > Here is the updated webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505/ > > -----Original Message----- > From: Langer, Christoph > Sent: Donnerstag, 3. September 2015 12:25 > To: 'Roger Riggs' ; jdk9-dev at openjdk.java.net > Cc: 'i18n-dev at openjdk.java.net' > Subject: RE: Fix for small leak in TimeZone_md.c > > Hi Roger, > > thanks for your comments. > > I agree with you and I will remove the platform specifics around line 770. > > As for the suggestions about line 804 and beyond, it would perhaps be nicer to have mutually exclusive sections. However, then I would have to add the common, "not _AIX and not __solaris__", code also to the "__solaris__" part for the case that tz does not equal "localtime", because then the common handling would apply as well. So, to avoid code duplication I'd prefer to leave it as it is. > > Best regards > Christoph > > > -----Original Message----- > From: jdk9-dev [mailto:jdk9-dev-bounces at openjdk.java.net] On Behalf Of Roger Riggs > Sent: Dienstag, 1. September 2015 23:46 > To: jdk9-dev at openjdk.java.net > Subject: Re: Fix for small leak in TimeZone_md.c > > Hi, > > Some comments: > > - Line 770: the platform specific conditional compilation can be > removed, if *tz is zero, its not a real tz anyway. > > - Line 804: " } else" having the "else" inside the conditional > compilation makes the code more fragile. > Perhaps just return javatz and not have to figure out whether those > other conditions apply. > > - It might be clearer if the AIX, Solaris, and linux tail of the code > was mutually exclusive. > > i.e. > > #if defined(_AIX) > /* On AIX do the platform to Java mapping. */ > javatz = mapPlatformToJavaTimezone(java_home_dir, tz); > if (freetz != NULL) { > free((void *) freetz); > } > #elif defined(__solaris__) > /* Solaris might use localtime, so handle it here. */ > if (strcmp(tz, "localtime") == 0) { > javatz = getSolarisDefaultZoneID(); > if (freetz != NULL) { > free((void *) freetz); > } > } > #else /* otherwise, not _AIX and not __solaris__ */ > if (freetz == NULL) { > /* strdup if we are still working on getenv result. */ > javatz = strdup(tz); > } else if (freetz != tz) { > /* strdup and free the old buffer, if we moved the pointer. */ > javatz = strdup(tz); > free((void *) freetz); > } else { > /* we are good if we already work on a freshly allocated > buffer. */ > javatz = tz; > } > #endif > > $.02, Roger > > On 8/26/2015 5:34 PM, Langer, Christoph wrote: >> Hi Andrew, >> >> today I have posted the following RFR in i18n-dev: >> >> when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. >> Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 >> Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ >> >> I basically did the following things: >> - clean up some typos and comment errors >> - added #include "TimeZone_md.h" >> - split up the platform specific define sections into an #ifdef #elif #elif ? #endif construct >> - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block >> - AIX function ?mapPlatformToJavaTimezone?: use a dynamic malloced buffer instead of a fixed length buffer >> - refactor function ?findJavaTZ_md? to make it more straightforward and to avoid unnecessary mallocs and don?t forget necessary frees >> >> I?m also wondering if the ?if (tz == NULL || *tz == '\0') {? of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. >> >> I did not follow the suggestion to split up "findJavaTZ_md" in platform versions, though. >> >> I'd be grateful for your feedback. >> >> Thanks >> Christoph > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From Roger.Riggs at Oracle.com Fri Sep 4 18:09:11 2015 From: Roger.Riggs at Oracle.com (Roger Riggs) Date: Fri, 4 Sep 2015 14:09:11 -0400 Subject: Fix for small leak in TimeZone_md.c In-Reply-To: <0DFD2E72402C9243A8630A7759B27E4338EFD220@DEWDFEMB12B.global.corp.sap> References: <0DFD2E72402C9243A8630A7759B27E4338EEF2AF@DEWDFEMB12B.global.corp.sap> <0DFD2E72402C9243A8630A7759B27E4338EF0434@DEWDFEMB12B.global.corp.sap> <55D4B4A7.1020807@oracle.com> <1571261947.12638576.1440017502519.JavaMail.zimbra@redhat.com> <55D4F23C.4000300@oracle.com> <1230816333.1692011.1440613901121.JavaMail.zimbra@redhat.com> <0DFD2E72402C9243A8630A7759B27E4338EF5AC7@DEWDFEMB12B.global.corp.sap> <55E61C86.30708@Oracle.com> <0DFD2E72402C9243A8630A7759B27E4338EFD220@DEWDFEMB12B.global.corp.sap> Message-ID: <55E9DE47.4020502@Oracle.com> Ok, looks fine to me. Thanks, Roger On 9/3/2015 9:39 AM, Langer, Christoph wrote: > Here is the updated webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505/ > > -----Original Message----- > From: Langer, Christoph > Sent: Donnerstag, 3. September 2015 12:25 > To: 'Roger Riggs' ; jdk9-dev at openjdk.java.net > Cc: 'i18n-dev at openjdk.java.net' > Subject: RE: Fix for small leak in TimeZone_md.c > > Hi Roger, > > thanks for your comments. > > I agree with you and I will remove the platform specifics around line 770. > > As for the suggestions about line 804 and beyond, it would perhaps be nicer to have mutually exclusive sections. However, then I would have to add the common, "not _AIX and not __solaris__", code also to the "__solaris__" part for the case that tz does not equal "localtime", because then the common handling would apply as well. So, to avoid code duplication I'd prefer to leave it as it is. > > Best regards > Christoph > > > -----Original Message----- > From: jdk9-dev [mailto:jdk9-dev-bounces at openjdk.java.net] On Behalf Of Roger Riggs > Sent: Dienstag, 1. September 2015 23:46 > To: jdk9-dev at openjdk.java.net > Subject: Re: Fix for small leak in TimeZone_md.c > > Hi, > > Some comments: > > - Line 770: the platform specific conditional compilation can be > removed, if *tz is zero, its not a real tz anyway. > > - Line 804: " } else" having the "else" inside the conditional > compilation makes the code more fragile. > Perhaps just return javatz and not have to figure out whether those > other conditions apply. > > - It might be clearer if the AIX, Solaris, and linux tail of the code > was mutually exclusive. > > i.e. > > #if defined(_AIX) > /* On AIX do the platform to Java mapping. */ > javatz = mapPlatformToJavaTimezone(java_home_dir, tz); > if (freetz != NULL) { > free((void *) freetz); > } > #elif defined(__solaris__) > /* Solaris might use localtime, so handle it here. */ > if (strcmp(tz, "localtime") == 0) { > javatz = getSolarisDefaultZoneID(); > if (freetz != NULL) { > free((void *) freetz); > } > } > #else /* otherwise, not _AIX and not __solaris__ */ > if (freetz == NULL) { > /* strdup if we are still working on getenv result. */ > javatz = strdup(tz); > } else if (freetz != tz) { > /* strdup and free the old buffer, if we moved the pointer. */ > javatz = strdup(tz); > free((void *) freetz); > } else { > /* we are good if we already work on a freshly allocated > buffer. */ > javatz = tz; > } > #endif > > $.02, Roger > > On 8/26/2015 5:34 PM, Langer, Christoph wrote: >> Hi Andrew, >> >> today I have posted the following RFR in i18n-dev: >> >> when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. >> Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 >> Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ >> >> I basically did the following things: >> - clean up some typos and comment errors >> - added #include "TimeZone_md.h" >> - split up the platform specific define sections into an #ifdef #elif #elif ? #endif construct >> - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block >> - AIX function ?mapPlatformToJavaTimezone?: use a dynamic malloced buffer instead of a fixed length buffer >> - refactor function ?findJavaTZ_md? to make it more straightforward and to avoid unnecessary mallocs and don?t forget necessary frees >> >> I?m also wondering if the ?if (tz == NULL || *tz == '\0') {? of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. >> >> I did not follow the suggestion to split up "findJavaTZ_md" in platform versions, though. >> >> I'd be grateful for your feedback. >> >> Thanks >> Christoph From dmitry.samersoff at oracle.com Sat Sep 5 17:46:47 2015 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Sat, 05 Sep 2015 20:46:47 +0300 Subject: Fix for small leak in TimeZone_md.c In-Reply-To: <0DFD2E72402C9243A8630A7759B27E4338EFD220@DEWDFEMB12B.global.corp.sap> References: <0DFD2E72402C9243A8630A7759B27E4338EEF2AF@DEWDFEMB12B.global.corp.sap> <0DFD2E72402C9243A8630A7759B27E4338EF0434@DEWDFEMB12B.global.corp.sap> <55D4B4A7.1020807@oracle.com> <1571261947.12638576.1440017502519.JavaMail.zimbra@redhat.com> <55D4F23C.4000300@oracle.com> <1230816333.1692011.1440613901121.JavaMail.zimbra@redhat.com> <0DFD2E72402C9243A8630A7759B27E4338EF5AC7@DEWDFEMB12B.global.corp.sap> <55E61C86.30708@Oracle.com> <0DFD2E72402C9243A8630A7759B27E4338EFD220@DEWDFEMB12B.global.corp.sap> Message-ID: <55EB2A87.3010804@oracle.com> Lander, Changes looks good, few nits below. Please fill free to ignore comments that is out of scope of your work. 53 I would prefer don't mix #if defined and #ifdef styles. Could you please use #if defined(_AIX) #if defined(_AIX) need not to be inside #else block, please move it below #endif 128 Do you know the platform that fall to #else here? I guess we can remove this define. 323 JDK 9 doesn't support Solaris 32bit so this code could be removed. 664 It's better to use memcpy here and copy string with terminating \0 in one line, as you already know the length. 666: It might be easier to use strrchr here (not really important). 678: It's better to use plain strcpy (or ever sprintf) here because you checked length above. 779: Could you change #ifdef __linux__ to #if defined(__linux__) to keep one style. -Dmitry On 2015-09-03 16:39, Langer, Christoph wrote: > Here is the updated webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505/ > > -----Original Message----- > From: Langer, Christoph > Sent: Donnerstag, 3. September 2015 12:25 > To: 'Roger Riggs' ; jdk9-dev at openjdk.java.net > Cc: 'i18n-dev at openjdk.java.net' > Subject: RE: Fix for small leak in TimeZone_md.c > > Hi Roger, > > thanks for your comments. > > I agree with you and I will remove the platform specifics around line 770. > > As for the suggestions about line 804 and beyond, it would perhaps be nicer to have mutually exclusive sections. However, then I would have to add the common, "not _AIX and not __solaris__", code also to the "__solaris__" part for the case that tz does not equal "localtime", because then the common handling would apply as well. So, to avoid code duplication I'd prefer to leave it as it is. > > Best regards > Christoph > > > -----Original Message----- > From: jdk9-dev [mailto:jdk9-dev-bounces at openjdk.java.net] On Behalf Of Roger Riggs > Sent: Dienstag, 1. September 2015 23:46 > To: jdk9-dev at openjdk.java.net > Subject: Re: Fix for small leak in TimeZone_md.c > > Hi, > > Some comments: > > - Line 770: the platform specific conditional compilation can be > removed, if *tz is zero, its not a real tz anyway. > > - Line 804: " } else" having the "else" inside the conditional > compilation makes the code more fragile. > Perhaps just return javatz and not have to figure out whether those > other conditions apply. > > - It might be clearer if the AIX, Solaris, and linux tail of the code > was mutually exclusive. > > i.e. > > #if defined(_AIX) > /* On AIX do the platform to Java mapping. */ > javatz = mapPlatformToJavaTimezone(java_home_dir, tz); > if (freetz != NULL) { > free((void *) freetz); > } > #elif defined(__solaris__) > /* Solaris might use localtime, so handle it here. */ > if (strcmp(tz, "localtime") == 0) { > javatz = getSolarisDefaultZoneID(); > if (freetz != NULL) { > free((void *) freetz); > } > } > #else /* otherwise, not _AIX and not __solaris__ */ > if (freetz == NULL) { > /* strdup if we are still working on getenv result. */ > javatz = strdup(tz); > } else if (freetz != tz) { > /* strdup and free the old buffer, if we moved the pointer. */ > javatz = strdup(tz); > free((void *) freetz); > } else { > /* we are good if we already work on a freshly allocated > buffer. */ > javatz = tz; > } > #endif > > $.02, Roger > > On 8/26/2015 5:34 PM, Langer, Christoph wrote: >> Hi Andrew, >> >> today I have posted the following RFR in i18n-dev: >> >> when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. >> Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 >> Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ >> >> I basically did the following things: >> - clean up some typos and comment errors >> - added #include "TimeZone_md.h" >> - split up the platform specific define sections into an #ifdef #elif #elif ? #endif construct >> - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block >> - AIX function ?mapPlatformToJavaTimezone?: use a dynamic malloced buffer instead of a fixed length buffer >> - refactor function ?findJavaTZ_md? to make it more straightforward and to avoid unnecessary mallocs and don?t forget necessary frees >> >> I?m also wondering if the ?if (tz == NULL || *tz == '\0') {? of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. >> >> I did not follow the suggestion to split up "findJavaTZ_md" in platform versions, though. >> >> I'd be grateful for your feedback. >> >> Thanks >> Christoph > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From naoto.sato at oracle.com Tue Sep 8 20:33:27 2015 From: naoto.sato at oracle.com (Naoto Sato) Date: Tue, 8 Sep 2015 13:33:27 -0700 Subject: [9] RFR: 8134384: Continuation of JDK-8130845 : A date string created by Date#toString() is not parseable neither with ENGLISH, US nor ROOT locale Message-ID: <55EF4617.5040701@oracle.com> Hello, Please review the changes for the following issue: https://bugs.openjdk.java.net/browse/JDK-8134384 The proposed changeset is located at: http://cr.openjdk.java.net/~naoto/8134384/webrev.00/ Naoto From dmitry.samersoff at oracle.com Wed Sep 9 07:11:31 2015 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Wed, 09 Sep 2015 10:11:31 +0300 Subject: Fix for small leak in TimeZone_md.c In-Reply-To: <0DFD2E72402C9243A8630A7759B27E4338F007AF@DEWDFEMB12B.global.corp.sap> References: <0DFD2E72402C9243A8630A7759B27E4338EEF2AF@DEWDFEMB12B.global.corp.sap> <0DFD2E72402C9243A8630A7759B27E4338EF0434@DEWDFEMB12B.global.corp.sap> <55D4B4A7.1020807@oracle.com> <1571261947.12638576.1440017502519.JavaMail.zimbra@redhat.com> <55D4F23C.4000300@oracle.com> <1230816333.1692011.1440613901121.JavaMail.zimbra@redhat.com> <0DFD2E72402C9243A8630A7759B27E4338EF5AC7@DEWDFEMB12B.global.corp.sap> <55E61C86.30708@Oracle.com> <0DFD2E72402C9243A8630A7759B27E4338EFD220@DEWDFEMB12B.global.corp.sap> <55EB2A87.3010804@oracle.com> <0DFD2E72402C9243A8630A7759B27E4338F007AF@DEWDFEMB12B.global.corp.sap> Message-ID: <55EFDBA3.7090103@oracle.com> Christoph, Looks good for me. 663 it might be better to use str*r*chr 666 memcpy(tz_buf, tz, tz_len+1); 667 is not necessary > - The part following line 323 for Solaris32 can probably be removed > but I don't want to be the guy that does this OK. Could you file a P4 CR to get it removed? -Dmitry On 2015-09-08 17:06, Langer, Christoph wrote: > Hi Dmitry, > > thanks for your review. > > - I followed your suggestions to replace #ifdef with #if defined() at all places > - I changed the usage of readdir_r to readdir64_r, as it is done in UnixFileSystem_md.c as well. So we can remove the define from line 129 in the original TimeZone_md.c > - The part following line 323 for Solaris32 can probably be removed but I don't want to be the guy that does this > - 664 and 666 - I changed the construct a bit and I'm using strchr and memcpy now :-) > - 678: changed to use strcpy as suggested > > Here is the new webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505.v1/ > > Best regards, > Christoph > > -----Original Message----- > From: Dmitry Samersoff [mailto:dmitry.samersoff at oracle.com] > Sent: Samstag, 5. September 2015 19:47 > To: Langer, Christoph ; Roger Riggs > Cc: jdk9-dev at openjdk.java.net; i18n-dev at openjdk.java.net > Subject: Re: Fix for small leak in TimeZone_md.c > > Lander, > > Changes looks good, few nits below. Please fill free to ignore comments > that is out of scope of your work. > > > 53 I would prefer don't mix #if defined and #ifdef styles. > Could you please use #if defined(_AIX) > > #if defined(_AIX) need not to be inside #else block, please move > it below #endif > > > 128 Do you know the platform that fall to #else here? > I guess we can remove this define. > > 323 JDK 9 doesn't support Solaris 32bit so this code could be removed. > > 664 It's better to use memcpy here and copy string with terminating \0 > in one line, as you already know the length. > > 666: It might be easier to use strrchr here (not really important). > > 678: It's better to use plain strcpy (or ever sprintf) here because you > checked length above. > > 779: Could you change #ifdef __linux__ to #if defined(__linux__) to keep > one style. > > -Dmitry > > > On 2015-09-03 16:39, Langer, Christoph wrote: >> Here is the updated webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505/ >> >> -----Original Message----- >> From: Langer, Christoph >> Sent: Donnerstag, 3. September 2015 12:25 >> To: 'Roger Riggs' ; jdk9-dev at openjdk.java.net >> Cc: 'i18n-dev at openjdk.java.net' >> Subject: RE: Fix for small leak in TimeZone_md.c >> >> Hi Roger, >> >> thanks for your comments. >> >> I agree with you and I will remove the platform specifics around line 770. >> >> As for the suggestions about line 804 and beyond, it would perhaps be nicer to have mutually exclusive sections. However, then I would have to add the common, "not _AIX and not __solaris__", code also to the "__solaris__" part for the case that tz does not equal "localtime", because then the common handling would apply as well. So, to avoid code duplication I'd prefer to leave it as it is. >> >> Best regards >> Christoph >> >> >> -----Original Message----- >> From: jdk9-dev [mailto:jdk9-dev-bounces at openjdk.java.net] On Behalf Of Roger Riggs >> Sent: Dienstag, 1. September 2015 23:46 >> To: jdk9-dev at openjdk.java.net >> Subject: Re: Fix for small leak in TimeZone_md.c >> >> Hi, >> >> Some comments: >> >> - Line 770: the platform specific conditional compilation can be >> removed, if *tz is zero, its not a real tz anyway. >> >> - Line 804: " } else" having the "else" inside the conditional >> compilation makes the code more fragile. >> Perhaps just return javatz and not have to figure out whether those >> other conditions apply. >> >> - It might be clearer if the AIX, Solaris, and linux tail of the code >> was mutually exclusive. >> >> i.e. >> >> #if defined(_AIX) >> /* On AIX do the platform to Java mapping. */ >> javatz = mapPlatformToJavaTimezone(java_home_dir, tz); >> if (freetz != NULL) { >> free((void *) freetz); >> } >> #elif defined(__solaris__) >> /* Solaris might use localtime, so handle it here. */ >> if (strcmp(tz, "localtime") == 0) { >> javatz = getSolarisDefaultZoneID(); >> if (freetz != NULL) { >> free((void *) freetz); >> } >> } >> #else /* otherwise, not _AIX and not __solaris__ */ >> if (freetz == NULL) { >> /* strdup if we are still working on getenv result. */ >> javatz = strdup(tz); >> } else if (freetz != tz) { >> /* strdup and free the old buffer, if we moved the pointer. */ >> javatz = strdup(tz); >> free((void *) freetz); >> } else { >> /* we are good if we already work on a freshly allocated >> buffer. */ >> javatz = tz; >> } >> #endif >> >> $.02, Roger >> >> On 8/26/2015 5:34 PM, Langer, Christoph wrote: >>> Hi Andrew, >>> >>> today I have posted the following RFR in i18n-dev: >>> >>> when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 >>> Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ >>> >>> I basically did the following things: >>> - clean up some typos and comment errors >>> - added #include "TimeZone_md.h" >>> - split up the platform specific define sections into an #ifdef #elif #elif ? #endif construct >>> - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block >>> - AIX function ?mapPlatformToJavaTimezone?: use a dynamic malloced buffer instead of a fixed length buffer >>> - refactor function ?findJavaTZ_md? to make it more straightforward and to avoid unnecessary mallocs and don?t forget necessary frees >>> >>> I?m also wondering if the ?if (tz == NULL || *tz == '\0') {? of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. >>> >>> I did not follow the suggestion to split up "findJavaTZ_md" in platform versions, though. >>> >>> I'd be grateful for your feedback. >>> >>> Thanks >>> Christoph >> > > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From christoph.langer at sap.com Wed Sep 9 13:08:44 2015 From: christoph.langer at sap.com (Langer, Christoph) Date: Wed, 9 Sep 2015 13:08:44 +0000 Subject: Fix for small leak in TimeZone_md.c In-Reply-To: <55EFDBA3.7090103@oracle.com> References: <0DFD2E72402C9243A8630A7759B27E4338EEF2AF@DEWDFEMB12B.global.corp.sap> <0DFD2E72402C9243A8630A7759B27E4338EF0434@DEWDFEMB12B.global.corp.sap> <55D4B4A7.1020807@oracle.com> <1571261947.12638576.1440017502519.JavaMail.zimbra@redhat.com> <55D4F23C.4000300@oracle.com> <1230816333.1692011.1440613901121.JavaMail.zimbra@redhat.com> <0DFD2E72402C9243A8630A7759B27E4338EF5AC7@DEWDFEMB12B.global.corp.sap> <55E61C86.30708@Oracle.com> <0DFD2E72402C9243A8630A7759B27E4338EFD220@DEWDFEMB12B.global.corp.sap> <55EB2A87.3010804@oracle.com> <0DFD2E72402C9243A8630A7759B27E4338F007AF@DEWDFEMB12B.global.corp.sap> <55EFDBA3.7090103@oracle.com> Message-ID: <0DFD2E72402C9243A8630A7759B27E4338F01A85@DEWDFEMB12B.global.corp.sap> Hi Dmitry, let me comment on your suggestions: 663 it might be better to use str*r*chr -> a TZ variable could look like TZ="MET-1METDST,M3.5.0/02:00:00,M10.5.0/03:00:00". So there could be multiple instances of the character ',' and I'm only interested in the first part of TZ, e.g. in "MET-1METDST" in this example case. So why should I want to use strrchr? 666 memcpy(tz_buf, tz, tz_len+1); 667 is not necessary -> well, in the case of a TZ variable like above, tz_len would be 11. If I now copy 12 characters, I don't copy a trailing 0 but the ',' character that strchr found. So I have to memcpy exactly tz_len characters and set the trailing 0 myself. As for the P4 CR - I can do it, when I'm editor eventually :-) Can I consider this change as reviewed then? Thanks Christoph -----Original Message----- From: Dmitry Samersoff [mailto:dmitry.samersoff at oracle.com] Sent: Mittwoch, 9. September 2015 09:12 To: Langer, Christoph Cc: jdk9-dev at openjdk.java.net; i18n-dev at openjdk.java.net; Roger Riggs Subject: Re: Fix for small leak in TimeZone_md.c Christoph, Looks good for me. 663 it might be better to use str*r*chr 666 memcpy(tz_buf, tz, tz_len+1); 667 is not necessary > - The part following line 323 for Solaris32 can probably be removed > but I don't want to be the guy that does this OK. Could you file a P4 CR to get it removed? -Dmitry On 2015-09-08 17:06, Langer, Christoph wrote: > Hi Dmitry, > > thanks for your review. > > - I followed your suggestions to replace #ifdef with #if defined() at all places > - I changed the usage of readdir_r to readdir64_r, as it is done in UnixFileSystem_md.c as well. So we can remove the define from line 129 in the original TimeZone_md.c > - The part following line 323 for Solaris32 can probably be removed but I don't want to be the guy that does this > - 664 and 666 - I changed the construct a bit and I'm using strchr and memcpy now :-) > - 678: changed to use strcpy as suggested > > Here is the new webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505.v1/ > > Best regards, > Christoph > > -----Original Message----- > From: Dmitry Samersoff [mailto:dmitry.samersoff at oracle.com] > Sent: Samstag, 5. September 2015 19:47 > To: Langer, Christoph ; Roger Riggs > Cc: jdk9-dev at openjdk.java.net; i18n-dev at openjdk.java.net > Subject: Re: Fix for small leak in TimeZone_md.c > > Lander, > > Changes looks good, few nits below. Please fill free to ignore comments > that is out of scope of your work. > > > 53 I would prefer don't mix #if defined and #ifdef styles. > Could you please use #if defined(_AIX) > > #if defined(_AIX) need not to be inside #else block, please move > it below #endif > > > 128 Do you know the platform that fall to #else here? > I guess we can remove this define. > > 323 JDK 9 doesn't support Solaris 32bit so this code could be removed. > > 664 It's better to use memcpy here and copy string with terminating \0 > in one line, as you already know the length. > > 666: It might be easier to use strrchr here (not really important). > > 678: It's better to use plain strcpy (or ever sprintf) here because you > checked length above. > > 779: Could you change #ifdef __linux__ to #if defined(__linux__) to keep > one style. > > -Dmitry > > > On 2015-09-03 16:39, Langer, Christoph wrote: >> Here is the updated webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505/ >> >> -----Original Message----- >> From: Langer, Christoph >> Sent: Donnerstag, 3. September 2015 12:25 >> To: 'Roger Riggs' ; jdk9-dev at openjdk.java.net >> Cc: 'i18n-dev at openjdk.java.net' >> Subject: RE: Fix for small leak in TimeZone_md.c >> >> Hi Roger, >> >> thanks for your comments. >> >> I agree with you and I will remove the platform specifics around line 770. >> >> As for the suggestions about line 804 and beyond, it would perhaps be nicer to have mutually exclusive sections. However, then I would have to add the common, "not _AIX and not __solaris__", code also to the "__solaris__" part for the case that tz does not equal "localtime", because then the common handling would apply as well. So, to avoid code duplication I'd prefer to leave it as it is. >> >> Best regards >> Christoph >> >> >> -----Original Message----- >> From: jdk9-dev [mailto:jdk9-dev-bounces at openjdk.java.net] On Behalf Of Roger Riggs >> Sent: Dienstag, 1. September 2015 23:46 >> To: jdk9-dev at openjdk.java.net >> Subject: Re: Fix for small leak in TimeZone_md.c >> >> Hi, >> >> Some comments: >> >> - Line 770: the platform specific conditional compilation can be >> removed, if *tz is zero, its not a real tz anyway. >> >> - Line 804: " } else" having the "else" inside the conditional >> compilation makes the code more fragile. >> Perhaps just return javatz and not have to figure out whether those >> other conditions apply. >> >> - It might be clearer if the AIX, Solaris, and linux tail of the code >> was mutually exclusive. >> >> i.e. >> >> #if defined(_AIX) >> /* On AIX do the platform to Java mapping. */ >> javatz = mapPlatformToJavaTimezone(java_home_dir, tz); >> if (freetz != NULL) { >> free((void *) freetz); >> } >> #elif defined(__solaris__) >> /* Solaris might use localtime, so handle it here. */ >> if (strcmp(tz, "localtime") == 0) { >> javatz = getSolarisDefaultZoneID(); >> if (freetz != NULL) { >> free((void *) freetz); >> } >> } >> #else /* otherwise, not _AIX and not __solaris__ */ >> if (freetz == NULL) { >> /* strdup if we are still working on getenv result. */ >> javatz = strdup(tz); >> } else if (freetz != tz) { >> /* strdup and free the old buffer, if we moved the pointer. */ >> javatz = strdup(tz); >> free((void *) freetz); >> } else { >> /* we are good if we already work on a freshly allocated >> buffer. */ >> javatz = tz; >> } >> #endif >> >> $.02, Roger >> >> On 8/26/2015 5:34 PM, Langer, Christoph wrote: >>> Hi Andrew, >>> >>> today I have posted the following RFR in i18n-dev: >>> >>> when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 >>> Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ >>> >>> I basically did the following things: >>> - clean up some typos and comment errors >>> - added #include "TimeZone_md.h" >>> - split up the platform specific define sections into an #ifdef #elif #elif ? #endif construct >>> - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block >>> - AIX function ?mapPlatformToJavaTimezone?: use a dynamic malloced buffer instead of a fixed length buffer >>> - refactor function ?findJavaTZ_md? to make it more straightforward and to avoid unnecessary mallocs and don?t forget necessary frees >>> >>> I?m also wondering if the ?if (tz == NULL || *tz == '\0') {? of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. >>> >>> I did not follow the suggestion to split up "findJavaTZ_md" in platform versions, though. >>> >>> I'd be grateful for your feedback. >>> >>> Thanks >>> Christoph >> > > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From dmitry.samersoff at oracle.com Wed Sep 9 13:17:37 2015 From: dmitry.samersoff at oracle.com (dmitry.samersoff at oracle.com) Date: Wed, 9 Sep 2015 16:17:37 +0300 Subject: Fix for small leak in TimeZone_md.c Message-ID: Christoph, Thank you for the explanation. Yes, the changes is reviewed. --Dmitry -----Original Message----- From: "Langer, Christoph" To: Dmitry Samersoff Cc: "jdk9-dev at openjdk.java.net" , "i18n-dev at openjdk.java.net" , Roger Riggs Sent: Wed, 09 Sep 2015 16:08 Subject: RE: Fix for small leak in TimeZone_md.c Hi Dmitry, let me comment on your suggestions: 663 it might be better to use str*r*chr -> a TZ variable could look like TZ="MET-1METDST,M3.5.0/02:00:00,M10.5.0/03:00:00". So there could be multiple instances of the character ',' and I'm only interested in the first part of TZ, e.g. in "MET-1METDST" in this example case. So why should I want to use strrchr? 666 memcpy(tz_buf, tz, tz_len+1); 667 is not necessary -> well, in the case of a TZ variable like above, tz_len would be 11. If I now copy 12 characters, I don't copy a trailing 0 but the ',' character that strchr found. So I have to memcpy exactly tz_len characters and set the trailing 0 myself. As for the P4 CR - I can do it, when I'm editor eventually :-) Can I consider this change as reviewed then? Thanks Christoph -----Original Message----- From: Dmitry Samersoff [mailto:dmitry.samersoff at oracle.com] Sent: Mittwoch, 9. September 2015 09:12 To: Langer, Christoph Cc: jdk9-dev at openjdk.java.net; i18n-dev at openjdk.java.net; Roger Riggs Subject: Re: Fix for small leak in TimeZone_md.c Christoph, Looks good for me. 663 it might be better to use str*r*chr 666 memcpy(tz_buf, tz, tz_len+1); 667 is not necessary > - The part following line 323 for Solaris32 can probably be removed > but I don't want to be the guy that does this OK. Could you file a P4 CR to get it removed? -Dmitry On 2015-09-08 17:06, Langer, Christoph wrote: > Hi Dmitry, > > thanks for your review. > > - I followed your suggestions to replace #ifdef with #if defined() at all places > - I changed the usage of readdir_r to readdir64_r, as it is done in UnixFileSystem_md.c as well. So we can remove the define from line 129 in the original TimeZone_md.c > - The part following line 323 for Solaris32 can probably be removed but I don't want to be the guy that does this > - 664 and 666 - I changed the construct a bit and I'm using strchr and memcpy now :-) > - 678: changed to use strcpy as suggested > > Here is the new webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505.v1/ > > Best regards, > Christoph > > -----Original Message----- > From: Dmitry Samersoff [mailto:dmitry.samersoff at oracle.com] > Sent: Samstag, 5. September 2015 19:47 > To: Langer, Christoph ; Roger Riggs > Cc: jdk9-dev at openjdk.java.net; i18n-dev at openjdk.java.net > Subject: Re: Fix for small leak in TimeZone_md.c > > Lander, > > Changes looks good, few nits below. Please fill free to ignore comments > that is out of scope of your work. > > > 53 I would prefer don't mix #if defined and #ifdef styles. > Could you please use #if defined(_AIX) > > #if defined(_AIX) need not to be inside #else block, please move > it below #endif > > > 128 Do you know the platform that fall to #else here? > I guess we can remove this define. > > 323 JDK 9 doesn't support Solaris 32bit so this code could be removed. > > 664 It's better to use memcpy here and copy string with terminating \0 > in one line, as you already know the length. > > 666: It might be easier to use strrchr here (not really important). > > 678: It's better to use plain strcpy (or ever sprintf) here because you > checked length above. > > 779: Could you change #ifdef __linux__ to #if defined(__linux__) to keep > one style. > > -Dmitry > > > On 2015-09-03 16:39, Langer, Christoph wrote: >> Here is the updated webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505/ >> >> -----Original Message----- >> From: Langer, Christoph >> Sent: Donnerstag, 3. September 2015 12:25 >> To: 'Roger Riggs' ; jdk9-dev at openjdk.java.net >> Cc: 'i18n-dev at openjdk.java.net' >> Subject: RE: Fix for small leak in TimeZone_md.c >> >> Hi Roger, >> >> thanks for your comments. >> >> I agree with you and I will remove the platform specifics around line 770. >> >> As for the suggestions about line 804 and beyond, it would perhaps be nicer to have mutually exclusive sections. However, then I would have to add the common, "not _AIX and not __solaris__", code also to the "__solaris__" part for the case that tz does not equal "localtime", because then the common handling would apply as well. So, to avoid code duplication I'd prefer to leave it as it is. >> >> Best regards >> Christoph >> >> >> -----Original Message----- >> From: jdk9-dev [mailto:jdk9-dev-bounces at openjdk.java.net] On Behalf Of Roger Riggs >> Sent: Dienstag, 1. September 2015 23:46 >> To: jdk9-dev at openjdk.java.net >> Subject: Re: Fix for small leak in TimeZone_md.c >> >> Hi, >> >> Some comments: >> >> - Line 770: the platform specific conditional compilation can be >> removed, if *tz is zero, its not a real tz anyway. >> >> - Line 804: " } else" having the "else" inside the conditional >> compilation makes the code more fragile. >> Perhaps just return javatz and not have to figure out whether those >> other conditions apply. >> >> - It might be clearer if the AIX, Solaris, and linux tail of the code >> was mutually exclusive. >> >> i.e. >> >> #if defined(_AIX) >> /* On AIX do the platform to Java mapping. */ >> javatz = mapPlatformToJavaTimezone(java_home_dir, tz); >> if (freetz != NULL) { >> free((void *) freetz); >> } >> #elif defined(__solaris__) >> /* Solaris might use localtime, so handle it here. */ >> if (strcmp(tz, "localtime") == 0) { >> javatz = getSolarisDefaultZoneID(); >> if (freetz != NULL) { >> free((void *) freetz); >> } >> } >> #else /* otherwise, not _AIX and not __solaris__ */ >> if (freetz == NULL) { >> /* strdup if we are still working on getenv result. */ >> javatz = strdup(tz); >> } else if (freetz != tz) { >> /* strdup and free the old buffer, if we moved the pointer. */ >> javatz = strdup(tz); >> free((void *) freetz); >> } else { >> /* we are good if we already work on a freshly allocated >> buffer. */ >> javatz = tz; >> } >> #endif >> >> $.02, Roger >> >> On 8/26/2015 5:34 PM, Langer, Christoph wrote: >>> Hi Andrew, >>> >>> today I have posted the following RFR in i18n-dev: >>> >>> when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 >>> Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ >>> >>> I basically did the following things: >>> - clean up some typos and comment errors >>> - added #include "TimeZone_md.h" >>> - split up the platform specific define sections into an #ifdef #elif #elif ? #endif construct >>> - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block >>> - AIX function ?mapPlatformToJavaTimezone?: use a dynamic malloced buffer instead of a fixed length buffer >>> - refactor function ?findJavaTZ_md? to make it more straightforward and to avoid unnecessary mallocs and don?t forget necessary frees >>> >>> I?m also wondering if the ?if (tz == NULL || *tz == '\0') {? of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. >>> >>> I did not follow the suggestion to split up "findJavaTZ_md" in platform versions, though. >>> >>> I'd be grateful for your feedback. >>> >>> Thanks >>> Christoph >> > > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From masayoshi.okutsu at oracle.com Wed Sep 9 23:03:29 2015 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Thu, 10 Sep 2015 08:03:29 +0900 Subject: [9] RFR: 8134384: Continuation of JDK-8130845 : A date string created by Date#toString() is not parseable neither with ENGLISH, US nor ROOT locale In-Reply-To: <55EF4617.5040701@oracle.com> References: <55EF4617.5040701@oracle.com> Message-ID: <55F0BAC1.3070105@oracle.com> Looks good to me. Masayoshi On 9/9/2015 5:33 AM, Naoto Sato wrote: > Hello, > > Please review the changes for the following issue: > > https://bugs.openjdk.java.net/browse/JDK-8134384 > > The proposed changeset is located at: > > http://cr.openjdk.java.net/~naoto/8134384/webrev.00/ > > Naoto From volker.simonis at gmail.com Thu Sep 10 13:20:39 2015 From: volker.simonis at gmail.com (Volker Simonis) Date: Thu, 10 Sep 2015 15:20:39 +0200 Subject: Fix for small leak in TimeZone_md.c In-Reply-To: <0DFD2E72402C9243A8630A7759B27E4338F01A85@DEWDFEMB12B.global.corp.sap> References: <0DFD2E72402C9243A8630A7759B27E4338EEF2AF@DEWDFEMB12B.global.corp.sap> <0DFD2E72402C9243A8630A7759B27E4338EF0434@DEWDFEMB12B.global.corp.sap> <55D4B4A7.1020807@oracle.com> <1571261947.12638576.1440017502519.JavaMail.zimbra@redhat.com> <55D4F23C.4000300@oracle.com> <1230816333.1692011.1440613901121.JavaMail.zimbra@redhat.com> <0DFD2E72402C9243A8630A7759B27E4338EF5AC7@DEWDFEMB12B.global.corp.sap> <55E61C86.30708@Oracle.com> <0DFD2E72402C9243A8630A7759B27E4338EFD220@DEWDFEMB12B.global.corp.sap> <55EB2A87.3010804@oracle.com> <0DFD2E72402C9243A8630A7759B27E4338F007AF@DEWDFEMB12B.global.corp.sap> <55EFDBA3.7090103@oracle.com> <0DFD2E72402C9243A8630A7759B27E4338F01A85@DEWDFEMB12B.global.corp.sap> Message-ID: Hi Christoph, the change looks good. Thanks for doing this clean-up. I'll sponsor the change. Regards, Volker On Wed, Sep 9, 2015 at 3:08 PM, Langer, Christoph wrote: > Hi Dmitry, > > let me comment on your suggestions: > 663 it might be better to use str*r*chr > -> a TZ variable could look like TZ="MET-1METDST,M3.5.0/02:00:00,M10.5.0/03:00:00". So there could be multiple instances of the character ',' and I'm only interested in the first part of TZ, e.g. in "MET-1METDST" in this example case. So why should I want to use strrchr? > > 666 memcpy(tz_buf, tz, tz_len+1); > 667 is not necessary > -> well, in the case of a TZ variable like above, tz_len would be 11. If I now copy 12 characters, I don't copy a trailing 0 but the ',' character that strchr found. So I have to memcpy exactly tz_len characters and set the trailing 0 myself. > > As for the P4 CR - I can do it, when I'm editor eventually :-) > > Can I consider this change as reviewed then? > > Thanks > Christoph > > -----Original Message----- > From: Dmitry Samersoff [mailto:dmitry.samersoff at oracle.com] > Sent: Mittwoch, 9. September 2015 09:12 > To: Langer, Christoph > Cc: jdk9-dev at openjdk.java.net; i18n-dev at openjdk.java.net; Roger Riggs > Subject: Re: Fix for small leak in TimeZone_md.c > > Christoph, > > Looks good for me. > > 663 it might be better to use str*r*chr > 666 memcpy(tz_buf, tz, tz_len+1); > 667 is not necessary > >> - The part following line 323 for Solaris32 can probably be removed >> but I don't want to be the guy that does this > > OK. Could you file a P4 CR to get it removed? > > -Dmitry > > On 2015-09-08 17:06, Langer, Christoph wrote: >> Hi Dmitry, >> >> thanks for your review. >> >> - I followed your suggestions to replace #ifdef with #if defined() at all places >> - I changed the usage of readdir_r to readdir64_r, as it is done in UnixFileSystem_md.c as well. So we can remove the define from line 129 in the original TimeZone_md.c >> - The part following line 323 for Solaris32 can probably be removed but I don't want to be the guy that does this >> - 664 and 666 - I changed the construct a bit and I'm using strchr and memcpy now :-) >> - 678: changed to use strcpy as suggested >> >> Here is the new webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505.v1/ >> >> Best regards, >> Christoph >> >> -----Original Message----- >> From: Dmitry Samersoff [mailto:dmitry.samersoff at oracle.com] >> Sent: Samstag, 5. September 2015 19:47 >> To: Langer, Christoph ; Roger Riggs >> Cc: jdk9-dev at openjdk.java.net; i18n-dev at openjdk.java.net >> Subject: Re: Fix for small leak in TimeZone_md.c >> >> Lander, >> >> Changes looks good, few nits below. Please fill free to ignore comments >> that is out of scope of your work. >> >> >> 53 I would prefer don't mix #if defined and #ifdef styles. >> Could you please use #if defined(_AIX) >> >> #if defined(_AIX) need not to be inside #else block, please move >> it below #endif >> >> >> 128 Do you know the platform that fall to #else here? >> I guess we can remove this define. >> >> 323 JDK 9 doesn't support Solaris 32bit so this code could be removed. >> >> 664 It's better to use memcpy here and copy string with terminating \0 >> in one line, as you already know the length. >> >> 666: It might be easier to use strrchr here (not really important). >> >> 678: It's better to use plain strcpy (or ever sprintf) here because you >> checked length above. >> >> 779: Could you change #ifdef __linux__ to #if defined(__linux__) to keep >> one style. >> >> -Dmitry >> >> >> On 2015-09-03 16:39, Langer, Christoph wrote: >>> Here is the updated webrev: http://cr.openjdk.java.net/~simonis/webrevs/2015/8134505/ >>> >>> -----Original Message----- >>> From: Langer, Christoph >>> Sent: Donnerstag, 3. September 2015 12:25 >>> To: 'Roger Riggs' ; jdk9-dev at openjdk.java.net >>> Cc: 'i18n-dev at openjdk.java.net' >>> Subject: RE: Fix for small leak in TimeZone_md.c >>> >>> Hi Roger, >>> >>> thanks for your comments. >>> >>> I agree with you and I will remove the platform specifics around line 770. >>> >>> As for the suggestions about line 804 and beyond, it would perhaps be nicer to have mutually exclusive sections. However, then I would have to add the common, "not _AIX and not __solaris__", code also to the "__solaris__" part for the case that tz does not equal "localtime", because then the common handling would apply as well. So, to avoid code duplication I'd prefer to leave it as it is. >>> >>> Best regards >>> Christoph >>> >>> >>> -----Original Message----- >>> From: jdk9-dev [mailto:jdk9-dev-bounces at openjdk.java.net] On Behalf Of Roger Riggs >>> Sent: Dienstag, 1. September 2015 23:46 >>> To: jdk9-dev at openjdk.java.net >>> Subject: Re: Fix for small leak in TimeZone_md.c >>> >>> Hi, >>> >>> Some comments: >>> >>> - Line 770: the platform specific conditional compilation can be >>> removed, if *tz is zero, its not a real tz anyway. >>> >>> - Line 804: " } else" having the "else" inside the conditional >>> compilation makes the code more fragile. >>> Perhaps just return javatz and not have to figure out whether those >>> other conditions apply. >>> >>> - It might be clearer if the AIX, Solaris, and linux tail of the code >>> was mutually exclusive. >>> >>> i.e. >>> >>> #if defined(_AIX) >>> /* On AIX do the platform to Java mapping. */ >>> javatz = mapPlatformToJavaTimezone(java_home_dir, tz); >>> if (freetz != NULL) { >>> free((void *) freetz); >>> } >>> #elif defined(__solaris__) >>> /* Solaris might use localtime, so handle it here. */ >>> if (strcmp(tz, "localtime") == 0) { >>> javatz = getSolarisDefaultZoneID(); >>> if (freetz != NULL) { >>> free((void *) freetz); >>> } >>> } >>> #else /* otherwise, not _AIX and not __solaris__ */ >>> if (freetz == NULL) { >>> /* strdup if we are still working on getenv result. */ >>> javatz = strdup(tz); >>> } else if (freetz != tz) { >>> /* strdup and free the old buffer, if we moved the pointer. */ >>> javatz = strdup(tz); >>> free((void *) freetz); >>> } else { >>> /* we are good if we already work on a freshly allocated >>> buffer. */ >>> javatz = tz; >>> } >>> #endif >>> >>> $.02, Roger >>> >>> On 8/26/2015 5:34 PM, Langer, Christoph wrote: >>>> Hi Andrew, >>>> >>>> today I have posted the following RFR in i18n-dev: >>>> >>>> when working on TimeZone_md.c lately, I found it worthwhile to do some cleanup on it. Please review my changes. >>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8134505 >>>> Webrev: http://cr.openjdk.java.net/~goetz/webrevs/8134505-timeZone/webrev.01/ >>>> >>>> I basically did the following things: >>>> - clean up some typos and comment errors >>>> - added #include "TimeZone_md.h" >>>> - split up the platform specific define sections into an #ifdef #elif #elif ? #endif construct >>>> - moved some AIX coding from the #ifdef block at the bottom of the file into the first AIX specific block >>>> - AIX function ?mapPlatformToJavaTimezone?: use a dynamic malloced buffer instead of a fixed length buffer >>>> - refactor function ?findJavaTZ_md? to make it more straightforward and to avoid unnecessary mallocs and don?t forget necessary frees >>>> >>>> I?m also wondering if the ?if (tz == NULL || *tz == '\0') {? of line 770 could be used for all platforms instead of Solaris and AIX only. The other platforms will only do a check if TZ is NULL but not if it is an empty string. >>>> >>>> I did not follow the suggestion to split up "findJavaTZ_md" in platform versions, though. >>>> >>>> I'd be grateful for your feedback. >>>> >>>> Thanks >>>> Christoph >>> >> >> > > > -- > Dmitry Samersoff > Oracle Java development team, Saint Petersburg, Russia > * I would love to change the world, but they won't give me the sources. From naoto.sato at oracle.com Thu Sep 10 22:49:21 2015 From: naoto.sato at oracle.com (Naoto Sato) Date: Thu, 10 Sep 2015 15:49:21 -0700 Subject: [9] RFR: 8134915: Improve performance of CLDRLocaleProviderAdapter.getCandidateLocales Message-ID: <55F208F1.1020009@oracle.com> Hello, Please review the changes for the following issue: https://bugs.openjdk.java.net/browse/JDK-8134915 Here is the proposed fix: http://cr.openjdk.java.net/~naoto/8134915/webrev.00/ It is basically replacing ResourceBundle based locale list with a simple hash map, and getting rid of runtime splitting of locales. Also, caching the resulted candidate locales which is already implemented in Jake repository by Masayoshi. Naoto From masayoshi.okutsu at oracle.com Thu Sep 10 23:18:30 2015 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Fri, 11 Sep 2015 08:18:30 +0900 Subject: [9] RFR: 8134915: Improve performance of CLDRLocaleProviderAdapter.getCandidateLocales In-Reply-To: <55F208F1.1020009@oracle.com> References: <55F208F1.1020009@oracle.com> Message-ID: <55F20FC6.2060204@oracle.com> Looks good to me. Masayoshi On 9/11/2015 7:49 AM, Naoto Sato wrote: > Hello, > > Please review the changes for the following issue: > > https://bugs.openjdk.java.net/browse/JDK-8134915 > > Here is the proposed fix: > > http://cr.openjdk.java.net/~naoto/8134915/webrev.00/ > > It is basically replacing ResourceBundle based locale list with a > simple hash map, and getting rid of runtime splitting of locales. > Also, caching the resulted candidate locales which is already > implemented in Jake repository by Masayoshi. > > Naoto From mark.reinhold at oracle.com Wed Sep 23 17:59:30 2015 From: mark.reinhold at oracle.com (mark.reinhold at oracle.com) Date: Wed, 23 Sep 2015 10:59:30 -0700 (PDT) Subject: JEP 267: Unicode 8.0 Message-ID: <20150923175930.26C1D7A234@eggemoggin.niobe.net> New JEP Candidate: http://openjdk.java.net/jeps/267 - Mark From naoto.sato at oracle.com Wed Sep 23 20:55:17 2015 From: naoto.sato at oracle.com (Naoto Sato) Date: Wed, 23 Sep 2015 13:55:17 -0700 Subject: [9] RFR: 8136518: java/util/TimeZone/CLDRDisplayNamesTest.java fails for de. Message-ID: <560311B5.7070607@oracle.com> Hello, Please review this simple change to a test case: https://bugs.openjdk.java.net/browse/JDK-8136518 http://cr.openjdk.java.net/~naoto/8136518/webrev.00/ The fix is to specify English on obtaining a TimeZone instance. Naoto From masayoshi.okutsu at oracle.com Thu Sep 24 02:39:38 2015 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Thu, 24 Sep 2015 11:39:38 +0900 Subject: [9] RFR: 8136518: java/util/TimeZone/CLDRDisplayNamesTest.java fails for de. In-Reply-To: <560311B5.7070607@oracle.com> References: <560311B5.7070607@oracle.com> Message-ID: <5603626A.5060800@oracle.com> Looks good to me. Masayoshi On 9/24/2015 5:55 AM, Naoto Sato wrote: > Hello, > > Please review this simple change to a test case: > > https://bugs.openjdk.java.net/browse/JDK-8136518 > http://cr.openjdk.java.net/~naoto/8136518/webrev.00/ > > The fix is to specify English on obtaining a TimeZone instance. > > Naoto From naoto.sato at oracle.com Thu Sep 24 16:01:11 2015 From: naoto.sato at oracle.com (Naoto Sato) Date: Thu, 24 Sep 2015 09:01:11 -0700 Subject: [9] RFR: 8136518: java/util/TimeZone/CLDRDisplayNamesTest.java fails for de. In-Reply-To: <5603626A.5060800@oracle.com> References: <560311B5.7070607@oracle.com> <5603626A.5060800@oracle.com> Message-ID: <56041E47.2060202@oracle.com> Thanks. I just forgot to add the bug id in the @bug tag, so will do it when I push the change. Naoto On 9/23/15 7:39 PM, Masayoshi Okutsu wrote: > Looks good to me. > > Masayoshi > > On 9/24/2015 5:55 AM, Naoto Sato wrote: >> Hello, >> >> Please review this simple change to a test case: >> >> https://bugs.openjdk.java.net/browse/JDK-8136518 >> http://cr.openjdk.java.net/~naoto/8136518/webrev.00/ >> >> The fix is to specify English on obtaining a TimeZone instance. >> >> Naoto > From naveen.ah.kumar at oracle.com Fri Sep 25 11:08:14 2015 From: naveen.ah.kumar at oracle.com (Naveen Kumar) Date: Fri, 25 Sep 2015 16:38:14 +0530 Subject: Review request: JDK-8081794 ParsePosition getErrorIndex returns 0 for TimeZone parsing problem Message-ID: <56052B1E.30704@oracle.com> Hi, Please review the following fix for jdk9. Bug:https://bugs.openjdk.java.net/browse/JDK-8081794 Webrev:http://cr.openjdk.java.net/~psadhukhan/naveen/webrev/ Issue: a malformed TimeZone will prevent parsing the date, but not set the correct errorIndex in ParsePosition Fix: remove incorrect update of "pos.index = -i" from subParse function in SimpleDateFormat.java, which (pos.index) is later used to update error index as "origPos.errorIndex = pos.index;" regards Naveen Kumar From naveen.ah.kumar at oracle.com Tue Sep 29 10:12:09 2015 From: naveen.ah.kumar at oracle.com (Naveen Kumar) Date: Tue, 29 Sep 2015 15:42:09 +0530 Subject: Review request: JDK-8081794 ParsePosition getErrorIndex returns 0 for TimeZone parsing problem In-Reply-To: <56052B1E.30704@oracle.com> References: <56052B1E.30704@oracle.com> Message-ID: <560A63F9.9080701@oracle.com> Hi, Please consider this updated webrev.01 for the review of bug JDK-8081794. Bug: https://bugs.openjdk.java.net/browse/JDK-8081794 Webrev: http://cr.openjdk.java.net/~okutsu/naveen/8081794/webrev.01/ Updates in Fix: Instead of removing "pos.index=-i" from subParse function, which was done in previous webrev version, the modifications is now done in subParseZoneString functions to return "-start" at the end instead of current return value of 0. This will automatically allow "pos.index=-i" set the correct value for errorIndex update. Updates in Test: Corrected Copyright information. Corrected Formatting issues regards Naveen Kumar On 9/25/2015 4:38 PM, Naveen Kumar wrote: > Hi, > > Please review the following fix for jdk9. > > Bug:https://bugs.openjdk.java.net/browse/JDK-8081794 > Webrev:http://cr.openjdk.java.net/~psadhukhan/naveen/webrev/ > > > Issue: > a malformed TimeZone will prevent parsing the date, but not > set the correct errorIndex in ParsePosition > > Fix: > remove incorrect update of "pos.index = -i" from subParse > function in SimpleDateFormat.java, which (pos.index) is later used to > update error index as "origPos.errorIndex = pos.index;" > > > regards > Naveen Kumar From masayoshi.okutsu at oracle.com Wed Sep 30 04:41:58 2015 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Wed, 30 Sep 2015 13:41:58 +0900 Subject: Review request: JDK-8081794 ParsePosition getErrorIndex returns 0 for TimeZone parsing problem In-Reply-To: <560A63F9.9080701@oracle.com> References: <56052B1E.30704@oracle.com> <560A63F9.9080701@oracle.com> Message-ID: <560B6816.4030505@oracle.com> Looks good to me. I will push the fix for you. Thanks, Masayoshi On 9/29/2015 7:12 PM, Naveen Kumar wrote: > Hi, > Please consider this updated webrev.01 for the review of bug > JDK-8081794. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8081794 > Webrev: http://cr.openjdk.java.net/~okutsu/naveen/8081794/webrev.01/ > > Updates in Fix: > Instead of removing "pos.index=-i" from > subParse function, which was done in previous webrev version, the > modifications is now done in subParseZoneString functions to return > "-start" at the end instead of current return value of 0. This will > automatically allow "pos.index=-i" set the correct value for > errorIndex update. > > Updates in Test: > Corrected Copyright information. > Corrected Formatting issues > > regards > Naveen Kumar > > > On 9/25/2015 4:38 PM, Naveen Kumar wrote: >> Hi, >> >> Please review the following fix for jdk9. >> >> Bug:https://bugs.openjdk.java.net/browse/JDK-8081794 >> Webrev:http://cr.openjdk.java.net/~psadhukhan/naveen/webrev/ >> >> >> Issue: >> a malformed TimeZone will prevent parsing the date, but not >> set the correct errorIndex in ParsePosition >> >> Fix: >> remove incorrect update of "pos.index = -i" from subParse >> function in SimpleDateFormat.java, which (pos.index) is later used to >> update error index as "origPos.errorIndex = pos.index;" >> >> >> regards >> Naveen Kumar > From naveen.ah.kumar at oracle.com Wed Sep 30 07:33:22 2015 From: naveen.ah.kumar at oracle.com (Naveen Kumar) Date: Wed, 30 Sep 2015 13:03:22 +0530 Subject: Review request: JDK-8081794 ParsePosition getErrorIndex returns 0 for TimeZone parsing problem In-Reply-To: <560B6816.4030505@oracle.com> References: <56052B1E.30704@oracle.com> <560A63F9.9080701@oracle.com> <560B6816.4030505@oracle.com> Message-ID: <560B9042.4070403@oracle.com> Thanks Masayoshi :-). Naveen On 9/30/2015 10:11 AM, Masayoshi Okutsu wrote: > Looks good to me. I will push the fix for you. > > Thanks, > Masayoshi > > On 9/29/2015 7:12 PM, Naveen Kumar wrote: >> Hi, >> Please consider this updated webrev.01 for the review of bug >> JDK-8081794. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8081794 >> Webrev: http://cr.openjdk.java.net/~okutsu/naveen/8081794/webrev.01/ >> >> Updates in Fix: >> Instead of removing "pos.index=-i" from >> subParse function, which was done in previous webrev version, the >> modifications is now done in subParseZoneString functions to return >> "-start" at the end instead of current return value of 0. This will >> automatically allow "pos.index=-i" set the correct value for >> errorIndex update. >> >> Updates in Test: >> Corrected Copyright information. >> Corrected Formatting issues >> >> regards >> Naveen Kumar >> >> >> On 9/25/2015 4:38 PM, Naveen Kumar wrote: >>> Hi, >>> >>> Please review the following fix for jdk9. >>> >>> Bug:https://bugs.openjdk.java.net/browse/JDK-8081794 >>> Webrev:http://cr.openjdk.java.net/~psadhukhan/naveen/webrev/ >>> >>> >>> Issue: >>> a malformed TimeZone will prevent parsing the date, but >>> not set the correct errorIndex in ParsePosition >>> >>> Fix: >>> remove incorrect update of "pos.index = -i" from subParse >>> function in SimpleDateFormat.java, which (pos.index) is later used >>> to update error index as "origPos.errorIndex = pos.index;" >>> >>> >>> regards >>> Naveen Kumar >> >