Title: changePosition NULL on UnifiedDiffReader.parseUnifiedDiff · Issue #117 · java-diff-utils/java-diff-utils · GitHub
Open Graph Title: changePosition NULL on UnifiedDiffReader.parseUnifiedDiff · Issue #117 · java-diff-utils/java-diff-utils
X Title: changePosition NULL on UnifiedDiffReader.parseUnifiedDiff · Issue #117 · java-diff-utils/java-diff-utils
Description: I was testing the tool and I picked a random commit from this repo to do so. Let's take 5338313. I accessed the diff of it by adding a .diff at the end of the URL and saved it into diff.txt file. I then used the tool to parse it in the f...
Open Graph Description: I was testing the tool and I picked a random commit from this repo to do so. Let's take 5338313. I accessed the diff of it by adding a .diff at the end of the URL and saved it into diff.txt file. I...
X Description: I was testing the tool and I picked a random commit from this repo to do so. Let's take 5338313. I accessed the diff of it by adding a .diff at the end of the URL and saved it into diff.txt fil...
Opengraph URL: https://github.com/java-diff-utils/java-diff-utils/issues/117
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"changePosition NULL on UnifiedDiffReader.parseUnifiedDiff","articleBody":"I was testing the tool and I picked a random commit from this repo to do so. Let's take https://github.com/java-diff-utils/java-diff-utils/commit/5338313a54c6eed065c3339a71870ba2d6fd0d0f. I accessed the `diff` of it by adding a `.diff` [at the end of the URL](https://github.com/java-diff-utils/java-diff-utils/commit/5338313a54c6eed065c3339a71870ba2d6fd0d0f.diff) and saved it into `diff.txt` file. I then used the tool to parse it in the following way:\r\n\r\n``` java\r\npublic static void main(String[] args) throws IOException {\r\n var stream = new FileInputStream(new File(\"/path/to/diff.txt\"));\r\n var patch = UnifiedDiffReader.parseUnifiedDiff(stream);\r\n\r\n patch.getFiles().forEach(f -\u003e {\r\n System.out.println(\"File: \" + f.getFromFile());\r\n f.getPatch().getDeltas().forEach(delta -\u003e {\r\n\r\n System.out.println(\"Source: \");\r\n System.out.println(delta.getSource().getPosition());\r\n delta.getSource().getChangePosition().forEach(System.out::print);\r\n\r\n System.out.println(\"Target: \");\r\n System.out.println(delta.getTarget().getPosition());\r\n delta.getTarget().getChangePosition().forEach(System.out::print);\r\n });\r\n });\r\n}\r\n```\r\n\r\nThe delta `getChangePosition` is just `null`. Am I doing something wrong?\r\n","author":{"url":"https://github.com/elanzini","@type":"Person","name":"elanzini"},"datePublished":"2021-03-11T07:20:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/117/java-diff-utils/issues/117"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fb1a38ec-6ef8-93c6-c4a6-c71c96b191cd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D170:221274:2D28D9:3EBD18:69694593 |
| html-safe-nonce | 599f48dc6bd5362e1f9ae936c51624c537bc58cd21a77bd36850e63a74026759 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTcwOjIyMTI3NDoyRDI4RDk6M0VCRDE4OjY5Njk0NTkzIiwidmlzaXRvcl9pZCI6IjQzMDc3MjA4MjA5MDE4ODk0MjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | da2d59acc8dcac6019c84c9dfe3080f97dc42b81c3a028788e51aaae2576aebe |
| hovercard-subject-tag | issue:828859807 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/java-diff-utils/java-diff-utils/117/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d2924c9a5b96eaed57ee7d75d4e8949fc459ff3bc9666f36367d20c466b56a75/java-diff-utils/java-diff-utils/issues/117 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d2924c9a5b96eaed57ee7d75d4e8949fc459ff3bc9666f36367d20c466b56a75/java-diff-utils/java-diff-utils/issues/117 |
| og:image:alt | I was testing the tool and I picked a random commit from this repo to do so. Let's take 5338313. I accessed the diff of it by adding a .diff at the end of the URL and saved it into diff.txt file. I... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | elanzini |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/java-diff-utils/java-diff-utils git https://github.com/java-diff-utils/java-diff-utils.git |
| octolytics-dimension-user_id | 40540835 |
| octolytics-dimension-user_login | java-diff-utils |
| octolytics-dimension-repository_id | 86663812 |
| octolytics-dimension-repository_nwo | java-diff-utils/java-diff-utils |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 86663812 |
| octolytics-dimension-repository_network_root_nwo | java-diff-utils/java-diff-utils |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width