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...
Thamos asked 14/11, 2009 at 0:40

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...
Gastroenteritis asked 11/1, 2013 at 13:7

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...
Patriarchate asked 5/6, 2012 at 11:24

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...
Coulter asked 14/7, 2022 at 20:59

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...
Sistrunk asked 10/6, 2012 at 20:9

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...
Puritanical asked 2/11, 2017 at 14:22

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...
Orison asked 19/4, 2022 at 7:30

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...
Warwick asked 13/1, 2012 at 12:57

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...
Jagged asked 11/5, 2012 at 12:21

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...
Donalt asked 22/11, 2019 at 0:55

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...
Frontal asked 15/11, 2017 at 3:25

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 ...
Bauer asked 16/11, 2015 at 6:22

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...
Sassy asked 2/9, 2010 at 19:26

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 ...
Newfashioned asked 27/10, 2010 at 18:3

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 ...
Agronomy asked 5/7, 2015 at 20:25

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); ...
Icao asked 8/5, 2012 at 14:10

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...
Shawndashawnee asked 25/4, 2019 at 7:34

© 2022 - 2024 — McMap. All rights reserved.