-
Notifications
You must be signed in to change notification settings - Fork 1.1k
filtering JAVAC.SYNTHCLASS
marchof edited this page Jan 10, 2013
·
9 revisions
Synthetic class have no direct relationship to the classes defined in source code and are created by the compiler for technical reasons. For example switches on enums result in a synthetic class which holds a "switch map" to map the actual enum ordinals (which may change if the enum is modified) to constants int values which are used in the lookupswitch
instruction.
Synthetic classes are completely removed.
switch (orientation) {
case NORTH: ... ;
case EAST: ... ;
case SOUTH: ... ;
case WEST: ... ;
}
There are two ways to mark synthetic classes:
-
ACC_SYNTHETIC
bit in theaccess_flags
field -
Synthetic
class attribute