findbugs Questions
6
Solved
I run findbugs against all of my code and only tackle the top stuff. I finally got the top stuff resolved and now am looking at the details. I have a simple entity, say a user:
public class User i...
3
Solved
When reading and scanning an old codes, I saw these lines of code :
public static void replaceNull(Object obj)
{
if (obj == null)
{
return;
}
Field[] fields = obj.getClass().getDeclaredField...
4
Solved
I recently discovered FindBugs' @edu.umd.cs.findbugs.annotations.SuppressWarnings annotation which is pretty cool and allows you to basically tell FindBugs to ignore certain warnings.
I've success...
4
Solved
From time to time I have to add a new value to a enum type in my project.
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY,
FILENOTFOUND //this one is new one
}
...
Sain asked 22/10, 2010 at 18:47
3
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 EI_EXPO...
7
Solved
Is it possible to turn off sonar (www.sonarsource.org) measurements for specific blocks of code, which one doesn't want to be measured?
An example is the "Preserve Stack Trace" warning which Findb...
4
The team are using find bugs. I would like to skip using find bugs.
I can see it has an option maven.findbugs.enable,but I don't know how to use that as an argument to maven.
I have tried - Dmave...
4
I'm using FileWrite class to write into a file.and its working fine. But FindBugs is pointing me a Minor issue in my code snippet.
code snippet:
SimpleDateFormat formatter = new SimpleDateFormat...
Solecism asked 13/7, 2018 at 7:19
1
Solved
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...
7
I have some switch statement as shown below. Notice there is no break.
Findbugs is reporting error on the second case statement only.
The error is : Switch statement found where one case falls thr...
Interviewee asked 19/12, 2011 at 16:2
5
Solved
I have the following (doctored) class in a system I'm working on and Findbugs is generating a SE_BAD_FIELD warning and I'm trying to understand why it would say that before I fix it in the way that...
Reams asked 10/5, 2010 at 21:22
4
I'm trying to call Findbugs via Ant, but receiving this error:
Cannot run program "C:\Program Files (x86)\Java\jre6\bin\javaw.exe" (in
directory "H:\Users\MyName\workspace\MyProject"):
CreatePro...
5
Solved
FindBugs reports a bug:
Reliance on default encoding
Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform enco...
Dan asked 1/3, 2014 at 13:51
2
Solved
I ran the FindBugs in my project, and I got the following warning:
new foo.pkg.Key(Client, Product, Date, String) may expose internal representation by storing an externally mutable object into Ke...
3
Solved
I would like to migrate from Checkstyle + PMD + Findbugs to SonarQube. I´ve read that SonarQube replaces all 3 plugins (and have some new rules in addition). But in my project we have some custom c...
Dunagan asked 26/2, 2020 at 13:56
2
Overview:
I am trying to upgrade Java and Gradle version in my project as follows:
java from 8 to 11
Gradle from 5 to 6
My project runs with no issues on the old versions but when runs on Ja...
8
Solved
Consider the class below. If I run Findbugs against it it will give me an error ("Non-transient non-serializable instance field in serializable class") on line 5 but not on line 7.
1 public class ...
Exordium asked 1/2, 2011 at 10:8
2
Solved
FindBugs raises a bug called EI_EXPOSE_REP with the following description :
EI: May expose internal representation by returning reference to mutable object
Returning a reference to a mutable obje...
2
I have the following code and findbugs complains that "Exception is caught when Exception is not thrown" under dodgy code. I do not understand how to solve this. getPMMLExportable throws ...
4
Solved
I have a class that looks similar to this, and findbugz is complaining about the 'write to the static field from the instance method' (initialize(), and killStaticfield()). I can't set the static f...
5
Solved
I've got a multiple project setup, using Maven and the Findbugs plugin. I need to exclude some files in one of the child projects, so I added it to findbugs-exclude.xml. That works when I build in ...
3
Solved
I have following piece of code:
/**
* Performs the filename extension check (command-line argument validity).
* @param valid True, if the check should be performed.
* @param filename File name ...
7
Solved
With PMD, if you want to ignore a specific warning, you can use // NOPMD to have that line be ignored.
Is there something similar for FindBugs?
Goren asked 2/12, 2009 at 0:21
7
Solved
I am working on a project that has a piece of code like the one below:
String sql = "SELECT MAX(" + columnName + ") FROM " + tableName;
PreparedStatement ps = connection.prepareStatement(sql);
...
9
Solved
FindBugs IDEA v1.0.1
Android Studio 3.4
I get this error when running FindBugs.
I don't use com.google.wireless.android.sdk anywhere in the app.
Error:Internal error: (java.lang.ClassNotFoundExce...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.