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 138590 - Go to attribure declaration throws IllegalArgumentException ElementOpen.encodeType
Summary: Go to attribure declaration throws IllegalArgumentException ElementOpen.encod...
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-30 09:58 UTC by Alexandr Scherbatiy
Modified: 2008-09-09 18:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log file (59.84 KB, text/plain)
2008-06-30 10:04 UTC, Alexandr Scherbatiy
Details
IDE log file (ElementOpen.getFile) (61.64 KB, text/plain)
2008-07-07 11:12 UTC, Alexandr Scherbatiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2008-06-30 09:58:23 UTC
Steps to reproduce:

- Create Echo JavaFX Script class:
----------  Echo.fx  ------------------
public class Echo {
    public attribute message: String ;
}
---------------------------------------

- Create Main JavaFX Script file:
----------  Main.fx  ------------------
Echo{ message: "Hello World!"}
---------------------------------------

- Hold <Ctrl> and click on 'message' attribute in 'Echo{ message: "Hello World!"}' line

The IllegalArgumentException  pops up:
java.lang.IllegalArgumentException
	at org.netbeans.api.javafx.editor.ElementOpen.encodeType(ElementOpen.java:365)
	at org.netbeans.api.javafx.editor.ElementOpen.createFieldDescriptor(ElementOpen.java:415)
	at org.netbeans.api.javafx.editor.ElementOpen.getSignatures(ElementOpen.java:297)
	at org.netbeans.api.javafx.editor.ElementOpen.openThroughJavaSupport(ElementOpen.java:264)
	at org.netbeans.api.javafx.editor.ElementOpen.open(ElementOpen.java:125)
	at org.netbeans.modules.javafx.editor.GoToSupport$1.run(GoToSupport.java:172)
	at org.netbeans.modules.javafx.editor.GoToSupport$1.run(GoToSupport.java:121)
Comment 1 Alexandr Scherbatiy 2008-06-30 10:04:34 UTC
Created attachment 63666 [details]
IDE log file
Comment 2 David Strupl 2008-06-30 10:29:49 UTC
Go to Petr.
Comment 3 Petr Nejedly 2008-07-01 10:00:17 UTC
Hmm, again another case where compiler has hard times resolving foreign symbols correctly.
For the "message:" part, the compiler will correctly recognize that it is a field (attribute) of the class Echo, that it
is named "message", but it can't evaluate its type correctly - the symbol has assigned ErrorType(attribute) for some
reason unknown to me yet.
Comment 4 Petr Nejedly 2008-07-02 16:06:46 UTC
May be related to the latest reincarnation of JFXC-1309.
Comment 5 Petr Nejedly 2008-07-03 10:11:11 UTC
Yes, with JFXC-1309 fixed, this exception no longer occurs and go-to works well.
I'm keeping this issue open (degraded) as the code in ElementOpen should still handle broken symbols gracefully.
Comment 6 Alexandr Scherbatiy 2008-07-07 11:11:29 UTC
The exception is reproduced if the file is not compiled:
----------  Main.fx  ------------------
a

Echo{ message: "Hello World!"}
---------------------------------------
java.lang.NullPointerException
	at org.netbeans.api.javafx.editor.ElementOpen.getFile(ElementOpen.java:221)
	at org.netbeans.api.javafx.editor.ElementOpen.open(ElementOpen.java:128)
	at org.netbeans.modules.javafx.editor.GoToSupport$1.run(GoToSupport.java:172)
	at org.netbeans.modules.javafx.editor.GoToSupport$1.run(GoToSupport.java:121)
	at org.netbeans.api.javafx.source.JavaFXSource.runUserActionTask(JavaFXSource.java:354)


I think that it is better to show a message "Unable the found the source because the file is not compiled" in this case
instead of the NPE.
Comment 7 Alexandr Scherbatiy 2008-07-07 11:12:23 UTC
Created attachment 63987 [details]
IDE log file (ElementOpen.getFile)
Comment 8 Petr Nejedly 2008-09-08 16:05:41 UTC
This is now fixed thanks to refixing JFXC-1309 and more robust ElementHandle implementation:
http://hg.netbeans.org/javafx/rev/30870bed7131
Comment 9 Lark Fitzgerald 2008-09-09 18:45:22 UTC
had to substitue var for attribute.

Tested using FX Cont trunk build 130 (Sep 9, 2008 4:49:22 PM) on NB6.5:
Product Version: NetBeans IDE Dev (Build 200809081401)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b14
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)