JDK-4749647 : REGRESSION: javac crashes when junk after class definition and no newline
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.4.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-09-18
  • Updated: 2002-09-18
  • Resolved: 2002-09-18
Related Reports
Duplicate :  
Description

Name: nt126004			Date: 09/18/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)

also 1.4.1 fcs, build 21

FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
javac crashes whenthere are junk at the EOF.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.compile attached file
2.
3.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
An exception has occurred in the compiler (1.4.1-rc). Please file a bug at the
Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi)  after
checking the Bug Parade for duplicates. Include your program and the following
diagnostic in your report.  Thank you.
java.lang.ArrayIndexOutOfBoundsException: 291 	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.skip(Parser.java:176) 	at
com.sun.tools.javac.v8.parser.Parser.syntaxError(Parser.java:187) 	at
com.sun.tools.javac.v8.parser.Parser.syntaxError(Parser.java:205) 	at
com.sun.tools.javac.v8.parser.Parser.classOrInterfaceDeclaration
(Parser.java:1872) 	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.

---------- BEGIN SOURCE ----------
/* only produces crash if there is no trailing new line

this compiles :
> tail -1 Testbug2.java | hex
00000000:  42 75 66 53 65 74 41 75 0A                       BufSetAu.

this does not :
> tail -1 Testbug.java | hex
00000000:  42 75 66 53 65 74 41 75                          BufSetAu
*/


public interface Testbug
{ 
        public void reset();
        
} // interface
        
        Style=.asm,1
ExtSetTemplateMacro=0,'\n'
ExtSetTemplateMacro=1,'\t'
ExtSetTemplateMacro=2,'@'

[Extension.cxx]
ExtSetBufFlags=0x8800048e,0x301cff
BufSetMaxVirtualLines=0x0019
BufSetMaxTabCol=0x00c8
BufSetAu

---------- END SOURCE ----------

Release Regression From : 1.4
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: 164464) 
======================================================================

Comments
EVALUATION Yes. This is a dup of 4746255.
11-06-2004