public class DeclarationRewriter extends Object implements CodeRewriter
This rewriter only deals with functions without return values. Functions with return values
should have been converted by ReturnValueRewriter
.
Before
public class Example {
public void myFun1(int[] arr) {
int a = 1;
for (int b : arr) {
System.out.println(b);
}
}
public void myFun2() {
int a = 2;
}
}
After
public class Example {
int a;
int local$0;
int local$1;
public void myFun1(int[] arr) {
a = 1;
for (int b : arr) {
local$0 = b;
System.out.println(local$0);
}
}
public void myFun2() {
local$1 = 2;
}
}
Constructor and Description |
---|
DeclarationRewriter(String code,
int maxMethodLength) |
public DeclarationRewriter(String code, int maxMethodLength)
public String rewrite()
rewrite
in interface CodeRewriter
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.