JDK-6679866 : portability issues with JLI-batch-200803 on Win*
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-03-25
  • Updated: 2011-04-19
  • Resolved: 2011-04-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b26Fixed
Related Reports
Relates :  
Description
The synopsis pretty much says it all:

- the fix for 6274276 doesn't want to build on Win*

The reason for filing this bug is that the fix for 6274276 is
changeset #4 of 15 in a batch that has been ported from TeamWare.
Mercurial doesn't let you backout just a single file in a repository
so the easiest way forward is to file a new bug and go on from there.

Comments
SUGGESTED FIX This bug seems like a good place to attach the webrevs for the entire batch. See JLI-batch-200803-webrev-cr0 for the Code Review Round 0 webrev and JLI-batch-200803-webrev-cr1 for the Code Review Round 1 webrevs (deltas-only and full).
26-03-2008

SUGGESTED FIX Here are the context diffs for the changes to make the Win* compiler happy: ------- JarFacade.c ------- *** /tmp/sccs.pga45a Wed Mar 26 21:09:19 2008 --- src/share/instrument/JarFacade.c Wed Mar 26 18:11:24 2008 *************** *** 23,28 **** --- 23,36 ---- * have any questions. */ + #ifdef _WIN32 + /* + * Win* needs this include. However, Linux and Solaris do not. + * Having this include on Solaris SPARC breaks having non US-ASCII + * characters in the value of the Premain-Class attribute. + */ + #include <ctype.h> + #endif /* _WIN32 */ #include <string.h> #include <stdlib.h> *************** *** 45,52 **** if (attribute->name == NULL) { free(attribute); } else { ! char *begin = value; char *end; /* skip any leading white space */ while (isspace(*begin)) { --- 53,61 ---- if (attribute->name == NULL) { free(attribute); } else { ! char *begin = (char *)value; char *end; + size_t value_len; /* skip any leading white space */ while (isspace(*begin)) { *************** *** 66,72 **** return; } ! size_t value_len = (size_t)(end - begin); attribute->value = malloc(value_len + 1); if (attribute->value == NULL) { free(attribute->name); --- 75,81 ---- return; } ! value_len = (size_t)(end - begin); attribute->value = malloc(value_len + 1); if (attribute->value == NULL) { free(attribute->name); *************** *** 74,80 **** } else { /* save the value without leading or trailing whitespace */ strncpy(attribute->value, begin, value_len); ! attribute->value[value_len] = NULL; attribute->next = NULL; if (context->head == NULL) { context->head = attribute; --- 83,89 ---- } else { /* save the value without leading or trailing whitespace */ strncpy(attribute->value, begin, value_len); ! attribute->value[value_len] = '\0'; attribute->next = NULL; if (context->head == NULL) { context->head = attribute;
25-03-2008

EVALUATION Make minor tweaks to make the Win* compiler happy...
25-03-2008