public boolean isTargetClassAndCurrentJvmTargetClassMatch ( ) { Class < ? > targetClassOnThisJVM ; // JVM에 Class가 없는 상황 try { targetClassOnThisJVM = Class . forName ( targetClassName ) ; } catch ( ClassNotFoundException e ) { log . error ( "target class " + targetClassName + " does not exist on this JVM." ) ; return false ; } ObjectStreamClass osc = ObjectStreamClass . lookup ( targetClassOnThisJVM ) ; // JVM Class가 Not serializable if ( osc == null ) { return false ; } return targetClassSerialVersionUID == osc . getSerialVersionUID ( ) ; }
Compare targetClassSerialVersionUID and current JVM s targetClass serialVersionUID . If they are same return true else return false .