Bug 144450 - IllegalArgumentException in core.dom.ASTNode.setSourceRange
Summary: IllegalArgumentException in core.dom.ASTNode.setSourceRange
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-30 10:25 EDT by kiril mitov CLA
Modified: 2010-04-26 04:40 EDT (History)
2 users (show)

See Also:


Attachments
Patch to log errors during the conversion (7.66 KB, patch)
2006-05-31 15:37 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kiril mitov CLA 2006-05-30 10:25:11 EDT
!ENTRY org.eclipse.jdt.ui 4 2 2006-05-30 12:03:50.786
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.jdt.ui".
!STACK 0
java.lang.IllegalArgumentException
        at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2599)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:483)
        at
org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:179)
        at
org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2659)
        at
org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2420)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:511)
        at
org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:179)
        at
org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2659)
        at
org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1242)
        at org.eclipse.jdt.core.dom.AST.convertCompilationUnit(AST.java:270)
        at
org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:187)
        at
org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:229)
        at
org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:505)
        at
org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:993)
        at
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:131)
        at
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:71)
        at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720)
        at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:779)
        at
org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1123)
        at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:97)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:82)
        at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:145)
        at
org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86)
        at
org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:94)
        at
org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:75)
        at
org.eclipse.jdt.internal.ui.text.JavaReconciler.process(JavaReconciler.java:342)
        at
org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:204)
Comment 1 kiril mitov CLA 2006-05-30 10:28:28 EDT
This exception was thrown while working with eclipse.
I have just downloaded eclipse-3.2RC6 and have not changed any preferences or configuration.
After some time I noticed this exception was thrown this is the .log file.

ps: Sorry for the previous comment. I accidently press enter.
Comment 2 Olivier Thomann CLA 2006-05-30 10:29:17 EDT
Could you please provide the contents of the compilation unit when you got this error?
I'll investigate it. Might be another case of incomplete recovery.
Comment 3 Olivier Thomann CLA 2006-05-30 11:04:00 EDT
This looks like a case where a method declaration doesn't have its declaration source end set.
David, this might come from a recovery issue.
Comment 4 Olivier Thomann CLA 2006-05-30 11:04:59 EDT
methodDeclaration.bodyEnd is not set in this case. A test case would be very welcome.
Comment 5 kiril mitov CLA 2006-05-31 05:49:02 EDT
I tried most of the compilation units i have been working in the time the exception occred. I edit them, scroll through them and so on but I could not reproduce the error. 
Sorry but it is imposible for me to provide an compilation unit
Comment 6 Olivier Thomann CLA 2006-05-31 15:37:45 EDT
Created attachment 43159 [details]
Patch to log errors during the conversion

This patch will log the cu contents when something wrong (RuntimeException) happens during the conversion and then rethrow it.
We would still get the same behavior, but at least it would be trivial to provide a test case to reproduce the issue.
Comment 7 Olivier Thomann CLA 2010-03-18 13:32:27 EDT
Released for 3.6M7 some logging code so that if this happens again we will be able to get a test case for it.

Closing as WORKSFORME since we were never able to reproduce this issue.
Comment 8 Srikanth Sankaran CLA 2010-04-26 04:40:27 EDT
Verified for 3.6M7