Commit 181f991
Use
(followup to 941974e)
I'm not sure why I was reflexively resistant to this. Probably I was just in a hurry to submit? :) It's not as if the logic in `enclosingClass` is arcane.
While I still don't think we need to worry that any of our calls to `enclClass` are happening on a module or a class itself—and if we do, we'll likely have bigger problems with the other nearby operations on `sym.owner`—I think it's probably better to "default" to using `enclosingClass`, which at least squirrels away this one particular use of internal APIs in a single location. That's especially true when it would not _quite_ be safe for us to mechanically replace every `enclClass` call with an `enclosingClass` call, thanks to the slightly differences in behavior. But here, not only do I claim that there should be no difference in behavior, but I actually tested.
PiperOrigin-RevId: 500171678ASTHelpers.enclosingClass.1 parent 360ed99 commit 181f991
File tree
1 file changed
+4
-3
lines changed- core/src/main/java/com/google/errorprone/bugpatterns/nullness
1 file changed
+4
-3
lines changedcore/src/main/java/com/google/errorprone/bugpatterns/nullness/NullArgumentForNonNullParameter.java
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
227 | | - | |
| 228 | + | |
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
232 | | - | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
0 commit comments