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 188493 - Variables window shows attributes as A$name
Summary: Variables window shows attributes as A$name
Status: RESOLVED WONTFIX
Alias: None
Product: javafx
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Michal Skvor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-08 13:59 UTC by Alexandr Scherbatiy
Modified: 2011-05-16 13:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Java debugger screenshot (81.69 KB, image/png)
2010-08-05 09:22 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-07-08 13:59:17 UTC
JavaFX Composer FXJDI Build #49 (Jul 8, 2010 7:48:33 AM)

Steps to reproduce:

- Copy the code to the editor:
----------------------------
class A{var name:String }

var a = A{name: "Hello!" };
var str = "Hello World!";
println(a);
----------------------------

- Set a breakpoint to the last line
- Debug the project
The Variables window shows A$name as attribute of 'a' variable:
------------------------
a
  + A$name
------------------------

Probably it should show just the attribute name.
Comment 1 Michal Skvor 2010-07-22 12:44:15 UTC
I discussed this with guys from JavaFX and they decided to see it this way. It's somehow logical because you can have A$a and B$a in the same class (script) and developer can't resolve which variable a belongs to adequate class. I'm closing it as works for me.
Comment 2 Alexandr Scherbatiy 2010-07-26 10:37:40 UTC
Could you please give an example.

For example this is not compiled:
 -------------  A.fx  ----------
var name;

public class A {
    var name;
}
--------------------------------
> A.fx:16: name is already defined in javafxapplication5.A

And this should work as expected:
-------------- Main.fx -----------------
class A { var name: String }
class B { var name: String }
var a = A { name: "A" };
var b = B { name: "B" };
---------------------------------------

------------------------
a
  + name
b
  + name
------------------------
Comment 3 Michal Skvor 2010-08-03 13:54:04 UTC
in your second sample the value for 'name' should be <class name>$<varible name> so for a it should be A$name and for b B$name.
Comment 4 Alexandr Scherbatiy 2010-08-05 09:19:00 UTC
Here is the code in JavaFX:
-----------  Main.fx ---------------
class A { var name: String }
class B { var name: String }

function run() {
    var a = A { name: "A" };
    var b = B { name: "B" };
    println("Hello!");   // set a breakpoint
} 
----------------------------------


Let's compare it with the Java code:
------------  Main.java  ----------------
class A{ public String name; }
class B{ public String name; }

public class Main {
    public static void main(String[] args) {
        A a = new A();
        a.name = "A";
        B b = new B();
        b.name = "B";
        System.out.println("Hello!");  // set a breakpoint
    }
}
----------------------------------

The Java debugger shows (see the attached screenshot). 

------------------------
a
  + name
b
  + name
------------------------

I suppose the same should be for the JavaFX.
Comment 5 Alexandr Scherbatiy 2010-08-05 09:22:04 UTC
Created attachment 101226 [details]
Java debugger screenshot
Comment 6 David Strupl 2011-05-16 13:52:59 UTC
Closing all bugs filed against JavaFX 1.x as wontfix. We will support JavaFX 2.0 - please keep opened only bugs against the new release. Thanks.