From c63abd50bfb43f3d9a6121e2c7634496b19bc957 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 10 Jun 2024 15:19:01 +0100 Subject: [PATCH] Simplify generics --- .../java/org/zwobble/mammoth/internal/docx/BodyXmlReader.java | 2 +- .../zwobble/mammoth/internal/docx/StatefulBodyXmlReader.java | 2 +- src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/zwobble/mammoth/internal/docx/BodyXmlReader.java b/src/main/java/org/zwobble/mammoth/internal/docx/BodyXmlReader.java index 4282bf6..83733eb 100644 --- a/src/main/java/org/zwobble/mammoth/internal/docx/BodyXmlReader.java +++ b/src/main/java/org/zwobble/mammoth/internal/docx/BodyXmlReader.java @@ -29,7 +29,7 @@ public BodyXmlReader( this.fileReader = fileReader; } - public ReadResult readElements(Iterable nodes) { + public ReadResult readElements(Iterable nodes) { return new StatefulBodyXmlReader( styles, numbering, diff --git a/src/main/java/org/zwobble/mammoth/internal/docx/StatefulBodyXmlReader.java b/src/main/java/org/zwobble/mammoth/internal/docx/StatefulBodyXmlReader.java index ae495d5..eaaa36c 100644 --- a/src/main/java/org/zwobble/mammoth/internal/docx/StatefulBodyXmlReader.java +++ b/src/main/java/org/zwobble/mammoth/internal/docx/StatefulBodyXmlReader.java @@ -253,7 +253,7 @@ private InternalResult> readRunStyle(XmlElementLike properties) return readStyle(properties, "w:rStyle", "Run", styles::findCharacterStyleById); } - ReadResult readElements(Iterable nodes) { + ReadResult readElements(Iterable nodes) { return ReadResult.flatMap(lazyFilter(nodes, XmlElement.class), this::readElement); } diff --git a/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java index 429b280..47d4d16 100644 --- a/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java +++ b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java @@ -301,7 +301,7 @@ public void contentOfDeletedParagraphIsPreprendedToNextParagraph() { map(), map() ); - List bodyXml = list( + List bodyXml = list( element("w:p", list( element("w:pPr", list( element("w:pStyle", map("w:val", "Heading1")),