find bugs intellij plugin does report when bug is cleaned up - intellij-idea

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.

Related

IntelliJ says 'Project JDK is Misconfigured', but it isn't, how can this be fixed?

I'm running IntelliJ Ultimate 2022.2.2. For quite some time (and versions) it has been complaining that the Project JDK is misconfigured and giving red lines under basically everything. This wasn't much of a problem aside from being very annoying, because the build configurations and Maven tasks still worked, but now it appears that breakpoints don't work anymore, which is a bit of an issue.
The exact issue is that in the POM, the Java version is set to 11. The JDK is also set to 11, as is the language level. IntelliJ, however, will only remove the warning (and red lines) if the JDK is set to 8 instead. Of course, doing that causes compilation and Maven tasks to fail, because the POM specifies that Java 11 must be used.
As stated above, I tried following IntelliJ's suggestion of changing the JDK to Java 8, which removed the editor warnings and errors, but caused compilation and Maven jobs to fail. Leaving it at 11 compiles and runs just fine, but the editor is filled with errors and warnings and breakpoints don't function.
I've also tried a clean checkout with invalidated caches, but that resulted in the exact same situation.
Why, then, does IntelliJ claim the project JDK is misconfigured, and how can I convince it that it really isn't?

Intellij - work-around for IDE not building module on Run/Debug

I have a pretty large project, of which the Selenium/Cucumber part is integrated, and belongs to me.
No, after upgrading to Intelij 2022, I find that things have changed to the worse. Since I only bother about the module containin cucumber/selenium tests, I have been used to just clicking Run or Debug on each Run/Debug configuration to get my changes built, and the Cucumber/Selenium tests run locally on my computer.
This doesn't work anymore, and absolutely 100% of all help/support I have found on the net is unhelpful. The problem is that when I make a change in the code and click Run or Debug, the module (cucumber, where all the Cucumber/selenium tests resides) is not built. So, it keeps running the previously built code when I'm working on debugging/fixing tests.
The solution has been to first build the module containing the tests, then run/debug the test(s). Even though the run/debug configuration DOES have "Build" before launch. But this is tiresome, and a total waste of time.
So, what I'm wondering is: Can I tailer a terminal command to do all this? That is, build a specified module, then Run or Debug a Cucumber test.
Any help/hints are appreciated. I'm experiencting the usual "me" problem, where it seems that everyone else in the world has something working, while the same solutions doesn't work for me.
EDIT:
I tried the solution offered below in the comments: Deleted the .idea folder, reimported all Maven modules and reconfigured the project. It seemed to work on the first run, but then it went back to not building before launch.
You can try to change Select Run/Debug configuration in idea. Change Build to Build Project. It worked for me.

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

FindBugs in Intellij Idea doesn't refresh the result

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.

Gradle dependency cannot show in intellij idea

I used maven a lot before, now, I want to investigate about gradle, but it seems gradle dont give me a good first impression.
When I config the repo, and build the project, intellij idea show me build successful, however, I cannot see the dependency from the project view, I have no idea why, I try to create several projects with almost same configuration, some of them will show dependency, some of them not, I have no idea why. Sometimes, the dependency will come out suddenly, and actually, I found gradle already download those dependnecy into the catch folder, but I have no idea why intellij cannot show it and use it.
Can someome show me how to fight with gradle and intellij?
Br,
Tim