-
-
Notifications
You must be signed in to change notification settings - Fork 214
Open
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/guidewire/pl/docexamples/DMSServlet.gs
+++ b/modules/configuration/gsrc/com/guidewire/pl/docexamples/DMSServlet.gs
@@ -37,6 +37,7 @@ class DMSServlet extends HttpServlet {
public static final var ATTRIB_DOC_PUBLICID_PARAM: String = "Document.PublicID"
public static final var ATTRIB_JOIN_TABLE_TYPE: String = "JoinTable.Type"
+ //a test
public static final var ATTRIB_JOIN_TABLE_PROPERTY: String = "JoinTable.JoinedProperty"
public static final var ATTRIB_JOINED_PUBLICID: String = "Joined.PublicID"
private var _purgeableUrl: String
diff --git a/testfile.txt b/testfile.txt
new file mode 100644
index 000000000..0ccd05bf0
--- /dev/null
+++ b/testfile.txt
@@ -0,0 +1 @@
+file.test- Run
UnifiedDiffReader.parseUnifiedDiff(new ByteArrayInputStream(raw.getBytes(StandardCharsets.UTF_8))); - You will get:
WARNING: >>> no rule matched
com.github.difflib.unifieddiff.UnifiedDiffParserException: expected data line not found
at com.github.difflib.unifieddiff.UnifiedDiffReader.parse(UnifiedDiffReader.java:145)
at com.github.difflib.unifieddiff.UnifiedDiffReader.parseUnifiedDiff(UnifiedDiffReader.java:205)
because this line is empty:
Expected behavior
Empty lines should not throw errors here according to my understanding.
System
- Java version 21
- Version [e.g. 4.15 (latest)]
Metadata
Metadata
Assignees
Labels
No labels