diff --git a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathParseTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathParseTests.cs index d2faab98..d6aa3b10 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathParseTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathParseTests.cs @@ -52,8 +52,8 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath JPath path = new JPath("[?(1 > 2)]"); Assert.AreEqual(1, path.Filters.Count); BooleanQueryExpression booleanExpression = (BooleanQueryExpression)((QueryFilter)path.Filters[0]).Expression; - Assert.AreEqual(new JValue(1), booleanExpression.Left); - Assert.AreEqual(new JValue(1), booleanExpression.Right); + Assert.AreEqual(1, (int)(JValue)booleanExpression.Left); + Assert.AreEqual(2, (int)(JValue)booleanExpression.Right); Assert.AreEqual(QueryOperator.GreaterThan, booleanExpression.Operator); } diff --git a/Src/Newtonsoft.Json/Linq/JsonPath/JPath.cs b/Src/Newtonsoft.Json/Linq/JsonPath/JPath.cs index 58f66737..4a0ae4f6 100644 --- a/Src/Newtonsoft.Json/Linq/JsonPath/JPath.cs +++ b/Src/Newtonsoft.Json/Linq/JsonPath/JPath.cs @@ -450,7 +450,7 @@ namespace Newtonsoft.Json.Linq.JsonPath return true; } - private JsonException ThrowUnexpectedCharacterException() + private JsonException CreateUnexpectedCharacterException() { return new JsonException("Unexpected character while parsing path query: " + _expression[_currentIndex]); } @@ -477,7 +477,7 @@ namespace Newtonsoft.Json.Linq.JsonPath return new JValue(value); } - throw ThrowUnexpectedCharacterException(); + throw CreateUnexpectedCharacterException(); } private QueryExpression ParseExpression() @@ -525,7 +525,7 @@ namespace Newtonsoft.Json.Linq.JsonPath { if (!Match("&&")) { - throw ThrowUnexpectedCharacterException(); + throw CreateUnexpectedCharacterException(); } if (parentExpression == null || parentExpression.Operator != QueryOperator.And) @@ -551,7 +551,7 @@ namespace Newtonsoft.Json.Linq.JsonPath { if (!Match("||")) { - throw ThrowUnexpectedCharacterException(); + throw CreateUnexpectedCharacterException(); } if (parentExpression == null || parentExpression.Operator != QueryOperator.Or)