It is very difficult to find the root cause without code. However, I can write an artificial test case when the Java compiler will create synthetic methods, even if I just changed the body of the method:
public class Test { static class Inner { private void getPrivate(int i) { Thread.dumpStack(); } private void getPrivate() { Thread.dumpStack(); } } public static void main(String[] args) { Inner inner = new Inner(); inner.getPrivate(0); inner.getPrivate(); } }
This effect is due to the synthetic access method $ 000 that javac generates to access a private member of the Inner class.
javac Test.java javap -c -private Test\$Inner
... static void access$000(edu.Test$Inner, int); Code: 0: aload_0 1: iload_1 2: invokespecial #2
Reorder the two methods basically:
public static void main(String[] args) { Inner inner = new Inner(); inner.getPrivate(); inner.getPrivate(0); }
As a result, the compiler changed the signature methods.
... static void access$000(edu.Test$Inner); Code: 0: aload_0 1: invokespecial #2
From the point of view of HotSwap, this change is prohibited because the signature of the access$000 method has been changed.
Ivan
source share