Title: UnifiedDiffParserException: expected file start line not found occurred when parse one Git format patch file · Issue #84 · java-diff-utils/java-diff-utils · GitHub
Open Graph Title: UnifiedDiffParserException: expected file start line not found occurred when parse one Git format patch file · Issue #84 · java-diff-utils/java-diff-utils
X Title: UnifiedDiffParserException: expected file start line not found occurred when parse one Git format patch file · Issue #84 · java-diff-utils/java-diff-utils
Description: Describe the bug UnifiedDiffParserException: expected file start line not found occured when parse one Git format patch file To Reproduce Steps to reproduce the behavior: Example data simple programm snippet See error the git format patc...
Open Graph Description: Describe the bug UnifiedDiffParserException: expected file start line not found occured when parse one Git format patch file To Reproduce Steps to reproduce the behavior: Example data simple progra...
X Description: Describe the bug UnifiedDiffParserException: expected file start line not found occured when parse one Git format patch file To Reproduce Steps to reproduce the behavior: Example data simple progra...
Opengraph URL: https://github.com/java-diff-utils/java-diff-utils/issues/84
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"UnifiedDiffParserException: expected file start line not found occurred when parse one Git format patch file","articleBody":"**Describe the bug**\r\nUnifiedDiffParserException: expected file start line not found occured when parse one Git format patch file\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Example data\r\n2. simple programm snippet\r\n3. See error\r\n\r\nthe git format patch file is here:\r\n```\r\nFrom b53e612a2ab5ff15d14860e252f84c0f343fe93a Mon Sep 17 00:00:00 2001\r\nFrom: nmancus1 \u003cnmancus1\r\nDate: Thu, 4 Jun 2020 11:46:34 -0400\r\nSubject: [PATCH] minor: Add input file for Java14 instanceof with pattern\r\n matching (#7290)\r\n\r\n---\r\n config/ant-phase-verify.xml | 2 +\r\n .../InputJava14InstanceofWithPatternMatching.java | 76 ++++++++++++++++++++++\r\n 2 files changed, 78 insertions(+)\r\n create mode 100644 src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/java14/InputJava14InstanceofWithPatternMatching.java\r\n\r\ndiff --git a/config/ant-phase-verify.xml b/config/ant-phase-verify.xml\r\nindex d27ffef..e0285ce 100644\r\n--- a/config/ant-phase-verify.xml\r\n+++ b/config/ant-phase-verify.xml\r\n@@ -148,6 +148,8 @@\r\n \u003cexclude name=\"**/InputMainFrameModelIncorrectClass.java\"/\u003e\r\n \u003cexclude name=\"**/InputBeforeExecutionExclusionFileFilterIncorrectClass.java\"/\u003e\r\n \u003cexclude name=\"**/InputJavaParser.java\"/\u003e\r\n+ \u003c!-- until https://github.com/checkstyle/checkstyle/issues/7290 --\u003e\r\n+ \u003cexclude name=\"**/InputJava14InstanceofWithPatternMatching.java\"/\u003e\r\n \u003c!-- Cannot parse until Java 14 support --\u003e\r\n \u003cexclude name=\"**/InputJava14Records.java\"/\u003e\r\n \u003c/fileset\u003e\r\ndiff --git a/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/java14/InputJava14InstanceofWithPatternMatching.java b/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/java14/InputJava14InstanceofWithPatternMatching.java\r\nnew file mode 100644\r\nindex 0000000..8fa3eba\r\n--- /dev/null\r\n+++ b/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/java14/InputJava14InstanceofWithPatternMatching.java\r\n@@ -0,0 +1,76 @@\r\n+//non-compiled with javac: Compilable with Java14\r\n+package com.puppycrawl.tools.checkstyle.grammar.java14;\r\n+\r\n+import java.util.Arrays;\r\n+import java.util.Locale;\r\n...... I removed it\r\n+ }\r\n+ }\r\n+}\r\n--\r\n2.7.4\r\n```\r\n\r\nwhen I run the follow codes, the exception happened in `UnifiedDiffReader.parseUnifiedDiff`\r\n```java\r\nfinal String fullFileName = getPath(fileName);\r\n final FileInputStream ins = new FileInputStream(fullFileName);\r\n return UnifiedDiffReader.parseUnifiedDiff(ins);\r\n```\r\n\r\nerror information:\r\n```sh\r\ncom.github.difflib.unifieddiff.UnifiedDiffParserException: expected file start line not found\r\n\r\n\tat com.github.difflib.unifieddiff.UnifiedDiffReader.parse(UnifiedDiffReader.java:90)\r\n\tat com.github.difflib.unifieddiff.UnifiedDiffReader.parseUnifiedDiff(UnifiedDiffReader.java:136)\r\n\tat com.github.checkstyle.patchfilter.SuppressionPatchFilterTest.getUnifiedDiff(SuppressionPatchFilterTest.java:232)\r\n\tat com.github.checkstyle.patchfilter.SuppressionPatchFilterTest.testGitFormatPatchLinuxTwo(SuppressionPatchFilterTest.java:151)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\r\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\r\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\r\n\tat org.junit.runner.JUnitCore.run(JUnitCore.java:137)\r\n\tat com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)\r\n\tat com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)\r\n\tat com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)\r\n\tat com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)\r\n\r\n```\r\n\r\n**Expected behavior**\r\nA clear and concise description of what you expected to happen.\r\n\r\nI hope to parse this file correctly.\r\n**System**\r\n - Java version 1.8\r\n - Version [e.g. 22]\r\nMaven plugin\r\n```\r\n \u003cgroupId\u003eio.github.java-diff-utils\u003c/groupId\u003e\r\n \u003cartifactId\u003ejava-diff-utils\u003c/artifactId\u003e\r\n \u003cversion\u003e4.5\u003c/version\u003e\r\n```\r\n\r\n","author":{"url":"https://github.com/HuGanghui","@type":"Person","name":"HuGanghui"},"datePublished":"2020-06-18T09:36:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/84/java-diff-utils/issues/84"}
| 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:291373b5-54d5-c61a-0cf6-a0bef17a8815 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC88:4D9DF:1C4927D:27E7F3F:696909AB |
| html-safe-nonce | ae361ff1aecb133bd894e2795689acb4412e4144a6aad27cf20f643ab406718f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzg4OjREOURGOjFDNDkyN0Q6MjdFN0YzRjo2OTY5MDlBQiIsInZpc2l0b3JfaWQiOiIzMzE0ODIxMDU3NDg1NTM5NzU1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2c27b9719f812fcf35e969522595bb2c55dcae7b69c069d7ee8a6b9529ada8fb |
| hovercard-subject-tag | issue:641060299 |
| 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/84/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0bd6f80c245745184637e98736d4a22b3c5251c89354a0f09a06937a825779f2/java-diff-utils/java-diff-utils/issues/84 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0bd6f80c245745184637e98736d4a22b3c5251c89354a0f09a06937a825779f2/java-diff-utils/java-diff-utils/issues/84 |
| og:image:alt | Describe the bug UnifiedDiffParserException: expected file start line not found occured when parse one Git format patch file To Reproduce Steps to reproduce the behavior: Example data simple progra... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | HuGanghui |
| hostname | github.com |
| expected-hostname | github.com |
| None | e6156bd4ef9f2dc8dadf4c49a8f7ed8532186388cef72eda3ccb9f0ab3b8cfca |
| 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 | ee2210c3e58153aae53400c942f8a7b4bbb43ec4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width