Bug 55814 - AssertionFailed in Java Editor
Summary: AssertionFailed in Java Editor
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords: vm
: 56171 57882 59033 60380 60541 60855 62604 62607 63885 67730 94797 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-23 21:25 EST by DJ Houghton CLA
Modified: 2005-05-12 12:13 EDT (History)
13 users (show)

See Also:


Attachments
limit file (135 bytes, text/plain)
2004-04-30 08:47 EDT, Dani Megert CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2004-03-23 21:25:11 EST
build i0323:2000, winxp, j9sc20031212

Using today's build with "show source of selected element only" results in an
exception and loss of syntax highlighting after clicking around in the outline
for a while. (not long)


osgi> !SESSION Mar 23, 2004 21:17:44.549 ---------------------------------------
------
java.fullversion=J2RE 1.4.1 IBM J9 build 20031212 (JIT enabled)
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -showlocation -vmargs -Xj9 -cp C:\eclipse\dev\i0323-2000
\eclipse\startup.jar org.eclipse.core.launcher.Main
!ENTRY org.eclipse.core.runtime 4 2 Mar 23, 2004 21:17:44.549
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.ru
ntime".
!STACK 0
org.eclipse.jface.text.Assert$AssertionFailedException: Assertion failed:
        at java.lang.Throwable.<init>(Throwable.java)
        at java.lang.Throwable.<init>(Throwable.java)
        at org.eclipse.jface.text.Assert$AssertionFailedException.<init>(Assert.
java:54)
        at org.eclipse.jface.text.Assert.isTrue(Assert.java:175)
        at org.eclipse.jface.text.Assert.isTrue(Assert.java)
        at org.eclipse.jface.text.projection.ProjectionMapping.toImageRegion(Pro
jectionMapping.java)
        at org.eclipse.jface.text.projection.ProjectionMapping.toImageRegion(Pro
jectionMapping.java)
        at org.eclipse.jface.text.TextViewer.modelRange2WidgetRange(TextViewer.j
ava)
        at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:398
1)
        at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.j
ava:4076)
        at org.eclipse.jface.text.presentation.PresentationReconciler.applyTextR
egionCollection(PresentationReconciler.java:564)
        at org.eclipse.jface.text.presentation.PresentationReconciler.processDam
age(PresentationReconciler.java:553)
        at org.eclipse.jface.text.presentation.PresentationReconciler.access$5(P
resentationReconciler.java:549)
        at org.eclipse.jface.text.presentation.PresentationReconciler$InternalLi
stener.textChanged(PresentationReconciler.java:223)
        at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java
:2233)
        at org.eclipse.jface.text.TextViewer$DocumentListener.documentChanged(Te
xtViewer.java:291)
        at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(Abstra
ctDocument.java:673)
        at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(Abstrac
tDocument.java:638)
        at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(Abstrac
tDocument.java:623)
        at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractD
ocument.java:698)
        at org.eclipse.jface.text.projection.ProjectionDocument.replaceMasterDoc
umentRanges(ProjectionDocument.java:742)
        at org.eclipse.jface.text.projection.ChildDocument.setParentDocumentRang
e(ChildDocument.java:78)
        at org.eclipse.jface.text.TextViewer.updateVisibleDocument(TextViewer.ja
va:2416)
        at org.eclipse.jface.text.TextViewer.updateSlaveDocument(TextViewer.java
:2434)
        at org.eclipse.jface.text.TextViewer.setVisibleRegion(TextViewer.java:30
71)
        at org.eclipse.ui.texteditor.AbstractTextEditor.setHighlightRange(Abstra
ctTextEditor.java:4047)
        at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setSelection(JavaEd
itor.java:2378)
        at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSelectionChanged(
JavaEditor.java:2482)
        at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$OutlineSelectionCha
ngedListener.selectionChanged(JavaEditor.java:291)
        at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.jav
a:431)
        at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatfo
rm.java)
        at org.eclipse.core.runtime.Platform.run(Platform.java)
        at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(S
tructuredViewer.java:429)
        at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(Structure
dViewer.java:680)
        at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(Structure
dViewer.java:698)
        at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrate
gy.java:198)
        at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:193)
        at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:334)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.ja
va)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1541)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1515)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav
a:257)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:90
)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformAct
ivator.java:288)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:232)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:116)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:79)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:41)
        at java.lang.reflect.Method.invoke(Method.java:386)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:315)
        at org.eclipse.core.launcher.Main.run(Main.java:740)
        at org.eclipse.core.launcher.Main.main(Main.java:724)
Comment 1 DJ Houghton CLA 2004-03-23 21:28:01 EST
Increasing severity.

I don't see a pattern with the exceptions. I tried clicking around (different
method sigs, etc) but it seems random. Same file...sometimes a method throws an
exception and sometimes not.
Comment 2 Dani Megert CLA 2004-03-24 04:05:53 EST
Kai, this looks like bug 55568 which is claimed to be fixed I200403230800. The
build inputs > I200403230800 from JDT UI were discarded by PDE but I200403230800
was correctly submitted. Since DJ tested with a build > I200403230800 this might
still be a problem.
Comment 3 Kai-Uwe Maetzel CLA 2004-03-24 06:11:16 EST
This seems to be a so called "impossible" problem. The assert statement checks 
whether the local parameter "exact" is false. The parameter is nowhere inside 
the method modified. The code path in the stack trace enforces the parameter 
to be false. 

I don't see how the assertion can fail with the given stack trace. Are both of 
you running on J9? There is no PR alike for other VMs.

Removing Milestone. Decreasing Priority.
Comment 4 DJ Houghton CLA 2004-03-24 07:08:19 EST
I use j9sc. Someone else on my team uses sunjdk1.4.2 (I believe) I will test
with Sun VM and try and reproduce the problem.
Comment 5 Kai-Uwe Maetzel CLA 2004-03-24 08:40:37 EST
Bug was unintensionally closed. Please reopen if necessary.
Comment 6 DJ Houghton CLA 2004-03-24 08:55:17 EST
I haven't be able to reproduce this with sun jdk 1.4.2. I will retest the 8am
build with j9sc once the build is available.
Comment 7 DJ Houghton CLA 2004-03-24 09:05:32 EST
Still a problem with i0324:0800 and j9sc20031212.
Will test i0324:800 and sunjdk1.4.2.
Comment 8 DJ Houghton CLA 2004-03-24 09:11:11 EST
Isn't the "show source of selected element only" setting supposed to be
persisted across all editors? I got this behaviour with j9sc.

- start Eclipse
- editor already open
- select "show source of selected element only"
- note that editor shows an import statment only
- click on one method
- get assertionfailedexception
- now editor has a problem redrawing - bird's eye on right border is ok (can see
it redraw warning/error annotations when toggling the view) but the editor
itself is all grey.
- switching to another editor and back does nothing
- when I switched to another editor I noticed that the "show source..." icon was
not selected but when I went back to my first editor, it was still selected.

Strange behaviour, but it might just be that I am in a weird state after the
first assertion failure.
Comment 9 John Arthorne CLA 2004-03-24 10:28:51 EST
- Reproduced the first time I opened an editor in I20040324 0800.
- I also use J9SC (cn1411-20031212)
- I also use "show source of selected element only"
Comment 10 Thomas M??der CLA 2004-03-25 05:20:03 EST
Looks like a JIT problem; adding -Xint fixes the problem for me. 
Comment 11 DJ Houghton CLA 2004-03-25 10:41:31 EST
I have entered a bug report against the j9sc team.
I am also trying to get a newer version of the vm to confirm that its still a
problem.
Comment 12 Dani Megert CLA 2004-03-25 12:15:43 EST
*** Bug 56171 has been marked as a duplicate of this bug. ***
Comment 13 David Williams CLA 2004-04-29 08:41:59 EDT
*** Bug 60380 has been marked as a duplicate of this bug. ***
Comment 14 Dani Megert CLA 2004-04-30 08:38:50 EDT
*** Bug 60541 has been marked as a duplicate of this bug. ***
Comment 15 Dani Megert CLA 2004-04-30 08:39:00 EDT
*** Bug 57882 has been marked as a duplicate of this bug. ***
Comment 16 Dani Megert CLA 2004-04-30 08:39:31 EDT
*** Bug 59033 has been marked as a duplicate of this bug. ***
Comment 17 Dani Megert CLA 2004-04-30 08:47:17 EDT
start you VM with:
-Xjit:limitFile=c:\temp\limit.txt

(see attached limit.txt)
Comment 18 Dani Megert CLA 2004-04-30 08:47:49 EDT
Created attachment 10165 [details]
limit file
Comment 19 Dani Megert CLA 2004-05-04 08:49:49 EDT
*** Bug 60855 has been marked as a duplicate of this bug. ***
Comment 20 Steven Wasleski CLA 2004-05-14 09:43:12 EDT
DJ or David, do either of you have an update on the status of this bug on a 
later driver or on the status of the defect DJ opened with the J9 team 
(comment #11)?  Have you tried the test described in comments 17 and 18?  And 
has the J9 team been given this test to help them diagnose the problem?  J9 is 
very important to us and we need to work to get this resolved.
Comment 21 Dani Megert CLA 2004-05-14 09:44:42 EDT
J9 has been fixed.
Comment 22 Steven Wasleski CLA 2004-05-14 10:05:21 EDT
Daniel, that is good news.  Do you know which IBM JRE 1.4.2 build contains the 
fix?  I need to be able to get this info to the build team in Ottawa and so we 
can mark this one fixed.
Comment 23 DJ Houghton CLA 2004-05-14 10:17:20 EDT
Verified fixed with the following VM:

C:\java\jre\bin>java -version
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1)
Classic VM (build 1.4.1, J2RE 1.4.1 IBM Windows 32 build cn1411-20040511 (JIT en
abled: jitc))
Comment 24 Olivier Thomann CLA 2004-05-14 10:19:49 EDT
This one doesn't seem to run J9 JIT.
Comment 25 Steven Wasleski CLA 2004-05-14 10:39:38 EDT
DJ or Olivier, do either of you know when this fix will show up in a 1.4.2 JRE 
build?
Comment 26 Olivier Thomann CLA 2004-05-14 10:43:49 EDT
Absolutely no idea
Comment 27 Dani Megert CLA 2004-05-14 10:58:21 EDT
no idea
Comment 28 DJ Houghton CLA 2004-05-14 11:12:36 EDT
No idea either. None of us are VM guys. :-)
Comment 29 Steven Wasleski CLA 2004-05-14 13:33:35 EDT
DJ, what was the defect number for the problem you opened against the J9 team 
(reference comment 11).  And in which bug tracking system was it opened?
Comment 30 Dani Megert CLA 2004-05-18 05:06:50 EDT
*** Bug 62604 has been marked as a duplicate of this bug. ***
Comment 31 Dani Megert CLA 2004-05-18 05:07:08 EDT
*** Bug 62607 has been marked as a duplicate of this bug. ***
Comment 32 Steven Wasleski CLA 2004-05-18 15:56:50 EDT
I have been informed that the J9 fix went into the IBM 1.4.2 JRE build on 
April 9th.  I am not sure how long it takes from build entry to published 
driver, but I would think it would be in the May 11th driver we just stepped 
up to in IES.  Please retry the failing scenarios with that J9 JRE level.
Comment 33 Kai-Uwe Maetzel CLA 2004-05-25 12:29:04 EDT
*** Bug 63885 has been marked as a duplicate of this bug. ***
Comment 34 Steven Wasleski CLA 2004-06-01 09:32:40 EDT
Has anyone been able to reproduce this using the latest IBM 1.4.2 JRE?  If 
not, can we mark this resolved?
Comment 35 DJ Houghton CLA 2004-06-01 09:36:05 EDT
I haven't seen it since I started using the latest VM.
Comment 36 John Arthorne CLA 2004-06-01 10:06:34 EDT
I have been heavily using Eclipse builds with the 20040510 IBM 1.4.2 VM and have
not experienced this problem since then. Previously I was able to consistently
reproduce the error in both the segmented Java editor and the compare editors. I
think this can be closed. 
Comment 37 Kai-Uwe Maetzel CLA 2004-06-02 14:02:14 EDT
Marking as fixed with RC1.
Comment 38 Dirk Baeumer CLA 2004-06-11 06:27:37 EDT
start verifying...
Comment 39 Dirk Baeumer CLA 2004-06-11 06:35:25 EDT
actually can't really verify. I tried the steps under #8 but the editor 
doesn't show a single import statement in this scenario. Only if I select it 
in the outliner. 

Did some testing (clicking around in single method mode) using 

java version "1.4.1"
J9 - VM for the Java(TM) platform (build 2.1)
IBM J9SE VM (build 2.1, J2RE 1.4.1 IBM J9 build 20040510 (JIT enabled))

Didn't get any exceptions.
Comment 40 Dani Megert CLA 2004-06-18 10:22:39 EDT
*** Bug 67730 has been marked as a duplicate of this bug. ***
Comment 41 Achintya CLA 2004-07-26 14:24:17 EDT
Hi, 
I know this bug was reported earlier and a work around was posted for IBM 1.4.2 
But i'm using the following verion of JRE from Sun
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

And have the same problem. And "-Xjit:limitFile=c:\temp\limit.txt" can't be used
 as a parameter for SUN JRE.. 
Any idea how to fix it with SUN JRE ?


Here is the stack trace... 
Error Jul 26, 2004 14:00:43.406 Problems occurred when invoking code from
plug-in: "org.eclipse.core.runtime".
java.lang.ClassCastException
at
org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.activeJavaEditorChanged(ASTProvider.java:220)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.access$0(ASTProvider.java:215)
at
org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$ActivationListener.partActivated(ASTProvider.java:70)
at org.eclipse.ui.internal.PartListenerList2$1.run(PartListenerList2.java:45)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:615)
at org.eclipse.core.runtime.Platform.run(Platform.java:747)
at
org.eclipse.ui.internal.PartListenerList2.firePartActivated(PartListenerList2.java:43)
at org.eclipse.ui.internal.WWinPartService$1.partActivated(WWinPartService.java:30)
at org.eclipse.ui.internal.WWinPartService.pageActivated(WWinPartService.java:153)
at org.eclipse.ui.internal.WWinPartService.pageOpened(WWinPartService.java:169)
at org.eclipse.ui.internal.WorkbenchWindow.firePageOpened(WorkbenchWindow.java:810)
at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1374)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1224)
at org.eclipse.ui.internal.Workbench.access$10(Workbench.java:1185)
at org.eclipse.ui.internal.Workbench$13.run(Workbench.java:1096)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:615)
at org.eclipse.core.runtime.Platform.run(Platform.java:747)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1029)
at
org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:167)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:652)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:819)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1325)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
at org.eclipse.core.launcher.Main.run(Main.java:644)
at org.eclipse.core.launcher.Main.main(Main.java:628)

Comment 42 Dani Megert CLA 2004-07-26 14:53:38 EDT
The class cast exception is just a follow up. Please provide the full .log.
You can use -Xint but this fully disables the JIT. Read Sun's VM options about
how to disable JIT for a specific method.
Comment 43 Dani Megert CLA 2005-05-12 12:13:42 EDT
*** Bug 94797 has been marked as a duplicate of this bug. ***