Remove unnecessary class from some static accesses#1863
Remove unnecessary class from some static accesses#1863liblit wants to merge 1 commit intowala:masterfrom
Conversation
Also, enable the corresponding IntelliJ IDEA inspection to catch similar issues in the future.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1863 +/- ##
============================================
+ Coverage 50.37% 50.38% +0.01%
- Complexity 12646 12647 +1
============================================
Files 1365 1365
Lines 84813 84802 -11
Branches 14470 14470
============================================
+ Hits 42725 42729 +4
+ Misses 37346 37334 -12
+ Partials 4742 4739 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
msridhar
left a comment
There was a problem hiding this comment.
I'm a bit unsure on whether this is a net win in all cases. It's unfortunate that WALA has so many public or protected static fields that get accessed from subclasses in a confusing way; probably the code could be structured better. But, given that we have this, I'm not sure that accessing such fields in an unqualified way is a win, in that it reduces code readability a bit. For a method / field in the same class removing the class qualifier is fine, but I'm not sure about superclasses. In an IDE of course you can just use code navigation to figure out where the method is declared, but I guess we should also be thinking about readability in text editors / for coding agents?
@liblit thoughts?
In general, I favor implicit and concise. But I understand your view too. If you'd rather not make these changes, it's OK with me to close this PR. |
|
Let's leave it open for now, I'd like to think it over a bit more. |
|
After further thought I think I'd prefer to leave the code as is. I do think it's more readable with the explicit class names in many cases. Thanks for giving this a shot @liblit |
|
All good! |
Also, enable the corresponding IntelliJ IDEA inspection to catch similar issues in the future.