Hello community, here is the log from the commit of package jackson-core for openSUSE:Factory checked in at 2020-01-07 23:55:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/jackson-core (Old) and /work/SRC/openSUSE:Factory/.jackson-core.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jackson-core" Tue Jan 7 23:55:31 2020 rev:3 rq:761586 version:2.10.2 Changes: -------- --- /work/SRC/openSUSE:Factory/jackson-core/jackson-core.changes 2019-11-24 00:44:08.763291178 +0100 +++ /work/SRC/openSUSE:Factory/.jackson-core.new.6675/jackson-core.changes 2020-01-07 23:56:06.188116950 +0100 @@ -1,0 +2,8 @@ +Tue Jan 7 10:32:16 UTC 2020 - Pedro Monreal Gonzalez <pmonrealgonza...@suse.com> + +- Changes for 2.10.2 + #580: FilteringGeneratorDelegate writeRawValue delegate to 'writeRaw()' + instead of 'writeRawValue()' + #582: 'FilteringGeneratorDelegate' bug when filtering arrays (in 2.10.1) + +------------------------------------------------------------------- Old: ---- jackson-core-2.10.1.tar.gz New: ---- jackson-core-2.10.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ jackson-core.spec ++++++ --- /var/tmp/diff_new_pack.INM2dE/_old 2020-01-07 23:56:07.356117556 +0100 +++ /var/tmp/diff_new_pack.INM2dE/_new 2020-01-07 23:56:07.380117569 +0100 @@ -1,7 +1,7 @@ # # spec file for package jackson-core # -# Copyright (c) 2019 SUSE LLC. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: jackson-core -Version: 2.10.1 +Version: 2.10.2 Release: 0 Summary: Core part of Jackson License: Apache-2.0 ++++++ jackson-core-2.10.1.tar.gz -> jackson-core-2.10.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/.travis.yml new/jackson-core-jackson-core-2.10.2/.travis.yml --- old/jackson-core-jackson-core-2.10.1/.travis.yml 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/.travis.yml 2020-01-05 03:04:51.000000000 +0100 @@ -5,7 +5,8 @@ - oraclejdk11 # Below this line is configuration for deploying to the Sonatype OSS repo -# http://blog.xeiam.com/2013/05/configure-travis-ci-to-deploy-snapshots.html +# https://knowm.org/configure-travis-ci-to-deploy-snapshots/ + before_install: "git clone -b travis `git config --get remote.origin.url` target/travis" after_success: "mvn deploy --settings target/travis/settings.xml" @@ -15,12 +16,6 @@ - master - "2.10" -# to make jdk6 work, as per: https://github.com/travis-ci/travis-ci/issues/8199 -addons: - apt: - packages: - - openjdk-6-jdk - env: global: - secure: "YW0hrdsHvH41pb5uPJ2DGzXrBgOVT7nEyag/bAQoDcSlOQ/g55tnY6rIGkqE/aYD47IroTEhW4yLyM3tZpbrqwagX4dUX90ukjcUwUvFE1ePTSEfdBtuHVwl8f6HmLIIw2yK0dQ1gOJ21T+3g+wddvK+6sWBJJ+s3O1FePDh6X0=" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/pom.xml new/jackson-core-jackson-core-2.10.2/pom.xml --- old/jackson-core-jackson-core-2.10.1/pom.xml 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/pom.xml 2020-01-05 03:04:51.000000000 +0100 @@ -3,13 +3,13 @@ <parent> <groupId>com.fasterxml.jackson</groupId> <artifactId>jackson-base</artifactId> - <version>2.10.1</version> + <version>2.10.2</version> </parent> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <name>Jackson-core</name> - <version>2.10.1</version> + <version>2.10.2</version> <packaging>bundle</packaging> <description>Core Jackson processing abstractions (aka Streaming API), implementation for JSON</description> <inceptionYear>2008</inceptionYear> @@ -19,7 +19,7 @@ <connection>scm:git:g...@github.com:FasterXML/jackson-core.git</connection> <developerConnection>scm:git:g...@github.com:FasterXML/jackson-core.git</developerConnection> <url>http://github.com/FasterXML/jackson-core</url> - <tag>jackson-core-2.10.1</tag> + <tag>jackson-core-2.10.2</tag> </scm> <properties> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/release-notes/CREDITS-2.x new/jackson-core-jackson-core-2.10.2/release-notes/CREDITS-2.x --- old/jackson-core-jackson-core-2.10.1/release-notes/CREDITS-2.x 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/release-notes/CREDITS-2.x 2020-01-05 03:04:51.000000000 +0100 @@ -115,6 +115,9 @@ Arnaud Roger (arnaudroger@github) * Contributed #359: FilteringGeneratorDelegate does not override writeStartObject(Object forValue) (2.8.8) + * Reported, contributed fix for #580: FilteringGeneratorDelegate writeRawValue delegate + to `writeRaw()` instead of `writeRawValue()` + (2.10.2) Emily Selwood (emilyselwood@github) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/release-notes/VERSION-2.x new/jackson-core-jackson-core-2.10.2/release-notes/VERSION-2.x --- old/jackson-core-jackson-core-2.10.1/release-notes/VERSION-2.x 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/release-notes/VERSION-2.x 2020-01-05 03:04:51.000000000 +0100 @@ -14,6 +14,14 @@ === Releases === ------------------------------------------------------------------------ +2.10.2 (05-Jan-2020) + +#580: FilteringGeneratorDelegate writeRawValue delegate to `writeRaw()` + instead of `writeRawValue()` + (reported by Arnaud R) +#582: `FilteringGeneratorDelegate` bug when filtering arrays (in 2.10.1) + (reported by alarribeau@github) + 2.10.1 (09-Nov-2019) #455: Jackson reports wrong locations for JsonEOFException diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java new/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java --- old/jackson-core-jackson-core-2.10.1/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java 2020-01-05 03:04:51.000000000 +0100 @@ -173,7 +173,7 @@ _filterContext = _filterContext.createChildArrayContext(_itemFilter, false); } } - + @Override public void writeStartArray(int size) throws IOException { @@ -202,6 +202,64 @@ _filterContext = _filterContext.createChildArrayContext(_itemFilter, false); } } + + @Override + public void writeStartArray(Object forValue) throws IOException + { + if (_itemFilter == null) { + _filterContext = _filterContext.createChildArrayContext(null, false); + return; + } + if (_itemFilter == TokenFilter.INCLUDE_ALL) { + _filterContext = _filterContext.createChildArrayContext(_itemFilter, true); + delegate.writeStartArray(forValue); + return; + } + _itemFilter = _filterContext.checkValue(_itemFilter); + if (_itemFilter == null) { + _filterContext = _filterContext.createChildArrayContext(null, false); + return; + } + if (_itemFilter != TokenFilter.INCLUDE_ALL) { + _itemFilter = _itemFilter.filterStartArray(); + } + if (_itemFilter == TokenFilter.INCLUDE_ALL) { + _checkParentPath(); + _filterContext = _filterContext.createChildArrayContext(_itemFilter, true); + delegate.writeStartArray(forValue); + } else { + _filterContext = _filterContext.createChildArrayContext(_itemFilter, false); + } + } + + @Override + public void writeStartArray(Object forValue, int size) throws IOException + { + if (_itemFilter == null) { + _filterContext = _filterContext.createChildArrayContext(null, false); + return; + } + if (_itemFilter == TokenFilter.INCLUDE_ALL) { + _filterContext = _filterContext.createChildArrayContext(_itemFilter, true); + delegate.writeStartArray(forValue, size); + return; + } + _itemFilter = _filterContext.checkValue(_itemFilter); + if (_itemFilter == null) { + _filterContext = _filterContext.createChildArrayContext(null, false); + return; + } + if (_itemFilter != TokenFilter.INCLUDE_ALL) { + _itemFilter = _itemFilter.filterStartArray(); + } + if (_itemFilter == TokenFilter.INCLUDE_ALL) { + _checkParentPath(); + _filterContext = _filterContext.createChildArrayContext(_itemFilter, true); + delegate.writeStartArray(forValue, size); + } else { + _filterContext = _filterContext.createChildArrayContext(_itemFilter, false); + } + } @Override public void writeEndArray() throws IOException @@ -242,7 +300,7 @@ _filterContext = _filterContext.createChildObjectContext(f, false); } } - + @Override public void writeStartObject(Object forValue) throws IOException { @@ -274,6 +332,36 @@ } @Override + public void writeStartObject(Object forValue, int size) throws IOException + { + if (_itemFilter == null) { + _filterContext = _filterContext.createChildObjectContext(_itemFilter, false); + return; + } + if (_itemFilter == TokenFilter.INCLUDE_ALL) { + _filterContext = _filterContext.createChildObjectContext(_itemFilter, true); + delegate.writeStartObject(forValue, size); + return; + } + + TokenFilter f = _filterContext.checkValue(_itemFilter); + if (f == null) { + return; + } + + if (f != TokenFilter.INCLUDE_ALL) { + f = f.filterStartObject(); + } + if (f == TokenFilter.INCLUDE_ALL) { + _checkParentPath(); + _filterContext = _filterContext.createChildObjectContext(f, true); + delegate.writeStartObject(forValue, size); + } else { + _filterContext = _filterContext.createChildObjectContext(f, false); + } + } + + @Override public void writeEndObject() throws IOException { _filterContext = _filterContext.closeObject(delegate); @@ -322,6 +410,12 @@ } } + // 02-Dec-2019, tatu: Not sure what else to do... so use default impl from base class + @Override + public void writeFieldId(long id) throws IOException { + writeFieldName(Long.toString(id)); + } + /* /********************************************************** /* Public API, write methods, text/String values @@ -427,7 +521,7 @@ public void writeRaw(String text, int offset, int len) throws IOException { if (_checkRawValueWrite()) { - delegate.writeRaw(text); + delegate.writeRaw(text, offset, len); } } @@ -459,7 +553,7 @@ public void writeRawValue(String text) throws IOException { if (_checkRawValueWrite()) { - delegate.writeRaw(text); + delegate.writeRawValue(text); } } @@ -467,7 +561,7 @@ public void writeRawValue(String text, int offset, int len) throws IOException { if (_checkRawValueWrite()) { - delegate.writeRaw(text, offset, len); + delegate.writeRawValue(text, offset, len); } } @@ -475,7 +569,7 @@ public void writeRawValue(char[] text, int offset, int len) throws IOException { if (_checkRawValueWrite()) { - delegate.writeRaw(text, offset, len); + delegate.writeRawValue(text, offset, len); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/src/main/java/com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.java new/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.java --- old/jackson-core-jackson-core-2.10.1/src/main/java/com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.java 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.java 2020-01-05 03:04:51.000000000 +0100 @@ -1928,12 +1928,12 @@ case 4: // 4-byte UTF c = _decodeUtf8_4(c); // Let's add first part right away: - outBuf[outPtr++] = (char) (0xD800 | (c >> 10)); if (outPtr >= outBuf.length) { outBuf = _textBuffer.finishCurrentSegment(); outPtr = 0; outEnd = outBuf.length; } + outBuf[outPtr++] = (char) (0xD800 | (c >> 10)); c = 0xDC00 | (c & 0x3FF); // And let the other char output down below break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java new/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java --- old/jackson-core-jackson-core-2.10.1/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java 2020-01-05 03:04:51.000000000 +0100 @@ -1720,11 +1720,11 @@ return (outputPtr + len); } - private final int _handleLongCustomEscape(byte[] outputBuffer, int outputPtr, int outputEnd, byte[] raw, - int remainingChars) + private final int _handleLongCustomEscape(byte[] outputBuffer, int outputPtr, int outputEnd, + byte[] raw, int remainingChars) throws IOException, JsonGenerationException { - int len = raw.length; + final int len = raw.length; if ((outputPtr + len) > outputEnd) { _outputTail = outputPtr; _flushBuffer(); @@ -1733,11 +1733,12 @@ _outputStream.write(raw, 0, len); return outputPtr; } - System.arraycopy(raw, 0, outputBuffer, outputPtr, len); - outputPtr += len; } + System.arraycopy(raw, 0, outputBuffer, outputPtr, len); + outputPtr += len; // but is the invariant still obeyed? If not, flush once more if ((outputPtr + 6 * remainingChars) > outputEnd) { + _outputTail = outputPtr; _flushBuffer(); return _outputTail; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/src/main/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.java new/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.java --- old/jackson-core-jackson-core-2.10.1/src/main/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.java 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.java 2020-01-05 03:04:51.000000000 +0100 @@ -100,7 +100,10 @@ @Override public boolean canOmitFields() { return delegate.canOmitFields(); } - + + @Override + public boolean canWriteFormattedNumbers() { return delegate.canWriteFormattedNumbers(); } + /* /********************************************************** /* Public API, configuration diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/src/test/java/com/fasterxml/jackson/core/filter/BasicGeneratorFilteringTest.java new/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/filter/BasicGeneratorFilteringTest.java --- old/jackson-core-jackson-core-2.10.1/src/test/java/com/fasterxml/jackson/core/filter/BasicGeneratorFilteringTest.java 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/filter/BasicGeneratorFilteringTest.java 2020-01-05 03:04:51.000000000 +0100 @@ -337,4 +337,23 @@ gen.close(); assertEquals(aposToQuotes("{'field1':{},'field2':'val2'}"), w.toString()); } + + // [core#580] + public void testRawValueDelegation() throws Exception + { + StringWriter w = new StringWriter(); + FilteringGeneratorDelegate gen = new FilteringGeneratorDelegate(JSON_F.createGenerator(w), + TokenFilter.INCLUDE_ALL, true, true); + + gen.writeStartArray(); + gen.writeRawValue(new char[] { '1'}, 0, 1); + gen.writeRawValue("123", 2, 1); + gen.writeRaw(','); + gen.writeRaw("/* comment */"); + gen.writeRaw(" ,42", 1, 3); + gen.writeEndArray(); + + gen.close(); + assertEquals("[1,3,/* comment */,42]", w.toString()); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/src/test/java/com/fasterxml/jackson/core/filter/JsonPointerGeneratorFilteringTest.java new/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/filter/JsonPointerGeneratorFilteringTest.java --- old/jackson-core-jackson-core-2.10.1/src/test/java/com/fasterxml/jackson/core/filter/JsonPointerGeneratorFilteringTest.java 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/filter/JsonPointerGeneratorFilteringTest.java 2020-01-05 03:04:51.000000000 +0100 @@ -108,4 +108,47 @@ assertEquals(aposToQuotes(exp), w.toString()); } + + + // for [core#582]: regression wrt array filtering + + public void testArrayFiltering582WithoutObject() throws IOException { + _testArrayFiltering582(0); + } + + public void testArrayFiltering582WithoutSize() throws IOException { + _testArrayFiltering582(1); + } + + public void testArrayFiltering582WithSize() throws IOException { + _testArrayFiltering582(2); + } + + private void _testArrayFiltering582(int mode) throws IOException + { + StringWriter output = new StringWriter(); + JsonGenerator jg = JSON_F.createGenerator(output); + + FilteringGeneratorDelegate gen = new FilteringGeneratorDelegate(jg, + new JsonPointerBasedFilter("/noMatch"), true, true); + final String[] stuff = new String[] { "foo", "bar" }; + + switch (mode) { + case 0: + gen.writeStartArray(); + break; + case 1: + gen.writeStartArray(stuff); + break; + default: + gen.writeStartArray(stuff, stuff.length); + } + gen.writeString(stuff[0]); + gen.writeString(stuff[1]); + gen.writeEndArray(); + gen.close(); + jg.close(); + + assertEquals("", output.toString()); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jackson-core-jackson-core-2.10.1/src/test/java/com/fasterxml/jackson/core/read/UTF8NamesParseTest.java new/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/read/UTF8NamesParseTest.java --- old/jackson-core-jackson-core-2.10.1/src/test/java/com/fasterxml/jackson/core/read/UTF8NamesParseTest.java 2019-11-10 00:01:15.000000000 +0100 +++ new/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/read/UTF8NamesParseTest.java 2020-01-05 03:04:51.000000000 +0100 @@ -157,18 +157,20 @@ public void testUtf8StringValue() throws Exception { - _testUtf8StringValue(MODE_INPUT_STREAM); - _testUtf8StringValue(MODE_DATA_INPUT); - _testUtf8StringValue(MODE_INPUT_STREAM_THROTTLED); + _testUtf8StringValue(MODE_INPUT_STREAM, 2900); + _testUtf8StringValue(MODE_DATA_INPUT, 2900); + _testUtf8StringValue(MODE_INPUT_STREAM_THROTTLED, 2900); + + _testUtf8StringValue(MODE_INPUT_STREAM, 5300); + _testUtf8StringValue(MODE_DATA_INPUT, 5300); + _testUtf8StringValue(MODE_INPUT_STREAM_THROTTLED, 5300); } - public void _testUtf8StringValue(int mode) throws Exception + public void _testUtf8StringValue(int mode, int len) throws Exception { Random r = new Random(13); - //int LEN = 72000; - int LEN = 720; - StringBuilder sb = new StringBuilder(LEN + 20); - while (sb.length() < LEN) { + StringBuilder sb = new StringBuilder(len + 20); + while (sb.length() < len) { int c; if (r.nextBoolean()) { // ascii c = 32 + (r.nextInt() & 0x3F); @@ -188,7 +190,7 @@ sb.append((char) c); } - ByteArrayOutputStream bout = new ByteArrayOutputStream(LEN); + ByteArrayOutputStream bout = new ByteArrayOutputStream(len + (len >> 2)); OutputStreamWriter out = new OutputStreamWriter(bout, "UTF-8"); out.write("[\""); String VALUE = sb.toString();