Bug 371398 - [misc] AssertionFailedException when replacing text
Summary: [misc] AssertionFailedException when replacing text
Status: NEW
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.sse (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: wst.sse CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2012-02-13 12:36 EST by Natalia Bartol CLA
Modified: 2013-06-19 11:14 EDT (History)
1 user (show)

See Also:


Attachments
AssertionFailedException caught (1.27 KB, application/octet-stream)
2012-02-13 12:41 EST, Natalia Bartol CLA
no flags Details
AssertionFailedException caught (1.27 KB, patch)
2012-02-13 12:42 EST, Natalia Bartol CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Natalia Bartol CLA 2012-02-13 12:36:01 EST
Build Identifier: 

!ENTRY org.eclipse.wst.sse.core 4 4 2012-02-08 10:21:25.071
!MESSAGE assertion failed: 
!STACK 0
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:62)
at org.eclipse.jface.text.TypedPosition.<init>(TypedPosition.java:45)
at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler$InternalListener.documentAboutToBeChanged(StructuredPresentationReconciler.java:340)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireDocumentAboutToChange(BasicStructuredDocument.java:389)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireDocumentAboutToChanged(BasicStructuredDocument.java:1120)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1912)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2423)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2408)
at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$2(JobSafeStructuredDocument.java:1)
at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$3.run(JobSafeStructuredDocument.java:141)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)

Reproducible: Sometimes

Steps to Reproduce:
1. Modify document, use Ctrl+D
Comment 1 Natalia Bartol CLA 2012-02-13 12:41:08 EST
Created attachment 210928 [details]
AssertionFailedException caught

I think that offset < 0 which causes AssertionFailedException in TypedPosition constructor has the same cause as possible BadLocatioException: concurrent threads   modifying document. As BadLocationException is caught in org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.InternalListener.documentAboutToBeChanged(DocumentEvent e) what about catching there AssertionFailedException as well?
Comment 2 Natalia Bartol CLA 2012-02-13 12:42:31 EST
Created attachment 210930 [details]
AssertionFailedException caught
Comment 3 Nick Sandonato CLA 2012-02-20 10:34:39 EST
Hi Natalia,

Thank you for the patch. I'd like to understand the problem first so that maybe we can fix the cause of this instead of suppressing the exception. Can you provide a testcase or some steps to reproduce the problem? Thanks!
Comment 4 Nick Sandonato CLA 2012-04-12 14:37:27 EDT
Comment on attachment 210930 [details]
AssertionFailedException caught

As stated, I think the best course of action would be to find out the root of this problem. Thank you for the patch, though.