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.
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.
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
Fixed also in Nevada Patch 1 and in Arrow.
Verified in nbdev 200507110943. This seems to be well solved by checkOffset method.