Skip to content

Commit 3656dcb

Browse files
ajaaymchingor13
authored andcommitted
Implement Closeable & Flushable in JsonGenerator and JsonParser (#540)
* fix #342 JsonGenerator and JsonParser should implement Closeable (and Flushable) * remove flushable from JsonParser
1 parent 02a6040 commit 3656dcb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

google-http-client/src/main/java/com/google/api/client/json/JsonGenerator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import com.google.api.client.util.Preconditions;
2323
import com.google.api.client.util.Types;
2424

25+
import java.io.Closeable;
26+
import java.io.Flushable;
2527
import java.io.IOException;
2628
import java.lang.reflect.Field;
2729
import java.math.BigDecimal;
@@ -39,7 +41,7 @@
3941
* @since 1.3
4042
* @author Yaniv Inbar
4143
*/
42-
public abstract class JsonGenerator {
44+
public abstract class JsonGenerator implements Closeable, Flushable {
4345

4446
/** Returns the JSON factory from which this generator was created. */
4547
public abstract JsonFactory getFactory();

google-http-client/src/main/java/com/google/api/client/json/JsonParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.api.client.util.Sets;
2525
import com.google.api.client.util.Types;
2626

27+
import java.io.Closeable;
2728
import java.io.IOException;
2829
import java.lang.reflect.Field;
2930
import java.lang.reflect.Modifier;
@@ -60,7 +61,7 @@
6061
* @since 1.3
6162
* @author Yaniv Inbar
6263
*/
63-
public abstract class JsonParser {
64+
public abstract class JsonParser implements Closeable {
6465

6566
/**
6667
* Maps a polymorphic {@link Class} to its {@link Field} with the {@link JsonPolymorphicTypeMap}

0 commit comments

Comments
 (0)