我java.lang.SuppressWarnings
在Android Studio中使用该软件包.
我无法摆脱这一个:
EI_EXPOSE_REP2: May expose internal representation by incorporating reference to mutable object (findbugs task)
它发生在setter方法中.
如何摆脱这种警告?
public class PropertyDetailDocumentStorageModel implements Parcelable { @SerializedName("picture") private byte[] mPicture; public void setmPicture(byte[] mPicture) { this.mPicture = mPicture; }
警告:
setmPicture(byte[]) may expose internal representation by storing an externally mutable object into PropertyDetailDocumentStorageModel.mPicture
请注意,这是在类型为唯一的字段上发生的byte[]
.同一类中具有getter的其他字段不会抛出此警告.