Skip to content

Commit fb9d27b

Browse files
committed
Simplify expression
1 parent e053c1e commit fb9d27b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

demoapp/src/main/java/org/cf/demoapp/java_io_PrintStream_println.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
import org.cf.smalivm.opcode.Op;
1010

1111
public class java_io_PrintStream_println extends MethodStateMethod implements UnknownValuesMethod {
12-
1312
public java_io_PrintStream_println() {
1413
super();
15-
1614
// Writing bytes over any kind of IO affects state outside of the VM.
1715
// Set the side effect level so the optimizer knows not to remove this method call.
1816
level = SideEffect.Level.STRONG;
@@ -23,10 +21,7 @@ protected void execute(VirtualMachine vm, Op op, MethodState mState) {
2321
// This is a virtual method, so register 0 contains a reference to an instance of Ljava/io/PrintStream;
2422
// Register 1 should have the string to print.
2523
HeapItem item = mState.peekParameter(1);
26-
Object value = item.getValue();
27-
String valueStr = (String) value;
28-
29-
System.out.println(valueStr);
24+
String value = (String) item.getValue();
25+
System.out.println(value);
3026
}
31-
3227
}

0 commit comments

Comments
 (0)