Title: Empty lines after chunk throw UnifiedDiffParserException · Issue #225 · java-diff-utils/java-diff-utils · GitHub
Open Graph Title: Empty lines after chunk throw UnifiedDiffParserException · Issue #225 · java-diff-utils/java-diff-utils
X Title: Empty lines after chunk throw UnifiedDiffParserException · Issue #225 · java-diff-utils/java-diff-utils
Description: Description Empty lines after chunk line seem to crash the UnifiedDiffReader.parseUnifiedDiff() method. To Reproduce Steps to reproduce the behavior: Example data: index 9e852060c..649690b43 100644 --- a/modules/configuration/gsrc/com/gu...
Open Graph Description: Description Empty lines after chunk line seem to crash the UnifiedDiffReader.parseUnifiedDiff() method. To Reproduce Steps to reproduce the behavior: Example data: index 9e852060c..649690b43 100644...
X Description: Description Empty lines after chunk line seem to crash the UnifiedDiffReader.parseUnifiedDiff() method. To Reproduce Steps to reproduce the behavior: Example data: index 9e852060c..649690b43 100644...
Opengraph URL: https://github.com/java-diff-utils/java-diff-utils/issues/225
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Empty lines after chunk throw UnifiedDiffParserException","articleBody":"**Description**\nEmpty lines after chunk line seem to crash the UnifiedDiffReader.parseUnifiedDiff() method.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Example data: \n```diff --git a/modules/configuration/gsrc/com/guidewire/pl/docexamples/DMSServlet.gs b/modules/configuration/gsrc/com/guidewire/pl/docexamples/DMSServlet.gs\nindex 9e852060c..649690b43 100644\n--- a/modules/configuration/gsrc/com/guidewire/pl/docexamples/DMSServlet.gs\n+++ b/modules/configuration/gsrc/com/guidewire/pl/docexamples/DMSServlet.gs\n@@ -37,6 +37,7 @@ class DMSServlet extends HttpServlet {\n \n public static final var ATTRIB_DOC_PUBLICID_PARAM: String = \"Document.PublicID\"\n public static final var ATTRIB_JOIN_TABLE_TYPE: String = \"JoinTable.Type\"\n+ //a test\n public static final var ATTRIB_JOIN_TABLE_PROPERTY: String = \"JoinTable.JoinedProperty\"\n public static final var ATTRIB_JOINED_PUBLICID: String = \"Joined.PublicID\"\n private var _purgeableUrl: String\ndiff --git a/testfile.txt b/testfile.txt\nnew file mode 100644\nindex 000000000..0ccd05bf0\n--- /dev/null\n+++ b/testfile.txt\n@@ -0,0 +1 @@\n+file.test\n```\n2. Run `UnifiedDiffReader.parseUnifiedDiff(new ByteArrayInputStream(raw.getBytes(StandardCharsets.UTF_8)));`\n3. You will get:\n```Dec 16, 2025 7:25:12 PM com.github.difflib.unifieddiff.UnifiedDiffReader processLine\nWARNING: \u003e\u003e\u003e no rule matched \ncom.github.difflib.unifieddiff.UnifiedDiffParserException: expected data line not found\n\tat com.github.difflib.unifieddiff.UnifiedDiffReader.parse(UnifiedDiffReader.java:145)\n\tat com.github.difflib.unifieddiff.UnifiedDiffReader.parseUnifiedDiff(UnifiedDiffReader.java:205)\n```\n because this line is empty:\n\n\u003cimg width=\"379\" height=\"61\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/b1164fac-a514-4f4c-8dbe-b4378d567b40\" /\u003e\n\n**Expected behavior**\nEmpty lines should not throw errors here according to my understanding.\n\n**System**\n - Java version 21\n - Version [e.g. 4.15 (latest)]\n","author":{"url":"https://github.com/MadnessIRL","@type":"Person","name":"MadnessIRL"},"datePublished":"2025-12-16T18:27:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/225/java-diff-utils/issues/225"}
| 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:4fc8dae8-e144-d5e5-84e6-ae76386b2c7f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8632:2962E0:26A94A:34651F:69681CC1 |
| html-safe-nonce | efa17f0c8d47992d70557cd90ae184fb3554f7d99a80058ab436d34e4d79d74c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjMyOjI5NjJFMDoyNkE5NEE6MzQ2NTFGOjY5NjgxQ0MxIiwidmlzaXRvcl9pZCI6IjQzNTM1MzAwOTQ3MDg0MDAwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 23ddf863dfa7320ae5010c374e12d9a31ebf64c41e52ef2a6afc4dfff2c68910 |
| hovercard-subject-tag | issue:3735885916 |
| 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/225/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2d9c767fd6b861636f87d8189425458f888139043b8b4955acca38848d76d1d9/java-diff-utils/java-diff-utils/issues/225 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2d9c767fd6b861636f87d8189425458f888139043b8b4955acca38848d76d1d9/java-diff-utils/java-diff-utils/issues/225 |
| og:image:alt | Description Empty lines after chunk line seem to crash the UnifiedDiffReader.parseUnifiedDiff() method. To Reproduce Steps to reproduce the behavior: Example data: index 9e852060c..649690b43 100644... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MadnessIRL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2452ef75cc61e096c7ab0f8a4fca0ff7d45789bc2e145182d98e41a6ba61e5e1 |
| 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 | 424b2f45b6311b8635b559db771ca199ff3a1b4f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width