Skip to content

Commit 21a7542

Browse files
committed
Minor fix wrt #17: should not add abstract methods without default impl, causes unnecessary compatibility issues
1 parent 933f33c commit 21a7542

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/main/java/com/fasterxml/jackson/core/JsonGenerator.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,10 @@ public void writeArray(double[] array, int offset, int length) throws IOExceptio
944944
*
945945
* @since 2.9
946946
*/
947-
public abstract void writeString(Reader reader, int len) throws IOException;
947+
public void writeString(Reader reader, int len) throws IOException {
948+
// Let's implement this as "unsupported" to make it easier to add new parser impls
949+
_reportUnsupportedOperation();
950+
}
948951

949952
/**
950953
* Method for outputting a String value. Depending on context

src/main/java/com/fasterxml/jackson/core/base/GeneratorBase.java

+7-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import java.io.IOException;
1010
import java.io.InputStream;
11-
import java.io.Reader;
1211
import java.math.BigDecimal;
1312

1413
/**
@@ -300,11 +299,13 @@ public void writeStartObject(Object forValue) throws IOException
300299
@Override public void writeFieldName(SerializableString name) throws IOException {
301300
writeFieldName(name.getValue());
302301
}
303-
302+
304303
//public abstract void writeString(String text) throws IOException;
305304

306305
//public abstract void writeString(char[] text, int offset, int len) throws IOException;
307306

307+
//public abstract void writeString(Reader reader, int len) throws IOException;
308+
308309
//public abstract void writeRaw(String text) throws IOException,;
309310

310311
//public abstract void writeRaw(char[] text, int offset, int len) throws IOException;
@@ -341,17 +342,11 @@ public int writeBinary(Base64Variant b64variant, InputStream data, int dataLengt
341342
return 0;
342343
}
343344

344-
@Override // since 2.9
345-
public void writeString(Reader reader, int len) throws IOException {
346-
// Let's implement this as "unsupported" to make it easier to add new parser impls
347-
_reportUnsupportedOperation();
348-
}
349-
350345
/*
351-
/**********************************************************
352-
/* Public API, write methods, primitive
353-
/**********************************************************
354-
*/
346+
/**********************************************************
347+
/* Public API, write methods, primitive
348+
/**********************************************************
349+
*/
355350

356351
// Not implemented at this level, added as placeholders
357352

0 commit comments

Comments
 (0)