@Internal public class MemberFieldRewriter extends Object implements CodeRewriter
Before
public class Example {
int a;
long b;
int c = 1;
long d = 2;
public void myFun() {
System.out.println(a + b + c + d);
}
}
After
public class Example {
int[] rewrite$0 = new int[2];
long[] rewrite$1 = new long[2];
{
rewrite$0[1] = 1;
rewrite$1[1] = 2;
}
public void myFun() {
System.out.println(rewrite$0[0] + rewrite$1[0] + rewrite$0[1] + rewrite$1[1]);
}
}
Constructor and Description |
---|
MemberFieldRewriter(String code,
int maxFieldCount) |
public MemberFieldRewriter(String code, int maxFieldCount)
public String rewrite()
rewrite
in interface CodeRewriter
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.