Bug 25185

Summary: ClassFormatError compiling a method with a compilation problem
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P2    
Version: 2.0   
Target Milestone: 2.1 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Olivier Thomann CLA 2002-10-22 09:46:47 EDT
Using 1118, I got a ClassFormatError when I tried to run a class that contained
a compile error.
java.lang.ClassFormatError: org/eclipse/jdt/internal/compiler/parser/Scanner
(Invalid start_pc/length in local var table)
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
	at ScannerTest.main(ScannerTest.java:12)
Exception in thread "main" 

This class is the Scanner class having a local variable used. The bug is not in
the problem method, but in two other methods. I will investigate in self hosting.
Comment 1 Olivier Thomann CLA 2002-10-22 11:51:51 EDT
The problem was due to a resize in the byte array and the fact that in some
cases I don't store a 0 in the array. Instead I was offset the index by 2.
Fixed and released in 2.1 stream.
Comment 2 David Audel CLA 2002-11-14 10:37:49 EST
Verified.