Commit bf2f8fa
Add checkstyle rule to prevent string resource access via Application context
AGP 8.8+ generateLocaleConfig causes incorrect locale-based resource
resolution when using Application context. This rule flags
WordPress.getContext().getString() and directs developers to use
Activity/Fragment context or injected ResourceProvider instead.
Also removes the one existing usage in ReaderPostTable by hardcoding
the string, since it was embedded in HTML stored in SQLite and would
never update on locale change anyway.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3fc041e commit bf2f8fa
File tree
2 files changed
+14
-3
lines changed- WordPress/src/main/java/org/wordpress/android/datasets
- config
2 files changed
+14
-3
lines changedLines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
844 | 842 | | |
845 | 843 | | |
846 | 844 | | |
847 | | - | |
| 845 | + | |
848 | 846 | | |
849 | 847 | | |
850 | 848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
122 | 135 | | |
123 | 136 | | |
124 | 137 | | |
| |||
0 commit comments