JDK-4746255 : REGRESSION: bogus 'c' at end of file gives ArrayIndexOutOfBoundsException
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.4.1
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000,windows_xp
  • CPU: x86
  • Submitted: 2002-09-12
  • Updated: 2002-10-26
  • Resolved: 2002-10-26
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.
Other
1.4.2 mantisFixed
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 09/12/2002


FULL PRODUCT VERSION :
java version "1.4.1-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19)
Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)

FULL OPERATING SYSTEM VERSION :
windows xp

A DESCRIPTION OF THE PROBLEM :
simply got this message when SunOne4.0 tried to compile one of my classes. I saw later that i typed a 'c' at the end of the source by error, and that it made the compiler crash.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
compile the source as it is below, with the bogus 'c' character at the end of the file. will not crash if the character is not there.

EXPECTED VERSUS ACTUAL BEHAVIOR :
i should get an error, don't know which one, about this last character.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
An exception has occurred in the compiler (1.4.1-rc). Please file a bug at the J
ava Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi)  after chec
king the Bug Parade for duplicates. Include your program and the following diagn
ostic in your report.  Thank you.
java.lang.ArrayIndexOutOfBoundsException: 2284
        at com.sun.tools.javac.v8.parser.Scanner.scanIdent(Scanner.java:500)
        at com.sun.tools.javac.v8.parser.Scanner.nextToken(Scanner.java:1110)
        at com.sun.tools.javac.v8.parser.Parser.accept(Parser.java:221)
        at com.sun.tools.javac.v8.parser.Parser.classOrInterfaceBody(Parser.java
:1950)
        at com.sun.tools.javac.v8.parser.Parser.classDeclaration(Parser.java:189
6)
        at com.sun.tools.javac.v8.parser.Parser.classOrInterfaceDeclaration(Pars
er.java:1868)
        at com.sun.tools.javac.v8.parser.Parser.typeDeclaration(Parser.java:1854
)
        at com.sun.tools.javac.v8.parser.Parser.compilationUnit(Parser.java:1802
)
        at com.sun.tools.javac.v8.JavaCompiler.parse(JavaCompiler.java:235)
        at com.sun.tools.javac.v8.JavaCompiler.parse(JavaCompiler.java:259)
        at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:332)
        at com.sun.tools.javac.v8.Main.compile(Main.java:520)
        at com.sun.tools.javac.Main.compile(Main.java:36)
        at com.sun.tools.javac.Main.main(Main.java:27)


REPRODUCIBILITY :
This bug can be reproduced always.


With JDK1.4.0_02:
-----------------

C:\>javac References.java
References.java:61: 'class' or 'interface' expected
c
^
1 error

---------- BEGIN SOURCE ----------
/*
 * References.java
 *
 * Created on 2 juillet 2002, 09:26
 */

package com.fifiturin.transmission;

/**
 *
 * @author  frederic
 */
public class References
{
	public static String _protocol="http";

// for online server
//	public static String _serverIp="xxx.xxx.xx.xx"
//	public static String writeImageUrl="/usr/images/";
//	public static String writeCheckUrl="/usr/checks/";

// for local
	public static String _serverIp="xxx.x.x.x";
	public static int    _port=8080;
	public static String writeImageUrl="c:/images/";
	public static String writeCheckUrl="c:/checks/";

	public static String _systemUrl="intranet";
	public static String _getKeyUrl="getServerCertificate";
	public static String _putKeyUrl="putClientCertificate";
	public static String _readDBUrl="readDB";
	public static String _writeDBUrl="writeDB";
	public static String _sendImagesUrl="sendImages";
	public static String _readImageUrl="images/items";
	public static String _readImageListUrl="images";
	
	public static String _sendCheckUrl="sendCheck";
	public static String _readCheckUrl="getCheck?number=";
	public static String _viewCheckUrl="viewCheck?number=";
	public static String _listWaitingChecksUrl="listWaitingChecks";
	
	public static String
getServerKeyUrl=_protocol+"://"+_serverIp+':'+_port+'/'+_systemUrl+'/'+_getKeyUrl;
	public static String
putClientKeyUrl=_protocol+"://"+_serverIp+':'+_port+'/'+_systemUrl+'/'+_putKeyUrl;

	public static String serverUrl=_protocol+"://"+_serverIp+':'+_port+'/';
	public static String readDBUrl=serverUrl+_systemUrl+'/'+_readDBUrl;
	public static String writeDBUrl=serverUrl+_systemUrl+'/'+_writeDBUrl;
	public static String sendImagesUrl=serverUrl+_systemUrl+'/'+_sendImagesUrl;
	public static String readImageUrl=serverUrl+_systemUrl+'/'+_readImageUrl;
	public static String readImageListUrl=serverUrl+_systemUrl+'/'+_readImageListUrl;
	
	public static String sendCheckUrl=serverUrl+_systemUrl+'/'+_sendCheckUrl;
	public static String readCheckUrl=serverUrl+_systemUrl+'/'+_readCheckUrl;
	public static String viewCheckUrl=serverUrl+_systemUrl+'/'+_viewCheckUrl;
	public static String
listWaitingChecksUrl=serverUrl+_systemUrl+'/'+_listWaitingChecksUrl;
}
c
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
remove the last character...

Release Regression From : 1.4.0_02
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 164380) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b05
14-06-2004

PUBLIC COMMENTS ...
10-06-2004

EVALUATION A bug. ###@###.### 2002-09-12
12-09-2002