public static long getSerialVersionUID ( Class < ? extends Serializable > clazz ) { try { return clazz . getField ( "serialVersionUID" ) . getLong ( null ) ; } catch ( NoSuchFieldException | IllegalAccessException ex ) { // ignored. return 0 ; } }
Transpiled code that directly acccess the serialVersionUID field when reflection is stripped won t compile because this field is also stripped .