Commit ea57745
committed
Warn for parameterized collection ValueState types
ValueState<Set<T>>, ValueState<List<T>> and ValueState<Map<K, V>> were
silently skipped because the resolved value type has unresolved parameters
(the element type is a type variable). The collection's own raw type is
known in these cases, so the specialized-state recommendation (SetState /
BagState or OrderedListState / MapState) can still be made. Drop the
blanket hasUnresolvedParameters() early-return and match on the raw
collection type instead; a payload that is itself a bare type variable
(ValueState<T>) still produces no recommendation.
Add unit tests covering the parameterized Set/List cases and the bare
type-variable no-warning case.1 parent 04f6c50 commit ea57745
2 files changed
Lines changed: 61 additions & 6 deletions
File tree
- sdks/java/core/src
- main/java/org/apache/beam/sdk/transforms/reflect
- test/java/org/apache/beam/sdk/transforms/reflect
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2355 | 2355 | | |
2356 | 2356 | | |
2357 | 2357 | | |
2358 | | - | |
2359 | | - | |
2360 | | - | |
2361 | | - | |
2362 | | - | |
2363 | | - | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
2364 | 2363 | | |
2365 | 2364 | | |
2366 | 2365 | | |
| |||
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
1735 | 1738 | | |
1736 | 1739 | | |
1737 | 1740 | | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
1738 | 1767 | | |
1739 | 1768 | | |
1740 | 1769 | | |
| |||
1760 | 1789 | | |
1761 | 1790 | | |
1762 | 1791 | | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
1763 | 1819 | | |
1764 | 1820 | | |
0 commit comments