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 187876 - Code completion throws IndexOutOfBoundsException for the function return type
Summary: Code completion throws IndexOutOfBoundsException for the function return type
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Anton Chechel
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2010-06-21 09:40 UTC by Alexandr Scherbatiy
Modified: 2010-07-07 20:15 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 170830


Attachments
stacktrace (2.66 KB, text/plain)
2010-06-21 09:40 UTC, Alexandr Scherbatiy
Details
stacktrace (2.66 KB, text/plain)
2010-06-29 09:32 UTC, Alexandr Scherbatiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2010-06-21 09:40:08 UTC
Build: NetBeans IDE Dev (Build 201006210001)
VM: Java HotSpot(TM) Client VM, 16.3-b01, Java(TM) SE Runtime Environment, 1.6.0_20-b02
OS: Windows XP

Stacktrace: 
java.lang.IndexOutOfBoundsException: -1
   at com.sun.tools.mjavac.util.List.get(List.java:412)
   at org.netbeans.modules.javafx.editor.semantic.MethodExitDetector.visitBlockExpression(MethodExitDetector.java:257)
   at org.netbeans.modules.javafx.editor.semantic.MethodExitDetector.visitBlockExpression(MethodExitDetector.java:62)
   at com.sun.tools.javafx.tree.JFXBlock.accept(JFXBlock.java:99)
   at com.sun.javafx.api.tree.JavaFXTreePathScanner.scan(JavaFXTreePathScanner.java:63)
   at org.netbeans.api.javafx.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
Comment 1 Alexandr Scherbatiy 2010-06-21 09:40:15 UTC
Created attachment 100268 [details]
stacktrace
Comment 2 Alexandr Scherbatiy 2010-06-21 09:41:48 UTC
Steps to reproduce:
- Copy the code to the editor:
----------------------------------------
class MDShape{
    
}

function create(dim:Integer, size:Number) {
} 
----------------------------------------

For the function 'create' type the return type 
'function create(dim:Integer, size:Number):MD'
- Press 
- Select MDShape from the popup list

The IndexOutOfBoundsException exception pops up.
Comment 3 Alexandr Scherbatiy 2010-06-22 09:37:15 UTC
Just use the code completion for the function return type while the
function body is empty. The exception pops up:
-------------------------
function f():Boolean{
      
}
-------------------------
Comment 4 Alexandr Scherbatiy 2010-06-29 09:31:28 UTC
Is it the JavaFX compiler issue?
Comment 5 Alexandr Scherbatiy 2010-06-29 09:32:03 UTC
Created attachment 100480 [details]
stacktrace
Comment 6 Petr Nejedly 2010-06-29 09:57:18 UTC
No, this is NetBeans issue. And not caused by code completion, rather by the semantic highlighter.
Comment 7 Anton Chechel 2010-06-29 11:43:04 UTC
fixed
http://hg.netbeans.org/javafx/rev/027b395e7cca
Comment 8 Alexandr Scherbatiy 2010-06-30 08:33:25 UTC
verified in NetBeans IDE 6.9.1 Dev (Build 201006292301)
Comment 9 Andrei Chistiakov 2010-07-07 20:10:17 UTC
Verified with NetBeans IDE 6.9.1 Dev (Build 201007052301)