Author: dgolovin
Date: 2011-09-14 14:33:11 -0400 (Wed, 14 Sep 2011)
New Revision: 34739
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeCompletedExpression.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/ColorFormatController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/MultiPropertyValue.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/StyleAttribute.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/StyleProperty.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/handler/FormatHandler.java
Log:
Code cleanup: replaced StringBuffer to StringBuilder
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -2060,20 +2060,20 @@
gridData.horizontalSpan = 2;
tipControlHeaderText.setLayoutData(gridData);
- StringBuffer tempAttr = new StringBuffer();
- StringBuffer tempValue = new StringBuffer();
+ StringBuilder tempAttr = new StringBuilder();
+ StringBuilder tempValue = new StringBuilder();
if (attributeString.length >= 2) {
for (int i = 1; i < attributeString.length; i++) {
buffer = attributeString[i].split(" ", 2); //$NON-NLS-1$
if (i == 1) {
- tempAttr.append(buffer[0] + " "); //$NON-NLS-1$
+ tempAttr.append(buffer[0]).append(" "); //$NON-NLS-1$
tempValue
- .append((buffer.length >= 2 ? buffer[1] : "") + " ");
//$NON-NLS-1$ //$NON-NLS-2$
+ .append((buffer.length >= 2 ? buffer[1] : "")).append(" ");
//$NON-NLS-1$ //$NON-NLS-2$
} else {
- tempAttr.append("\n" + buffer[0] + " "); //$NON-NLS-1$
//$NON-NLS-2$
+ tempAttr.append("\n").append(buffer[0]).append(" ");
//$NON-NLS-1$ //$NON-NLS-2$
tempValue
- .append(" \n" + (buffer.length >= 2 ? buffer[1] : "") +
" "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ .append(" \n").append(buffer.length >= 2 ? buffer[1] :
"").append(" "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -1150,7 +1150,7 @@
linkNode.setAttribute(VpeTemplateManager.ATTR_LINK_EXT, ext_val);
BufferedReader in = null;
try {
- StringBuffer styleText = new StringBuffer(EMPTY_STRING);
+ StringBuilder styleText = new StringBuilder(EMPTY_STRING);
URL url = new URL((new Path(href_val)).toOSString());
String fileName = url.getFile();
in = new BufferedReader(new FileReader(
@@ -1404,7 +1404,7 @@
}
private String getTooltip(Element sourceElement) {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append(sourceElement.getNodeName());
NamedNodeMap attrs = sourceElement.getAttributes();
int len = attrs.getLength();
@@ -1414,15 +1414,15 @@
}
int valueLength = attrs.item(i).getNodeValue().length();
if (valueLength > 30) {
- StringBuffer temp = new StringBuffer();
- temp.append(attrs.item(i).getNodeValue().substring(0, 15)
- + " ... " //$NON-NLS-1$
- + attrs.item(i).getNodeValue().substring(
+ StringBuilder temp = new StringBuilder();
+ temp.append(attrs.item(i).getNodeValue().substring(0, 15))
+ .append(" ... ") //$NON-NLS-1$
+ .append(attrs.item(i).getNodeValue().substring(
valueLength - 15, valueLength));
- buffer.append("\n" + attrs.item(i).getNodeName() + ": " + temp);
//$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("\n").append(attrs.item(i).getNodeName()).append(":
").append(temp); //$NON-NLS-1$ //$NON-NLS-2$
} else {
- buffer.append("\n" + attrs.item(i).getNodeName() + ": "
//$NON-NLS-1$ //$NON-NLS-2$
- + attrs.item(i).getNodeValue());
+ buffer.append("\n").append(attrs.item(i).getNodeName()).append(":
") //$NON-NLS-1$ //$NON-NLS-2$
+ .append(attrs.item(i).getNodeValue());
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -81,7 +81,7 @@
try {
//TODO Max Areshkau This code was leave here for versions compatibility BEGIN
Node attrBorder = element.getAttributeNode(VpeTemplateManager.ATTR_ANY_BORDER);
- StringBuffer stringBuffer = new StringBuffer();
+ StringBuilder stringBuffer = new StringBuilder();
if (attrBorder != null) {
stringBuffer.append("border-width:").append(attrBorder.getNodeValue())
//$NON-NLS-1$
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -740,7 +740,7 @@
anyData.setChildren(ATTR_VALUE_YES.equalsIgnoreCase(attr.getNodeValue()));
}
//TODO Max Areshkau This code was leave here for versions compatibility BEGIN
- StringBuffer stringBuffer = new StringBuffer();
+ StringBuilder stringBuffer = new StringBuilder();
Node attrDisplay = anyNode.getAttributeNode(ATTR_ANY_DISPLAY);
if (attr != null) {
stringBuffer.append(HTML.ATTR_DISPLAY).append(":") //$NON-NLS-1$
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -167,7 +167,7 @@
}
File fileToOpen = new File(fullResourcePath);
if (fileToOpen.exists() && fileToOpen.isFile()) {
- StringBuffer fileContent = new StringBuffer();
+ StringBuilder fileContent = new StringBuilder();
try {
BufferedReader input = new BufferedReader(new FileReader(fileToOpen));
try {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeCompletedExpression.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeCompletedExpression.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeCompletedExpression.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -25,7 +25,7 @@
if (expressions == null) {
return new VpeValue(""); //$NON-NLS-1$
}
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
for (int i = 0; i < expressions.length; i++) {
result.append(expressions[i].exec(pageContext, sourceNode).stringValue());
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/ColorFormatController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/ColorFormatController.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/ColorFormatController.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -48,7 +48,7 @@
if (newColor == null) {
return;
}
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
String c = Integer.toHexString(newColor.red);
if(c.length()<2) {
buf.append("0"); //$NON-NLS-1$
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/MultiPropertyValue.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/MultiPropertyValue.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/MultiPropertyValue.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -116,7 +116,7 @@
* @see java.lang.Object#toString()
*/
public String toString() {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for(int i=0; i<tokens.size(); i++) {
buffer.append(tokens.get(i).toString());
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/StyleAttribute.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/StyleAttribute.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/StyleAttribute.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -227,7 +227,7 @@
* @see java.lang.Object#toString()
*/
public String toString() {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for(int i=0; i<tokens.size(); i++) {
buffer.append(tokens.get(i).toString());
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/StyleProperty.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/StyleProperty.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/css/StyleProperty.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -160,7 +160,7 @@
* @see java.lang.Object#toString()
*/
public String toString() {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for(int i=0; i<tokens.size(); i++) {
buffer.append(tokens.get(i).toString());
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/handler/FormatHandler.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/handler/FormatHandler.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/handler/FormatHandler.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -134,7 +134,7 @@
}
protected String getNodeBody(Node node) {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
NodeList list = node.getChildNodes();
for(int i=0; i<list.getLength(); i++) {
Node child = list.item(i);
@@ -186,7 +186,7 @@
IDocument document = viewer.getDocument();
// Append start part - "<tag";
- StringBuffer resultNode = new StringBuffer("<").append(newName);
//$NON-NLS-1$
+ StringBuilder resultNode = new StringBuilder("<").append(newName);
//$NON-NLS-1$
int endOffcet = element.getEndOffset() - element.getStartOffset();
int startEndOffcet = element.getStartEndOffset() - element.getStartOffset();
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2011-09-14
18:30:39 UTC (rev 34738)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2011-09-14
18:33:11 UTC (rev 34739)
@@ -93,7 +93,7 @@
private static final Mozilla mozilla;
static {
- StringBuffer buff = new StringBuffer();
+ StringBuilder buff = new StringBuilder();
buff.append("org.mozilla.xulrunner.") //$NON-NLS-1$
.append(Platform.getWS()).append('.')
.append(Platform.getOS());
Show replies by date