Package org.apache.flink.table.codesplit
Class DeclarationRewriter
java.lang.Object
org.apache.flink.table.codesplit.DeclarationRewriter
- All Implemented Interfaces:
CodeRewriter
Extract and rename local variables into member variables.
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 Summary
Constructors -
Method Summary
-
Constructor Details
-
DeclarationRewriter
-
-
Method Details
-
rewrite
- Specified by:
rewritein interfaceCodeRewriter
-