@@ -32,11 +32,7 @@ public class TestJacksonJsonPointer {
3232 public void testEmpty () throws IOException {
3333 final JsonPointer empty = JsonPointer .compile ("" );
3434 assertEquals ("" , empty .toString ());
35- if (isBefore2_14_0 ()) {
36- assertEquals ("" , empty .getMatchingProperty ());
37- } else {
38- assertEquals (null , empty .getMatchingProperty ());
39- }
35+ assertEquals (null , empty .getMatchingProperty ());
4036 assertTrue (empty .getMatchingIndex () < 0 );
4137 assertEquals (JsonPointer .compile ("" ), empty );
4238 assertNotEquals (JsonPointer .compile ("/" ), empty );
@@ -57,11 +53,7 @@ public void testRoot() throws IOException {
5753
5854 final JsonPointer tail = root .tail ();
5955 assertEquals ("" , tail .toString ());
60- if (isBefore2_14_0 ()) {
61- assertEquals ("" , tail .getMatchingProperty ());
62- } else {
63- assertEquals (null , tail .getMatchingProperty ());
64- }
56+ assertEquals (null , tail .getMatchingProperty ());
6557 assertTrue (tail .getMatchingIndex () < 0 );
6658 assertEquals (JsonPointer .compile ("" ), tail );
6759 assertNotEquals (JsonPointer .compile ("/" ), tail );
@@ -91,11 +83,7 @@ public void testRootDuplicated() throws IOException {
9183
9284 final JsonPointer tail2 = tail1 .tail ();
9385 assertEquals ("" , tail2 .toString ());
94- if (isBefore2_14_0 ()) {
95- assertEquals ("" , tail2 .getMatchingProperty ());
96- } else {
97- assertEquals (null , tail2 .getMatchingProperty ());
98- }
86+ assertEquals (null , tail2 .getMatchingProperty ());
9987 assertTrue (tail2 .getMatchingIndex () < 0 );
10088 assertEquals (JsonPointer .compile ("" ), tail2 );
10189 assertNotEquals (JsonPointer .compile ("/" ), tail2 );
@@ -116,11 +104,7 @@ public void testSingleProperty() throws IOException {
116104
117105 final JsonPointer tail = root .tail ();
118106 assertEquals ("" , tail .toString ());
119- if (isBefore2_14_0 ()) {
120- assertEquals ("" , tail .getMatchingProperty ());
121- } else {
122- assertEquals (null , tail .getMatchingProperty ());
123- }
107+ assertEquals (null , tail .getMatchingProperty ());
124108 assertTrue (tail .getMatchingIndex () < 0 );
125109 assertEquals (JsonPointer .compile ("" ), tail );
126110 assertNotEquals (JsonPointer .compile ("/" ), tail );
@@ -141,11 +125,7 @@ public void testSingleIndex() throws IOException {
141125
142126 final JsonPointer tail = root .tail ();
143127 assertEquals ("" , tail .toString ());
144- if (isBefore2_14_0 ()) {
145- assertEquals ("" , tail .getMatchingProperty ());
146- } else {
147- assertEquals (null , tail .getMatchingProperty ());
148- }
128+ assertEquals (null , tail .getMatchingProperty ());
149129 assertTrue (tail .getMatchingIndex () < 0 );
150130 assertEquals (JsonPointer .compile ("" ), tail );
151131 assertNotEquals (JsonPointer .compile ("/" ), tail );
@@ -185,11 +165,7 @@ public void testMultipleProperties() throws IOException {
185165
186166 final JsonPointer tail3 = tail2 .tail ();
187167 assertEquals ("" , tail3 .toString ());
188- if (isBefore2_14_0 ()) {
189- assertEquals ("" , tail3 .getMatchingProperty ());
190- } else {
191- assertEquals (null , tail3 .getMatchingProperty ());
192- }
168+ assertEquals (null , tail3 .getMatchingProperty ());
193169 assertTrue (tail3 .getMatchingIndex () < 0 );
194170 assertEquals (JsonPointer .compile ("" ), tail3 );
195171 assertNotEquals (JsonPointer .compile ("/" ), tail3 );
@@ -203,12 +179,4 @@ public void testMultipleProperties() throws IOException {
203179 static void printJacksonVersion () {
204180 System .out .println ("Tested with Jackson: " + PackageVersion .VERSION .toString ());
205181 }
206-
207- // The behavior of JsonPointer.compile("").tail() is different from Jackson 2.14.0.
208- //
209- // https://github.com/FasterXML/jackson-core/issues/788
210- // https://github.com/FasterXML/jackson-core/commit/b0f6eb9bb2d2d829efb19020e7df4d732066f8cd
211- private static boolean isBefore2_14_0 () {
212- return PackageVersion .VERSION .getMajorVersion () <= 2 && PackageVersion .VERSION .getMinorVersion () <= 13 ;
213- }
214182}
0 commit comments