The feature is that you can change how the sources are organized. Currently, you can group them by source sets or don't group them at all. If I start NetBeans with the config telling the plugin to group the sources, my solution works. However, if I reconfigure it to non-grouping mode and after that configure it back to grouping mode badges will no longer be displayed on my custom node.
I have debugged the code and this is what happens when the issue occurs:
1. I properly detect that the badges might have changed on the node.
2. I call fireIconChange and fireOpenedIconChange.
3. Despite the change events, NetBeans never tries to get the icon again.
The two relavant classes of my plugin are: JavaSourceSetNode which is wrapped into a BadgeAwareNode (extends FilterNode).