Comments (5)
I can't reproduce the problem:
You have enabled the “Dodgy code (STYLE)“ checkbox and a “FindNullDeref“ one, right?
Dodgy code (STYLE) | FindNullDeref |
---|---|
![]() |
![]() |
If it's that, provide a minimal code example for which IntelliJ SpotBugs plugin doesn't catch a bug.
from spotbugs-intellij-plugin.
We have a similar issue. Spotbugs Maven plugin finds many bugs that Intellij's plugin doesn't . In our platform, both instances are producing different results. InteliiJ's is configured to consider all "Reports" and "Detectors", while Maven's is running on default settings. In the depicted example we are using an "inclusion" xml file to narrow down the results and quicken the test. It's configuration works properly via Maven and seems to be working normally in Intellij as well. The project has no suppression annotations. The problem has been reproduced locally both in 2019.3 and 2020.1 versions on 2 different computers. We use OSX Catalina, Java 1.8. Plugin version is 1.1.0.
Unfortunately, I could not yet reproduce the problem on a minimal code example. It seems you need a mass of occurrences for the problem to arise.
from spotbugs-intellij-plugin.
@jqyp Yes, I have enabled all necessary settings.
Here's the result of scanning the code with Spotbugs Intellij plugin (problem is in addNewItems
method):
Same code scanned with maven plugin reports error:
from spotbugs-intellij-plugin.
I can simulate this using a simple SpringBoot Application:
BTW, the error is a false positive, trimAllWhitespace
is null safe
from spotbugs-intellij-plugin.
Hi, same problem here :/
We had an exercise at university to learn about SpotBugs and the SpotBugs via maven plugin
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.2.0</version>
<dependencies>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<version>4.2.3</version>
</dependency>
</dependencies>
</plugin>
works fine: it finds all bugs in the exercise. But the "SpotBugs plugin 1.2.4 with SpotBugs version 4.1.3" finds not a single bug. They are also quite obvious: even IntelliJ highlights them.
What am I doing wrong?
I can also provide a minimal working code example:
public class Student {
private String firstName;
public Student(String firstName) {
setFirstName(firstName);
}
public void setFirstName(String firstName) {
this.firstName.replaceAll("[^A-Za-z]", "");
}
public static void main(String[] args) {
Student oliver = new Student("Oliver");
}
}
the bug is in line 10: this.firstName.replaceAll("[^A-Za-z]", "");
instead of this.firstName=firstName.replaceAll("[^A-Za-z]", "");
The Sputbugs IDEA plugin is just giving me this answer:
it says no class files found but if I click on "more" it says the class Student has been analysed.
I'm using both maven and IDEA plugin with default setting.
Im using:
IntelliJ IDEA 2021.1.3 (Ultimate Edition)
Build #IU-211.7628.21, built on June 30, 2021
Non-Bundled Plugins: org.jetbrains.plugins.spotbugs (1.2.4),
from spotbugs-intellij-plugin.
Related Issues (20)
- Spotbugs 1.2.7 Unable to find slf4j logger HOT 6
- *** exception class was changed or removed
- Runtime Error in 1.2.7 HOT 3
- Spotbug Error : Modules page of IntelliJ's Project Structure settings view is blank! HOT 1
- com.intellij.diagnostic.PluginException: PSI element is provided on EDT by org.jetbrains.plugins.spotbugs.gui.tree.view.BugTree.getData("psi.Element"). Please move that to a BGT data provider using PlatformCoreDataKeys.BGT_DATA_PROVIDER [Plugin: org.jetbrains.plugins.spotbugs] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23) HOT 4
- java.lang.LinkageError: loader constraint violation: when resolving method 'org.slf4j.ILoggerFactory HOT 7
- java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: org.slf4j.jul.JULServiceProvider not a subtype at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) HOT 2
- java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: org.slf4j.jul.JULServiceProvider not a subtype at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) HOT 3
- Rules from fb-contrib not detected by plugin, but are detected in sonarqube HOT 2
- java.lang.IllegalArgumentException: Unsupported class file major version 61 at org.objectweb.asm.ClassReader.<init>(ClassReader.java:196)
- java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: org.slf4j.jul.JULServiceProvider not a subtype at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) HOT 2
- Settings window hangs with "loading ..." HOT 2
- Doesn't support generated-sources
- Do not request resource from classloader using path with leading slash
- com.intellij.diagnostic.PluginException: PSI element is provided on EDT by org.jetbrains.plugins.spotbugs.gui.tree.view.BugTree.getData("psi.Element"). Please move that to a BGT data provider using PlatformCoreDataKeys.BGT_DATA_PROVIDER [Plugin: org.jetbrains.plugins.spotbugs] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
- com.intellij.diagnostic.PluginException: 402 ms to call on EDT PreviewSelectBugInstance#update@mouse shortcut (org.jetbrains.plugins.spotbugs.actions.PreviewSelectBugInstance). Revise AnAction.getActionUpdateThread property [Plugin: org.jetbrains.plugins.spotbugs] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
- java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: org.slf4j.jul.JULServiceProvider not a subtype at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
- java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: org.slf4j.jul.JULServiceProvider not a subtype at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
- Since update to Intellij 2024.1, an error is reported for use of deprecated 'ActionUpdateThread.OLD_EDT' HOT 4
- Since update to Intellij 2024.1 java.lang.RuntimeException: Cannot invoke (class=BulkVirtualFileListenerAdapter, method=after, topic=BulkFileListener)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spotbugs-intellij-plugin.