diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-09-14 01:32:10 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-09-14 01:32:10 +0000 |
commit | 7235ff9036b3ec74cf718d738410b0096a9afafb (patch) | |
tree | 15c7adb03f8cf5344a15d71cf2aabafe7ccb4427 /poi-scratchpad/src/main | |
parent | 59b16f025bf98cd411482243aa3601bdb8dbc722 (diff) | |
download | poi-7235ff9036b3ec74cf718d738410b0096a9afafb.tar.gz poi-7235ff9036b3ec74cf718d738410b0096a9afafb.zip |
try to use IllegalStateException instead of RuntimeException
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1904051 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src/main')
12 files changed, 12 insertions, 12 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusGDIImageRenderer.java b/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusGDIImageRenderer.java index 2d8f3b0e45..dfa4685fe1 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusGDIImageRenderer.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusGDIImageRenderer.java @@ -103,7 +103,7 @@ public class HemfPlusGDIImageRenderer extends BitmapImageRenderer { bOffs = new int[]{2, 1, 0}; break; default: - throw new RuntimeException("not yet implemented"); + throw new IllegalStateException("not yet implemented"); } ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusObject.java b/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusObject.java index 2553102d11..ebeb0f1d0f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusObject.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusObject.java @@ -205,7 +205,7 @@ public class HemfPlusObject { ) { other.linkContinuedObject(objectData); } else { - throw new RuntimeException("can't find previous record for continued record"); + throw new IllegalStateException("can't find previous record for continued record"); } } else { ctx.addPlusObjectTableEntry(this, getObjectId()); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hemf/usermodel/HemfEmbeddedIterator.java b/poi-scratchpad/src/main/java/org/apache/poi/hemf/usermodel/HemfEmbeddedIterator.java index 0faf461808..d6d2b536f4 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hemf/usermodel/HemfEmbeddedIterator.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hemf/usermodel/HemfEmbeddedIterator.java @@ -299,7 +299,7 @@ public class HemfEmbeddedIterator implements Iterator<HwmfEmbedded> { emb.setData(bos.toByteArray()); } catch (IOException e) { // TODO: throw appropriate exception - throw new RuntimeException(e); + throw new IllegalStateException(e); } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/TextPropCollection.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/TextPropCollection.java index de90c60c8d..814c82e788 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/TextPropCollection.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/TextPropCollection.java @@ -329,7 +329,7 @@ public class TextPropCollection implements GenericRecord, Duplicatable { public void setIndentLevel(short indentLevel) { if (textPropType == TextPropType.character) { - throw new RuntimeException("trying to set an indent on a character collection."); + throw new IllegalStateException("trying to set an indent on a character collection."); } this.indentLevel = indentLevel; } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFObjectShape.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFObjectShape.java index 2111d5387a..4739ddb907 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFObjectShape.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFObjectShape.java @@ -241,7 +241,7 @@ public final class HSLFObjectShape extends HSLFPictureShape implements ObjectSha public OutputStream updateObjectData(final Application application, final ObjectMetaData metaData) { final ObjectMetaData md = (application != null) ? application.getMetaData() : metaData; if (md == null) { - throw new RuntimeException("either application or metaData needs to be set"); + throw new IllegalStateException("either application or metaData needs to be set"); } // can't use UnsynchronizedByteArrayOutputStream here, because it's final diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java index 643463e191..52a0a962c3 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java @@ -278,7 +278,7 @@ public class MAPIMessage extends POIReadOnlyDocument { ); return rtf.getDataString(); } catch (IOException e) { - throw new RuntimeException("Shouldn't happen", e); + throw new IllegalStateException("Shouldn't happen", e); } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfMisc.java b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfMisc.java index dc307614ea..da669354df 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfMisc.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfMisc.java @@ -528,7 +528,7 @@ public class HwmfMisc { case BS_DIBPATTERN8X8: case BS_MONOPATTERN: case BS_PATTERN8X8: - throw new RuntimeException("pattern not supported"); + throw new IllegalStateException("pattern not supported"); } return size; } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfTernaryRasterOp.java b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfTernaryRasterOp.java index b9d9f7ed2b..dd5c7e0c80 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfTernaryRasterOp.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfTernaryRasterOp.java @@ -429,7 +429,7 @@ public enum HwmfTernaryRasterOp { stack[stackPnt++] = "all black"; break; default: - throw new RuntimeException("unknown cmd '"+c+"'."); + throw new IllegalStateException("unknown cmd '"+c+"'."); } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java index 0ac072ddd2..7098f2811d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java @@ -208,7 +208,7 @@ public class HwmfPicture implements Iterable<HwmfRecord>, GenericRecord { if (inner != null) { return inner; } - throw new RuntimeException("invalid wmf file - window records are incomplete."); + throw new IllegalStateException("invalid wmf file - window records are incomplete."); } /** diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/HWPFLister.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/HWPFLister.java index 55657f72b3..52ae97a3ed 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/HWPFLister.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/HWPFLister.java @@ -263,7 +263,7 @@ public final class HWPFLister { } } catch ( IOException e ) { - throw new RuntimeException( e ); + throw new IllegalStateException( e ); } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java index 9c8dc8b568..880c4e2d38 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java @@ -259,7 +259,7 @@ public final class WordExtractor implements POIOLE2TextExtractor { } catch (RuntimeException e) { throw e; } catch ( Exception exc ) { - throw new RuntimeException( exc ); + throw new IllegalStateException( exc ); } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmUtils.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmUtils.java index 2c30f29a01..bf3fd50c3e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmUtils.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmUtils.java @@ -116,7 +116,7 @@ public final class SprmUtils { break; default: //should never happen - throw new RuntimeException("Invalid sprm type"); + throw new IllegalStateException("Invalid sprm type"); } LittleEndian.putShort(sprm, 0, instruction); list.add(sprm); |