Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-static access to static fields and methods should be prohibited #984

Closed
golszewski86 opened this issue Jan 17, 2019 · 2 comments · Fixed by #1191
Closed

Non-static access to static fields and methods should be prohibited #984

golszewski86 opened this issue Jan 17, 2019 · 2 comments · Fixed by #1191

Comments

@golszewski86
Copy link

Consider following code:

public final class Test {
    private static final String TEXT = "text";

    public void foo() {
        this.bar(this.TEXT);
    }

    private static void bar(final String txt) {
    }
}

Static field TEXT and static method bar should be accessed in static way, but qulice reports no error when they are accessed using this keyword.
Java compiler (OpenJDK 1.8.0_191) reports a warning but the code compiles smoothly.

@0crat
Copy link
Collaborator

0crat commented Jan 17, 2019

@krzyk/z please, pay attention to this issue

@0crat
Copy link
Collaborator

0crat commented Jan 17, 2019

@golszewski86/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants