Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2016-04-21 18:35:17 -0400
committerSergey Prigogin2016-04-21 23:17:03 -0400
commit2356a29c7015ad41cfe8630568a1c3ab5c3c5eb3 (patch)
tree834bab2dc4a5287047b0ee87c96903bb9d4f20e2 /toolchains
parente901d4a7d4298b999365288b6b5b8d018b75ae73 (diff)
downloadorg.eclipse.cdt-2356a29c7015ad41cfe8630568a1c3ab5c3c5eb3.tar.gz
org.eclipse.cdt-2356a29c7015ad41cfe8630568a1c3ab5c3c5eb3.tar.xz
org.eclipse.cdt-2356a29c7015ad41cfe8630568a1c3ab5c3c5eb3.zip
Bug 492200 - Replace StringBuffer with StringBuilder
There are many opportunities for replacing `StringBuffer` with `StringBuilder` provided that the type isn't visible from the public API and is used only in internal methods. Replace these where appropriate. Change-Id: Ic2f50c5b6f3c3a4eae301bb3b40fb6faed235f79 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'toolchains')
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/board/ArduinoPlatform.java4
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/launch/ArduinoLaunchConfigurationDelegate.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/board/ArduinoPlatform.java b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/board/ArduinoPlatform.java
index 313d479fd3..55eaddf405 100644
--- a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/board/ArduinoPlatform.java
+++ b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/board/ArduinoPlatform.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
+ * Copyright (c) 2015, 2016 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -172,7 +172,7 @@ public class ArduinoPlatform {
try (BufferedReader reader = new BufferedReader(
new FileReader(getInstallPath().resolve("platform.txt").toFile()))) { //$NON-NLS-1$
// There are regex's here and need to preserve the \'s
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (String line = reader.readLine(); line != null; line = reader.readLine()) {
buffer.append(line.replace("\\", "\\\\")); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append('\n');
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/launch/ArduinoLaunchConfigurationDelegate.java b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/launch/ArduinoLaunchConfigurationDelegate.java
index 62d40b43b4..b3b1d36188 100644
--- a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/launch/ArduinoLaunchConfigurationDelegate.java
+++ b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/launch/ArduinoLaunchConfigurationDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
+ * Copyright (c) 2015, 2016 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -85,7 +85,7 @@ public class ArduinoLaunchConfigurationDelegate extends LaunchConfigurationTarge
monitor);
String[] uploadCmd = arduinoConfig.getUploadCommand(arduinoTarget.getPortName());
- StringBuffer cmdStr = new StringBuffer(uploadCmd[0]);
+ StringBuilder cmdStr = new StringBuilder(uploadCmd[0]);
for (int i = 1; i < uploadCmd.length; ++i) {
cmdStr.append(' ');
cmdStr.append(uploadCmd[i]);

Back to the top