You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jt...@apache.org on 2020/07/01 11:56:47 UTC
[netbeans] branch master updated: Using StringBuffer as msgs are
accessed from multiple threads
This is an automated email from the ASF dual-hosted git repository.
jtulach pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 40584ec Using StringBuffer as msgs are accessed from multiple threads
new 58bd5a3 Merging in usage of StringBuffer instead of StringBuilder as discovered during #2225 review
40584ec is described below
commit 40584ecfeb52cfd7f8f5bc619ad97ad968303819
Author: Jaroslav Tulach <ja...@oracle.com>
AuthorDate: Wed Jul 1 09:57:03 2020 +0200
Using StringBuffer as msgs are accessed from multiple threads
---
nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ConfigureProxy.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ConfigureProxy.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ConfigureProxy.java
index 4d96452..eb71bb9 100644
--- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ConfigureProxy.java
+++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ConfigureProxy.java
@@ -26,8 +26,6 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
@@ -84,7 +82,7 @@ public final class ConfigureProxy extends Task {
static URLConnection openConnection(Task task, final URL url, URI[] connectedVia) throws IOException {
final URLConnection[] conn = { null };
final List<Exception> errs = new CopyOnWriteArrayList<>();
- final StringBuilder msgs = new StringBuilder();
+ final StringBuffer msgs = new StringBuffer();
final CountDownLatch connected = new CountDownLatch(1);
ExecutorService connectors = Executors.newFixedThreadPool(3);
connectors.submit(() -> {
@@ -125,7 +123,7 @@ public final class ConfigureProxy extends Task {
final URLConnection[] conn, URI[] connectedVia,
final CountDownLatch connected,
final List<Exception> errs,
- StringBuilder msgs
+ StringBuffer msgs
) {
String httpProxy = System.getenv(propertyName);
msgs.append("\n[" + propertyName + "] set to " + httpProxy);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists