{"action":"opened","issue":{"url":"https://api.github.com/repos/jayway/JsonPath/issues/70","labels_url":"https://api.github.com/repos/jayway/JsonPath/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/jayway/JsonPath/issues/70/comments","events_url":"https://api.github.com/repos/jayway/JsonPath/issues/70/events","html_url":"https://github.com/jayway/JsonPath/issues/70","id":62956662,"number":70,"title":"Regression from 0.9.1","user":{"login":"niclash","id":106693,"avatar_url":"https://avatars.githubusercontent.com/u/106693?v=3","gravatar_id":"","url":"https://api.github.com/users/niclash","html_url":"https://github.com/niclash","followers_url":"https://api.github.com/users/niclash/followers","following_url":"https://api.github.com/users/niclash/following{/other_user}","gists_url":"https://api.github.com/users/niclash/gists{/gist_id}","starred_url":"https://api.github.com/users/niclash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niclash/subscriptions","organizations_url":"https://api.github.com/users/niclash/orgs","repos_url":"https://api.github.com/users/niclash/repos","events_url":"https://api.github.com/users/niclash/events{/privacy}","received_events_url":"https://api.github.com/users/niclash/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-19T11:07:16Z","updated_at":"2015-03-19T11:07:16Z","closed_at":null,"body":"There is a regression in 1.2.0 from 0.9.1, where a complex input document and expression simply doesn't agree correctly.\r\n\r\nThe code is found below, and the exception shows that it misunderstands the Array situation of the \"[0]\" in \"path2\", although it clearly extracts a JSONArray in if I remove the \"[0]\" as seen in the code below.\r\n\r\nException in thread \"main\" com.jayway.jsonpath.InvalidPathException: Filter: [0] can only be applied to arrays. Current context is: 51.968503937007874\r\n\tat com.jayway.jsonpath.internal.token.ArrayPathToken.evaluate(ArrayPathToken.java:60)\r\n\tat com.jayway.jsonpath.internal.token.PathToken.handleObjectProperty(PathToken.java:71)\r\n\tat com.jayway.jsonpath.internal.token.PropertyPathToken.evaluate(PropertyPathToken.java:44)\r\n\tat com.jayway.jsonpath.internal.token.PathToken.handleArrayIndex(PathToken.java:125)\r\n\tat com.jayway.jsonpath.internal.token.PredicatePathToken.evaluate(PredicatePathToken.java:67)\r\n\r\n\r\nimport com.jayway.jsonpath.JsonPath;\r\n\r\npublic class JsonPathFailureTest\r\n{\r\n    public static void main( String[] args )\r\n    {\r\n        JsonPath path1 = JsonPath.compile( \"$.blocks[?(@.name=='AQ')].edges[?(@.name=='value')].value\" );\r\n        Object result1 = path1.read( JSON );\r\n        System.out.println( result1 );\r\n        System.out.println( result1.getClass() );\r\n\r\n        JsonPath path2 = JsonPath.compile( \"$.blocks[?(@.name=='AQ')].edges[?(@.name=='value')].value[0]\" );\r\n        System.out.println( path2.read( JSON ) );\r\n    }\r\n\r\n    private static final String JSON =\r\n        \"{\" +\r\n        \"    \\\"blocks\\\":[{\\\"edges\\\":[{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"expr\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"k\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"1.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"m\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"xnet://81/aq\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"-1.0\\\",\\\"tracked\\\":true}],\\\"name\\\":\\\"regMode\\\",\\\"type\\\":\\\"AnalogOutput\\\"},{\\\"edges\\\":[{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"expr\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"k\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"1.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"m\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"xnet://81/dq\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false}],\\\"name\\\":\\\"DQ\\\",\\\"type\\\":\\\"AnalogOutput\\\"},{\\\"edges\\\":[{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"expr\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"k\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"1.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"m\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"xnet://81/i\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"50.0\\\",\\\"tracked\\\":false}],\\\"name\\\":\\\"I\\\",\\\"type\\\":\\\"AnalogOutput\\\"},{\\\"edges\\\":[{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"expr\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"k\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"1.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"m\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"xnet://81/setp\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"55.0\\\",\\\"tracked\\\":false}],\\\"name\\\":\\\"BV\\\",\\\"type\\\":\\\"AnalogOutput\\\"},{\\\"edges\\\":[{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"expr\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"k\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"1.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"m\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"out\\\",\\\"low\\\":null,\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"55.5\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"xnet://81/ai\\\",\\\"tracked\\\":false}],\\\"name\\\":\\\"GT1\\\",\\\"type\\\":\\\"AnalogInput\\\"},{\\\"edges\\\":[{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"expr\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"k\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"1.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"m\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"xnet://81/p\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"2.0\\\",\\\"tracked\\\":false}],\\\"name\\\":\\\"P\\\",\\\"type\\\":\\\"AnalogOutput\\\"},{\\\"edges\\\":[{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"expr\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"k\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"1.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"m\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"out\\\",\\\"low\\\":null,\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"51.968503937007874\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"xnet://81/aq\\\",\\\"tracked\\\":false}],\\\"name\\\":\\\"AQ\\\",\\\"type\\\":\\\"AnalogInput\\\"},{\\\"edges\\\":[{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"expr\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"k\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"1.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"m\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"out\\\",\\\"low\\\":null,\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"55.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"xnet://81/setp\\\",\\\"tracked\\\":false}],\\\"name\\\":\\\"actualSetp\\\",\\\"type\\\":\\\"AnalogInput\\\"},{\\\"edges\\\":[{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"expr\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"k\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"1.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"m\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"out\\\",\\\"low\\\":null,\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Double\\\",\\\"value\\\":\\\"0.0\\\",\\\"tracked\\\":false},{\\\"high\\\":null,\\\"io\\\":\\\"in\\\",\\\"low\\\":null,\\\"name\\\":\\\"url\\\",\\\"type\\\":\\\"String\\\",\\\"value\\\":\\\"xnet://81/dq\\\",\\\"tracked\\\":false}],\\\"name\\\":\\\"actualDQ\\\",\\\"type\\\":\\\"AnalogInput\\\"}],\\\"connections\\\":[{\\\"from\\\":\\\"VVC.choice.output\\\",\\\"to\\\":\\\"SG-VV.DQ.value\\\",\\\"type\\\":\\\"Double\\\"}],\\\"name\\\":\\\"SG-VV\\\"}\";\r\n\r\n}\r\n"}}