Bug 10698 - DOM/AST: exception when creating AST
Summary: DOM/AST: exception when creating AST
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-04 13:06 EST by Dirk Baeumer CLA
Modified: 2002-03-07 10:49 EST (History)
0 users

See Also:


Attachments
Test case for bug in clear() implementation (838 bytes, text/plain)
2002-03-06 13:55 EST, Olivier Thomann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2002-03-04 13:06:52 EST
JDTCore 20020304

Here is the example code:

package expression_in;

public class A_test617 {
	public int foo() {
		return 10 + /*]*/20 * 30/*[*/ + 10;
	}
}


Creating an AST for it generates the following exception

java.util.ConcurrentModificationException

Stack trace:
   java/lang/Throwable.<init>()V
   java/util/AbstractList$SimpleListIterator.next()Ljava/lang/Object;
   java/util/AbstractList.removeRange(II)V
   java/util/AbstractList.clear()V
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/BinaryExpression;)
Lorg/eclipse/jdt/core/dom/InfixExpression;
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/Expression;)
Lorg/eclipse/jdt/core/dom/Expression;
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/ReturnStatement;)
Lorg/eclipse/jdt/core/dom/ReturnStatement;
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/Statement;)
Lorg/eclipse/jdt/core/dom/Statement;
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration;)
Lorg/eclipse/jdt/core/dom/MethodDeclaration;
   org/eclipse/jdt/core/dom/ASTConverter.buildBodyDeclarations
(Lorg/eclipse/jdt/internal/compiler/ast/TypeDeclaration;Lorg/eclipse/jdt/core/do
m/TypeDeclaration;)V
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/TypeDeclaration;)
Lorg/eclipse/jdt/core/dom/TypeDeclaration;
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration;[C)
Lorg/eclipse/jdt/core/dom/CompilationUnit;
   org/eclipse/jdt/core/dom/AST.parseCompilationUnit
(Lorg/eclipse/jdt/core/ICompilationUnit;Z)
Lorg/eclipse/jdt/core/dom/CompilationUnit;
   
org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.checkA
ctivation(Lorg/eclipse/core/runtime/IProgressMonitor;)
Lorg/eclipse/jdt/internal/corext/refactoring/base/RefactoringStatus;
   
org/eclipse/jdt/internal/corext/refactoring/base/Refactoring.checkPreconditions
(Lorg/eclipse/core/runtime/IProgressMonitor;)
Lorg/eclipse/jdt/internal/corext/refactoring/base/RefactoringStatus;
   org/eclipse/jdt/ui/tests/refactoring/AbstractSelectionTestCase.performTest
(Lorg/eclipse/jdt/core/ICompilationUnit;Lorg/eclipse/jdt/internal/corext/refacto
ring/base/Refactoring;ILjava/lang/String;)V
   org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.performTest
(Lorg/eclipse/jdt/core/IPackageFragment;Ljava/lang/String;ILjava/lang/String;)V
   org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.expressionTest()V
   org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.test617()V
   java/lang/reflect/AccessibleObject.invokeV(Ljava/lang/Object;
[Ljava/lang/Object;)V
   java/lang/reflect/Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)
Ljava/lang/Object;
   junit/framework/TestCase.runTest()V
   junit/framework/TestCase.runBare()V
   junit/framework/TestResult$1.protect()V
   junit/framework/TestResult.runProtected
(Ljunit/framework/Test;Ljunit/framework/Protectable;)V
   junit/framework/TestResult.run(Ljunit/framework/TestCase;)V
   junit/framework/TestCase.run(Ljunit/framework/TestResult;)V
   junit/framework/TestSuite.runTest
(Ljunit/framework/Test;Ljunit/framework/TestResult;)V
   junit/framework/TestSuite.run(Ljunit/framework/TestResult;)V
   junit/extensions/TestDecorator.basicRun(Ljunit/framework/TestResult;)V
   junit/extensions/TestSetup$1.protect()V
   junit/framework/TestResult.runProtected
(Ljunit/framework/Test;Ljunit/framework/Protectable;)V
   junit/extensions/TestSetup.run(Ljunit/framework/TestResult;)V
   org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.runTests
([Ljava/lang/String;)V
   org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.run()V
   org/eclipse/pde/internal/junit/ui/RemotePluginTestRunner.main
([Ljava/lang/String;)V
   org/eclipse/pde/internal/junit/ui/UITestApplication.runEventLoop()V
   org/eclipse/ui/internal/Workbench.run(Ljava/lang/Object;)Ljava/lang/Object;
   org/eclipse/core/internal/boot/InternalBootLoader.run
(Ljava/lang/String;Ljava/net/URL;Ljava/lang/String;[Ljava/lang/String;)
Ljava/lang/Object;
   org/eclipse/core/boot/BootLoader.run
(Ljava/lang/String;Ljava/net/URL;Ljava/lang/String;[Ljava/lang/String;)
Ljava/lang/Object;
   java/lang/reflect/AccessibleObject.invokeL(Ljava/lang/Object;
[Ljava/lang/Object;)Ljava/lang/Object;
   java/lang/reflect/Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)
Ljava/lang/Object;
   org/eclipse/core/launcher/Main.basicRun([Ljava/lang/String;)
Ljava/lang/Object;
   org/eclipse/core/launcher/Main.run([Ljava/lang/String;)Ljava/lang/Object;
   org/eclipse/core/launcher/UIMain.main([Ljava/lang/String;)V
Comment 1 Olivier Thomann CLA 2002-03-04 15:01:11 EST
Cannot reproduce.
Look like a concurrent access to the extendedOperands list inside the 
InfixExpression.
Are you iterating the tree in the same time you create it? I don't do any 
concurrent access. Could you please provide me some steps to reproduce which are as close as 
possible from your test case?
Comment 2 Dirk Baeumer CLA 2002-03-05 11:04:13 EST
No I don't do anything special. It happens when I try to create an AST for a 
compilation unit calling AST.parseCompilationUnit(...). So I don't even have a 
node to iterate over.

It also happens with the latest core from 20020305.
Comment 3 Olivier Thomann CLA 2002-03-05 11:10:27 EST
The problem is that I am using the same test case and I don't get it. Which 
rt.jar are you using? Maybe it comes from a different implementation of 
java.util.AbstractList.
Comment 4 Dirk Baeumer CLA 2002-03-05 11:42:17 EST
I am using J9.
Comment 5 Dirk Baeumer CLA 2002-03-05 11:45:55 EST
Running the same tests using JDK 1.3.1_01 works. My current J9 version is 

Licensed Materials - Property of IBM

J9 - VM for the Java(TM) platform, Version 1.5
(c) Copyright IBM Corp. 1991, 2002  All Rights Reserved
Target: 20020206 (Windows 2000 5.0 build 2195 Service Pack 2 x86)

IBM is a registered trademark of IBM Corp.
Java and all Java-based marks and logos are trademarks or registered
trademarks of Sun Microsystems, Inc.

java version "1.3.0"
Comment 6 Olivier Thomann CLA 2002-03-05 11:47:50 EST
Just to be sure that the problem comes from the libraries, could you please try 
to run the same code using JDK1.4? It would be great to narrow down the 
investigation. Thanks.
Comment 7 Olivier Thomann CLA 2002-03-05 11:48:49 EST
Ok, I'll try to find out what is the right behavior in this case. Thanks for 
your help.
Comment 8 Dirk Baeumer CLA 2002-03-05 12:48:00 EST
Problem exists on latest J9 
(http://home.ott.oti.com/teams/bluebird/drops/ive02252002.zip) too.
Comment 9 Olivier Thomann CLA 2002-03-06 13:55:37 EST
Created attachment 431 [details]
Test case for bug in clear() implementation
Comment 10 Olivier Thomann CLA 2002-03-07 10:44:37 EST
This was due to a bug in J9 JCL. I am checking if I can make the fix available as a attachment.
Comment 11 Olivier Thomann CLA 2002-03-07 10:49:04 EST
The fix will be available later.
Closed.