Skip to content

Commit

Permalink
Make it final for fields are only assgined during initialization (#28641
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yufengwangca authored and pull[bot] committed Dec 11, 2023
1 parent ca56ee5 commit 1943776
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
public final class AttributeState {
private static final String TAG = "AttributeState";

private Object valueObject;
private byte[] tlv;
private final Object valueObject;
private final byte[] tlv;
private JSONObject json;

public AttributeState(Object valueObject, byte[] tlv, String jsonString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

/** An event path that should be used for requests. */
public class ChipEventPath {
private ChipPathId endpointId, clusterId, eventId;
private boolean isUrgent;
private final ChipPathId endpointId, clusterId, eventId;
private final boolean isUrgent;

private ChipEventPath(
ChipPathId endpointId, ChipPathId clusterId, ChipPathId eventId, boolean isUrgent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

/** Class representing a potentially wildcard identifier for endpoints/clusters/attributes. */
public class ChipPathId {
private long id;
private IdType type;
private final long id;
private final IdType type;

public enum IdType {
// Enum names are read by JNI code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public final class EventState {
public static final int MILLIS_SINCE_EPOCH = 1;
private static final String TAG = "EventState";

private long eventNumber;
private int priorityLevel;
private int timestampType;
private long timestampValue;
private final long eventNumber;
private final int priorityLevel;
private final int timestampType;
private final long timestampValue;

private Object valueObject;
private byte[] tlv;
private final Object valueObject;
private final byte[] tlv;
private JSONObject json;

public EventState(
Expand Down

0 comments on commit 1943776

Please sign in to comment.