-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
This is from a find bugs report contributed by D. Borza:
- com.longevitysoft.android.xml.plist.domain.Data
line 73:
public java.lang.String getValue(boolean decode) {
dataStringer.newBuilder();
if (decode) {
return dataStringer.getBuilder()
.append(new java.lang.String(Base64.
decodeFast(rawData)))
.toString();
} else {
-> return dataStringer.getBuilder().append(rawData).toString();
}
}
The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array.
- class: com.longevitysoft.android.xml.plist.domain.Array
line 252:
public boolean equals(Object that) {
-> return data.equals(that);
}
This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels