Replaced StringBuffer with more efficient StringBuilder.

This commit is contained in:
Anthony Whitford
2015-09-12 19:50:43 -07:00
parent 0859eab2dc
commit 6e1c6b4bed
2 changed files with 4 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ public class SuppressionHandler extends DefaultHandler {
/** /**
* The current node text being extracted from the element. * The current node text being extracted from the element.
*/ */
private StringBuffer currentText; private StringBuilder currentText;
/** /**
* Handles the start element event. * Handles the start element event.
@@ -100,7 +100,7 @@ public class SuppressionHandler extends DefaultHandler {
@Override @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
currentAttributes = attributes; currentAttributes = attributes;
currentText = new StringBuffer(); currentText = new StringBuilder();
if (SUPPRESS.equals(qName)) { if (SUPPRESS.equals(qName)) {
rule = new SuppressionRule(); rule = new SuppressionRule();
final String base = currentAttributes.getValue("base"); final String base = currentAttributes.getValue("base");

View File

@@ -100,7 +100,7 @@ public class PomHandler extends DefaultHandler {
/** /**
* The current node text being extracted from the element. * The current node text being extracted from the element.
*/ */
private StringBuffer currentText; private StringBuilder currentText;
/** /**
* Handles the start element event. * Handles the start element event.
@@ -113,7 +113,7 @@ public class PomHandler extends DefaultHandler {
*/ */
@Override @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
currentText = new StringBuffer(); currentText = new StringBuilder();
stack.push(qName); stack.push(qName);
if (LICENSE.equals(qName)) { if (LICENSE.equals(qName)) {
license = new License(); license = new License();