{"action":"created","issue":{"url":"https://api.github.com/repos/jgrapht/jgrapht/issues/323","repository_url":"https://api.github.com/repos/jgrapht/jgrapht","labels_url":"https://api.github.com/repos/jgrapht/jgrapht/issues/323/labels{/name}","comments_url":"https://api.github.com/repos/jgrapht/jgrapht/issues/323/comments","events_url":"https://api.github.com/repos/jgrapht/jgrapht/issues/323/events","html_url":"https://github.com/jgrapht/jgrapht/pull/323","id":186466220,"number":323,"title":"Fix PathValidator to make its implementation feasible","user":{"login":"assimiz","id":2134809,"avatar_url":"https://avatars.githubusercontent.com/u/2134809?v=3","gravatar_id":"","url":"https://api.github.com/users/assimiz","html_url":"https://github.com/assimiz","followers_url":"https://api.github.com/users/assimiz/followers","following_url":"https://api.github.com/users/assimiz/following{/other_user}","gists_url":"https://api.github.com/users/assimiz/gists{/gist_id}","starred_url":"https://api.github.com/users/assimiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/assimiz/subscriptions","organizations_url":"https://api.github.com/users/assimiz/orgs","repos_url":"https://api.github.com/users/assimiz/repos","events_url":"https://api.github.com/users/assimiz/events{/privacy}","received_events_url":"https://api.github.com/users/assimiz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-11-01T06:10:21Z","updated_at":"2016-11-03T08:36:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jgrapht/jgrapht/pulls/323","html_url":"https://github.com/jgrapht/jgrapht/pull/323","diff_url":"https://github.com/jgrapht/jgrapht/pull/323.diff","patch_url":"https://github.com/jgrapht/jgrapht/pull/323.patch"},"body":"We previously provided an option to users of `KShortestPaths` to provide an external `PathValidator` (see PR #228). The problem is that `AbstractPathElement` which is a parameter of the `KShortestPaths#isValidPath` method, is invisible out of the `org.jgrapht.alg` package. Hence, users of `PathValidator` are unable to actually implement it.\r\n\r\nI have added a public `PathElement` interface on top of `AbstractPathElement`. It includes all the methods currently implemented by `AbstractPathElement`. By that we actually allow the implementation of `PathValidator` while uncompromising package visibility and encapsulation."},"comment":{"url":"https://api.github.com/repos/jgrapht/jgrapht/issues/comments/258086802","html_url":"https://github.com/jgrapht/jgrapht/pull/323#issuecomment-258086802","issue_url":"https://api.github.com/repos/jgrapht/jgrapht/issues/323","id":258086802,"user":{"login":"d-michail","id":15940875,"avatar_url":"https://avatars.githubusercontent.com/u/15940875?v=3","gravatar_id":"","url":"https://api.github.com/users/d-michail","html_url":"https://github.com/d-michail","followers_url":"https://api.github.com/users/d-michail/followers","following_url":"https://api.github.com/users/d-michail/following{/other_user}","gists_url":"https://api.github.com/users/d-michail/gists{/gist_id}","starred_url":"https://api.github.com/users/d-michail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-michail/subscriptions","organizations_url":"https://api.github.com/users/d-michail/orgs","repos_url":"https://api.github.com/users/d-michail/repos","events_url":"https://api.github.com/users/d-michail/events{/privacy}","received_events_url":"https://api.github.com/users/d-michail/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T08:36:20Z","updated_at":"2016-11-03T08:36:20Z","body":"Hi, \r\n\r\nboth solutions below work for me as well: \r\n\r\n - either create a new inner interface inside the `PathValidator` interface containing methods \r\n```\r\nV getLastVertex();\r\nE getLastEdge();\r\nIterator<E> reverseIterator();\r\n```\r\n  possible namings are `PathTail`, `ReversePathTail`, `PartialPath`, `ReversePartialPath`, etc.\r\n\r\n - or use GraphPath in the interface\r\n\r\nLet us first fix a clean interface and then we see how to adjust the implementation."}}
{"actor":{"display_login":"d-michail"}}