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:04244db5-b5bb-3624-4de6-fe6e29a22889 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E590:19DA02:27E21D4:379EE56:69694D2D |
| html-safe-nonce | 1cbb47badcaa94a9cf3f34329d79957db72c77e26397baf3e951147c2fd551f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTkwOjE5REEwMjoyN0UyMUQ0OjM3OUVFNTY6Njk2OTREMkQiLCJ2aXNpdG9yX2lkIjoiNzU5Mzc1NjM3MzE3NzY2NDQ1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 345774aa0edda8889163786283668bb54133bb89eaffb1147f2847ef57e53bdd |
| 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 | 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