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.
I think that after I cut some text from Ruby test. Hard to get rid of it. Attaching relevant part of log. Todays fresh build, Linux.
Created attachment 44714 [details] exceptions.txt
Do you have any ideas how to reproduce this? Do you remember which file you were editing? Can you attach it? (I'm curious to know if it has any heredocs (<<FOO) in it.
Unfortunately no. I did some larger refactoring and create some tests in debug-commons project. It happened to me with this file: svn cat svn://rubyforge.org/var/svn/debug-commons/trunk/test-base/stepping_breakpoints_test.rb I did some commenting/uncommenting, running test, editing externally, back to NetBeans editor, ... so do not have steps :) Let me know if I may enable some logging or whatever...
I can reproduce this with the following unit test (append to the bottom of org.netbeans.modules.ruby.BracketCompleterTest in ruby/editing/test/unit/src public void test108889() throws Exception { // Reproduce 108889: AIOOBE and AE during editing insertChar("x = %q((^))", 'a', "x = %q((a^))"); } If I try this editing scenario by hand, it doesn't throw the exceptions. (The above test will place the caret at "^" in the first string, insert the character a, and then make sure the resulting document is the same as the second string, with the caret position being where "^" is shown (in both cases, the "^" is removed from the string before inserting/comparing with the document.)
I've checked in the unit test (disabled in xtest but there nevertheless) so just open BracketCompleterTest and run it, you'll get the failure. I don't know if this is a lexer bug, or if the Ruby lexer is returning some data that the lexer is not expecting/allowing. I'm reassigning to the lexer for an initial evaluation. This by the way looks similar to issue 107922, but that's filed as a P3 and I think Martin is right that this is a P2. This might also be related to issue 108813 (a P1); in issue 108347 the user observd both problems (the exception as well as the infinite tokenlist loop).
This is possibly/likely a duplicate of 108617
I'm getting this exception in lots of other scenarios too so it's getting really severe. It's blocking instant-renaming of block vars for example. Bumping up the priority.
*** Issue 109701 has been marked as a duplicate of this issue. ***
*** Issue 109935 has been marked as a duplicate of this issue. ***
*** Issue 109946 has been marked as a duplicate of this issue. ***
I'm able to reproduce by using the BracketCompleterTest and I hope to have a fix ready today's evening.
I have committed a fix for AIOOBE. I would like to add a test for this issue but I need to create a special language that will have an extra lookahead so that the specific conditions get triggered. Checking in TokenListUpdater.java; /cvs/lexer/src/org/netbeans/lib/lexer/inc/TokenListUpdater.java,v <-- TokenListUpdater.java new revision: 1.13; previous revision: 1.12
Great - the unit tests are passing now! Thanks!! I'm seeing one more problem though, which I think is similar to the scenario used in several of the bugs I closed as duplicates of this one. If you create an empty Ruby script (or just create a Ruby Application and replace the text in the file that is opened) with the following in it: [1,2,3].each { |foo| puts foo } Place the caret on the first instance of "foo" and hit Command-R (Ctrl-R) to go into instant renaming of foo. Press "a". For me, it triggers the following exception which looks similar to the original problem: java.lang.ArrayIndexOutOfBoundsException: 64 at org.netbeans.lib.lexer.LanguageOperation.tokenValidator(LanguageOperation.java:164) at org.netbeans.lib.lexer.inc.TokenListUpdater.update(TokenListUpdater.java:252) at org.netbeans.lib.lexer.TokenHierarchyOperation.textModified(TokenHierarchyOperation.java:277) at org.netbeans.spi.lexer.TokenHierarchyControl.textModified(TokenHierarchyControl.java:81) at org.netbeans.lib.lexer.inc.DocumentInput.modified(DocumentInput.java:115) at org.netbeans.lib.lexer.inc.DocumentInput.insertUpdate(DocumentInput.java:104) at org.netbeans.lib.editor.util.swing.PriorityDocumentListenerList.insertUpdate(PriorityDocumentListenerList.java:48) at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:184) at org.netbeans.editor.BaseDocument.fireInsertUpdate(BaseDocument.java:1342) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:599) at org.netbeans.modules.gsf.GsfEditorKitFactory$GsfEditorKit$GsfDefaultKeyTypedAction.replaceSelection(GsfEditorKitFactory.java:485) at org.netbeans.editor.BaseKit$DefaultKeyTypedAction.actionPerformed(BaseKit.java:1013) at org.netbeans.editor.ext.ExtKit$ExtDefaultKeyTypedAction.actionPerformed(ExtKit.java:886) at org.netbeans.modules.gsf.GsfEditorKitFactory$GsfEditorKit$GsfDefaultKeyTypedAction.actionPerformed(GsfEditorKitFactory.java:420) at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:266) Do you want me to reopen this one, or create a new issue for this?