{"action":"created","issue":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2951","repository_url":"https://api.github.com/repos/checkstyle/checkstyle","labels_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2951/labels{/name}","comments_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2951/comments","events_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2951/events","html_url":"https://github.com/checkstyle/checkstyle/pull/2951","id":135134830,"number":2951,"title":"Issue #2950: rewrote LineWrappingHandler for nodes not on first line","user":{"login":"rnveach","id":5427943,"avatar_url":"https://avatars.githubusercontent.com/u/5427943?v=3","gravatar_id":"","url":"https://api.github.com/users/rnveach","html_url":"https://github.com/rnveach","followers_url":"https://api.github.com/users/rnveach/followers","following_url":"https://api.github.com/users/rnveach/following{/other_user}","gists_url":"https://api.github.com/users/rnveach/gists{/gist_id}","starred_url":"https://api.github.com/users/rnveach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnveach/subscriptions","organizations_url":"https://api.github.com/users/rnveach/orgs","repos_url":"https://api.github.com/users/rnveach/repos","events_url":"https://api.github.com/users/rnveach/events{/privacy}","received_events_url":"https://api.github.com/users/rnveach/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-02-20T23:42:58Z","updated_at":"2016-04-23T03:40:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/checkstyle/checkstyle/pulls/2951","html_url":"https://github.com/checkstyle/checkstyle/pull/2951","diff_url":"https://github.com/checkstyle/checkstyle/pull/2951.diff","patch_url":"https://github.com/checkstyle/checkstyle/pull/2951.patch"},"body":"Issue #2950. This comes before PR #2940.\r\n\r\nThis fixes indentation for lines with some type of multiple statements on it, and rewrites `LineWrappingHandler` to be more of a utility and not require the first node to be the first on the line. This allows us to use this in places where we don't know where the node is on the line, like `throws`.\r\n\r\nChanges to `LineWrappingHandler`:\r\n* It is now more a utility class. It only takes `IndentationCheck` on instance, so it is more connected to `IndentationCheck` and requires us to only make one instance, instead of an instance for every AST.\r\n* Every call to `checkIndentation` now takes the nodes to examine as parameters instead of being stuck to the instance. We never called this method more than once on one instance, so I found the connection to the instance was pointless.\r\n* `getFirstNodeIndent` was replaced with `getLineStart` from `AbstractExpressionHandler`. This does have the side effect of including comments that exist before code on the line, but NetBeans's formatter works this way too.\r\n\r\n**Note:** So we stop duplicating methods between this class and `AbstractExpressionHandler`, I may make a unique base like `AbstractHandler` that both classes can use.\r\n\r\nI consider `AbstractExpressionHandler.checkLinesIndent` and similar methods a bad emulation of `LineWrappingHandler` and am thinking of replacing them for the other. The reason is because they check all lines inbetween the 2 nodes ignoring the AST structure. This can cause full comments to be picked up in the mix.\r\nIt can also be confusing which to use since one uses `basicOffset` and the other uses `lineWrappingIndentation` for indentation, and one uses `forceStrictCondition` while the other doesn't.\r\n\r\nAll changes to other classes were to make use of the new `LineWrappingHandler`.\r\nRegression to come."},"comment":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/comments/213660399","html_url":"https://github.com/checkstyle/checkstyle/pull/2951#issuecomment-213660399","issue_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2951","id":213660399,"user":{"login":"rnveach","id":5427943,"avatar_url":"https://avatars.githubusercontent.com/u/5427943?v=3","gravatar_id":"","url":"https://api.github.com/users/rnveach","html_url":"https://github.com/rnveach","followers_url":"https://api.github.com/users/rnveach/followers","following_url":"https://api.github.com/users/rnveach/following{/other_user}","gists_url":"https://api.github.com/users/rnveach/gists{/gist_id}","starred_url":"https://api.github.com/users/rnveach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnveach/subscriptions","organizations_url":"https://api.github.com/users/rnveach/orgs","repos_url":"https://api.github.com/users/rnveach/repos","events_url":"https://api.github.com/users/rnveach/events{/privacy}","received_events_url":"https://api.github.com/users/rnveach/received_events","type":"User","site_admin":false},"created_at":"2016-04-23T03:40:50Z","updated_at":"2016-04-23T03:40:50Z","body":"@romani \r\nRebase is done. Cicleci timed out.\r\nRegression is the same."}}