File tree 3 files changed +31
-8
lines changed
main/java/com/fasterxml/jackson/core/util
test/java/com/fasterxml/jackson/core/util
3 files changed +31
-8
lines changed Original file line number Diff line number Diff line change 1
1
Project: jackson-core
2
- Version: 2.4.2 (13-Aug -2014)
2
+ Version: 2.4.3 (xx-xxx -2014)
3
3
4
- #145: NPE at BytesToNameCanonicalizer
5
- (reported by Shay B)
6
- #146: Error while parsing negative floats at the end of the input buffer
7
- (reported by rjmac@github)
4
+ #152: Exception for property names longer than 256k
5
+ (reported by CrendKing@github)
8
6
9
7
------------------------------------------------------------------------
10
8
=== History: ===
11
9
------------------------------------------------------------------------
12
10
11
+ 2.4.2 (13-Aug-2014)
12
+
13
+ #145: NPE at BytesToNameCanonicalizer
14
+ (reported by Shay B)
15
+ #146: Error while parsing negative floats at the end of the input buffer
16
+ (reported by rjmac@github)
17
+
13
18
2.4.1 (16-Jun-2014)
14
19
15
20
#143: Flaw in `BufferRecycler.allocByteBuffer(int,int)` that results in
Original file line number Diff line number Diff line change @@ -580,10 +580,13 @@ public char[] finishCurrentSegment() {
580
580
public char [] expandCurrentSegment ()
581
581
{
582
582
final char [] curr = _currentSegment ;
583
- // Let's grow by 50%
583
+ // Let's grow by 50% by default
584
584
final int len = curr .length ;
585
- // Must grow by at least 1 char, no matter what
586
- int newLen = (len == MAX_SEGMENT_LEN ) ? (MAX_SEGMENT_LEN +1 ) : Math .min (MAX_SEGMENT_LEN , len + (len >> 1 ));
585
+ int newLen = len + (len >> 1 );
586
+ // but above intended maximum, slow to increase by 25%
587
+ if (newLen > MAX_SEGMENT_LEN ) {
588
+ newLen = len + (len >> 2 );
589
+ }
587
590
return (_currentSegment = Arrays .copyOf (curr , newLen ));
588
591
}
589
592
Original file line number Diff line number Diff line change @@ -62,4 +62,19 @@ public void testLongAppend()
62
62
assertEquals (len +2 , tb .size ());
63
63
assertEquals (EXP , tb .contentsAsString ());
64
64
}
65
+
66
+ // [Core#152]
67
+ public void testExpand ()
68
+ {
69
+ TextBuffer tb = new TextBuffer (new BufferRecycler ());
70
+ char [] buf = tb .getCurrentSegment ();
71
+
72
+ while (buf .length < 500 * 1000 ) {
73
+ char [] old = buf ;
74
+ buf = tb .expandCurrentSegment ();
75
+ if (old .length >= buf .length ) {
76
+ fail ("Expected buffer of " +old .length +" to expand, did not, length now " +buf .length );
77
+ }
78
+ }
79
+ }
65
80
}
You can’t perform that action at this time.
0 commit comments