Add field access condition override example
This commit is contained in:
parent
7ed39dc319
commit
c6cd8a4e15
@ -1,20 +1,24 @@
|
||||
import dev.w1zzrd.asm.InjectClass;
|
||||
import dev.w1zzrd.asm.Inject;
|
||||
import dev.w1zzrd.asm.Merger;
|
||||
|
||||
@InjectClass(value = MergeTest.class)
|
||||
public class MergeInject implements Runnable {
|
||||
|
||||
// Dummy field
|
||||
String s;
|
||||
|
||||
@Inject
|
||||
public String test(){
|
||||
System.out.println(Merger.field("s"));
|
||||
System.out.println(s);
|
||||
return "Modified";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Inject
|
||||
public void run() {
|
||||
for (int i = 0; i < 5; ++i)
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
s = s + "!";
|
||||
System.out.println(test());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
public class MergeTest {
|
||||
|
||||
private String s = "Hello";
|
||||
private final String s;
|
||||
|
||||
|
||||
public MergeTest(){
|
||||
|
||||
s = "Hello";
|
||||
}
|
||||
|
||||
public MergeTest(String s) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user