Community
Participate
Working Groups
2018-12RC1: The full Variables View display of a HashSet not unsurprisingly shows all the gory HashMap/Node detail, but surely the logical structure display should suppress the dummy Object values and show just the non-null keys as an indexed array.
Created attachment 276802 [details] HashMap and HashSet Can you please elaborate, what do you mean ? Attached is the screenshot I see.
Sorry. Double checking the 'poor' display and it all seems good now. I'll re-open if I can actually reproduce the issue.
Created attachment 276807 [details] screenshot your screenshot shows the problem too, but not so obviously since you did not expand. In my screen shot the 2nd/5th lines are 100% redundant, the 3rd/4th lines should be merged giving realizedSuccessEdges HashSet... [0] SuccessEdgeImpl...
see attachment#276807 [details] from previous comment
(In reply to Ed Willink from comment #4) > see attachment#276807 [details] from previous comment This is non logical structure display. Please turn on Logical structure which shows directly [0] value1 [1] value 2
No. If it was a non-logical display you would see all the gory details of HashMap$Node and the entrySet/keySet/....
Created attachment 276818 [details] Logical expanded view
Created attachment 276819 [details] Non Logical Expanded view
Added the expanded views in my IDE.
Great. Is it too late to get the improved rules into RC2? Can you share the improved rules now?
(In reply to Ed Willink from comment #10) > Great. Is it too late to get the improved rules into RC2? > > Can you share the improved rules now? It is already there since 4.7, not sure why you are not seeing it.
Hm. Trying two different HashSet's the displays are as you suggest. At least my screenshot reminds me where I got a bad display. Need to investigate further/provide a complete almost-trivial repro.
(In reply to Ed Willink from comment #12) > Need to investigate further/provide a complete almost-trivial repro. Using the same JUnit test on two different Windows 10, 2018-12RC1 installations, I get different results (one right, one 'wrong'). Checking Window->Preferences->Java->Debug->Logical Structures, the 5 entries all appear to be as contributed by JDT; no accidental magic user tweaks. But looking at the entries I don't see how it can work. There is no detail formatter for HashSet, so it presumably uses Map that formats as an array of entries that are formatted as key/value pairs. Surely it can only work if there is a Set formatter that displays keySet().toArray()?
(In reply to Ed Willink from comment #13) > ... I get different results (one right, one 'wrong') ...] Found the difference. If the context menu is invoked on the HashSet, there is a Show Logical Structure->Array (last used) selection that differs between my machines. At best the availability of four display options from the permutation of Logical/Non-Logical Array/not-Array is confusing. I would expect that Logical/Non-Logical is a persistent icon-driven user preference. Array/not-Array if useful at all, should either also be persistent icon-driven or a one-time short temporary tweak.
We don't have time to work on this, if any one wants to work on this, we can provide inputs.