diff options
Diffstat (limited to 'poi-scratchpad')
3 files changed, 13 insertions, 6 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hpbf/model/qcbits/QCPLCBit.java b/poi-scratchpad/src/main/java/org/apache/poi/hpbf/model/qcbits/QCPLCBit.java index a8a12a9ea0..cd039cf36d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hpbf/model/qcbits/QCPLCBit.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hpbf/model/qcbits/QCPLCBit.java @@ -207,7 +207,7 @@ public abstract class QCPLCBit extends QCBit { * of the text area that this applies to. */ public static class Type12 extends QCPLCBit { - private String[] hyperlinks; + private final String[] hyperlinks; private static final int oneStartsAt = 0x4c; private static final int twoStartsAt = 0x68; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java index 61ed4da168..f31df61f38 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java @@ -214,6 +214,7 @@ public final class HWPFDocument extends HWPFDocumentCore { * @param istream The InputStream that contains the Word document. * @throws IOException If there is an unexpected IOException from the passed * in InputStream. + * @throws org.apache.poi.EmptyFileException If the given stream is empty */ public HWPFDocument(InputStream istream) throws IOException { //do Ole stuff 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 3e51fb8f5d..46939beec4 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 @@ -46,6 +46,7 @@ import org.apache.poi.sl.usermodel.BaseTestSlideShow; import org.apache.poi.sl.usermodel.PlaceholderDetails; import org.apache.poi.util.LocaleUtil; import org.junit.jupiter.api.Test; +import org.opentest4j.AssertionFailedError; /** * Tests for TextRuns @@ -603,16 +604,21 @@ public final class TestTextRun { .mapToInt(r -> ((DateTimeMCAtom)r).getIndex()).toArray(); assertArrayEquals(expFormatId, actFormatId); - List<HSLFShapePlaceholderDetails> phs = shapes.stream().map(HSLFSimpleShape::getPlaceholderDetails).collect(Collectors.toList()); + List<HSLFShapePlaceholderDetails> phs = + shapes.stream().map(HSLFSimpleShape::getPlaceholderDetails).collect(Collectors.toList()); for (Map.Entry<Locale,String[]> me : formats.entrySet()) { LocaleUtil.setUserLocale(me.getKey()); - // refresh internal members - phs.forEach(PlaceholderDetails::getPlaceholder); + try { + // 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).toArray(String[]::new); + assertArrayEquals(me.getValue(), actDate); + } catch (AssertionFailedError e) { + throw new AssertionFailedError("While handling local " + me.getKey()); + } } } finally { LocaleUtil.resetUserLocale(); |