I donβt think there is a way to access this number if you are not creating a debugger plugin. Netbeans simply assigns a new number to each new object that it encounters during a debugging session. The check "is a new object" is probably based on the identifier ( == ), and not on Object.hashCode() / System.identityHashCode() .
You can take "some instance table in a virtual machine" literally. Even if the JVM does not have explicit tables, you can still get such a list from a heap dump (HPROF). OQL (Object Query Language) allows SQL-like access to such data. For instance:
select f.field1 from my.package.MyClass f where f.field2 = 123
By the way, in this question I was looking for a way to display toString() instead of #number - to get that I had to right-click the header of the variable table and select the new column "Row Value". An alternative way is to add a Variable formatter to "Tools / Options / Java / Java Debugger / Variable formatters"
source share