Use Java Objects class
Use final parameter
import java.io.DataOutputStream;
import java.io.IOException;
+import java.util.Objects;
/**
* Source file class file attribute
@@ -49,11 +50,7 @@ public boolean equals(final Object obj) {
return false;
}
final SourceFileAttribute other = (SourceFileAttribute) obj;
- if (name == null) {
- if (other.name != null) {
- return false;
- }
- } else if (!name.equals(other.name)) {
+ if (!Objects.equals(name, other.name)) {
return false;
}
return true;
