1
votes

We have Findbugs configured to run on our Jenkins via Maven.

Among other things it complains about SE_BAD_FIELD on the following code line:

private boolean logged = false;

The description of this bug says

Se: Non-transient non-serializable instance field in serializable class (SE_BAD_FIELD)

This Serializable class defines a non-primitive instance field which is neither transient, Serializable, or java.lang.Object, and does not appear to implement the Externalizable interface or the readObject() and writeObject() methods. Objects of this class will not be deserialized correctly if a non-Serializable object is stored in this field.

But boolean is a primitive!? So why is it complaining? Or is this some kind of Findbugs, Maven or Jenkins Bug?

1
Have you tried cleaning your Jenkins workspace and running a maven clean? Do you still get the same error? - Deco
Can you post the full class? Or at least those sections of your class that are needed to reproduce the problem. - Lukas Eder
I have noticed that FindBugs sometimes reports the wrong line number for SE_BAD_FIELD. So you might want to check the other fields for serializability instead. (I use FB 1.3.9.). If the problem persists, please post all fields. - barfuin
@Thomas That seems to be it! There was another field which actually had that problem! Please post the comment as an answer so I can upvote and accept it. - Jens Schauder

1 Answers

1
votes

I have noticed that FindBugs sometimes reports the wrong line number for SE_BAD_FIELD. So you might want to check the other fields for serializability instead. (I use FB 1.3.9.).