Skip to content

Commit

Permalink
Merge branch 'release_branch_DEVSIX-5576' into master-rc
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Sep 29, 2021
2 parents a4927a6 + 60fd8f4 commit 26e4c05
Show file tree
Hide file tree
Showing 47 changed files with 229 additions and 257 deletions.
84 changes: 82 additions & 2 deletions LICENSE.TXT → NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ SLF4j under the MIT license:
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------

Logback: the reliable, generic, fast and flexible logging framework.
Copyright (C) 1999-2012, QOS.ch. All rights reserved.
Expand All @@ -30,6 +33,10 @@ Logback: the reliable, generic, fast and flexible logging framework.
the terms of the Eclipse Public License v1.0 as published by
the Eclipse Foundation ( http://www.eclipse.org/legal/epl-v10.html )


--------------------------------------------------------------------------


Bouncy Castle APIs under the following license:
Copyright (c) 2000 - 2016 The Legion of the Bouncy Castle Inc.
(https://www.bouncycastle.org)
Expand All @@ -40,6 +47,10 @@ Bouncy Castle APIs under the following license:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------


DOM4j under the following license:
Redistribution and use of this software and associated documentation ("Software"), with or without modification, are permitted provided that the following conditions are met:

Expand All @@ -52,5 +63,74 @@ DOM4j under the following license:
THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.

XML-Commons under the Apache License Version 2.0 ( http://www.apache.org/licenses/LICENSE-2.0.html )

--------------------------------------------------------------------------

XML-Commons under the Apache License Version 2.0 ( http://www.apache.org/licenses/LICENSE-2.0.html )


--------------------------------------------------------------------------

Silk icon set 1.3 under the following license:

_________________________________________
Mark James
http://www.famfamfam.com/lab/icons/silk/
_________________________________________

This work is licensed under a
Creative Commons Attribution 2.5 License.
[ http://creativecommons.org/licenses/by/2.5/ ]

This means you may use it for any purpose,
and make any changes you like.
All I ask is that you include a link back
to this page in your credits.

Are you using this icon set? Send me an email
(including a link or picture if available) to
mjames at gmail dot com

Any other questions about this icon set please
contact mjames at gmail dot com

--------------------------------------------

ICU4J under the following license:


COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)

Copyright © 1991-2020 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.

Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.

THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.

For transitive 3rd-party dependencies through ICU4J, see https://raw.githubusercontent.com/unicode-org/icu/46861a5c78367f7c720559243d6bf96146ee070f/icu4c/LICENSE
13 changes: 9 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.itextpdf</groupId>
<artifactId>root</artifactId>
<version>7.1.16</version>
<version>7.2.0</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -86,6 +86,11 @@
<artifactId>dom4j</artifactId>
<version>${dom4j.version}</version>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>69.1</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>pdftest</artifactId>
Expand Down Expand Up @@ -133,9 +138,9 @@
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<descriptors>
<descriptor>src/assembly/jar-with-dependencies-excluded-poms.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
<archive>
<manifest>
Expand Down
31 changes: 31 additions & 0 deletions src/assembly/jar-with-dependencies-excluded-poms.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
<id>jar-with-dependencies-excluded-poms</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<unpackOptions>
<excludes>
<exclude>**/io/pom.xml</exclude>
<exclude>**/io/pom.properties</exclude>
<exclude>**/kernel/pom.xml</exclude>
<exclude>**/kernel/pom.properties</exclude>
<exclude>**/logback-classic/pom.xml</exclude>
<exclude>**/logback-classic/pom.properties</exclude>
<exclude>**/logback-core/pom.xml</exclude>
<exclude>**/logback-core/pom.properties</exclude>
<exclude>**/slf4j-api/pom.xml</exclude>
<exclude>**/slf4j-api/pom.properties</exclude>
</excludes>
</unpackOptions>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
4 changes: 2 additions & 2 deletions src/main/java/com/itextpdf/rups/Rups.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This file is part of the iText (R) project.
*/
package com.itextpdf.rups;

import com.itextpdf.kernel.Version;
import com.itextpdf.kernel.actions.data.ITextCoreProductData;
import com.itextpdf.kernel.utils.CompareTool;
import com.itextpdf.rups.controller.RupsController;
import com.itextpdf.rups.view.icons.FrameIconUtil;
Expand Down Expand Up @@ -101,7 +101,7 @@ public void run() {

static void initApplication(JFrame frame, RupsController controller, final int onCloseOperation) {
// title bar
frame.setTitle("iText RUPS " + Version.getInstance().getVersion());
frame.setTitle("iText RUPS " + ITextCoreProductData.getInstance().getVersion());
frame.setIconImages(FrameIconUtil.loadFrameIcons());
frame.setDefaultCloseOperation(onCloseOperation);
// the content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ This file is part of the iText (R) project.

import com.itextpdf.kernel.pdf.*;
import com.itextpdf.kernel.utils.CompareTool;
import com.itextpdf.kernel.utils.objectpathitems.ArrayPathItem;
import com.itextpdf.kernel.utils.objectpathitems.DictPathItem;
import com.itextpdf.kernel.utils.objectpathitems.IndirectPathItem;
import com.itextpdf.kernel.utils.objectpathitems.LocalPathItem;
import com.itextpdf.kernel.utils.objectpathitems.ObjectPath;
import com.itextpdf.rups.event.*;
import com.itextpdf.rups.io.listeners.PdfTreeNavigationListener;
import com.itextpdf.rups.model.ObjectLoader;
Expand Down Expand Up @@ -382,25 +387,25 @@ protected void highlightChanges(CompareTool.CompareResult compareResult) {
if (compareResult == null) {
return;
}
for (CompareTool.ObjectPath path : compareResult.getDifferences().keySet()) {
for (ObjectPath path : compareResult.getDifferences().keySet()) {
PdfObjectTreeNode currentNode;
Stack<CompareTool.ObjectPath.IndirectPathItem> indirectPath = (Stack<CompareTool.ObjectPath.IndirectPathItem>) path.getIndirectPath().clone();
Stack<IndirectPathItem> indirectPath = (Stack<IndirectPathItem>) path.getIndirectPath();
while (!indirectPath.empty()) {
CompareTool.ObjectPath.IndirectPathItem indirectPathItem = indirectPath.pop();
IndirectPathItem indirectPathItem = indirectPath.pop();
currentNode = nodes.getNode(indirectPathItem.getOutObject().getObjNumber());
if (currentNode != null) {
nodes.expandNode(currentNode);
}
}
Stack<CompareTool.ObjectPath.LocalPathItem> localPath = (Stack<CompareTool.ObjectPath.LocalPathItem>) path.getLocalPath().clone();
Stack<LocalPathItem> localPath = (Stack<LocalPathItem>) path.getLocalPath();
currentNode = nodes.getNode(path.getBaseOutObject().getObjNumber());
while (!localPath.empty() && currentNode != null) {
nodes.expandNode(currentNode);
CompareTool.ObjectPath.LocalPathItem item = localPath.pop();
if (item instanceof CompareTool.ObjectPath.DictPathItem) {
currentNode = nodes.getChildNode(currentNode, ((CompareTool.ObjectPath.DictPathItem) item).getKey());
} else if (item instanceof CompareTool.ObjectPath.ArrayPathItem) {
int index = ((CompareTool.ObjectPath.ArrayPathItem) item).getIndex();
LocalPathItem item = localPath.pop();
if (item instanceof DictPathItem) {
currentNode = nodes.getChildNode(currentNode, ((DictPathItem) item).getKey());
} else if (item instanceof ArrayPathItem) {
int index = ((ArrayPathItem) item).getIndex();
currentNode = (PdfObjectTreeNode) currentNode.getChildAt(index);
}
}
Expand Down
18 changes: 7 additions & 11 deletions src/main/java/com/itextpdf/rups/controller/RupsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ This file is part of the iText (R) project.
*/
package com.itextpdf.rups.controller;

import com.itextpdf.kernel.PdfException;
import com.itextpdf.kernel.Version;
import com.itextpdf.kernel.actions.data.ITextCoreProductData;
import com.itextpdf.kernel.exceptions.PdfException;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfReader;
import com.itextpdf.kernel.utils.CompareTool;
Expand Down Expand Up @@ -304,10 +304,10 @@ public void loadRawContent(byte[] contents, String fileName, File directory, boo
startObjectLoader();
if (!pluginMode) {
String directoryPath = directory == null ? "" : directory.getCanonicalPath() + File.separator;
ownedFrame.setTitle("iText RUPS - " + directoryPath + fileName + " - " + Version.getInstance().getVersion());
ownedFrame.setTitle("iText RUPS - " + directoryPath + fileName + " - " + ITextCoreProductData.getInstance().getVersion());
}
readerController.getParser().setDocument(pdfFile.getPdfDocument());
} catch (IOException | PdfException | com.itextpdf.io.IOException ioe) {
} catch (IOException | PdfException | com.itextpdf.io.exceptions.IOException ioe) {
JOptionPane.showMessageDialog(masterComponent, ioe.getMessage(), "Dialog", JOptionPane.ERROR_MESSAGE);
}
}
Expand Down Expand Up @@ -384,7 +384,7 @@ public void saveFile(File file) {

JOptionPane.showMessageDialog(masterComponent, "File saved.", "Dialog", JOptionPane.INFORMATION_MESSAGE);
loadFile(file, false);
} catch (PdfException | IOException | com.itextpdf.io.IOException de) {
} catch (PdfException | IOException | com.itextpdf.io.exceptions.IOException de) {
JOptionPane.showMessageDialog(masterComponent, de.getMessage(), "Dialog", JOptionPane.ERROR_MESSAGE);
} finally {
try {
Expand All @@ -409,7 +409,7 @@ public void closeRoutine() {
docToClose.close();
}
if (!pluginMode) {
ownedFrame.setTitle("iText RUPS " + Version.getInstance().getVersion());
ownedFrame.setTitle("iText RUPS " + ITextCoreProductData.getInstance().getVersion());
}
readerController.getParser().setDocument(null);
}
Expand All @@ -423,11 +423,7 @@ public CompareTool.CompareResult compareWithDocument(PdfDocument document) {
LoggerHelper.warn(LoggerMessages.COMPARED_DOCUMENT_IS_CLOSED, getClass());
} else {
CompareTool compareTool = new CompareTool().setCompareByContentErrorsLimit(100).disableCachedPagesComparison();
try {
return compareTool.compareByCatalog(getPdfFile().getPdfDocument(), document);
} catch (IOException e) {
LoggerHelper.warn(LoggerMessages.COMPARING_ERROR, e, getClass());
}
return compareTool.compareByCatalog(getPdfFile().getPdfDocument(), document);
}
return null;
}
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/com/itextpdf/rups/io/FileChooserAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,4 @@ public void actionPerformed(ActionEvent evt) {
protected abstract int showDialog();

protected abstract RupsEvent getEvent();

/**
* A serial version UID.
*/
private static final long serialVersionUID = 2225830878098387118L;

}
7 changes: 3 additions & 4 deletions src/main/java/com/itextpdf/rups/io/TextAreaOutputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ public class TextAreaOutputStream extends OutputStream {
* Constructs a TextAreaOutputStream.
*
* @param text the text area to which we want to write.
* @throws IOException an exception
*/
public TextAreaOutputStream(JTextArea text) throws IOException {
public TextAreaOutputStream(JTextArea text) {
this.text = text;
clear();
}
Expand All @@ -79,7 +78,7 @@ public void clear() {
* @see java.io.OutputStream#write(int)
*/
@Override
public void write(int i) throws IOException {
public void write(int i) {
byte[] b = {(byte) i};
write(b, 0, 1);
}
Expand All @@ -88,7 +87,7 @@ public void write(int i) throws IOException {
* @see java.io.OutputStream#write(byte[], int, int)
*/
@Override
public void write(byte[] b, int off, int len) throws IOException {
public void write(byte[] b, int off, int len) {
String snippet = new String(b, off, len, StandardCharsets.UTF_8);
text.append(snippet);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This file is part of the iText (R) project.
package com.itextpdf.rups.model;

import com.itextpdf.io.util.IntHashtable;
import com.itextpdf.kernel.PdfException;
import com.itextpdf.kernel.exceptions.PdfException;
import com.itextpdf.kernel.pdf.*;

import java.lang.reflect.Field;
Expand Down
Loading

0 comments on commit 26e4c05

Please sign in to comment.