diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2020-04-05 20:50:40 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2020-04-05 20:50:40 +0000 |
commit | 65ccec11cb7d8806b0da6c9c8dead6706621c1e7 (patch) | |
tree | c9c5b71607dd745fbea0bc80cbfdd6244ca5cea0 /src/java/org/apache/poi/POIReadOnlyDocument.java | |
parent | d8421364646f195743625f24848205f999cdca53 (diff) | |
download | poi-65ccec11cb7d8806b0da6c9c8dead6706621c1e7.tar.gz poi-65ccec11cb7d8806b0da6c9c8dead6706621c1e7.zip |
Sonar fixes - String literals should not be duplicated
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1876163 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/POIReadOnlyDocument.java')
-rw-r--r-- | src/java/org/apache/poi/POIReadOnlyDocument.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/java/org/apache/poi/POIReadOnlyDocument.java b/src/java/org/apache/poi/POIReadOnlyDocument.java index dfe44d42f7..5f250704db 100644 --- a/src/java/org/apache/poi/POIReadOnlyDocument.java +++ b/src/java/org/apache/poi/POIReadOnlyDocument.java @@ -26,7 +26,7 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; /** * This holds the common functionality for all read-only * POI Document classes, i.e. ones which don't support writing. - * + * * @since POI 3.15 beta 3 */ public abstract class POIReadOnlyDocument extends POIDocument { @@ -39,29 +39,33 @@ public abstract class POIReadOnlyDocument extends POIDocument { /** * Note - writing is not yet supported for this file format, sorry. - * + * * @throws IllegalStateException If you call the method, as writing is not supported */ @Override public void write() { - throw new IllegalStateException("Writing is not yet implemented for this Document Format"); + notImplemented(); } /** * Note - writing is not yet supported for this file format, sorry. - * + * * @throws IllegalStateException If you call the method, as writing is not supported */ @Override public void write(File file) { - throw new IllegalStateException("Writing is not yet implemented for this Document Format"); + notImplemented(); } /** * Note - writing is not yet supported for this file format, sorry. - * + * * @throws IllegalStateException If you call the method, as writing is not supported */ @Override public void write(OutputStream out) { + notImplemented(); + } + + private static void notImplemented() { throw new IllegalStateException("Writing is not yet implemented for this Document Format"); } } |