Skip to content

Commit

Permalink
PDFBOX-5809: recursion protection only needed for objects that allow …
Browse files Browse the repository at this point in the history
…recursion (change needed because identical integers weren't displayed)

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1917471 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed May 2, 2024
1 parent 5e22117 commit 636c4ec
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1365,9 +1365,9 @@ private static String getDictionaryString(COSBase base, List<COSBase> objs) thro
// avoid endless recursion
return "hash:" + base.hashCode();
}
objs.add(base);
if (base instanceof COSDictionary)
{
objs.add(base);
StringBuilder sb = new StringBuilder("COSDictionary{");
for (Map.Entry<COSName, COSBase> x : ((COSDictionary) base).entrySet())
{
Expand All @@ -1389,6 +1389,7 @@ private static String getDictionaryString(COSBase base, List<COSBase> objs) thro
}
if (base instanceof COSArray)
{
objs.add(base);
StringBuilder sb = new StringBuilder("COSArray{");
for (COSBase x : (COSArray) base)
{
Expand All @@ -1400,6 +1401,7 @@ private static String getDictionaryString(COSBase base, List<COSBase> objs) thro
}
if (base instanceof COSObject)
{
objs.add(base);
COSObject obj = (COSObject) base;
return "COSObject{"
+ getDictionaryString(
Expand Down

0 comments on commit 636c4ec

Please sign in to comment.