Hello community,

here is the log from the commit of package jackson-core for openSUSE:Factory 
checked in at 2020-03-26 23:33:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/jackson-core (Old)
 and      /work/SRC/openSUSE:Factory/.jackson-core.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "jackson-core"

Thu Mar 26 23:33:02 2020 rev:4 rq:788432 version:2.10.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/jackson-core/jackson-core.changes        
2020-01-07 23:56:06.188116950 +0100
+++ /work/SRC/openSUSE:Factory/.jackson-core.new.3160/jackson-core.changes      
2020-03-26 23:33:15.838774820 +0100
@@ -1,0 +2,10 @@
+Thu Mar 26 07:34:19 UTC 2020 - Fridrich Strba <fst...@suse.com>
+
+- Update to 2.10.3
+- Changes:
+  * #592: DataFormatMatcher#getMatchedFormatName throws NPE when
+    no match exists
+  * #603: 'JsonParser.getCurrentLocation()` byte/char offset update
+    incorrectly for big payloads
+
+-------------------------------------------------------------------

Old:
----
  jackson-core-2.10.2.tar.gz

New:
----
  jackson-core-2.10.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ jackson-core.spec ++++++
--- /var/tmp/diff_new_pack.LiGDN7/_old  2020-03-26 23:33:16.238774964 +0100
+++ /var/tmp/diff_new_pack.LiGDN7/_new  2020-03-26 23:33:16.242774966 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           jackson-core
-Version:        2.10.2
+Version:        2.10.3
 Release:        0
 Summary:        Core part of Jackson
 License:        Apache-2.0

++++++ jackson-core-2.10.2.tar.gz -> jackson-core-2.10.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jackson-core-jackson-core-2.10.2/pom.xml 
new/jackson-core-jackson-core-2.10.3/pom.xml
--- old/jackson-core-jackson-core-2.10.2/pom.xml        2020-01-05 
03:04:51.000000000 +0100
+++ new/jackson-core-jackson-core-2.10.3/pom.xml        2020-03-03 
04:11:26.000000000 +0100
@@ -3,13 +3,13 @@
   <parent>
     <groupId>com.fasterxml.jackson</groupId>
     <artifactId>jackson-base</artifactId>
-    <version>2.10.2</version>
+    <version>2.10.3</version>
   </parent>
 
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-core</artifactId>
   <name>Jackson-core</name>
-  <version>2.10.2</version>
+  <version>2.10.3</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.2</tag>
+    <tag>jackson-core-2.10.3</tag>
   </scm>
 
   <properties>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jackson-core-jackson-core-2.10.2/release-notes/CREDITS-2.x 
new/jackson-core-jackson-core-2.10.3/release-notes/CREDITS-2.x
--- old/jackson-core-jackson-core-2.10.2/release-notes/CREDITS-2.x      
2020-01-05 03:04:51.000000000 +0100
+++ new/jackson-core-jackson-core-2.10.3/release-notes/CREDITS-2.x      
2020-03-03 04:11:26.000000000 +0100
@@ -196,10 +196,18 @@
   (2.10.0)
 
 Fabien Renaud (fabienrenaud@github)
-  * Reported, contributed fix fir #533: UTF-8 BOM not accounted for in
+  * Reported, contributed fix for #533: UTF-8 BOM not accounted for in
     `JsonLocation.getByteOffset()`
   (2.10.0)
+  * Reported, contributed fix for #603: 'JsonParser.getCurrentLocation()`
+    byte/char offset update incorrectly for big payloads
+  (2.10.3)
 
 Todd O'Bryan (toddobryan@github)
   * Contributed fix fox #455: Jackson reports wrong locations for 
JsonEOFException
   (2.10.1)
+
+Scott Leberknight (sleberknight@github)
+  * Reported, contributed fix for #592: DataFormatMatcher#getMatchedFormatName 
throws NPE
+    when no match exists
+  (2.10.3)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jackson-core-jackson-core-2.10.2/release-notes/VERSION-2.x 
new/jackson-core-jackson-core-2.10.3/release-notes/VERSION-2.x
--- old/jackson-core-jackson-core-2.10.2/release-notes/VERSION-2.x      
2020-01-05 03:04:51.000000000 +0100
+++ new/jackson-core-jackson-core-2.10.3/release-notes/VERSION-2.x      
2020-03-03 04:11:26.000000000 +0100
@@ -14,6 +14,13 @@
 === Releases ===
 ------------------------------------------------------------------------
 
+2.10.3 (03-Mar-2020)
+
+#592: DataFormatMatcher#getMatchedFormatName throws NPE when no match exists
+ (reported by Scott L)
+#603: 'JsonParser.getCurrentLocation()` byte/char offset update incorrectly 
for big payloads
+ (reported, fix contributed by Fabien R)
+
 2.10.2 (05-Jan-2020)
 
 #580: FilteringGeneratorDelegate writeRawValue delegate to `writeRaw()`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/format/DataFormatMatcher.java
 
new/jackson-core-jackson-core-2.10.3/src/main/java/com/fasterxml/jackson/core/format/DataFormatMatcher.java
--- 
old/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/format/DataFormatMatcher.java
 2020-01-05 03:04:51.000000000 +0100
+++ 
new/jackson-core-jackson-core-2.10.3/src/main/java/com/fasterxml/jackson/core/format/DataFormatMatcher.java
 2020-03-03 04:11:26.000000000 +0100
@@ -91,7 +91,7 @@
      *</pre>
      */
     public String getMatchedFormatName() {
-        return _match.getFormatName();
+        return hasMatch() ? getMatch().getFormatName() : null;
     }
     
     /*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java
 
new/jackson-core-jackson-core-2.10.3/src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java
--- 
old/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java
       2020-01-05 03:04:51.000000000 +0100
+++ 
new/jackson-core-jackson-core-2.10.3/src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java
       2020-03-03 04:11:26.000000000 +0100
@@ -244,14 +244,10 @@
     
     protected boolean _loadMore() throws IOException
     {
-        final int bufSize = _inputEnd;
-
         if (_reader != null) {
             int count = _reader.read(_inputBuffer, 0, _inputBuffer.length);
             if (count > 0) {
-                _inputPtr = 0;
-                _inputEnd = count;
-
+                final int bufSize = _inputEnd;
                 _currInputProcessed += bufSize;
                 _currInputRowStart -= bufSize;
 
@@ -260,6 +256,9 @@
                 //   in negative value, which is fine as combine value remains 
unchanged.
                 _nameStartOffset -= bufSize;
 
+                _inputPtr = 0;
+                _inputEnd = count;
+
                 return true;
             }
             // End of input
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
 
new/jackson-core-jackson-core-2.10.3/src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
--- 
old/jackson-core-jackson-core-2.10.2/src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
        2020-01-05 03:04:51.000000000 +0100
+++ 
new/jackson-core-jackson-core-2.10.3/src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
        2020-03-03 04:11:26.000000000 +0100
@@ -210,7 +210,6 @@
 
     protected final boolean _loadMore() throws IOException
     {
-        final int bufSize = _inputEnd;
         if (_inputStream != null) {
             int space = _inputBuffer.length;
             if (space == 0) { // only occurs when we've been closed
@@ -219,17 +218,19 @@
             
             int count = _inputStream.read(_inputBuffer, 0, space);
             if (count > 0) {
-                _inputPtr = 0;
-                _inputEnd = count;
+                final int bufSize = _inputEnd;
 
-                _currInputProcessed += _inputEnd;
-                _currInputRowStart -= _inputEnd;
+                _currInputProcessed += bufSize;
+                _currInputRowStart -= bufSize;
 
                 // 26-Nov-2015, tatu: Since name-offset requires it too, must 
offset
                 //   this increase to avoid "moving" name-offset, resulting 
most likely
                 //   in negative value, which is fine as combine value remains 
unchanged.
                 _nameStartOffset -= bufSize;
 
+                _inputPtr = 0;
+                _inputEnd = count;
+
                 return true;
             }
             // End of input
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/format/DataFormatMatcherTest.java
 
new/jackson-core-jackson-core-2.10.3/src/test/java/com/fasterxml/jackson/core/format/DataFormatMatcherTest.java
--- 
old/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/format/DataFormatMatcherTest.java
     2020-01-05 03:04:51.000000000 +0100
+++ 
new/jackson-core-jackson-core-2.10.3/src/test/java/com/fasterxml/jackson/core/format/DataFormatMatcherTest.java
     2020-03-03 04:11:26.000000000 +0100
@@ -35,4 +35,24 @@
         verifyException(e, "Illegal start/length");
     }
   }
+
+  public void testGetMatchedFormatNameReturnsNameWhenMatches() {
+    DataFormatMatcher dataFormatMatcher = new DataFormatMatcher(null,
+            new byte[2],
+            1,
+            0,
+            new JsonFactory(),
+            MatchStrength.SOLID_MATCH);
+    assertEquals(JsonFactory.FORMAT_NAME_JSON, 
dataFormatMatcher.getMatchedFormatName());
+  }
+
+  public void testGetMatchedFormatNameReturnsNullWhenNoMatch() {
+    DataFormatMatcher dataFormatMatcher = new DataFormatMatcher(null,
+            new byte[2],
+            1,
+            0,
+            null,
+            MatchStrength.NO_MATCH);
+    assertNull(dataFormatMatcher.getMatchedFormatName());
+  }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/format/TestJsonFormatDetection.java
 
new/jackson-core-jackson-core-2.10.3/src/test/java/com/fasterxml/jackson/core/format/TestJsonFormatDetection.java
--- 
old/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/format/TestJsonFormatDetection.java
   2020-01-05 03:04:51.000000000 +0100
+++ 
new/jackson-core-jackson-core-2.10.3/src/test/java/com/fasterxml/jackson/core/format/TestJsonFormatDetection.java
   2020-03-03 04:11:26.000000000 +0100
@@ -83,6 +83,7 @@
         DataFormatMatcher matcher = detector.findFormat(new 
ByteArrayInputStream(NON_JSON.getBytes("UTF-8")));
         // should not have match
         assertFalse(matcher.hasMatch());
+        assertNull(matcher.getMatchedFormatName());
         // and thus:
         assertEquals(MatchStrength.INCONCLUSIVE, matcher.getMatchStrength());
         // also:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/read/LocationOffsetsTest.java
 
new/jackson-core-jackson-core-2.10.3/src/test/java/com/fasterxml/jackson/core/read/LocationOffsetsTest.java
--- 
old/jackson-core-jackson-core-2.10.2/src/test/java/com/fasterxml/jackson/core/read/LocationOffsetsTest.java
 2020-01-05 03:04:51.000000000 +0100
+++ 
new/jackson-core-jackson-core-2.10.3/src/test/java/com/fasterxml/jackson/core/read/LocationOffsetsTest.java
 2020-03-03 04:11:26.000000000 +0100
@@ -2,6 +2,9 @@
 
 import com.fasterxml.jackson.core.*;
 
+import java.io.IOException;
+import java.util.Random;
+
 public class LocationOffsetsTest extends com.fasterxml.jackson.core.BaseTest
 {
     final JsonFactory JSON_F = new JsonFactory();
@@ -104,6 +107,45 @@
         p.close();
     }
 
+    public void testWithLazyStringReadStreaming() throws Exception
+    {
+        _testWithLazyStringRead(MODE_READER);
+        _testWithLazyStringRead(MODE_INPUT_STREAM);
+    }
+
+    public void testWithLazyStringReadDataInput() throws Exception
+    {
+        // DataInput-backed reader does not track column, so can not
+        // verify much; but force finishToken() regardless
+        JsonParser p = createParser(JSON_F, MODE_DATA_INPUT, "[\"text\"]");
+        assertToken(JsonToken.START_ARRAY, p.nextToken());
+        assertToken(JsonToken.VALUE_STRING, p.nextToken());
+        assertEquals(1, p.getCurrentLocation().getLineNr());
+        p.finishToken();
+        assertEquals("text", p.getText());
+        p.close();
+    }
+
+    private void _testWithLazyStringRead(int readMode) throws Exception
+    {
+        JsonParser p = createParser(JSON_F, readMode, "[\"text\"]");
+        assertToken(JsonToken.START_ARRAY, p.nextToken());
+        assertToken(JsonToken.VALUE_STRING, p.nextToken());
+        // initially location pointing to first character
+        assertEquals(3, p.getCurrentLocation().getColumnNr());
+        p.finishToken();
+        // but will move once we force reading
+        assertEquals(8, p.getCurrentLocation().getColumnNr());
+        // and no change if we call again (but is ok to call)
+        p.finishToken();
+        assertEquals(8, p.getCurrentLocation().getColumnNr());
+
+        // also just for fun, verify content
+        assertEquals("text", p.getText());
+        assertEquals(8, p.getCurrentLocation().getColumnNr());
+        p.close();
+    }
+
     // for [core#533]
     public void testUtf8Bom() throws Exception
     {
@@ -192,4 +234,75 @@
         System.arraycopy(bytes, 0, arr, 3, bytes.length);
         return arr;
     }
+
+    // [core#603]
+    public void testBigPayload() throws IOException {
+        JsonLocation loc;
+        JsonParser p;
+
+        String doc = "{\"key\":\"" + generateRandomAlpha(50000) + "\"}";
+
+        p = createParserUsingStream(JSON_F, doc, "UTF-8");
+
+        assertToken(JsonToken.START_OBJECT, p.nextToken());
+        loc = p.getTokenLocation();
+        assertEquals(0, loc.getByteOffset());
+        assertEquals(-1L, loc.getCharOffset());
+        assertEquals(1, loc.getLineNr());
+        assertEquals(1, loc.getColumnNr());
+        loc = p.getCurrentLocation();
+        assertEquals(1, loc.getByteOffset());
+        assertEquals(-1L, loc.getCharOffset());
+        assertEquals(1, loc.getLineNr());
+        assertEquals(2, loc.getColumnNr());
+
+        assertToken(JsonToken.FIELD_NAME, p.nextToken());
+        loc = p.getTokenLocation();
+        assertEquals(1, loc.getByteOffset());
+        assertEquals(-1L, loc.getCharOffset());
+        assertEquals(1, loc.getLineNr());
+        assertEquals(2, loc.getColumnNr());
+        loc = p.getCurrentLocation();
+        assertEquals(8, loc.getByteOffset());
+        assertEquals(-1L, loc.getCharOffset());
+        assertEquals(1, loc.getLineNr());
+        assertEquals(9, loc.getColumnNr());
+
+        assertToken(JsonToken.VALUE_STRING, p.nextToken());
+        loc = p.getTokenLocation();
+        assertEquals(7, loc.getByteOffset());
+        assertEquals(-1L, loc.getCharOffset());
+        assertEquals(1, loc.getLineNr());
+        assertEquals(8, loc.getColumnNr());
+        loc = p.getCurrentLocation();
+        assertEquals(8, loc.getByteOffset());
+        assertEquals(-1L, loc.getCharOffset());
+        assertEquals(1, loc.getLineNr());
+        assertEquals(9, loc.getColumnNr());
+
+        p.getTextCharacters();
+        loc = p.getTokenLocation();
+        assertEquals(7, loc.getByteOffset());
+        assertEquals(-1L, loc.getCharOffset());
+        assertEquals(1, loc.getLineNr());
+        assertEquals(8, loc.getColumnNr());
+        loc = p.getCurrentLocation();
+        assertEquals(doc.length() - 1, loc.getByteOffset());
+        assertEquals(-1L, loc.getCharOffset());
+        assertEquals(1, loc.getLineNr());
+        assertEquals(doc.length(), loc.getColumnNr());
+
+        p.close();
+    }
+
+    private String generateRandomAlpha(int length) {
+        StringBuilder sb = new StringBuilder(length);
+        Random rnd = new Random(length);
+        for (int i = 0; i < length; ++i) {
+            // let's limit it not to include surrogate pairs:
+            char ch = (char) ('A' + rnd.nextInt(26));
+            sb.append(ch);
+        }
+        return sb.toString();
+    }
 }


Reply via email to