|
Eclipse can be configured to warn about useless null pointer checks, which triggers on:
package org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731;
import java.io.Serializable;
import java.beans.ConstructorProperties;
import com.google.common.base.Preconditions;
import java.util.Arrays;
import com.google.common.io.BaseEncoding;
public class Metadata
implements Serializable {
private static final long serialVersionUID = -1641905433045568824L;
private final byte[] _value;
@ConstructorProperties("value")
public Metadata(byte[] _value)
{
Preconditions.checkNotNull(_value, "Supplied value may not be null");
this._value = _value == null ? null : _value.clone();
}
Given that we already have a precondition in place, we can remove the null check.
|