Skip to content

Commit f8a4409

Browse files
GavinF17Capstan
authored andcommitted
Made getters final; added deepCopy() to PathValueOperation.getValue()
1 parent a7c285a commit f8a4409

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/main/java/com/github/fge/jsonpatch/DualPathOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public final void serializeWithType(final JsonGenerator jgen,
7272
serialize(jgen, provider);
7373
}
7474

75-
public JsonPointer getFrom() {
75+
public final JsonPointer getFrom() {
7676
return from;
7777
}
7878

src/main/java/com/github/fge/jsonpatch/JsonPatch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public JsonNode apply(final JsonNode node)
151151
return ret;
152152
}
153153

154-
public List<JsonPatchOperation> getOperations() {
154+
public final List<JsonPatchOperation> getOperations() {
155155
return operations;
156156
}
157157

src/main/java/com/github/fge/jsonpatch/JsonPatchOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ protected JsonPatchOperation(final String op, final JsonPointer path)
9494
public abstract JsonNode apply(final JsonNode node)
9595
throws JsonPatchException;
9696

97-
public String getOp() {
97+
public final String getOp() {
9898
return op;
9999
}
100100

101-
public JsonPointer getPath() {
101+
public final JsonPointer getPath() {
102102
return path;
103103
}
104104

src/main/java/com/github/fge/jsonpatch/PathValueOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public final void serializeWithType(final JsonGenerator jgen,
7373
serialize(jgen, provider);
7474
}
7575

76-
public JsonNode getValue() {
77-
return value;
76+
public final JsonNode getValue() {
77+
return value.deepCopy();
7878
}
7979

8080
@Override

0 commit comments

Comments
 (0)