Commit de828cc
fix: consolidate control validation into layoutNow (#340)
* fix: consolidate control validation into layoutNow
requestLayout and flushPendingLayoutRequests each filtered out null/
disposed controls via a shared validControls helper before delegating
to layoutNow, duplicating the same defensive check at every call site.
layoutNow now performs its own null/disposed filtering right where it
dereferences the controls (getShell(), shell.layout(...)), so the
invariant is enforced in exactly one place instead of trusted by two
separate callers. requestLayout becomes a pure dispatcher: it no
longer pre-filters, it just forwards the raw controls to
pendingLayoutRequests or layoutNow.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* fix: repair syntax broken by autofix commit in requestLayout
The prior "Potential fix for pull request finding" commit (04e7682)
badly spliced a null-check into requestLayout, leaving a dangling
duplicate `layoutNow(changed); }` outside the method body and
dedenting the whole method. This left invalid Java that failed the
Tycho/ECJ compile in CI.
Restores correct syntax/indentation while keeping the null-guard
around Collections.addAll(pendingLayoutRequests, changed), which is
the same defensive check layoutNow already applies to its own
`controls` parameter.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent 073b82a commit de828cc
2 files changed
Lines changed: 82 additions & 5 deletions
File tree
- com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat
Lines changed: 74 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
164 | 167 | | |
165 | 168 | | |
166 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
167 | 173 | | |
168 | 174 | | |
169 | 175 | | |
| |||
517 | 523 | | |
518 | 524 | | |
519 | 525 | | |
520 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
521 | 532 | | |
522 | 533 | | |
523 | 534 | | |
| |||
1702 | 1713 | | |
1703 | 1714 | | |
1704 | 1715 | | |
| 1716 | + | |
1705 | 1717 | | |
1706 | 1718 | | |
1707 | 1719 | | |
1708 | 1720 | | |
1709 | 1721 | | |
1710 | 1722 | | |
1711 | | - | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
1712 | 1750 | | |
1713 | | - | |
1714 | | - | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
1715 | 1785 | | |
1716 | 1786 | | |
1717 | 1787 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
| |||
0 commit comments