Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace StringBuffers with StringBuilders #291

Merged
merged 1 commit into from
Nov 15, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public boolean importData(JComponent comp, Transferable t) {
if (flavor != null) {
Reader reader = flavor.getReaderForText(t);
char[] buf = new char[512];
StringBuffer b = new StringBuffer();
StringBuilder b = new StringBuilder();
int count;
// excise excess NUL characters (bug in firefox, java
// or my code, not sure which). someone got the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public boolean importData(JComponent comp, Transferable t) {
if (flavor != null) {
Reader reader = flavor.getReaderForText(t);
char[] buf = new char[512];
StringBuffer b = new StringBuffer();
StringBuilder b = new StringBuilder();
int count;
// excise excess NUL characters (bug in firefox,
// java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ public void insertString (int offset, String str, AttributeSet a)
balloon.hide();
}
}
StringBuffer buffer =
new StringBuffer(FilteredTextField.this.getText());
StringBuilder buffer =
new StringBuilder(FilteredTextField.this.getText());
if (offset >= 0 && offset <= buffer.length()) {
buffer.insert(offset, str);
String strBuf = buffer.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ public EnumKey(HKEY hKey, int dwIndex) {
* @return A environment block
*/
public static String getEnvironmentBlock(Map<String, String> environment) {
StringBuffer out = new StringBuffer();
StringBuilder out = new StringBuilder();
for (Entry<String, String> entry : environment.entrySet()) {
if (entry.getValue() != null) {
out.append(entry.getKey() + "=" + entry.getValue() + "\0");
Expand Down
2 changes: 1 addition & 1 deletion src/com/sun/jna/Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ private static String getSignature(Class cls) {

// No String.replace available in 1.4
static String replace(String s1, String s2, String str) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
while (true) {
int idx = str.indexOf(s1);
if (idx == -1) {
Expand Down
2 changes: 1 addition & 1 deletion test/com/sun/jna/NativeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class NativeTest extends TestCase {
private static final String UNICODE = "[\u0444]";

public void testLongStringGeneration() {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
final int MAX = Platform.isWindowsCE() ? 200000 : 2000000;
for (int i=0;i < MAX;i++) {
buf.append('a');
Expand Down