United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4071592 : java.io.UTFDataFormatException raised by javac

Details
Type:
Bug
Submit Date:
1997-08-13
Status:
Closed
Updated Date:
2000-02-02
Project Name:
JDK
Resolved Date:
2000-02-02
Component:
tools
OS:
solaris_2.6,solaris_2.5.1
Sub-Component:
javac
CPU:
sparc
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.1.3,1.2.0
Fixed Versions:

Related Reports
Duplicate:
Relates:

Sub Tasks

Description
while trying workaround for bug#4071527,
$ javac -J-oss64m a.java
java.io.UTFDataFormatException
        at java.io.DataOutputStream.writeUTF(DataOutputStream.java)
        at sun.tools.asm.StringConstantData.write(StringConstantData.java)
        at sun.tools.asm.ConstantPool.write(ConstantPool.java)
        at sun.tools.javac.SourceClass.compileClass(SourceClass.java)
        at sun.tools.javac.SourceClass.compile(SourceClass.java)
        at sun.tools.javac.Main.compile(Main.java)
        at sun.tools.javac.Main.main(Main.java)
error: An exception has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error

                                    

Comments
EVALUATION

java.io.DataOutputStream.writeUTF throws a java.io.UTFDataFormatException
when the string to be encoded is too long.  This is a limitation of the
VM format.  This exception should be caught and a nice message given to
explain why compilation is failing.

david.stoutamire@Eng 1997-08-26
                                     
1997-08-26
WORK AROUND

Don't use strings too long to be represented (that is, that will
result in more than 64k bytes in the UTF-8 encoding described in
the VM spec section 4.4.7).
                                     
2004-06-11



Hardware and Software, Engineered to Work Together