forked from jacoco/jacoco
-
Notifications
You must be signed in to change notification settings - Fork 1
filtering JAVAC.SYNTHMETH
marchof edited this page Jan 10, 2013
·
2 revisions
Synthetic methods have no direct correspondence in source code and are created by the compiler for technical reasons. For example synthetic bridge methods are required to give inner classes access to private members of the containing class.
Synthetic methods are completely removed.
class Outer {
private int counter;
private class Inner {
private void inc() {
counter++;
}
}
}
There are two ways to mark synthetic methods:
-
ACC_SYNTHETIC
bit in theaccess_flags
field of the method -
Synthetic
method attribute