I'm using Java 1.7.0_79
The code in questions is this and I am instantiating a new object, and I want to check if the object has a valid reference after the constructor returns, I check to see if it is null:
mClientConnection = null;
mClientConnection = new XMPPTCPConnection(configBuilder.build());
if(mClientConnection == null) {
return false;
}
The constructor implementation contains this:
public XMPPTCPConnection(XMPPTCPConnectionConfiguration config) {
super(config);
this.config = config;
}
I am wondering how can I check that the mClientConnection contains a valid reference?
I am using findbugs and I get this reported error:
This method contains a redundant check of a known non-null value against the constant null