aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java1
-rw-r--r--poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestTextRun.java12
2 files changed, 10 insertions, 3 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java
index 3542fbf264..f46c145f15 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java
@@ -59,6 +59,7 @@ public final class LocaleDateFormat {
VI_VN(LocaleID.VI_VN, 0, 1, 2, 3, 5, 6, 10, 11, 12, 13, 14, 15, 16),
HI_IN(LocaleID.HI_IN, 1, 2, 3, 5, 7, 11, 13, 0, 1, 5, 10, 11, 14),
SYR_SY(LocaleID.SYR_SY, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
+ DE_DE(LocaleID.DE_DE, "dd.MM.yyyy", 1, 3, 2, 5, 9, 10, 11, 12, 15, 16, 13, 14, 4, 6, 7, 8),
NO_MAP(LocaleID.INVALID_O, 0, 1, 3, 2, 5, 9, 10, 11, 12, 15, 16, 13, 14, 4, 6, 7, 8)
;
diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestTextRun.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestTextRun.java
index a361ad650b..bff3775218 100644
--- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestTextRun.java
+++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestTextRun.java
@@ -21,6 +21,7 @@ import static org.apache.poi.hslf.HSLFTestDataSamples.getSlideShow;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
@@ -471,7 +472,7 @@ public final class TestTextRun {
// as getShapes()
List<HSLFShape> sh = slide.getShapes();
assertEquals(2, sh.size());
- assertTrue(sh.get(0) instanceof HSLFTextBox);
+ assertInstanceOf(HSLFTextBox.class, sh.get(0));
HSLFTextBox box1 = (HSLFTextBox) sh.get(0);
assertSame(run1, box1.getTextParagraphs());
HSLFTextBox box2 = (HSLFTextBox) sh.get(1);
@@ -613,8 +614,13 @@ public final class TestTextRun {
// refresh internal members
phs.forEach(PlaceholderDetails::getPlaceholder);
- String[] actDate = phs.stream().map(PlaceholderDetails::getDateFormat).map(ldt::format).toArray(String[]::new);
- assertArrayEquals(me.getValue(), actDate,
+ String[] actDate = phs.stream().map(PlaceholderDetails::getDateFormat).map(ldt::format).
+ // JDK 23 removes the COMPAT/JRE locale provider and this changes blanks to some non-breaking space
+ map(s -> s.replace(" ", " ")).
+ toArray(String[]::new);
+ String[] values = me.getValue();
+
+ assertArrayEquals(values, actDate,
"While handling local " + me.getKey());
}
} finally {