Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » assertion error in MergingHighlightedPositionAcceptor
assertion error in MergingHighlightedPositionAcceptor [message #667955] Tue, 03 May 2011 00:41 Go to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
I keep getting this error/stacktrace for some combinations of
code/highlighting (see trace below).

The assert in Position is:
Assert.isTrue(length >= 0);

So something must be passing on a negative length. I checked that my
highlighting logic does not produce any 0 or negaitve lengths.

Is this by any chance a known (and even fixed issue)?

The error occurs when editing. And if trying to close and reopen the
file, it refuses to open with a different (confusing) error.

- henrik

EXCEPTION WHILE EDITING
=======================
org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
at org.eclipse.jface.text.Position.<init>(Position.java:63)
at
org.eclipse.xtext.ui.editor.syntaxcoloring.AttributedPositio n. <init>(AttributedPosition.java:32)
at
org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingPrese nter.createHighlightedPosition(HighlightingPresenter.java:27 0)
at
org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingRecon ciler.addPosition(HighlightingReconciler.java:124)
at
org.eclipse.xtext.ui.editor.syntaxcoloring.MergingHighlighte dPositionAcceptor.provideHighlightingFor(MergingHighlightedP ositionAcceptor.java:51)
at
org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingRecon ciler.reconcilePositions(HighlightingReconciler.java:87)
at
org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingRecon ciler.modelChanged(HighlightingReconciler.java:275)
at
org.eclipse.xtext.ui.editor.model.XtextDocument.notifyModelL isteners(XtextDocument.java:126)
at
org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumen tLocker.afterModify(XtextDocument.java:180)
at
org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumen tLocker.afterModify(XtextDocument.java:1)
at
org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.mod ify(AbstractReadWriteAcces.java:50)
at
org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumen tLocker.modify(XtextDocument.java:187)
at
org.eclipse.xtext.ui.editor.model.XtextDocument.internalModi fy(XtextDocument.java:98)
at
org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcil eStrategy.reconcile(XtextDocumentReconcileStrategy.java:33)
at
org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(X textReconciler.java:239)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


EXCEPTION WHEN OPENING FILE
===========================
org.eclipse.core.runtime.AssertionFailedException: unknown saveable:
org.eclipse.ui.internal.DefaultSaveable@4b7ae6a5 from part:
org.eclipse.ui.internal.ErrorEditorPart@4b7ae6a5
at org.eclipse.ui.internal.SaveablesList.logWarning(SaveablesLi st.java:187)
at org.eclipse.ui.internal.SaveablesList.addModel(SaveablesList .java:117)
at org.eclipse.ui.internal.SaveablesList.addModels(SaveablesLis t.java:289)
at org.eclipse.ui.internal.SaveablesList.postOpen(SaveablesList .java:684)
at org.eclipse.ui.internal.PartList.partOpened(PartList.java:23 4)
at org.eclipse.ui.internal.PartList.access$0(PartList.java:210)
at org.eclipse.ui.internal.PartList$1.propertyChanged(PartList. java:40)
at
org.eclipse.ui.internal.WorkbenchPartReference.fireInternalP ropertyChange(WorkbenchPartReference.java:375)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:610)
at
org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.java:271)
at
org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:1429)
at
org.eclipse.ui.internal.EditorManager$5.runWithException(Edi torManager.java:942)
at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3593)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3286)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:803)
at
org.eclipse.ui.internal.Workbench$31.runWithException(Workbe nch.java:1567)
at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3593)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3286)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2548)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 38)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Re: assertion error in MergingHighlightedPositionAcceptor [message #667998 is a reply to message #667955] Tue, 03 May 2011 09:29 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Henrik,

there seems to be a situation when the length of a node is -1. Could you
please file a ticket?

So far I recommend the workaround to check the length manually prior to
calling addPosition in your highlighting calculator.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


Am 03.05.11 02:41, schrieb Henrik Lindberg:
> I keep getting this error/stacktrace for some combinations of
> code/highlighting (see trace below).
>
> The assert in Position is:
> Assert.isTrue(length >= 0);
>
> So something must be passing on a negative length. I checked that my
> highlighting logic does not produce any 0 or negaitve lengths.
>
> Is this by any chance a known (and even fixed issue)?
>
> The error occurs when editing. And if trying to close and reopen the
> file, it refuses to open with a different (confusing) error.
>
> - henrik
>
> EXCEPTION WHILE EDITING
> =======================
> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
> at org.eclipse.jface.text.Position.<init>(Position.java:63)
> at
> org.eclipse.xtext.ui.editor.syntaxcoloring.AttributedPositio n. <init>(AttributedPosition.java:32)
>
> at
> org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingPrese nter.createHighlightedPosition(HighlightingPresenter.java:27 0)
>
> at
> org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingRecon ciler.addPosition(HighlightingReconciler.java:124)
>
> at
> org.eclipse.xtext.ui.editor.syntaxcoloring.MergingHighlighte dPositionAcceptor.provideHighlightingFor(MergingHighlightedP ositionAcceptor.java:51)
>
> at
> org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingRecon ciler.reconcilePositions(HighlightingReconciler.java:87)
>
> at
> org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingRecon ciler.modelChanged(HighlightingReconciler.java:275)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument.notifyModelL isteners(XtextDocument.java:126)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumen tLocker.afterModify(XtextDocument.java:180)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumen tLocker.afterModify(XtextDocument.java:1)
>
> at
> org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.mod ify(AbstractReadWriteAcces.java:50)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumen tLocker.modify(XtextDocument.java:187)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument.internalModi fy(XtextDocument.java:98)
>
> at
> org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcil eStrategy.reconcile(XtextDocumentReconcileStrategy.java:33)
>
> at
> org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(X textReconciler.java:239)
>
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
>
>
> EXCEPTION WHEN OPENING FILE
> ===========================
> org.eclipse.core.runtime.AssertionFailedException: unknown saveable:
> org.eclipse.ui.internal.DefaultSaveable@4b7ae6a5 from part:
> org.eclipse.ui.internal.ErrorEditorPart@4b7ae6a5
> at org.eclipse.ui.internal.SaveablesList.logWarning(SaveablesLi st.java:187)
> at org.eclipse.ui.internal.SaveablesList.addModel(SaveablesList .java:117)
> at org.eclipse.ui.internal.SaveablesList.addModels(SaveablesLis t.java:289)
> at org.eclipse.ui.internal.SaveablesList.postOpen(SaveablesList .java:684)
> at org.eclipse.ui.internal.PartList.partOpened(PartList.java:23 4)
> at org.eclipse.ui.internal.PartList.access$0(PartList.java:210)
> at org.eclipse.ui.internal.PartList$1.propertyChanged(PartList. java:40)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.fireInternalP ropertyChange(WorkbenchPartReference.java:375)
>
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:610)
>
> at
> org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.java:271)
>
> at
> org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:1429)
>
> at
> org.eclipse.ui.internal.EditorManager$5.runWithException(Edi torManager.java:942)
>
> at
> org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
>
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:134)
>
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3593)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3286)
> at
> org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:803)
>
> at
> org.eclipse.ui.internal.Workbench$31.runWithException(Workbe nch.java:1567)
> at
> org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
>
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:134)
>
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3593)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3286)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2548)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 38)
> at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:664)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 620)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Re: assertion error in MergingHighlightedPositionAcceptor [message #668007 is a reply to message #667998] Tue, 03 May 2011 11:09 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
I already do that. The error occurs when merging takes place. All of the
input is valid. Not possible to work around as most of the involved
functionality is not injected.

I found the case that caused the problem, and I now avoid applying the
styling in that case. It is not what I want, but at least it does not
crash.
- henrik

Sebastian Zarnekow <Sebastian.Zarnekow@itemis.de> wrote:
> Hi Henrik,
>
> there seems to be a situation when the length of a node is -1. Could you
> please file a ticket?
>
> So far I recommend the workaround to check the length manually prior to
> calling addPosition in your highlighting calculator.
>
> Regards,
> Sebastian


--
- henrik
Re: assertion error in MergingHighlightedPositionAcceptor [message #668037 is a reply to message #668007] Tue, 03 May 2011 13:33 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Henrik,

could you please provide the sequence of positions that leads to the
exception in a bugzilla? That would be helpful.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 03.05.11 13:09, schrieb Henrik Lindberg:
> I already do that. The error occurs when merging takes place. All of the
> input is valid. Not possible to work around as most of the involved
> functionality is not injected.
>
> I found the case that caused the problem, and I now avoid applying the
> styling in that case. It is not what I want, but at least it does not
> crash.
> - henrik
>
> Sebastian Zarnekow<Sebastian.Zarnekow@itemis.de> wrote:
>> Hi Henrik,
>>
>> there seems to be a situation when the length of a node is -1. Could you
>> please file a ticket?
>>
>> So far I recommend the workaround to check the length manually prior to
>> calling addPosition in your highlighting calculator.
>>
>> Regards,
>> Sebastian
>
>
Re: assertion error in MergingHighlightedPositionAcceptor [message #668084 is a reply to message #668037] Tue, 03 May 2011 16:31 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Is it enough to just get the sequence of offset length info ?
Any particular format?

- henrik

On 5/3/11 3:33 PM, Sebastian Zarnekow wrote:
> Hi Henrik,
>
> could you please provide the sequence of positions that leads to the
> exception in a bugzilla? That would be helpful.
>
> Regards,
> Sebastian
Re: assertion error in MergingHighlightedPositionAcceptor [message #668091 is a reply to message #668084] Tue, 03 May 2011 17:33 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=344616
Let me know if more info is needed.
- henrik

On 5/3/11 6:31 PM, Henrik Lindberg wrote:
> Is it enough to just get the sequence of offset length info ?
> Any particular format?
>
> - henrik
>
> On 5/3/11 3:33 PM, Sebastian Zarnekow wrote:
>> Hi Henrik,
>>
>> could you please provide the sequence of positions that leads to the
>> exception in a bugzilla? That would be helpful.
>>
>> Regards,
>> Sebastian
>
Previous Topic:Xtend2 - sorting by a function
Next Topic:[XText] organize outline view
Goto Forum:
  


Current Time: Tue Apr 23 06:41:28 GMT 2024

Powered by FUDForum. Page generated in 0.03305 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top