Community
Participate
Working Groups
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
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?
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.
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.
I am using J9.
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"
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.
Ok, I'll try to find out what is the right behavior in this case. Thanks for your help.
Problem exists on latest J9 (http://home.ott.oti.com/teams/bluebird/drops/ive02252002.zip) too.
Created attachment 431 [details] Test case for bug in clear() implementation
This was due to a bug in J9 JCL. I am checking if I can make the fix available as a attachment.
The fix will be available later. Closed.