Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349386 - ASTParser.newParser(AST.JLS3) fails with VerifyError
Summary: ASTParser.newParser(AST.JLS3) fails with VerifyError
Status: CLOSED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2011-06-14 19:26 EDT by Tom Ball CLA
Modified: 2011-06-17 12:46 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Ball CLA 2011-06-14 19:26:49 EDT
Build Identifier: 3.7.0-M7 B53 (the jar is org.eclipse.jdt.core_3.7.0.v_B53.jar)

Running a translator that works with 3.6.2, on 3.7.7 the following error is thrown:


Exception in thread "main" java.lang.VerifyError: class org.eclipse.jdt.internal.compiler.parser.RecoveryScanner overrides final method getCurrentTokenSource.()[C
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
	at com.google.devtools.j2objc.J2ObjC.translate(J2ObjC.java:89)
	at com.google.devtools.j2objc.J2ObjC.main(J2ObjC.java:308)


Reproducible: Always

Steps to Reproduce:
1. call ASTParser.newParser(AST.JLS3) (no setup needed).

Here is a test file it fails with:


import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;

public class JDTVerifyErrorTest {

  public static void main(String[] args) {
    ASTParser.newParser(AST.JLS3);
  }
}
Comment 1 Olivier Thomann CLA 2011-06-15 14:55:44 EDT
I could not reproduce.
Please provide a list of all installed bundles.

Could you please try the same code with Eclipse 3.7M7 that has nothing else installed ?

Thanks.
Comment 2 Olivier Thomann CLA 2011-06-17 11:51:42 EDT
The method getCurrentTokenSource() on the class Scanner is not final since 3.2M5. So you must have incompatible versions installed somehow in your workspace.
It would be good to find out what you have installed in your workspace that could cause this failure.
Where did you find the class com.google.devtools.j2objc.J2ObjC ?
Comment 3 Tom Ball CLA 2011-06-17 12:46:47 EDT
I had a weird build problem, which pulled in incompatible jars.  Sorry for the noise...