apache / apache/grails-intellij-plugin

Grails: "Method may be static" inspection shown wrongfully

Open
#375 0 comments 0 reactions 0 assignees View on GitHub
bug imported-from-youtrack
Dominant language
Java
Stars
17
Forks
4
Avg merge
5d 15h
Merged PRs (30d)
4

Description

***What steps will reproduce the issue?***
1\. Create a Grails project that has a class with a non static method that could be static with the exception of having a non static logger. See screenshot for example code.
***What is the expected result?***

Inspection is not triggered-

***What happens instead?***

Inspection "Method may be static" is shown. If building example we get the error "46: Apparent variable 'log' was found in a static scope but doesn't refer to a local variable, static field or class." See screenshot for code.

Also, the IDE should show the above case as a compile error (static method with non-static content) since the software does not compile.

---

*Imported from [IDEA-297927](https://youtrack.jetbrains.com/issue/IDEA-297927) · Type: Bug · Votes: 0*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue in a Grails project with a non-static method and a non-static logger, focusing on the "Method may be static" inspection. Done means the inspection is not shown for this case and the IDE reports the resulting static-scope compile error.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.