public final class jdk.internal.org.jline.utils.ExecHelper
minor version: 0
major version: 59
flags: flags: (0x0031) ACC_PUBLIC, ACC_FINAL, ACC_SUPER
this_class: jdk.internal.org.jline.utils.ExecHelper
super_class: java.lang.Object
{
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljdk/internal/org/jline/utils/ExecHelper;
public static java.lang.String exec(boolean, java.lang.String[]);
descriptor: (Z[Ljava/lang/String;)Ljava/lang/String;
flags: (0x0089) ACC_PUBLIC, ACC_STATIC, ACC_VARARGS
Code:
stack=5, locals=5, args_size=2
start local 0 start local 1 0: aload 1
invokestatic java.util.Objects.requireNonNull:(Ljava/lang/Object;)Ljava/lang/Object;
pop
1: iconst_2
anewarray java.lang.Object
dup
iconst_0
2: ldc "Running: "
aastore
dup
iconst_1
aload 1
aastore
invokestatic jdk.internal.org.jline.utils.Log.trace:([Ljava/lang/Object;)V
3: new java.lang.ProcessBuilder
dup
aload 1
invokespecial java.lang.ProcessBuilder.<init>:([Ljava/lang/String;)V
astore 2
start local 2 4: iload 0
ifeq 6
5: aload 2
getstatic java.lang.ProcessBuilder$Redirect.INHERIT:Ljava/lang/ProcessBuilder$Redirect;
invokevirtual java.lang.ProcessBuilder.redirectInput:(Ljava/lang/ProcessBuilder$Redirect;)Ljava/lang/ProcessBuilder;
pop
6: StackMap locals: java.lang.ProcessBuilder
StackMap stack:
aload 2
invokevirtual java.lang.ProcessBuilder.start:()Ljava/lang/Process;
astore 3
start local 3 7: aload 3
invokestatic jdk.internal.org.jline.utils.ExecHelper.waitAndCapture:(Ljava/lang/Process;)Ljava/lang/String;
astore 4
start local 4 8: iconst_2
anewarray java.lang.Object
dup
iconst_0
9: ldc "Result: "
aastore
dup
iconst_1
aload 4
aastore
invokestatic jdk.internal.org.jline.utils.Log.trace:([Ljava/lang/Object;)V
10: aload 3
invokevirtual java.lang.Process.exitValue:()I
ifeq 14
11: aload 4
ldc "\n"
invokevirtual java.lang.String.endsWith:(Ljava/lang/String;)Z
ifeq 13
12: aload 4
iconst_0
aload 4
invokevirtual java.lang.String.length:()I
iconst_1
isub
invokevirtual java.lang.String.substring:(II)Ljava/lang/String;
astore 4
13: StackMap locals: java.lang.Process java.lang.String
StackMap stack:
new java.io.IOException
dup
new java.lang.StringBuilder
dup
ldc "Error executing '"
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc " "
aload 1
invokestatic java.lang.String.join:(Ljava/lang/CharSequence;[Ljava/lang/CharSequence;)Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
ldc "': "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 4
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.io.IOException.<init>:(Ljava/lang/String;)V
athrow
14: StackMap locals:
StackMap stack:
aload 4
15: areturn
end local 4 end local 3 end local 2 16: StackMap locals: int java.lang.String[]
StackMap stack: java.lang.InterruptedException
astore 2
start local 2 17: new java.io.InterruptedIOException
dup
ldc "Command interrupted"
invokespecial java.io.InterruptedIOException.<init>:(Ljava/lang/String;)V
aload 2
invokevirtual java.io.InterruptedIOException.initCause:(Ljava/lang/Throwable;)Ljava/lang/Throwable;
checkcast java.io.IOException
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 18 0 redirectInput Z
0 18 1 cmd [Ljava/lang/String;
4 16 2 pb Ljava/lang/ProcessBuilder;
7 16 3 p Ljava/lang/Process;
8 16 4 result Ljava/lang/String;
17 18 2 e Ljava/lang/InterruptedException;
Exception table:
from to target type
1 15 16 Class java.lang.InterruptedException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
redirectInput
cmd final
public static java.lang.String waitAndCapture(java.lang.Process);
descriptor: (Ljava/lang/Process;)Ljava/lang/String;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=7, args_size=1
start local 0 0: new java.io.ByteArrayOutputStream
dup
invokespecial java.io.ByteArrayOutputStream.<init>:()V
astore 1
start local 1 1: aconst_null
astore 2
start local 2 2: aconst_null
astore 3
start local 3 3: aconst_null
astore 4
start local 4 4: aload 0
invokevirtual java.lang.Process.getInputStream:()Ljava/io/InputStream;
astore 2
5: goto 7
start local 5 6: StackMap locals: java.lang.Process java.io.ByteArrayOutputStream java.io.InputStream java.io.InputStream java.io.OutputStream int
StackMap stack:
aload 1
iload 5
invokevirtual java.io.ByteArrayOutputStream.write:(I)V
end local 5 7: StackMap locals:
StackMap stack:
aload 2
invokevirtual java.io.InputStream.read:()I
dup
istore 5
start local 5 8: iconst_m1
if_icmpne 6
9: aload 0
invokevirtual java.lang.Process.getErrorStream:()Ljava/io/InputStream;
astore 3
10: goto 12
11: StackMap locals: int
StackMap stack:
aload 1
iload 5
invokevirtual java.io.ByteArrayOutputStream.write:(I)V
12: StackMap locals:
StackMap stack:
aload 3
invokevirtual java.io.InputStream.read:()I
dup
istore 5
iconst_m1
if_icmpne 11
13: aload 0
invokevirtual java.lang.Process.getOutputStream:()Ljava/io/OutputStream;
astore 4
14: aload 0
invokevirtual java.lang.Process.waitFor:()I
pop
end local 5 15: goto 19
StackMap locals: java.lang.Process java.io.ByteArrayOutputStream java.io.InputStream java.io.InputStream java.io.OutputStream
StackMap stack: java.lang.Throwable
16: astore 6
iconst_3
anewarray java.io.Closeable
dup
iconst_0
17: aload 2
aastore
dup
iconst_1
aload 4
aastore
dup
iconst_2
aload 3
aastore
invokestatic jdk.internal.org.jline.utils.ExecHelper.close:([Ljava/io/Closeable;)V
18: aload 6
athrow
19: StackMap locals:
StackMap stack:
iconst_3
anewarray java.io.Closeable
dup
iconst_0
20: aload 2
aastore
dup
iconst_1
aload 4
aastore
dup
iconst_2
aload 3
aastore
invokestatic jdk.internal.org.jline.utils.ExecHelper.close:([Ljava/io/Closeable;)V
21: aload 1
invokevirtual java.io.ByteArrayOutputStream.toString:()Ljava/lang/String;
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 22 0 p Ljava/lang/Process;
1 22 1 bout Ljava/io/ByteArrayOutputStream;
2 22 2 in Ljava/io/InputStream;
3 22 3 err Ljava/io/InputStream;
4 22 4 out Ljava/io/OutputStream;
6 7 5 c I
8 15 5 c I
Exception table:
from to target type
4 16 16 any
Exceptions:
throws java.io.IOException, java.lang.InterruptedException
MethodParameters:
Name Flags
p
private static void close(java.io.Closeable[]);
descriptor: ([Ljava/io/Closeable;)V
flags: (0x008a) ACC_PRIVATE, ACC_STATIC, ACC_VARARGS
Code:
stack=2, locals=5, args_size=1
start local 0 0: aload 0
dup
astore 4
arraylength
istore 3
iconst_0
istore 2
goto 7
StackMap locals: java.io.Closeable[] top int int java.io.Closeable[]
StackMap stack:
1: aload 4
iload 2
aaload
astore 1
start local 1 2: aload 1
ifnull 6
3: aload 1
invokeinterface java.io.Closeable.close:()V
4: goto 6
StackMap locals: java.io.Closeable[] java.io.Closeable int int java.io.Closeable[]
StackMap stack: java.lang.Exception
5: pop
end local 1 6: StackMap locals: java.io.Closeable[] top int int java.io.Closeable[]
StackMap stack:
iinc 2 1
StackMap locals:
StackMap stack:
7: iload 2
iload 3
if_icmplt 1
8: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 closeables [Ljava/io/Closeable;
2 6 1 c Ljava/io/Closeable;
Exception table:
from to target type
3 4 5 Class java.lang.Exception
MethodParameters:
Name Flags
closeables final
}
SourceFile: "ExecHelper.java"
InnerClasses:
public abstract Redirect = java.lang.ProcessBuilder$Redirect of java.lang.ProcessBuilder