1,003 questions
0
votes
0
answers
24
views
How can i use the spotbugs eclipse plugin from local spotbugs build?
I wrote a new detector for spotbugs, and part of it requires the project files to be on classpath to work, so I'm trying to build and use the spotbugs eclipse plugin locally. How can i do that?
0
votes
0
answers
37
views
Why does emptyArray.every() return true in Javascript? [duplicate]
Why emptyArray.every() returns true? It doesn´t make sense to me because there is no element which you can apply the callBackFunction on?
Example:
let x=[];
x.every(n=>n>10);
I would expect an ...
3
votes
2
answers
247
views
MSACCESS.EXE process won't end
After applying the quality update for the latest channel (preview version) of Microsoft Access (64-bit), version 2408 (build 17928.20066) dated 8/14, the MSACCESS.EXE process won't end even after ...
0
votes
0
answers
335
views
Using findbugs To Scan A Specific Java Class File And Get "Unable to get XClass for java/lang/Object" Exception
I added spotbugs as dependency in my pom.xml.
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<...
0
votes
0
answers
69
views
Findbugs 'null pointer dereference' warning for ImmutableList but not for Arrays.asList
I get 'NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE: Possible null pointer dereference due to return value of called method' for com.google.common.collect.ImmutableList.of(..) but not for java.util.Arrays....
1
vote
0
answers
25
views
How to effectively find bugs of particular pattern during CI in place of code review?
I have code:
void foo() {
pageHead = GetPage(pageId)
ret = do_work_1()
if ret != ok:
LeavePage(pageId)
return
ret = do_work_2()
+ if ret != ok:
// LeavePage(...
2
votes
2
answers
721
views
SonarQube A NullPointerException could be thrown; Conn is nullable here
I have created the connection from HttpsURLConnection to set all the parameters to it. In the end finally block i am disconnecting it as showin below. But the SonarQube build is not passing. Showing ...
-1
votes
2
answers
51
views
how to constant object or remain object values same in javascript?
Here is basic example where I want to explain my requirement . I want not to change object a values after assigning it to const b and changing its values .I want console result original object a ...
0
votes
1
answer
194
views
SpotBugs SE_NO_SERIALVERSIONID not triggering
I am trying to add SpotBugs to my project specifically for SE_NO_SERIALVERSIONID and after running with effort=max I don't see a single class detected, but we know 10 examples we testing to see if ...
2
votes
0
answers
736
views
"[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)"
After installing firebase, this problem started to appear, it works on android but it's no working on ios.
I tried everything but it didn't work, what do you advise me to do?
0
votes
1
answer
349
views
PendingIntent doesn't work in android studio
This is my code:
package com.example.notifsimple
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
...
3
votes
5
answers
15k
views
Unhandled Exception: PlatformException(null-error, Host platform returned null value for non-null return value., null, null)
i got this Error i didn't know how i would to solve it any solution Please.
when i initialise firebase im main function it show me this white screnn and flutter icon:
but when i delete this ...
0
votes
1
answer
224
views
Spotbugs "Mutable servlet field" warning
Spotbugs is reporting a "Mutable servlet field" warning in this code (simplified test case):
import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http....
8
votes
3
answers
7k
views
Spotbugs exclude filter in gradle project
I am new to gradle and am trying to configure Spotbugs.
I've added the plugin to the build.gradle and the spotbugs issues showed up.
However I want to exclude the Findbugs EI_EXPOSE_REP and ...
0
votes
0
answers
298
views
Java + Spotbugs: Question(MeterRegistry) may expose internal representation by storing an externally mutable object into Question.meterRegistry
Small question regarding a Java and Spotbugs issue please.
I have a very simple class:
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import org....
6
votes
1
answer
16k
views
Spotbugs + Java: may expose internal representation by storing an externally mutable object into QuestionPojo.map
Small question regarding a Spotbug finding I am having a hard time to fix please.
On this super simple POJO:
import java.util.Map;
public class QuestionPojo {
private final Map<String, String&...
0
votes
2
answers
757
views
Message about a redundant nullcheck of list which is known to be null
I need to have an empty list, to which I'll add some objects (that I pick and parse from AWS S3) based on some criterion. The list might remain empty at the end, which is why I'm checking for null ...
2
votes
0
answers
804
views
mvn reports does not generate jacoco/surefire/findbugs reports
Initial question : "I'm a beginner in java programming and i'm a bit lost.
I've issues with my current project. Indeed, I try to generate reports with the command mvn site but it seems that some ...
0
votes
1
answer
364
views
Trying to compile an old Java project but missing resources and I don't know how to include them
Very new to Java. I have some old code I'm looking at and I have a problem with findbugs. I'm using Eclipse and a regular Java project. I've installed it using the Install new software from the Help ...
1
vote
1
answer
100
views
Spark/Scala transform fails in FindBugs
FindBugs is reporting a "Null pointer dereference of ?" in the following Spark/Scala transform:
val df = Seq((10,20)).toDF
df
.transform(addCol1) // <-- Null pointer dereference of ?
...
0
votes
1
answer
282
views
Jenkins warnings-ng-plugin custom folder structure AKA multiple "Source Directory"
I migrated from the old obsolete FindBugs plugin to the warnings-ng-plugin Sprotbugs tool. Everything works great except sources. The plugin doesn't show the source code of Java files (my workspace ...
0
votes
1
answer
2k
views
FindBugs detects the SIC_INNER_SHOULD_BE_STATIC_ANON warning for the following code
FindBugs detects the SIC_INNER_SHOULD_BE_STATIC_ANON warning for the following code.
Besides ignoring warnings in SuppressFBWarnings
How can I avoid SIC_INNER_SHOULD_BE_STATIC_ANON?
Class MyClass $ 1 ...
-1
votes
1
answer
284
views
INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE findbugs
I am getting the error in my coverity.
Suspicious integer expression
(FB.INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE)
defect: Bad comparison of nonnegative value with 0.
Code where the issue raised
...
0
votes
1
answer
2k
views
SonarQube 9.0 - FindBugs/SpotBugs plugin?
Small question regarding SonarQube, the 9.0 version of SonarQube.
I went to the market place after installation in order to download some plugins, and found the FindBugs/SpotBugs plugin is absent.
May ...
0
votes
1
answer
1k
views
Throw NPE if the source value is null in MapStruct
MapStruct has NullValueMappingStrategy as RETURN_NULL by default. My requirement is that when source is null, I need to throw a NPE, similar to how @NonNull of lombok works.
But I guess there is no ...
0
votes
0
answers
173
views
Find Bugs Plugin Bug type NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
I am having following piece of code which is failing findbugs plugin:
LocalSessionFactoryBean bean= createSessionFactory(dSource);
if(bean!=null)
reader.setSessionFactory(bean.getObject()); // this ...
0
votes
1
answer
799
views
FindBugs Warning removal
I am getting following error while running FindBugs:
Bug type NP_NULL_ON_SOME_PATH.
The code giving error is below:
List<Request> reviewerList = null;
response = restAPI CAll // assume ...
0
votes
0
answers
55
views
Application security scanner
I am working on a project to develop a SAST(static application security testing) scanner. Can people suggest best practices to read the code base quicker?
I got few ideas like using AST or BCEL.
...
0
votes
1
answer
395
views
I have a bug "Method may fail to clean up stream or resource" in findBugs and I don't know how to solve this bug, so can someone solve it please?
This method may fail to clean up (close, dispose of) a stream, database object, or other resource requiring an explicit cleanup operation.
In general, if a method opens a stream or other resource, the ...
0
votes
1
answer
360
views
What should be marked `final` to resolve this Scala code smell?
I have trouble understanding the "code smell" reported by Sonarqube in my scala class. The message is something like:
com.foo.bar.MyObject$.MODULE$ isn't final and can't be protected from ...
-1
votes
2
answers
176
views
Static Analysis tool to catch self-invocation bypassing Spring cache @Cacheable method
I understand that this is because of the way proxies are created for handling caching, transaction related functionality in Spring. And the way to fix it is use AspectJ but I donot want to take that ...
1
vote
2
answers
2k
views
How to fix stream error: may fail to close stream error
I am writing a method but see this error: may fail to close stream.
According to some solutions on different posts, I have added try and catch within the finally block. I also added IOUtils....
0
votes
0
answers
18
views
issue while installing FindBugs in NetBeans 8-2 [duplicate]
I am trying to install findBugs on NetBeans 8.2 and I am getting the following error:
Can you please help!
Thank you!
0
votes
1
answer
409
views
Findbugs error - RV_RETURN_VALUE_IGNORED when using ImmutableSet.Builder
Findbugs throws warning for the following piece of code. Seems like a simple of Builder class to add items and construct at the end. Whats the issue here ?
public static Set<Entity> convert(@...
-1
votes
1
answer
60
views
Today I am facing very abnormal bug in android code
I am trying to substract 1.0f from 8.6f value and it returns me 7.6000004
float temp=8.6f-1.0f;
Log.e("temp",temp+"");
and it is printing
7.6000004
What was wrong here ? I am or ...
3
votes
0
answers
2k
views
SpotBugs ignore whole directory in src folder
Hy,
In my maven setup, I have a plugin, which generates source code and puts it into my java src folder.
As this code is auto generated, I'd like to exclude it from all SpotBugs checks.
The file ...
5
votes
0
answers
322
views
Unable to delete build dir after running Sonar
I am using the SonarQube Gradle plugin version 3.0 with Gradle 6.7.1 for analysis of my Java code. This works fine and the results are uploaded to Sonar. When I do gradlew clean test sonarqube ...
0
votes
1
answer
2k
views
FindBugs - Boxed value is unboxed and then immediately reboxed
Getting Boxed value is unboxed and then immediately reboxed error in following code snippet.
Please help me understand where is the issue?
public Integer convert(String str) {
String ...
1
vote
4
answers
851
views
Count Occurrences of Seven Integers in Array
I have written the code below and it has comments attached. The application is to read seven integers entered by the user. The application then prints out the number of occurrences of each of the ...
-1
votes
1
answer
230
views
Why I can not see bugs from Findbugs on SonarQube?
I have installed Findbugs-Plug-in in Sonarqube and activate it (set as default). I have my maven-project in eclipse. If I run this project, I become 47 bugs and can see all in Bug Explorer. In Run ...
2
votes
2
answers
6k
views
Spot bugs / Maven build in multi module project
During adding spotbugs to my multi module project I've got an issue:
Failed to execute goal on project %X: Could not resolve dependencies for project %X:war:1.0.1-SNAPSHOT: Failure to find %Y.
1-...
1
vote
2
answers
735
views
apply CheckReturnValue to entire project
I work on a large legacy Java 8 (Android) application. We recently found a bug that was caused by an ignored result of method. Specifically a caller of a send() method didn't take the right actions ...
1
vote
2
answers
444
views
Is this FindBugs nullpointer dereference error valid for spring-data Specification class?
I am getting "Possible null pointer dereference due to return value of called method" FindBugs error on following line.
Specification spec = Specification.where(idSpec).and(nameSpec)
....
0
votes
1
answer
489
views
Findbugs: RV_RETURN_VALUE_IGNORED_BAD_PRACTICE using ExecutorService
I'm using Findbugs and I'm getting the RV_RETURN_VALUE_IGNORED_BAD_PRACTICE next error, this is my code:
ExecutorService executor = Executors.newSingleThreadExecutor();
try {
executor....
0
votes
1
answer
294
views
Configure jsr-305 annotations for Eclipse
I have configured Eclipse as seen in the screenshot.
However I get no errors for this code:
@Nonnull public static Object test(@CheckForNull Object t) {
return t;
}
When I run spotbugs on ...
1
vote
1
answer
5k
views
SonarQube: Unsupported class file major version 58 error when using Java 11
I am trying to execute mvn sonar:sonar command on spring boot project
$ mvn sonar:sonar -Dsonar.host.url=<URL> -Dsonar.login=<Token>
When I run the above command I get error message
Can ...
1
vote
0
answers
498
views
How to properly run SpotBugs on a Scala project
I'm trying to get SpotBugs run on Scala project using the SpotBugs CLI.
I installed the CLI like this:
$ curl -L -o /tmp/spotbugs-4.0.3.tgz https://github.com/spotbugs/spotbugs/releases/download/4.0....
2
votes
1
answer
6k
views
Execution findbugs of goal org.codehaus.mojo:findbugs-maven-plugin:3.0.5:findbugs failed: Java returned: 1
Findbugs does not support jdk11, I have a project in which I have a dependency jar which uses findbugs.
https://github.com/gleclaire/findbugs-maven-plugin/issues/93
Although I don't have findbugs ...
0
votes
1
answer
244
views
Merge static analyzer reports
I want to merge the reports generated by PMD, FindBugs, and SonarLint to give the user a more general preview by combining the important warnings reported by each of them. So can someone suggest to me ...
1
vote
1
answer
1k
views
Is it possible to deactivate 'Sonar way' quality profile from an analysis?
I would like to analyse my code only against a Finbug quality profile.
In order to simplify the issues reading, I would like to deactivate the default 'Sonar way' profile or at least to filter its ...