|
From: <zep...@us...> - 2007-01-18 16:35:26
|
Revision: 266
http://svn.sourceforge.net/pzfilereader/?rev=266&view=rev
Author: zepernick
Date: 2007-01-18 08:34:24 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
correct findbug string concat, changed to StringBuffer
Modified Paths:
--------------
trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractDelimiterPZParser.java
Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractDelimiterPZParser.java
===================================================================
--- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractDelimiterPZParser.java 2007-01-18 14:31:48 UTC (rev 265)
+++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractDelimiterPZParser.java 2007-01-18 16:34:24 UTC (rev 266)
@@ -248,7 +248,7 @@
protected String fetchNextRecord(final BufferedReader br, final char qual,
final char delim) throws IOException{
String line = null;
- String lineData = "";
+ StringBuffer lineData = new StringBuffer();
boolean processingMultiLine = false;
while ((line = br.readLine()) != null) {
@@ -273,7 +273,7 @@
// check to see if we have reached the end of the linebreak in
// the record
- final String trimmedLineData = lineData.trim();
+ final String trimmedLineData = lineData.toString().trim();
if (processingMultiLine && trimmedLineData.length() > 0) {
// need to do one last check here. it is possible that the "
// could be part of the data
@@ -284,11 +284,11 @@
// it is safe to assume we have reached the end of the
// line break
processingMultiLine = false;
- lineData += "\r\n" + line;
+ lineData.append("\r\n").append(line);
} else {
// check to see if this is the last line of the record
// looking for a qualifier followed by a delimiter
- lineData += "\r\n" + line;
+ lineData.append("\r\n").append(line);
boolean qualiFound = false;
for (int i = 0; i < chrArry.length; i++) {
if (qualiFound) {
@@ -323,7 +323,7 @@
}
} else {
// throw the line into lineData var.
- lineData += line;
+ lineData.append(line);
if (processingMultiLine) {
continue; // if we are working on a multiline rec, get
// the data on the next line
@@ -338,6 +338,6 @@
return null;
}
- return lineData;
+ return lineData.toString();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|