bamaer commented on PR #8419:
URL: https://github.com/apache/hop/pull/8419#issuecomment-5713756527

   @mattcasters all three dialog leftovers and both nits are fixed in 
`bb7d268`. Good catches, all three were mine from the rewrite.
   
   **1. Strategy combo.** `ChunkingStrategyType` no longer overrides 
`toString()`, so the combo shows `CHARACTER` / `PARAGRAPH` / `STRUCTURE` and 
`Enum.valueOf` reads it back. That also makes it consistent with the 
`ContentType` combo next to it in the same dialog, which already showed 
constant names. `fromString` still accepts `"Character"`, so anything saved 
while the old display text was in use keeps loading.
   
   **2. Stream field combos.** Now filled through 
`GuiCompositeWidgets.setComboValues` as you suggested, rather than my 
instanceof chain. One wrinkle worth recording: it is not a drop-in, because 
setting items clears the widget text, so a naive call would have wiped the 
saved field names that currently survive by accident. `GitInputDialog` has the 
same problem and reads the text, sets items, then writes it back. I copied that.
   
   **3. Content type enablement.** `comboText` handles `Combo` as well as 
`ComboVar`, and `enableFields` now parses with 
`ChunkingStrategyType.fromString(...) == STRUCTURE` instead of comparing 
against one spelling, so it follows the widget whatever it holds.
   
   Nits: the "word separators" javadoc is gone from `chunk()`, and the stacked 
javadoc on `TextChunkerData` is unstacked, with the input field description put 
back on `inputFieldIndex` where it belongs.
   
   **Coverage.** 94 unit tests, up from 92. The new 
`everyEnumOnTheDialogReadsBackFromItsDisplayedText` asserts 
`name().equals(toString())` for every constant of both enums the dialog shows, 
so this cannot come back in either of them. I verified it by reinstating 
`toString()`:
   
       ChunkingStrategyType must not override toString(): the dialog reads the 
combo
       back with Enum.valueOf, which only accepts the constant name
       ==> expected: <CHARACTER> but was: <Character>
   
   A second test pins that `fromString("Character")` still resolves.
   
   All four behaviours confirmed in Hop GUI: the strategy persists across OK 
and reopen, switching to STRUCTURE enables the content type widgets live, all 
three field dropdowns list the previous transform's fields, and a saved 
selection survives the fill. The chunker integration tests are green. They 
would not have caught any of this, since they run headlessly through hop-run 
and never construct a dialog, which is why the enum guard is a unit test.
   
   0 checkstyle violations, spotless and rat clean.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to