diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2014-10-25 21:32:03 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2014-10-25 21:32:03 +0000 |
commit | c828d44a84b1407179014a49fd391b82023e70c5 (patch) | |
tree | 4debb5e7df8a838ef5d534c24a7ed7451b609a05 /src/examples | |
parent | 1499778fddf4134b429bf346efc6e67998dc8c2e (diff) | |
download | poi-c828d44a84b1407179014a49fd391b82023e70c5.tar.gz poi-c828d44a84b1407179014a49fd391b82023e70c5.zip |
house keeping - fixes for sonarqube blockers
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1634255 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
3 files changed, 20 insertions, 10 deletions
diff --git a/src/examples/src/org/apache/poi/hwpf/Word2Forrest.java b/src/examples/src/org/apache/poi/hwpf/Word2Forrest.java index 82d3a8a230..0b8570226a 100644 --- a/src/examples/src/org/apache/poi/hwpf/Word2Forrest.java +++ b/src/examples/src/org/apache/poi/hwpf/Word2Forrest.java @@ -17,17 +17,26 @@ package org.apache.poi.hwpf; -import org.apache.poi.hwpf.HWPFDocument; -import org.apache.poi.hwpf.usermodel.*; -import org.apache.poi.hwpf.model.*; - -import java.io.*; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.io.Writer; + +import org.apache.poi.hwpf.model.StyleDescription; +import org.apache.poi.hwpf.model.StyleSheet; +import org.apache.poi.hwpf.usermodel.CharacterRun; +import org.apache.poi.hwpf.usermodel.Paragraph; +import org.apache.poi.hwpf.usermodel.Range; public final class Word2Forrest { Writer _out; HWPFDocument _doc; + @SuppressWarnings("unused") public Word2Forrest(HWPFDocument doc, OutputStream stream) throws IOException, UnsupportedEncodingException { @@ -216,7 +225,7 @@ public final class Word2Forrest new Word2Forrest(new HWPFDocument(new FileInputStream(args[0])), out); out.close(); } - catch (Throwable t) + catch (Exception t) { t.printStackTrace(); } diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/POIBrowser.java b/src/examples/src/org/apache/poi/poifs/poibrowser/POIBrowser.java index 7dc487db85..7624ed2125 100644 --- a/src/examples/src/org/apache/poi/poifs/poibrowser/POIBrowser.java +++ b/src/examples/src/org/apache/poi/poifs/poibrowser/POIBrowser.java @@ -41,6 +41,7 @@ import org.apache.poi.poifs.eventfilesystem.POIFSReader; * @author Rainer Klute <a * href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de></a> */ +@SuppressWarnings("serial") public class POIBrowser extends JFrame { @@ -99,7 +100,7 @@ public class POIBrowser extends JFrame { System.err.println(filename + ": " + ex); } - catch (Throwable t) + catch (Exception t) { System.err.println("Unexpected exception while reading \"" + filename + "\":"); diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java b/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java index 34b59eb458..a5435c0ce3 100644 --- a/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java +++ b/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java @@ -70,7 +70,7 @@ public class TreeReaderListener implements POIFSReaderListener * <p>Maps filenames and POI document paths to their associated * tree nodes.</p> */ - protected Map pathToNode; + protected Map<Object,MutableTreeNode> pathToNode; /** * <p>The name of the file this {@link TreeReaderListener} @@ -99,7 +99,7 @@ public class TreeReaderListener implements POIFSReaderListener { this.filename = filename; this.rootNode = rootNode; - pathToNode = new HashMap(15); // Should be a reasonable guess. + pathToNode = new HashMap<Object,MutableTreeNode>(15); // Should be a reasonable guess. } @@ -146,7 +146,7 @@ public class TreeReaderListener implements POIFSReaderListener d = new DocumentDescriptor(event.getName(), event.getPath(), is, nrOfBytes); } - catch (Throwable t) + catch (Exception t) { System.err.println ("Unexpected exception while processing " + |