Commit 85e6c77
authored
Fix organize imports to recognize forbidden static favorites (#2924)
- add new JavaElementUtil.isForbiddenOnClasspath() method to figure
out if a qualified name is forbidden or discouraged on the class path
of the project of a given type root
- modify UnresolvedElementBaseSubProcessor to use new API
- modify OrganizeImportsOperation to check if a static import from
the favorites is forbidden in the class path of the compilation unit
- add new test to ImportOrganizeTest1d8
- fixes #28931 parent a0e1871 commit 85e6c77
4 files changed
Lines changed: 180 additions & 56 deletions
File tree
- org.eclipse.jdt.core.manipulation
- common/org/eclipse/jdt
- core/manipulation
- internal/ui/text/correction
- core extension/org/eclipse/jdt/internal/corext/refactoring/util
- org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
820 | 821 | | |
821 | 822 | | |
822 | 823 | | |
823 | | - | |
824 | | - | |
825 | | - | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
826 | 832 | | |
827 | 833 | | |
828 | 834 | | |
| |||
837 | 843 | | |
838 | 844 | | |
839 | 845 | | |
840 | | - | |
841 | 846 | | |
842 | 847 | | |
843 | 848 | | |
| |||
Lines changed: 3 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
49 | | - | |
50 | | - | |
51 | 48 | | |
52 | 49 | | |
53 | 50 | | |
| |||
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
62 | | - | |
63 | 59 | | |
64 | 60 | | |
65 | 61 | | |
| |||
138 | 134 | | |
139 | 135 | | |
140 | 136 | | |
| 137 | + | |
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
| |||
1530 | 1527 | | |
1531 | 1528 | | |
1532 | 1529 | | |
1533 | | - | |
| 1530 | + | |
| 1531 | + | |
1534 | 1532 | | |
1535 | 1533 | | |
1536 | 1534 | | |
| |||
1554 | 1552 | | |
1555 | 1553 | | |
1556 | 1554 | | |
1557 | | - | |
1558 | | - | |
1559 | | - | |
1560 | | - | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
1581 | 1555 | | |
1582 | 1556 | | |
1583 | 1557 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
248 | 252 | | |
249 | 253 | | |
250 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
251 | 283 | | |
0 commit comments