Bug 323825 - Exception in SourceModuleAnnotationModel.createPositionFromProblem
Summary: Exception in SourceModuleAnnotationModel.createPositionFromProblem
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Common (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows Vista
: P3 major (vote)
Target Milestone: 2.0.1   Edit
Assignee: dltk.common-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-27 10:09 EDT by Eric Boureau CLA
Modified: 2010-09-06 05:14 EDT (History)
1 user (show)

See Also:
alex.panchenko: iplog+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Boureau CLA 2010-08-27 10:09:50 EDT
Build Identifier: Eclipse 20100218-1602 / DLTK 2.0.0.v20100518-1923-7L--EAAoOVMSKg6AVz-vN

When editing my source code, I sometime have an exception in SourceModuleDocumentProvider.SourceModuleAnnotationModel.createPositionFromProblem.

The exception is raised because the start position is greater than the documentLength which led to create a new Position with a negative length

I suggest to add this test:

	int documentLength = fDocument.getLength();
>>>>	if (start > documentLength)
>>>>		start = documentLength;
	if(start + length > documentLength){
		length = documentLength - start;
	}




Reproducible: Sometimes

Steps to Reproduce:
1. have an error marker on the end of the document
2. press the backspace rapidly to delete some part of code in the document body
Comment 1 Alex Panchenko CLA 2010-09-06 05:14:01 EDT
Applied in HEAD & 2.0 maintenance branch