aboutsummaryrefslogtreecommitdiffstats
path: root/poi-scratchpad/src
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2021-12-05 15:33:39 +0000
committerDominik Stadler <centic@apache.org>2021-12-05 15:33:39 +0000
commitd5538d24d83aa2feb67c57909211bfaae673c989 (patch)
tree5b60270a5bd0a74bffe17d96cb78af4bbda81e4b /poi-scratchpad/src
parenta3967026a38f10c70692ef28d4e32d7b33625ec0 (diff)
downloadpoi-d5538d24d83aa2feb67c57909211bfaae673c989.tar.gz
poi-d5538d24d83aa2feb67c57909211bfaae673c989.zip
Apply IDE suggestions, adjust tests, ...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895596 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src')
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hpbf/model/qcbits/QCPLCBit.java2
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java1
-rw-r--r--poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestTextRun.java16
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();