You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sd...@apache.org on 2021/05/31 14:30:33 UTC
[netbeans] branch master updated: Fixes NPE and potential lockup in
tests.
This is an automated email from the ASF dual-hosted git repository.
sdedic 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 1f6b584 Fixes NPE and potential lockup in tests.
new 392357a Merge pull request #2982 from sdedic/sdedic/ioprovider-npes
1f6b584 is described below
commit 1f6b584576c608d65596d41a7c2a04822f5f3687
Author: Svata Dedic <sv...@oracle.com>
AuthorDate: Mon May 31 11:15:02 2021 +0200
Fixes NPE and potential lockup in tests.
---
.../src/org/openide/execution/ExecutionEngine.java | 3 ++-
platform/openide.io/src/org/openide/windows/IOProvider.java | 7 ++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/platform/openide.execution/src/org/openide/execution/ExecutionEngine.java b/platform/openide.execution/src/org/openide/execution/ExecutionEngine.java
index 6655b84..9ed92b5 100644
--- a/platform/openide.execution/src/org/openide/execution/ExecutionEngine.java
+++ b/platform/openide.execution/src/org/openide/execution/ExecutionEngine.java
@@ -127,13 +127,14 @@ public abstract class ExecutionEngine extends Object {
private RequestProcessor.Task task;
private int resultValue;
private final String name;
- private InputOutput io;
+ private final InputOutput io;
public ET(Runnable run, String name, InputOutput io) {
super(run);
this.originalLookup = Lookup.getDefault();
this.resultValue = resultValue;
this.name = name;
+ this.io = io;
task = RequestProcessor.getDefault().post(this);
}
diff --git a/platform/openide.io/src/org/openide/windows/IOProvider.java b/platform/openide.io/src/org/openide/windows/IOProvider.java
index 53f2f3f..fbd5f21 100644
--- a/platform/openide.io/src/org/openide/windows/IOProvider.java
+++ b/platform/openide.io/src/org/openide/windows/IOProvider.java
@@ -191,7 +191,12 @@ public abstract class IOProvider {
/** Fallback implementation. */
private static final class Trivial extends IOProvider {
- private static final Reader in = new BufferedReader(new InputStreamReader(System.in));
+ private static final Reader in = new BufferedReader(new InputStreamReader(System.in)) {
+ public void close() {
+ // do nothing, prevent blocking between System.in.read() and System.in.close();
+ }
+ };
+
private static final PrintStream out = System.out;
private static final PrintStream err = System.err;
---------------------------------------------------------------------
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