Add class qualifier to static member access should only apply to other classes
See original GitHub issuePlease make it configurable to add the class qualifier to only to the classes other than the one where this static member is defined.
For example,
class Hello {
static final String STR="Hello";
void sayIt() {
println(STR); // should not qualify it as Hello.STR
}
class Other {
String do() {
String s = Hello.STR; // should qualify
return s.replace("l", "y");
}
}
}
class World extends Hello {
void sayIt() {
println(Hello.STR + " World!"); // should qualify
}
}
Because I didn’t find it useful to have
ThisClassDefinition.log.info("Why so verbose");
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
protected static member for inherited class - Stack Overflow
My problem is how to have one static model per subclass, while still ensuring it is defined in the parent class (so if...
Read more >static members - cppreference.com
Static members of a class are not associated with the objects of the class: they are independent variables with static or thread (since...
Read more >Static Classes and Static Class Members - C# guide
Static classes cannot be instantiated in C#. You access the members of a static class by using the class name itself.
Read more >13.14 — Static member functions - Learn C++
If the static member variables are public, we can access them directly using the class name and the scope resolution operator.
Read more >Controlling Access to Members of a Class - Oracle Help Center
Access level modifiers determine whether other classes can use a ... The private modifier specifies that the member can only be accessed in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @rw00, thank you for you interest in the plugin.
You can submit a PR anytime for this feature. Best way to do that would be to extend the class
com.siyeh.ig.style.UnqualifiedFieldAccessInspection
that is used in the plugin atcom.dubreuia.processors.java.ProcessorFactory#getUnqualifiedFieldAccessProcessor
.Check out https://github.com/dubreuia/intellij-plugin-save-actions#contributing to setup your environment.
Fixed https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v1.0.0