Fix #209
Conflicts:
release-notes/VERSION
diff --git a/pom.xml b/pom.xml
index 86245fb..0ba47e4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<name>Jackson-core</name>
- <version>2.8.0-SNAPSHOT</version>
+ <version>2.7.4-SNAPSHOT</version>
<packaging>bundle</packaging>
<description>Core Jackson abstractions, basic JSON streaming API implementation</description>
<inceptionYear>2008</inceptionYear>
@@ -23,7 +23,7 @@
</scm>
<properties>
- <!-- 03-Feb-2016, tatu: Retain Java6/JDK1.6 compatibility for streaming for Jackson 2.8 -->
+ <!-- 02-Oct-2015, tatu: Retain Java6/JDK1.6 compatibility for streaming for Jackson 2.7 -->
<javac.src.version>1.6</javac.src.version>
<javac.target.version>1.6</javac.target.version>
@@ -103,7 +103,8 @@
<encoding>UTF-8</encoding>
<maxmemory>1g</maxmemory>
<links>
- <link>http://docs.oracle.com/javase/7/docs/api/</link>
+ <!-- JDK, other Jackson pkgs -->
+ <link>http://docs.oracle.com/javase/6/docs/api/</link>
</links>
<excludePackageNames>${javadoc.package.exclude}</excludePackageNames>
<bootclasspath>${sun.boot.class.path}</bootclasspath>
diff --git a/release-notes/CREDITS b/release-notes/CREDITS
index f07310b..97fb34e 100644
--- a/release-notes/CREDITS
+++ b/release-notes/CREDITS
@@ -75,3 +75,7 @@
* Reported #37: JsonParser.getTokenLocation() doesn't update after field names
(2.7.0)
+Lokesh Kumar N (LokeshN@github)
+ * Contributed #209: Make use of `_allowMultipleMatches` in `FilteringParserDelegate`
+ (2.7.4)
+
diff --git a/release-notes/VERSION b/release-notes/VERSION
index d7bccec..be7a2d0 100644
--- a/release-notes/VERSION
+++ b/release-notes/VERSION
@@ -14,12 +14,14 @@
=== Releases ===
------------------------------------------------------------------------
-2.8.0 (not yet released)
+2.7.4 (not yet released)
-#253: Add `JsonGenerator. writeEmbeddedObject()` to allow writes of opaque native types
- (suggested by Gregoire C)
-#255: Relax ownership checks for buffers not to require increase in size
-#257: Add `writeStartObject(Object pojo)` to streamline assignment of current value
+#209: Make use of `_allowMultipleMatches` in `FilteringParserDelegate`
+ (contributed by Lokesh N)
+
+2.7.3 (16-Mar-2016)
+
+No changes since 2.7.2.
2.7.2 (26-Feb-2016)
diff --git a/src/main/java/com/fasterxml/jackson/core/JsonGenerator.java b/src/main/java/com/fasterxml/jackson/core/JsonGenerator.java
index 80d5f91..09704a4 100644
--- a/src/main/java/com/fasterxml/jackson/core/JsonGenerator.java
+++ b/src/main/java/com/fasterxml/jackson/core/JsonGenerator.java
@@ -756,26 +756,6 @@
public abstract void writeStartObject() throws IOException;
/**
- * Method for writing starting marker of a JSON Object value
- * (character '{'; plus possible white space decoration
- * if pretty-printing is enabled), to represent Java given
- * as the argument. Argument is offered as metadata, but more
- * importantly it should be assigned as the "current value"
- * for the Object content that gets constructed and initialized.
- *<p>
- * Object values can be written in any context where values
- * are allowed: meaning everywhere except for when
- * a field name is expected.
- *
- * @since 2.8.
- */
- public void writeStartObject(Object forValue) throws IOException
- {
- writeStartObject();
- setCurrentValue(forValue);
- }
-
- /**
* Method for writing closing marker of a JSON Object value
* (character '}'; plus possible white space decoration
* if pretty-printing is enabled).
@@ -1256,17 +1236,6 @@
throw new JsonGenerationException("No native support for writing Type Ids", this);
}
- /**
- * Method that can be called on backends that support passing opaque datatypes of
- * non-JSON formats
- *
- * @since 2.8
- */
- public void writeEmbeddedObject(Object object) throws IOException {
- throw new JsonGenerationException("No native support for writing embedded objects",
- this);
- }
-
/*
/**********************************************************
/* Public API, write methods, serializing Java objects
diff --git a/src/main/java/com/fasterxml/jackson/core/ObjectCodec.java b/src/main/java/com/fasterxml/jackson/core/ObjectCodec.java
index afa6aaa..649c89f 100644
--- a/src/main/java/com/fasterxml/jackson/core/ObjectCodec.java
+++ b/src/main/java/com/fasterxml/jackson/core/ObjectCodec.java
@@ -26,9 +26,9 @@
{
protected ObjectCodec() { }
- // Since 2.3
+ // Since 2.3: need baseline implementation to avoid backwards compatibility
@Override
- public abstract Version version();
+ public Version version() { return Version.unknownVersion(); }
/*
/**********************************************************
@@ -46,8 +46,8 @@
* The reason is that due to type erasure, key and value types
* can not be introspected when using this method.
*/
- public abstract <T> T readValue(JsonParser p, Class<T> valueType)
- throws IOException;
+ public abstract <T> T readValue(JsonParser jp, Class<T> valueType)
+ throws IOException, JsonProcessingException;
/**
* Method to deserialize JSON content into a Java type, reference
@@ -56,8 +56,8 @@
* and specifically needs to be used if the root type is a
* parameterized (generic) container type.
*/
- public abstract <T> T readValue(JsonParser p, TypeReference<?> valueTypeRef)
- throws IOException;
+ public abstract <T> T readValue(JsonParser jp, TypeReference<?> valueTypeRef)
+ throws IOException, JsonProcessingException;
/**
* Method to deserialize JSON content into a POJO, type specified
@@ -65,30 +65,30 @@
* including containers like {@link java.util.Collection} and
* {@link java.util.Map}).
*/
- public abstract <T> T readValue(JsonParser p, ResolvedType valueType)
- throws IOException;
+ public abstract <T> T readValue(JsonParser jp, ResolvedType valueType)
+ throws IOException, JsonProcessingException;
/**
* Method for reading sequence of Objects from parser stream,
* all with same specified value type.
*/
- public abstract <T> Iterator<T> readValues(JsonParser p, Class<T> valueType)
- throws IOException;
+ public abstract <T> Iterator<T> readValues(JsonParser jp, Class<T> valueType)
+ throws IOException, JsonProcessingException;
/**
* Method for reading sequence of Objects from parser stream,
* all with same specified value type.
*/
- public abstract <T> Iterator<T> readValues(JsonParser p, TypeReference<?> valueTypeRef)
- throws IOException;
+ public abstract <T> Iterator<T> readValues(JsonParser jp, TypeReference<?> valueTypeRef)
+ throws IOException, JsonProcessingException;
/**
* Method for reading sequence of Objects from parser stream,
* all with same specified value type.
*/
- public abstract <T> Iterator<T> readValues(JsonParser p, ResolvedType valueType)
- throws IOException;
-
+ public abstract <T> Iterator<T> readValues(JsonParser jp, ResolvedType valueType)
+ throws IOException, JsonProcessingException;
+
/*
/**********************************************************
/* API for serialization (Object-to-JSON)
@@ -99,7 +99,8 @@
* Method to serialize given Java Object, using generator
* provided.
*/
- public abstract void writeValue(JsonGenerator gen, Object value) throws IOException;
+ public abstract void writeValue(JsonGenerator jgen, Object value)
+ throws IOException, JsonProcessingException;
/*
/**********************************************************
@@ -115,13 +116,15 @@
* value event, not container). Empty or whitespace
* documents return null.
*
- * @return next tree from p, or null if empty.
+ * @return next tree from jp, or null if empty.
*/
@Override
- public abstract <T extends TreeNode> T readTree(JsonParser p) throws IOException;
+ public abstract <T extends TreeNode> T readTree(JsonParser jp)
+ throws IOException, JsonProcessingException;
@Override
- public abstract void writeTree(JsonGenerator gen, TreeNode tree) throws IOException;
+ public abstract void writeTree(JsonGenerator jg, TreeNode tree)
+ throws IOException, JsonProcessingException;
/**
* Method for construct root level Object nodes
diff --git a/src/main/java/com/fasterxml/jackson/core/base/GeneratorBase.java b/src/main/java/com/fasterxml/jackson/core/base/GeneratorBase.java
index b35916b..c99832b 100644
--- a/src/main/java/com/fasterxml/jackson/core/base/GeneratorBase.java
+++ b/src/main/java/com/fasterxml/jackson/core/base/GeneratorBase.java
@@ -266,16 +266,6 @@
//public void writeStartObject() throws IOException
//public void writeEndObject() throws IOException
- @Override // since 2.8
- public void writeStartObject(Object forValue) throws IOException
- {
- writeStartObject();
- if ((_writeContext != null) && (forValue != null)) {
- _writeContext.setCurrentValue(forValue);
- }
- setCurrentValue(forValue);
- }
-
/*
/**********************************************************
/* Public API, write methods, textual
diff --git a/src/main/java/com/fasterxml/jackson/core/io/IOContext.java b/src/main/java/com/fasterxml/jackson/core/io/IOContext.java
index 18f50c8..a4675be 100644
--- a/src/main/java/com/fasterxml/jackson/core/io/IOContext.java
+++ b/src/main/java/com/fasterxml/jackson/core/io/IOContext.java
@@ -270,17 +270,12 @@
}
protected final void _verifyRelease(byte[] toRelease, byte[] src) {
- // 07-Mar-2016, tatu: As per [core#255], only prevent shrinking of buffer
- if ((toRelease != src) && (toRelease.length < src.length)) { throw wrongBuf(); }
+ if ((toRelease != src) && (toRelease.length <= src.length)) { throw wrongBuf(); }
}
protected final void _verifyRelease(char[] toRelease, char[] src) {
- // 07-Mar-2016, tatu: As per [core#255], only prevent shrinking of buffer
- if ((toRelease != src) && (toRelease.length < src.length)) { throw wrongBuf(); }
+ if ((toRelease != src) && (toRelease.length <= src.length)) { throw wrongBuf(); }
}
- private IllegalArgumentException wrongBuf() {
- // sanity check failed; trying to return different, smaller buffer.
- return new IllegalArgumentException("Trying to release buffer smaller than original");
- }
+ private IllegalArgumentException wrongBuf() { return new IllegalArgumentException("Trying to release buffer not owned by the context"); }
}
diff --git a/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java b/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
index d5a33fe..8f17ea3 100644
--- a/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
+++ b/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
@@ -309,25 +309,6 @@
}
}
- @Override // since 2.8
- public void writeStartObject(Object forValue) throws IOException
- {
- _verifyValueWrite("start an object");
- JsonWriteContext ctxt = _writeContext.createChildObjectContext();
- _writeContext = ctxt;
- if (forValue != null) {
- ctxt.setCurrentValue(forValue);
- }
- if (_cfgPrettyPrinter != null) {
- _cfgPrettyPrinter.writeStartObject(this);
- } else {
- if (_outputTail >= _outputEnd) {
- _flushBuffer();
- }
- _outputBuffer[_outputTail++] = '{';
- }
- }
-
@Override
public final void writeEndObject() throws IOException
{
diff --git a/src/main/java/com/fasterxml/jackson/core/json/WriterBasedJsonGenerator.java b/src/main/java/com/fasterxml/jackson/core/json/WriterBasedJsonGenerator.java
index 6e5b9ff..316886b 100644
--- a/src/main/java/com/fasterxml/jackson/core/json/WriterBasedJsonGenerator.java
+++ b/src/main/java/com/fasterxml/jackson/core/json/WriterBasedJsonGenerator.java
@@ -195,7 +195,7 @@
*/
@Override
- public void writeStartArray() throws IOException
+ public void writeStartArray() throws IOException, JsonGenerationException
{
_verifyValueWrite("start an array");
_writeContext = _writeContext.createChildArrayContext();
@@ -210,7 +210,7 @@
}
@Override
- public void writeEndArray() throws IOException
+ public void writeEndArray() throws IOException, JsonGenerationException
{
if (!_writeContext.inArray()) {
_reportError("Current context not an ARRAY but "+_writeContext.getTypeDesc());
@@ -226,27 +226,8 @@
_writeContext = _writeContext.clearAndGetParent();
}
- @Override // since 2.8
- public void writeStartObject(Object forValue) throws IOException
- {
- _verifyValueWrite("start an object");
- JsonWriteContext ctxt = _writeContext.createChildObjectContext();
- _writeContext = ctxt;
- if (forValue != null) {
- ctxt.setCurrentValue(forValue);
- }
- if (_cfgPrettyPrinter != null) {
- _cfgPrettyPrinter.writeStartObject(this);
- } else {
- if (_outputTail >= _outputEnd) {
- _flushBuffer();
- }
- _outputBuffer[_outputTail++] = '{';
- }
- }
-
@Override
- public void writeStartObject() throws IOException
+ public void writeStartObject() throws IOException, JsonGenerationException
{
_verifyValueWrite("start an object");
_writeContext = _writeContext.createChildObjectContext();
@@ -261,7 +242,7 @@
}
@Override
- public void writeEndObject() throws IOException
+ public void writeEndObject() throws IOException, JsonGenerationException
{
if (!_writeContext.inObject()) {
_reportError("Current context not an object but "+_writeContext.getTypeDesc());
diff --git a/src/main/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.java b/src/main/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.java
index 40cd508..f8c31ca 100644
--- a/src/main/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.java
+++ b/src/main/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.java
@@ -200,9 +200,6 @@
@Override
public void writeStartObject() throws IOException { delegate.writeStartObject(); }
-
- @Override
- public void writeStartObject(Object forValue) throws IOException { delegate.writeStartObject(forValue); }
@Override
public void writeEndObject() throws IOException { delegate.writeEndObject(); }
@@ -329,9 +326,6 @@
@Override
public void writeTypeId(Object id) throws IOException { delegate.writeTypeId(id); }
-
- @Override
- public void writeEmbeddedObject(Object object) throws IOException { delegate.writeEmbeddedObject(object); }
/*
/**********************************************************
diff --git a/src/test/java/com/fasterxml/jackson/core/io/TestIOContext.java b/src/test/java/com/fasterxml/jackson/core/io/TestIOContext.java
index 475abb5..3bad591 100644
--- a/src/test/java/com/fasterxml/jackson/core/io/TestIOContext.java
+++ b/src/test/java/com/fasterxml/jackson/core/io/TestIOContext.java
@@ -24,7 +24,7 @@
try {
ctxt.releaseReadIOBuffer(new byte[1]);
} catch (IllegalArgumentException e) {
- verifyException(e, "smaller than original");
+ verifyException(e, "not owned");
}
// but call with null is a NOP for convenience
ctxt.releaseReadIOBuffer(null);
@@ -40,7 +40,7 @@
try {
ctxt.releaseWriteEncodingBuffer(new byte[1]);
} catch (IllegalArgumentException e) {
- verifyException(e, "smaller than original");
+ verifyException(e, "not owned");
}
ctxt.releaseWriteEncodingBuffer(null);
@@ -55,7 +55,7 @@
try {
ctxt.releaseTokenBuffer(new char[1]);
} catch (IllegalArgumentException e) {
- verifyException(e, "smaller than original");
+ verifyException(e, "not owned");
}
ctxt.releaseTokenBuffer(null);
@@ -70,7 +70,7 @@
try {
ctxt.releaseConcatBuffer(new char[1]);
} catch (IllegalArgumentException e) {
- verifyException(e, "smaller than original");
+ verifyException(e, "not owned");
}
ctxt.releaseConcatBuffer(null);
@@ -85,7 +85,7 @@
try {
ctxt.releaseNameCopyBuffer(new char[1]);
} catch (IllegalArgumentException e) {
- verifyException(e, "smaller than original");
+ verifyException(e, "not owned");
}
ctxt.releaseNameCopyBuffer(null);
}