This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 35914 - Position can be created past the end of the document
Summary: Position can be created past the end of the document
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-04 15:37 UTC by Miloslav Metelka
Modified: 2007-11-05 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miloslav Metelka 2003-09-04 15:37:33 UTC
It's possible to create position past the end of
the document in the current editor implementation
using org.netbeans.editor.DocumentContent i.e.
Document.createPosition(10000000) returns a valid
Position object.
Comment 1 Miloslav Metelka 2003-09-04 15:45:19 UTC
Although the BaseDocument using DocumentContent was tested by rather
detailed tests (e.g. whether positions being inside the removed area
in the document will be properly restored after undo is performed) to
behave exactly in the same way like PlainDocument implementation will
unfortunately there was no test to attempt to create position on an
invalid offset which resulted into this bug.

Fixed in maintrunk:
Checking in DocumentContent.java;
/cvs/editor/libsrc/org/netbeans/editor/DocumentContent.java,v  <-- 
DocumentContent.java
new revision: 1.4; previous revision: 1.3
done
Comment 2 Antonin Nebuzelsky 2003-11-04 14:52:59 UTC
Fixed also in Nevada Patch 1 and in Arrow.
Comment 3 Max Sauer 2005-07-13 16:36:40 UTC
Verified in nbdev 200507110943. This seems to be well solved by checkOffset method.