Bug 55088 - IAE when using ICU.reconcile(GET_AST_TRUE, ...)
Summary: IAE when using ICU.reconcile(GET_AST_TRUE, ...)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 56228 56906 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-17 08:06 EST by Dani Megert CLA
Modified: 2004-05-18 11:18 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2004-03-17 08:06:38 EST
I200403161300 + new code to use AST on reconcile

I saw this in .log but have no steps to reproduce:

java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.dom.NumberLiteral.setToken(NumberLiteral.java:184)
	at org.eclipse.jdt.core.dom.AST.newNumberLiteral(AST.java:2603)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1369)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:873)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2028)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1794)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:758)
	at
org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:330)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:268)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:146)
	at org.eclipse.jdt.core.dom.AST.convertCompilationUnit(AST.java:233)
	at
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:77)
	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:1043)
	at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:75)
	at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:129)
	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.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:155)
Comment 1 Olivier Thomann CLA 2004-03-18 13:55:46 EST
We need a test case for this one.
It looks like the DOM/AST is created on a compilation unit that has a number
literal that starts with - followed by something else than
TerminalTokens.TokenNameDoubleLiteral, TerminalTokens.TokenNameIntegerLiteral,
TerminalTokens.TokenNameFloatingPointLiteral, or
TerminalTokens.TokenNameLongLiteral.

This is not legal and this is why it is failing. I need a test case to find out
why we do end up creating the DOM/AST in this case.
Comment 2 Dani Megert CLA 2004-03-19 03:31:25 EST
As stated in my initial comment I have no steps. I assume that as soon as we
release our code to use reconcile(true, ...) we will see more of those.
Comment 3 Olivier Thomann CLA 2004-03-25 15:21:03 EST
*** Bug 56228 has been marked as a duplicate of this bug. ***
Comment 4 Olivier Thomann CLA 2004-03-31 13:47:43 EST
I added extra logging in HEAD to track this one down.
Could it be possible that the working copy contents changes during the conversion?
Comment 5 Olivier Thomann CLA 2004-03-31 13:56:44 EST
I think the problem is coming from the ReconcileWorkingCopyOperation.
Line 73 a compilation unit is built using the source of the working copy.
The source is retrieved again line 77. The problem is that between these two
lines the source might have changed. And this could lead to such errors while
converting the compilation unit.
The same source has to be used for the creation of the compilation unit AND the
conversion of the same compilation unit.

Jerome, what do you think?
Comment 6 Olivier Thomann CLA 2004-03-31 17:56:28 EST
*** Bug 56906 has been marked as a duplicate of this bug. ***
Comment 7 Jerome Lanneluc CLA 2004-04-01 06:57:22 EST
Thanks Olivier.
Changed ReconcileWorkingCopyOperation.executeOperation() and 
Compilation.buildStructure(...) to pass in the same contents to the problem 
finder and to the AST converter.
Comment 8 Frederic Fusier CLA 2004-05-18 11:18:05 EDT
Verified for 3.0 M9 with build I200405180816.

Note that comment 7 should read: CompilationUnit.buildStructure(...) - in
org.eclipse.jdt.internal.core package - instead of Compilation.buildStructure(...)