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 252417

Summary: Support HashMap in FXML
Product: javafx Reporter: tiainen
Component: EditorAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description tiainen 2015-05-15 11:04:04 UTC
According to the FXML documentation (https://docs.oracle.com/javase/8/javafx/api/javafx/fxml/doc-files/introduction_to_fxml.html#instance_declaration_elements), in the Maps section of instance Declarations:

"If an element represents a type that already implements Map (such as java.util.HashMap), it is not wrapped and its get() and put() methods are invoked directly."

<HashMap foo="123" bar="456"/>

The editor now complains with the following error:

Class 'java.util.HashMap' does not support property 'foo'
Comment 1 flipm1967 2017-03-01 20:35:38 UTC
Test Case 

<Slider fx:id="sl_filtfreq" GridPane.columnIndex="1" GridPane.rowIndex="0" min="0" max="127"><userData><HashMap command="32"/></userData></Slider> 

This actually compiles and runs successfully but the netbeans interface shows the red circle exclaimation mark.

Error is "Class 'java.util.HashMap' does not support property 'command'"

You can see the dilemma - most other types have fixed properties but of course a hash map does not, the values look like properties which is probably what is confusing the editor.