Use Objects#requireNonNull()
import java.io.DataOutputStream;
import java.io.IOException;
+import java.util.Objects;
/**
* An {@link Attribute} representing a constant.
@@ -36,10 +37,7 @@ public static void setAttributeName(final CPUTF8 cpUTF8Value) {
public ConstantValueAttribute(final ClassFileEntry entry) {
super(attributeName);
- if (entry == null) {
- throw new NullPointerException();
- }
- this.entry = entry;
+ this.entry = Objects.requireNonNull(entry, "entry");
}
@Override
