Skip to content

Commit

Permalink
TIKA-4311: refactor / simplify; replace deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
THausherr committed Sep 17, 2024
1 parent e9f1c82 commit c578618
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,13 @@ private static void findPages(COSBase kidsObj, List<ObjectRef> pageRefs) {
COSBase kidbase = ((COSObject) kid).getObject();
if (kidbase instanceof COSDictionary) {
COSDictionary dict = (COSDictionary) kidbase;
if (dict.containsKey(COSName.TYPE) &&
COSName.PAGE.equals(dict.getCOSName(COSName.TYPE))) {
pageRefs.add(new ObjectRef(((COSObject) kid).getObjectNumber(),
((COSObject) kid).getGenerationNumber()));
if (COSName.PAGE.equals(dict.getCOSName(COSName.TYPE))) {
pageRefs.add(new ObjectRef(((COSObject) kid).getKey().getNumber(),
((COSObject) kid).getKey().getGeneration()));
continue;
}
if (((COSDictionary) kidbase).containsKey(COSName.KIDS)) {
findPages(((COSDictionary) kidbase).getDictionaryObject(COSName.KIDS), pageRefs);
if (dict.containsKey(COSName.KIDS)) {
findPages(dict.getDictionaryObject(COSName.KIDS), pageRefs);
}
}
}
Expand Down

0 comments on commit c578618

Please sign in to comment.