浏览代码

Bug 66425: Avoid a ClassCastException found via oss-fuzz

Add exception details and fix expected exceptions to make tests run again

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1911503 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_2_4
Dominik Stadler 9 个月前
父节点
当前提交
a8b31c37a6

+ 1
- 1
poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java 查看文件

@@ -286,7 +286,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
}
}
} catch (ClassCastException e) {
throw new IllegalArgumentException("Relation and type of document-part did not match, had relation " + relation + " and type of document-part: " + p.getClass());
throw new IllegalArgumentException("Relation and type of document-part did not match, had relation " + relation + " and type of document-part: " + p.getClass(), e);
}
}
initHyperlinks();

+ 1
- 1
poi-scratchpad/src/main/java/org/apache/poi/hsmf/datatypes/Chunks.java 查看文件

@@ -251,7 +251,7 @@ public final class Chunks implements ChunkGroupWithProperties {
allChunks.computeIfAbsent(prop, k -> new ArrayList<>());
allChunks.get(prop).add(chunk);
} catch (ClassCastException e) {
throw new IllegalArgumentException("Property and type of chunk did not match, had property " + prop + " and type of chunk: " + chunk.getClass());
throw new IllegalArgumentException("Property and type of chunk did not match, had property " + prop + " and type of chunk: " + chunk.getClass(), e);
}
}


二进制
test-data/spreadsheet/stress.xls 查看文件


正在加载...
取消
保存