JDK-5046139 : not able to compile when a special char is added in the comment area.
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: sparc
  • Submitted: 2004-05-12
  • Updated: 2004-05-13
  • Resolved: 2004-05-12
Related Reports
Relates :  
Description
When a special char is entered to comment area, it would failed to compile.  Take a look at the attched file (HelloClient.java).  In line 1 and 4, it has \346preinvoke\306 as part comment and I assume the compiler should ignore the line; however, it is giveing the following error and no class file created.  When I compiled with "-source 1.4", it has warning and class file created.

I don't know how the \346 and \306 was typed,  this is coming from a test.  See below for locaiton of the test.  Note: This is CORBA test.

I have tried many systems and found 1 syteme that will not have compilation error.  The hostname is kuai.

Error
======
HelloClient.java:1: unmappable character for encoding ASCII
//Purpose               : To verify whether Cookie object remains persistent within ?preinvoke?,
                                                                                    ^
HelloClient.java:1: unmappable character for encoding ASCII
//Purpose               : To verify whether Cookie object remains persistent within ?preinvoke?,
                                                                                              ^
HelloClient.java:4: unmappable character for encoding ASCII
* Purpose               : To verify whether invocation of ?postinvoke?, ?preinvoke? are in order,
                                                          ^
HelloClient.java:4: unmappable character for encoding ASCII
* Purpose               : To verify whether invocation of ?postinvoke?, ?preinvoke? are in order,
                                                                     ^
HelloClient.java:4: unmappable character for encoding ASCII
* Purpose               : To verify whether invocation of ?postinvoke?, ?preinvoke? are in order,
                                                                        ^
HelloClient.java:4: unmappable character for encoding ASCII
* Purpose               : To verify whether invocation of ?postinvoke?, ?preinvoke? are in order,
                                                                                  ^
6 errors




JDK          :   1.5.0-b49 b50  (passed with -source 1.4 added)
VM           :   client
switch/Mode  :   default
Platform[s]  :   Sol 9 and 10
Test owner   : 
Failing Test : 
  
api/poa/servantlocator/test1

TestBase and source Location: 
==================
/net/cady/export/dtf/unified/knight-ws/suites/corba_test/CORBA_tiger/tests/api/poa/servantlocator/test1
    
How to reproduce:
====================

  1. cd /net/cady/export/dtf/unified/knight-ws/suites/corba_test/CORBA_tiger
  2. export PATH=`pwd`/bin:$PATH
  3. cd tests/api/poa/servantlocator/test1
  4. rip-make -env tiger -workdir /tmp -jdk [your jdk] -v build

  
Output:
==========
HelloClient.java:46: unmappable character for encoding ASCII
* Purpose               : To verify whether invocation of ?postinvoke?, ?preinvoke? are in order,
                                                          ^
HelloClient.java:46: unmappable character for encoding ASCII
* Purpose               : To verify whether invocation of ?postinvoke?, ?preinvoke? are in order,
                                                                     ^
HelloClient.java:46: unmappable character for encoding ASCII
* Purpose               : To verify whether invocation of ?postinvoke?, ?preinvoke? are in order,
                                                                        ^
HelloClient.java:46: unmappable character for encoding ASCII
* Purpose               : To verify whether invocation of ?postinvoke?, ?preinvoke? are in order,
                                                                                  ^
HelloClient.java:53: unmappable character for encoding ASCII
* Purpose               : To verify whether Cookie object remains persistent within ?preinvoke?,
                                                                                    ^
HelloClient.java:53: unmappable character for encoding ASCII
* Purpose               : To verify whether Cookie object remains persistent within ?preinvoke?,
                                                                                              ^
HelloClient.java:54: unmappable character for encoding ASCII
*                                 ?postinvoke? under the context, when a client makes a invocation
                                  ^
HelloClient.java:54: unmappable character for encoding ASCII
*                                 ?postinvoke? under the context, when a client makes a invocation
                                             ^
HelloClient.java:62: unmappable character for encoding ASCII
*                                 single invocation starting from ?preinvoke? to ?postinvoke?.
                                                                  ^
HelloClient.java:62: unmappable character for encoding ASCII
*                                 single invocation starting from ?preinvoke? to ?postinvoke?.
                                                                            ^
HelloClient.java:62: unmappable character for encoding ASCII
*                                 single invocation starting from ?preinvoke? to ?postinvoke?.
                                                                                 ^
HelloClient.java:62: unmappable character for encoding ASCII
*                                 single invocation starting from ?preinvoke? to ?postinvoke?.
                                                                                            ^
12 errors
*** Error code 1 (ignored)




Specific Machine Info:
=====================




###@###.### 2004-05-12

Comments
EVALUATION The phases of translation are (1) decoding the source, in which a file of bytes is translated into a sequence of characters using the specified -encoding, or the platforms default encoding if none is specified. (2) unocide processing, in which unicode escapes are translated into the corresponding character. (3) lexical analysis, in which comments are discarded and tokens of the Java Programming language are recognized. (4) etc. In this program there is an error in phase (1) - the source file does not correspond to ANY legal sequence of characters according to the encoding. While earlier versions of javac were somewhat relaxed in accepting this kind of code, they were actually incorrect to do so. Specifically, when such sequences of bytes appeared in strings, the compiler would silently replace them by a unicode replacement character. This change is expected and intentional. To get the earlier, relaxed compiler behavior compile with -source 1.4. See also 4767128. ###@###.### 2004-05-12
12-05-2004