From e4a3574b778257693067e61733c8beafb3e9bf55 Mon Sep 17 00:00:00 2001 From: octoate Date: Thu, 19 Oct 2006 16:58:45 +0000 Subject: [PATCH] StringBuffer now resets every time the parser is called git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2817 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/parser/xls/xlsParser.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/plasma/parser/xls/xlsParser.java b/source/de/anomic/plasma/parser/xls/xlsParser.java index 3a0a6a676..c5a6df98e 100644 --- a/source/de/anomic/plasma/parser/xls/xlsParser.java +++ b/source/de/anomic/plasma/parser/xls/xlsParser.java @@ -64,8 +64,8 @@ import de.anomic.plasma.parser.ParserException; public class xlsParser extends AbstractParser implements Parser, HSSFListener { - //StringBuffer which contains the found strings after parsing the XLS file - private StringBuffer sbFoundStrings = new StringBuffer(); + //StringBuffer for parsed text + private StringBuffer sbFoundStrings = null; //sstrecord needed for event parsing private SSTRecord sstrec; @@ -106,6 +106,9 @@ public class xlsParser extends AbstractParser implements Parser, HSSFListener { String charset, InputStream source) throws ParserException, InterruptedException { try { + //generate new StringBuffer for parsing + sbFoundStrings = new StringBuffer(); + //create a new org.apache.poi.poifs.filesystem.Filesystem POIFSFileSystem poifs = new POIFSFileSystem(source); //get the Workbook (excel part) stream in a InputStream @@ -154,6 +157,8 @@ public class xlsParser extends AbstractParser implements Parser, HSSFListener { String errorMsg = "Unable to parse the xls document '" + location + "':" + e.getMessage(); this.theLogger.logSevere(errorMsg); throw new ParserException(errorMsg, location); + } finally { + sbFoundStrings = null; } }