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 141094 - UnsupportedOperationException: Not supported yet.
Summary: UnsupportedOperationException: Not supported yet.
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Torbjorn Norbye
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-22 01:33 UTC by jamespb
Modified: 2008-07-23 16:57 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 79779


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jamespb 2008-07-22 01:33:57 UTC
I've seen this a few times editing ruby files.


Build: NetBeans IDE Dev (Build 080721)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05
OS: Linux, 2.6.22-15-generic, i386
User comments: opened a .rb file
STACKTRACE: (first 10 lines)
java.lang.UnsupportedOperationException: Not supported yet.
        at org.jruby.ast.Node$1.getStartOffset(Node.java:74)
        at org.netbeans.modules.ruby.AstPath.find(AstPath.java:141)
        at org.netbeans.modules.ruby.AstPath.findPathTo(AstPath.java:129)
        at org.netbeans.modules.ruby.AstPath.<init>(AstPath.java:82)
        at org.netbeans.modules.ruby.hints.infrastructure.RubyHintsProvider.computeSuggestions(RubyHintsProvider.java:212)
        at org.netbeans.modules.gsfret.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:109)
        at org.netbeans.modules.gsfret.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:63)
        at org.netbeans.napi.gsfret.source.Source$CompilationJob.run(Source.java:1349)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
Comment 1 Torbjorn Norbye 2008-07-22 02:04:04 UTC
Can you by any chance reproduce this?  Is there any chance you can let me see the .rb file? If not, I'd like to add some
diagnostics to the build and see what it prints when you reproduce this bug.  
Comment 2 jamespb 2008-07-22 04:21:46 UTC
For at least one of these, the file was completely empty - I did a touch foo.rb, then opened it in the editor.  I don't
think it has anything to do with contents.  Unfortunately, I don't have a reliable repro case yet.  Happy to run with
diagnostics enabled though - I'm building Netbeans myself now, so if you don't want to check it in, just point me to a
patch.
Comment 3 Martin Schovanek 2008-07-22 12:30:59 UTC
BTW: can you try it with latest daily build downloaded from nb.org?
Comment 4 Torbjorn Norbye 2008-07-22 15:24:43 UTC
I don't think trying with a fresh downloaded build will help; this appears to be related to JRuby 1.1.3. It has added
some new node types, one of which is "synthetic" - it doesn't provide a node position, instead it throws this exception.
I'm trying to find out which code constructs produces this. I'm going to study it from the JRuby source side to see if I
can find it.
Comment 5 Torbjorn Norbye 2008-07-23 06:08:16 UTC
I can reproduce this - when the document is empty!  At this point we end up with an "empty" AST (only has synthetic
nodes, which are now as of 1.1.3 throwing exceptions when the AST iterator attempts to access the source positions).

I'm adding a unit test for that to the various features. I also have a stresstest which parses all the Ruby source files
in the JRuby distro and runs some utility checks on them to make sure there are no exceptions thrown etc.
Comment 6 Torbjorn Norbye 2008-07-23 08:22:36 UTC
I have a fix. I'll check it in in the morning when I can babysit the builds.
Comment 7 Torbjorn Norbye 2008-07-23 16:57:28 UTC
Should be fixed now (changeset 81ddf15c7fd1), build #2995 and later.