Author: tilman
Date: Wed Mar 25 15:44:19 2026
New Revision: 1932550
Log:
PDFBOX-5660: sonar fix
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/compress/COSWriterCompressionPool.java
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/compress/COSWriterCompressionPool.java
==============================================================================
---
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/compress/COSWriterCompressionPool.java
Wed Mar 25 15:44:15 2026 (r1932549)
+++
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/compress/COSWriterCompressionPool.java
Wed Mar 25 15:44:19 2026 (r1932550)
@@ -16,7 +16,6 @@
*/
package org.apache.pdfbox.pdfwriter.compress;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -68,10 +67,8 @@ public class COSWriterCompressionPool
*
* @param document The document, that shall be compressed.
* @param parameters The configuration of the compression operations, that
shall be applied.
- * @throws IOException Shall be thrown if a compression operation failed.
*/
public COSWriterCompressionPool(PDDocument document, CompressParameters
parameters)
- throws IOException
{
this.document = document;
this.parameters = parameters != null ? parameters : new
CompressParameters();
@@ -171,9 +168,8 @@ public class COSWriterCompressionPool
* Attempts to find yet unregistered streams and dictionaries in the given
structure.
*
* @param cosBaseList A list of objects to be added for compressing.
- * @throws IOException Shall be thrown, if adding failed.
*/
- private List<COSBase> addStructure(List<COSBase> cosBaseList) throws
IOException
+ private List<COSBase> addStructure(List<COSBase> cosBaseList)
{
List<COSBase> cosBaseListNext = new ArrayList<>();
for (COSBase cosBase : cosBaseList)
@@ -188,9 +184,8 @@ public class COSWriterCompressionPool
* Attempts to find yet unregistered streams and dictionaries in the given
structure.
*
* @param current The object to be added for compressing.
- * @throws IOException Shall be thrown, if compressing the object failed.
*/
- private List<COSBase> addStructure(COSBase current) throws IOException
+ private List<COSBase> addStructure(COSBase current)
{
COSBase base = current;
if (current instanceof COSStream
@@ -225,9 +220,8 @@ public class COSWriterCompressionPool
* @param elements collection of all elements of a COSDictionary/COSArray.
*
* @return a collection containing the relevant objects within the given
Collection.
- * @throws IOException if something went wrong.
*/
- private List<COSBase> getElements(Collection<? extends COSBase> elements)
throws IOException
+ private List<COSBase> getElements(Collection<? extends COSBase> elements)
{
List<COSBase> relevantElements = new ArrayList<>();
for (COSBase element : elements)