From commits-return-14047-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Sun Jan 6 12:14:18 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8BF6A180636 for ; Sun, 6 Jan 2019 12:14:17 +0100 (CET) Received: (qmail 13689 invoked by uid 500); 6 Jan 2019 11:14:16 -0000 Mailing-List: contact commits-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list commits@pdfbox.apache.org Received: (qmail 13680 invoked by uid 99); 6 Jan 2019 11:14:16 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Jan 2019 11:14:16 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 1CBF63A0F6C for ; Sun, 6 Jan 2019 11:14:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1850540 - /pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java Date: Sun, 06 Jan 2019 11:14:16 -0000 To: commits@pdfbox.apache.org From: tilman@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20190106111416.1CBF63A0F6C@svn01-us-west.apache.org> Author: tilman Date: Sun Jan 6 11:14:15 2019 New Revision: 1850540 URL: http://svn.apache.org/viewvc?rev=1850540&view=rev Log: PDFBOX-4003: get the whole tree map with the new convenience method when testing (not relevant in results here because these are flat, but used by myself to check the integrity of files prior to future tests) Modified: pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java Modified: pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java?rev=1850540&r1=1850539&r2=1850540&view=diff ============================================================================== --- pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java (original) +++ pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PDFMergerUtilityTest.java Sun Jan 6 11:14:15 2019 @@ -525,19 +525,12 @@ public class PDFMergerUtilityTest extend * * @param document */ - void checkWithNumberTree(PDDocument document) + void checkWithNumberTree(PDDocument document) throws IOException { PDDocumentCatalog documentCatalog = document.getDocumentCatalog(); PDNumberTreeNode parentTree = documentCatalog.getStructureTreeRoot().getParentTree(); - COSDictionary parentTreeDict = parentTree.getCOSObject(); - COSArray numArray = (COSArray) parentTreeDict.getDictionaryObject(COSName.NUMS); - Set keySet = new HashSet(); - for (int i = 0; i < numArray.size(); i += 2) - { - int key = numArray.getInt(i); - assertTrue(key >= 0); - keySet.add(key); - } + Map numberTreeAsMap = PDFMergerUtility.getNumberTreeAsMap(parentTree); + Set keySet = numberTreeAsMap.keySet(); PDAcroForm acroForm = documentCatalog.getAcroForm(); if (acroForm != null) {