This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pdfbox-jbig2.git


The following commit(s) were added to refs/heads/master by this push:
     new 743b79b  PDFBOX-5660: remove exception that isn't thrown
743b79b is described below

commit 743b79beddd076475734c6f31b0f45cd0ebb49ac
Author: Tilman Hausherr <[email protected]>
AuthorDate: Fri May 15 15:55:28 2026 +0200

    PDFBOX-5660: remove exception that isn't thrown
---
 .../apache/pdfbox/jbig2/segments/EndOfStripe.java  |  3 +--
 .../pdfbox/jbig2/segments/SymbolDictionary.java    | 12 ++++-------
 .../apache/pdfbox/jbig2/segments/TextRegion.java   | 25 ++++++++++------------
 .../apache/pdfbox/jbig2/JBIG2ImageReaderDemo.java  |  3 +--
 4 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/src/main/java/org/apache/pdfbox/jbig2/segments/EndOfStripe.java 
b/src/main/java/org/apache/pdfbox/jbig2/segments/EndOfStripe.java
index f9fa66a..ff02827 100644
--- a/src/main/java/org/apache/pdfbox/jbig2/segments/EndOfStripe.java
+++ b/src/main/java/org/apache/pdfbox/jbig2/segments/EndOfStripe.java
@@ -34,8 +34,7 @@ public class EndOfStripe implements SegmentData
     private SubInputStream subInputStream;
     private int lineNumber;
 
-    private void parseHeader()
-            throws IOException, IntegerMaxValueException, 
InvalidHeaderValueException
+    private void parseHeader() throws IOException
     {
         lineNumber = (int) (subInputStream.readBits(32) & 0xffffffff);
     }
diff --git 
a/src/main/java/org/apache/pdfbox/jbig2/segments/SymbolDictionary.java 
b/src/main/java/org/apache/pdfbox/jbig2/segments/SymbolDictionary.java
index ab1f740..392e658 100644
--- a/src/main/java/org/apache/pdfbox/jbig2/segments/SymbolDictionary.java
+++ b/src/main/java/org/apache/pdfbox/jbig2/segments/SymbolDictionary.java
@@ -318,7 +318,7 @@ public class SymbolDictionary implements Dictionary
         }
     }
 
-    private void checkInput() throws InvalidHeaderValueException
+    private void checkInput()
     {
         if (isHuffmanEncoded)
         {
@@ -547,7 +547,7 @@ public class SymbolDictionary implements Dictionary
     private void decodeHeightClassBitmap(final Bitmap 
heightClassCollectiveBitmap,
             final int heightClassFirstSymbol, final int heightClassHeight,
             final int[] newSymbolsWidths)
-            throws IntegerMaxValueException, InvalidHeaderValueException, 
IOException
+            throws IOException
     {
 
         for (int i = heightClassFirstSymbol; i < amountOfDecodedSymbols; i++)
@@ -727,13 +727,10 @@ public class SymbolDictionary implements Dictionary
      * @param rdy The y-offset for refinement.
      * @throws IllegalStateException if {@code cx} or {@code 
arithmeticDecoder} is not initialized.
      * @throws IOException if an I/O error occurs during decoding.
-     * @throws InvalidHeaderValueException if an invalid header value is 
encountered.
-     * @throws IntegerMaxValueException if an integer value exceeds its 
maximum allowed value
-     * 
      */
     private void decodeNewSymbols(final int symWidth, final int hcHeight, 
final Bitmap ibo,
             final int rdx, final int rdy)
-            throws IOException, InvalidHeaderValueException, 
IntegerMaxValueException
+            throws IOException
     {
         // cx (bitmap coding context) must already be initialized via 
ensureBitmapCxInitialized()
         // in getDictionary(). It is required by 
GenericRefinementRegionDecodingProcedure.decode
@@ -1033,8 +1030,7 @@ public class SymbolDictionary implements Dictionary
         }
     }
 
-    private HuffmanTable getUserTable(final int tablePosition)
-            throws InvalidHeaderValueException, IOException
+    private HuffmanTable getUserTable(final int tablePosition) throws 
IOException
     {
         int tableCounter = 0;
 
diff --git a/src/main/java/org/apache/pdfbox/jbig2/segments/TextRegion.java 
b/src/main/java/org/apache/pdfbox/jbig2/segments/TextRegion.java
index 1b62e75..690973e 100644
--- a/src/main/java/org/apache/pdfbox/jbig2/segments/TextRegion.java
+++ b/src/main/java/org/apache/pdfbox/jbig2/segments/TextRegion.java
@@ -391,7 +391,7 @@ public class TextRegion implements Region
         }
     }
 
-    private long decodeStripT() throws IOException, InvalidHeaderValueException
+    private long decodeStripT() throws IOException
     {
 
         long stripT = 0;
@@ -433,8 +433,7 @@ public class TextRegion implements Region
         return stripT * -(sbStrips);
     }
 
-    private void decodeSymbolInstances()
-            throws IOException, InvalidHeaderValueException, 
IntegerMaxValueException
+    private void decodeSymbolInstances() throws IOException
     {
 
         long stripT = decodeStripT();
@@ -531,7 +530,7 @@ public class TextRegion implements Region
         return (dT * sbStrips);
     }
 
-    private long decodeDfS() throws IOException, InvalidHeaderValueException
+    private long decodeDfS() throws IOException
     {
         if (isHuffmanEncoded)
         {
@@ -554,7 +553,7 @@ public class TextRegion implements Region
         }
     }
 
-    private long decodeIdS() throws IOException, InvalidHeaderValueException
+    private long decodeIdS() throws IOException
     {
         if (isHuffmanEncoded)
         {
@@ -635,8 +634,7 @@ public class TextRegion implements Region
         return 0;
     }
 
-    private Bitmap decodeIb(long r, long id)
-            throws IOException, InvalidHeaderValueException, 
IntegerMaxValueException
+    private Bitmap decodeIb(long r, long id) throws IOException
     {
         Bitmap ib;
 
@@ -699,7 +697,7 @@ public class TextRegion implements Region
         return ib;
     }
 
-    private long decodeRdw() throws IOException, InvalidHeaderValueException
+    private long decodeRdw() throws IOException
     {
         if (isHuffmanEncoded)
         {
@@ -740,7 +738,7 @@ public class TextRegion implements Region
         }
     }
 
-    private long decodeRdh() throws IOException, InvalidHeaderValueException
+    private long decodeRdh() throws IOException
     {
         if (isHuffmanEncoded)
         {
@@ -785,7 +783,7 @@ public class TextRegion implements Region
         }
     }
 
-    private long decodeRdx() throws IOException, InvalidHeaderValueException
+    private long decodeRdx() throws IOException
     {
         if (isHuffmanEncoded)
         {
@@ -834,7 +832,7 @@ public class TextRegion implements Region
         }
     }
 
-    private long decodeRdy() throws IOException, InvalidHeaderValueException
+    private long decodeRdy() throws IOException
     {
         if (isHuffmanEncoded)
         {
@@ -888,7 +886,7 @@ public class TextRegion implements Region
         }
     }
 
-    private long decodeSymInRefSize() throws IOException, 
InvalidHeaderValueException
+    private long decodeSymInRefSize() throws IOException
     {
         if (sbHuffRSize == 0)
         {
@@ -1017,8 +1015,7 @@ public class TextRegion implements Region
         amountOfSymbols = symbols.size();
     }
 
-    private HuffmanTable getUserTable(final int tablePosition)
-            throws InvalidHeaderValueException, IOException
+    private HuffmanTable getUserTable(final int tablePosition) throws 
IOException
     {
         int tableCounter = 0;
 
diff --git a/src/test/java/org/apache/pdfbox/jbig2/JBIG2ImageReaderDemo.java 
b/src/test/java/org/apache/pdfbox/jbig2/JBIG2ImageReaderDemo.java
index 8a6d7b9..4d39e13 100644
--- a/src/test/java/org/apache/pdfbox/jbig2/JBIG2ImageReaderDemo.java
+++ b/src/test/java/org/apache/pdfbox/jbig2/JBIG2ImageReaderDemo.java
@@ -23,7 +23,6 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
 import java.net.URISyntaxException;
 import java.net.URL;
 
@@ -70,7 +69,7 @@ public class JBIG2ImageReaderDemo
     }
 
     public static void main(String[] args)
-            throws InterruptedException, InvocationTargetException, 
IOException, JBIG2Exception, URISyntaxException
+            throws IOException, JBIG2Exception, URISyntaxException
     {
         URL imageUrl = 
JBIG2ImageReaderDemo.class.getResource("/images/042_1.jb2");
         new JBIG2ImageReaderDemo(imageUrl.toURI().getPath(), 1).show();

Reply via email to