Skip to content

Commit f323240

Browse files
Add @CanIgnoreReturnValue to GraphAdapterBuilder methods. (#2828)
1 parent 38f4b62 commit f323240

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

extras/src/main/java/com/google/gson/graph/GraphAdapterBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.gson.graph;
1818

19+
import com.google.errorprone.annotations.CanIgnoreReturnValue;
1920
import com.google.gson.Gson;
2021
import com.google.gson.GsonBuilder;
2122
import com.google.gson.InstanceCreator;
@@ -85,6 +86,7 @@ public GraphAdapterBuilder() {
8586
* @param type the type to register
8687
* @return this builder instance for chaining
8788
*/
89+
@CanIgnoreReturnValue
8890
public GraphAdapterBuilder addType(Type type) {
8991
ObjectConstructor<?> objectConstructor = constructorConstructor.get(TypeToken.get(type));
9092
InstanceCreator<Object> instanceCreator =
@@ -105,6 +107,7 @@ public Object createInstance(Type type) {
105107
* deserialization
106108
* @return this builder instance for chaining
107109
*/
110+
@CanIgnoreReturnValue
108111
public GraphAdapterBuilder addType(Type type, InstanceCreator<?> instanceCreator) {
109112
if (type == null || instanceCreator == null) {
110113
throw new NullPointerException();

0 commit comments

Comments
 (0)