FindBugs in Intellij Idea doesn't refresh the result - intellij-idea

Intellij Idea - version 14.1.3. Installed Findbugs plugin (v.0.9.997) and run once.
After fixing found bugs, I run it again but unfortunately the plugin still shows the same list of errors, ignoring my changes. Some of errors even point to the nonexisting lines (which I deleted).
Tried to invalidate IDE cache (with restarting), nevertheless it didn't help.
Could you please assist?

Unlike IntelliJ IDEA's built in inspections, FindBugs uses the class files to find problems, not the source files. Make sure you compile your project after fixing the problems, otherwise FindBugs will keep seeing the problems in the out-of-date class files.

Related

IntelliJ Idea red Spring and Lombok annotations

I have a problem with IntelliJ Idea 2020.1 Ultimate Edition. It shows Lombok and Spring annotations and imports in red. The project compiles, I can run tests. I did some googling. I tried to reimport maven projects and go to File->Invalidate Caches/Restart. Then I deleted Idea system directory - it does not help. Before it worked fine, I do not know why it started doing this. Can somebody help me out?
I am not sure it is a correct solution, but it worked for me. I just reinstalled IDEA. It was faster that talk to IDEA support trying to figure out what is the cause of the issue
I got the same problem and fixed it from this way. First download lombok dependency from spring.
Then go to IDE and paste it to pom file and run. It isn't fix your problem. Go to Choose this and clear cache. Then restart.
If isn't fix your problem then go to this site and download relevant version of lombok for your IDE. https://plugins.jetbrains.com/plugin/6317-lombok
enter image description here
Then it will download a file. Then go to where you install the IDE and go to this path and paste that lombok java file.
IDE path
After trying these methods error was fixed. Thank you.

Intellij-IDEA selects the wrong maven dependency

I have used IDEA for some time and recently I updated to version 2018.1.1 from 2016.3. So it seems as if IDEA have gotten smarter, but not to my pleasure I am afraid.
So basically I have started to run into a lot of troubles lately. I have for example noted that when there are possible issues with the unit tests (eg. TestNG tests) there are currently two things that happens
1) Maven cannot find the jar (which btw builds perfectly from command line using mvn clean install)
2) Maven reverts to the latest working jar.
If I then try to reimport, I will go directly to (2). I also get weird error where commercial libraries such as guava generates errors.
I have never seen this until I upgraded IDEA Intellij. Anyone that have an suggestion on that might cause this and how to solve the problem.
The behavior I want is that the version marked out in the pom is imported with all the possible flaws, like it use to do. Then I can find the errors and fix them. I should also point out that, mvn clean install -Dmaven.test.skip works perfectly from command line, so not dependency issues with production code.
maven 3.3.9
jdk 1.8_172-b11
EDIT
I must mention that I use the "import maven projects automatically" feature here, which might explain (2), but I can still not see how this issue appears in the first place. Apart from changing IDEA version previously I have not had any problems in finding SNAPSHOTs.
EDIT 2
So the problem was indeed a pom error. I am not sure how eclipse managed to find the "correct" file (which was btw, not the correct file). After updating the pom it all worked out. I will not mention this here, since the behavior was a bit obscure (and I am not sure I understand it really). It have something to do with versions of the libraries, dependencyManagment, submodules and dependencies from submodules.
BR
Patrik

"No such property" when refreshing project in IntelliJ IDEA Ultimate

I have a groovy project in IntelliJ Ultimate 2017.1.5 based on gradle. I'm using groovy 2.4.4. My IDEA is set up to run gradle with gradle 4.0.2.
Gradle 'webclient' project refresh failed
Error:No such property: from for class: org.gradle.api.internal.tasks.DefaultTaskOutputs$TaskOutputUnionFileCollection
Unfortunately, nothing in IntelliJ tells me where this error comes from. All I know is, from the package name, that it has to do with gradle. This IDE is seemingly really unhelpful. It either works, which is rarely, and when it doesn't work, doesn't give you much error reporting.
I found a work-around. If I add
apply plugin: 'idea'
To the top of my module's build.gradle
and run
./gradlew idea
It downloads my dependencies in to the right place (where, IDK, but it works - im guessing IDEA knows how to find my local ~/.gradle repo).
But refreshing the project from the UI still fails. It would be nice of IntelliJ told you what it's doing. I don't know why they want to hide everything it's doing, when the system is so brittle and breakable.

How to refresh Lombok annotation processing in IntelliJ?

Suppose part of annotations are not processed. Below you see setMinLatitude() setter is not discovered:
Simultaneously all getters are seen:
Building of project works fine, only IntelliJ hits are not up-to-date.
For me "Build -> Rebuild project" fix this kind of issues.
Go to build > Rebuild Project that will fix your problem
by the way you can use the annotation #Getter and #Setter on the
class filed and it will generate for all the members in the class
I've had this problem when I've updated IDEA to a newer version, but the Lombok plugin wasn't automatically updated, and the existing version of the plugin was incompatible with the new version of IDEA. I didn't notice anything obvious to suggest that the plugin was the issue with annotation processing failures. Pulling up the "Plugins" settings (IntelliJ IDEA -> Preferences... -> Plugins on macOS) made it obvious that the plugin was no longer supported and needed to be updated. Updating the plugin and restarting immediately fixed the issue.
This probably doesn't apply in your case where some of the Lombok annotations are being processed, but will hopefully be helpful for others who have this issue.

find bugs intellij plugin does report when bug is cleaned up

I installed and ran find bugs on my Intellij project, then proceeded to clean up my code. After I re-ran the analysis, and it reported the same bugs even though they were cleaned up.
Even after a re-install the same thing happened, it still seems to report fixed bugs.
Findbugs runs on bytecode. Once you fix your code, you should make sure your code is recompiled. If you do that in intellij, try to perform "rebuild project" before running findbugs again.