JDK-6681798 : (build) CharsetEncoder.java fails to compile in openjdk6 on ubuntu 8.04
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: OpenJDK6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_2.6
  • CPU: x86
  • Submitted: 2008-03-29
  • Updated: 2011-05-18
  • Resolved: 2011-05-18
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 Availabitlity Release.

To download the current JDK release, click here.
7 b33Fixed
In compiling openjdk6 on ubuntu 8.04 it fails while compiling CharsetEncoder.java.
Compiling the same source on ubuntu 7.10 does not fail.  I asked an Ubuntu contact
about this and he claims it has to do with quoting problems in the spp.sh shell script
and referenced this icedtea patch


That changes SPP_CMD to use /bin/bash which probably is not a good solution.

What occurs is CharsetEncoder.java is generated using a shell/sed/awk script from a
different source file.  It uses tags like $replType$ which get replaced with various
strings encoded in the script.  What happens is in the generated source file the
$replType$ tag is not replaced and the compiler barfs with a syntax error.

EVALUATION replace spp.sh with a java regex based version.

EVALUATION Also see: https://bugs.launchpad.net/ubuntu/+source/dash/+bug/61463

WORK AROUND A possible workaround is to change the symbolic link for /bin/sh which, by default, points to 'dash'. One way to do this is with: sudo dpkg-reconfigure dash And answer "no"

EVALUATION This appears to be an issue with dash (on Ubuntu sh is linked to dash). All is okay with dash 0.5.3-1 but with dash 0.5.4-8 (the version with Hardy Herron/8.04) it seems that square brackets used in a sed script aren't passed through correctly to sed. This impacts the generation of code that involves the replacement of tokens with "byte[]". All is okay if sh is linked to bash.