Bug 59023 - [1.5] Refactoring fails when foreach loop present in source file
Summary: [1.5] Refactoring fails when foreach loop present in source file
Status: RESOLVED DUPLICATE of bug 59052
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-19 00:03 EDT by Walter Mundt CLA
Modified: 2005-01-11 11:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Mundt CLA 2004-04-19 00:03:59 EDT
If certain refactorings are attempted with a Cheetah-enabled 3.0M8 installation
on a source file with some of the new-style for loops, the following exception
shows up and the dialog for configuring the refactoring does not:

java.lang.IllegalArgumentException: Not yet implemented: convert(class
org.eclipse.jdt.internal.compiler.ast.ForeachStatement)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1792)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:398)
        at
org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:209)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1936)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:931)
        at org.eclipse.jdt.core.dom.AST.convertCompilationUnit(AST.java:239)
        at
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:81)
        at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:700)
        at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:739)
        at
org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1111)
        at
org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1080)
        at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:85)
        at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:145)
        at
org.eclipse.jface.text.reconciler.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:111)
        at
org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:123)
        at
org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:104)
        at
org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:280)
        at
org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:155)

Commenting out the foreach loops allows the refactoring to proceed.

Using JDT core 3.0.0.cheetah03 installed through the CVS checkout updater.
Comment 1 Philipe Mulet CLA 2004-04-19 05:31:01 EDT
Remember that tools outside compiler have not yet been leveraged to support 
1.5. Support will gradually come.
Comment 2 Olivier Thomann CLA 2004-04-19 10:19:37 EDT
The problem is that the reconciler is only using AST level 2.0 and to get the
1.5 constructs it would need to use the AST level 3.0.
There is no much I can do about this.
Comment 3 Olivier Thomann CLA 2004-04-19 10:43:07 EDT

*** This bug has been marked as a duplicate of 59052 ***