Bug 305001 - Exception occurred in listener of Java element change notification
Summary: Exception occurred in listener of Java element change notification
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-08 10:42 EST by Micha Riser CLA
Modified: 2010-04-26 12:13 EDT (History)
3 users (show)

See Also:


Attachments
rough patch (4.25 KB, patch)
2010-03-10 06:56 EST, Ayushman Jain CLA
Olivier_Thomann: iplog+
Details | Diff
Updated patch (4.56 KB, patch)
2010-03-16 10:43 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 Micha Riser CLA 2010-03-08 10:42:01 EST
What steps will reproduce the problem?
Happened during writing in the Java Editor (insertion using Content Assist).


-- Error Details --
Date: Mon Mar 08 16:38:39 CET 2010
Message: Exception occurred in listener of Java element change notification
Severity: Error
Product: Eclipse 1.2.2.20100122-1337 (org.eclipse.epp.package.modeling.product)
Plugin: org.eclipse.jdt.core
Exception Stack Trace:
java.lang.ArrayIndexOutOfBoundsException
at org.eclipse.jdt.internal.ui.javaeditor.DocumentAdapter.getText(DocumentAdapter.java:400)
at org.eclipse.jdt.internal.core.Member.getJavadocRange(Member.java:282)
at org.eclipse.emf.mint.internal.MemberAnnotationManager.getJavadoc(MemberAnnotationManager.java:240)
at org.eclipse.emf.mint.internal.MemberAnnotationManager.computeCodeGenStatus(MemberAnnotationManager.java:219)
at org.eclipse.emf.mint.internal.MemberAnnotationManager.getCodeGenStatusChecked(MemberAnnotationManager.java:93)
at org.eclipse.emf.mint.internal.MemberAnnotationManager.computeChanges(MemberAnnotationManager.java:183)
at org.eclipse.emf.mint.internal.MemberAnnotationManager.elementChanged(MemberAnnotationManager.java:122)
at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1557)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1547)
at org.eclipse.jdt.internal.core.DeltaProcessor.fireReconcileDelta(DeltaProcessor.java:1399)
at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1358)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:769)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1244)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:151)
at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86)
at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:102)
at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
Comment 1 Markus Keller CLA 2010-03-09 12:32:24 EST
java.lang.ArrayIndexOutOfBoundsException
at
org.eclipse.jdt.internal.ui.javaeditor.DocumentAdapter.getText(DocumentAdapter.java:400)
at org.eclipse.jdt.internal.core.Member.getJavadocRange(Member.java:282)

This can always happen since access to the buffer is not synchronized in Member#getJavadocRange(..). I think JDT Core should:

- adapt IBuffer#getText(..) to realities and specify that it can throw IndexOutOfBoundsException
- in Member#getJavadocRange(..), catch the IOOBE and return null
Comment 2 Ayushman Jain CLA 2010-03-10 06:56:06 EST
Created attachment 161598 [details]
rough patch
Comment 3 Olivier Thomann CLA 2010-03-10 14:45:35 EST
Thanks for the patch, Ayushman
Comment 4 Olivier Thomann CLA 2010-03-16 10:43:38 EDT
Created attachment 162167 [details]
Updated patch
Comment 5 Olivier Thomann CLA 2010-03-16 10:44:44 EDT
Daniel, does this change require PMC approval?
I would say no since this is not an API breakage as is. It is more an update of the specification to reflect reality and warn the users of possible IOOBE.
Comment 6 Dani Megert CLA 2010-03-16 10:48:32 EDT
>Daniel, does this change require PMC approval?
No.
Comment 7 Olivier Thomann CLA 2010-03-16 10:54:17 EDT
Released for 3.6M7.
Comment 8 Frederic Fusier CLA 2010-04-26 12:13:35 EDT
Verified for 3.6M7 using v_A48 code.