@ -1440,7 +1440,7 @@ public abstract class GeneratedMessageLite<
} catch ( ClassNotFoundException e ) {
throw new RuntimeException ( "Unable to find proto buffer class: " + messageClassName , e ) ;
} catch ( NoSuchFieldException e ) {
return readResolveFallback ( ) ;
throw new RuntimeException ( "Unable to find DEFAULT_INSTANCE in " + messageClassName , e ) ;
} catch ( SecurityException e ) {
throw new RuntimeException ( "Unable to call DEFAULT_INSTANCE in " + messageClassName , e ) ;
} catch ( IllegalAccessException e ) {
@ -1450,33 +1450,6 @@ public abstract class GeneratedMessageLite<
}
}
/ * *
* @deprecated from v3 . 0 . 0 - beta - 3 + , for compatibility with v2 . 5 . 0 and v2 . 6 . 1 generated code .
* /
@Deprecated
private Object readResolveFallback ( ) throws ObjectStreamException {
try {
Class < ? > messageClass = resolveMessageClass ( ) ;
java . lang . reflect . Field defaultInstanceField =
messageClass . getDeclaredField ( "defaultInstance" ) ;
defaultInstanceField . setAccessible ( true ) ;
MessageLite defaultInstance = ( MessageLite ) defaultInstanceField . get ( null ) ;
return defaultInstance . newBuilderForType ( )
. mergeFrom ( asBytes )
. buildPartial ( ) ;
} catch ( ClassNotFoundException e ) {
throw new RuntimeException ( "Unable to find proto buffer class: " + messageClassName , e ) ;
} catch ( NoSuchFieldException e ) {
throw new RuntimeException ( "Unable to find defaultInstance in " + messageClassName , e ) ;
} catch ( SecurityException e ) {
throw new RuntimeException ( "Unable to call defaultInstance in " + messageClassName , e ) ;
} catch ( IllegalAccessException e ) {
throw new RuntimeException ( "Unable to call parsePartialFrom" , e ) ;
} catch ( InvalidProtocolBufferException e ) {
throw new RuntimeException ( "Unable to understand proto buffer" , e ) ;
}
}
private Class < ? > resolveMessageClass ( ) throws ClassNotFoundException {
return messageClass ! = null ? messageClass : Class . forName ( messageClassName ) ;
}